refactor(ivy): split the memory instruction into store and load (#22268)

PR Close #22268
This commit is contained in:
Victor Berchet
2018-02-16 16:58:07 -08:00
parent 3ceee99e22
commit 5a14e2238f
19 changed files with 105 additions and 114 deletions

View File

@ -63,7 +63,7 @@ export class Identifiers {
static interpolation8: o.ExternalReference = {name: 'ɵi8', moduleName: CORE};
static interpolationV: o.ExternalReference = {name: 'ɵiV', moduleName: CORE};
static memory: o.ExternalReference = {name: m', moduleName: CORE};
static load: o.ExternalReference = {name: ld', moduleName: CORE};
static projection: o.ExternalReference = {name: 'ɵP', moduleName: CORE};
static projectionDef: o.ExternalReference = {name: 'ɵpD', moduleName: CORE};

View File

@ -408,7 +408,7 @@ class TemplateDefinitionBuilder implements TemplateAstVisitor, LocalResolver {
// Generate the update temporary.
const variableName = this.bindingScope.freshReferenceName();
this._bindingMode.push(o.variable(variableName, o.INFERRED_TYPE)
.set(o.importExpr(R3.memory).callFn([o.literal(slot)]))
.set(o.importExpr(R3.load).callFn([o.literal(slot)]))
.toDeclStmt(o.INFERRED_TYPE, [o.StmtModifier.Final]));
this.bindingScope.set(reference.name, variableName);
return [reference.name, reference.originalValue];