Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(124)

Unified Diff: sdk/lib/_internal/compiler/implementation/ssa/codegen.dart

Issue 255843005: Avoid generating VariableUse nodes with non-identifier names (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: sdk/lib/_internal/compiler/implementation/ssa/codegen.dart
diff --git a/sdk/lib/_internal/compiler/implementation/ssa/codegen.dart b/sdk/lib/_internal/compiler/implementation/ssa/codegen.dart
index 638b0b52bfeabf82458b4288955b5d65f7d5a5d0..93f0933959bc0e5c38f2fcec49d9bf4b0afbd62c 100644
--- a/sdk/lib/_internal/compiler/implementation/ssa/codegen.dart
+++ b/sdk/lib/_internal/compiler/implementation/ssa/codegen.dart
@@ -1613,7 +1613,7 @@ class SsaCodeGenerator implements HVisitor, HBlockInformationVisitor {
});
}
- push(new js.VariableUse(backend.namer.isolateAccess(node.element)));
+ push(backend.namer.elementAccess(node.element));
push(new js.Call(pop(), visitArguments(node.inputs, start: 0)), node);
}
@@ -1745,11 +1745,9 @@ class SsaCodeGenerator implements HVisitor, HBlockInformationVisitor {
}
visitForeignNew(HForeignNew node) {
- String jsClassReference = backend.namer.isolateAccess(node.element);
+ js.Expression jsClassReference = backend.namer.elementAccess(node.element);
List<js.Expression> arguments = visitArguments(node.inputs, start: 0);
- // TODO(floitsch): jsClassReference is an Access. We shouldn't treat it
- // as if it was a string.
- push(new js.New(new js.VariableUse(jsClassReference), arguments), node);
+ push(new js.New(jsClassReference, arguments), node);
registerForeignTypes(node);
if (node.instantiatedTypes == null) {
return;
@@ -1985,8 +1983,7 @@ class SsaCodeGenerator implements HVisitor, HBlockInformationVisitor {
void generateThrowWithHelper(String helperName, argument) {
Element helper = compiler.findHelper(helperName);
world.registerStaticUse(helper);
- js.VariableUse jsHelper =
- new js.VariableUse(backend.namer.isolateAccess(helper));
+ js.Expression jsHelper = backend.namer.elementAccess(helper);
List arguments = [];
var location;
if (argument is List) {
@@ -2019,8 +2016,7 @@ class SsaCodeGenerator implements HVisitor, HBlockInformationVisitor {
Element helper = compiler.findHelper("throwExpression");
world.registerStaticUse(helper);
- js.VariableUse jsHelper =
- new js.VariableUse(backend.namer.isolateAccess(helper));
+ js.Expression jsHelper = backend.namer.elementAccess(helper);
js.Call value = new js.Call(jsHelper, [pop()]);
attachLocation(value, argument);
push(value, node);
@@ -2033,10 +2029,9 @@ class SsaCodeGenerator implements HVisitor, HBlockInformationVisitor {
void visitStatic(HStatic node) {
Element element = node.element;
if (element.isFunction()) {
- push(new js.VariableUse(
- backend.namer.isolateStaticClosureAccess(node.element)));
+ push(backend.namer.isolateStaticClosureAccess(node.element));
} else {
- push(new js.VariableUse(backend.namer.isolateAccess(node.element)));
+ push(backend.namer.elementAccess(node.element));
}
world.registerStaticUse(element);
}
@@ -2044,9 +2039,9 @@ class SsaCodeGenerator implements HVisitor, HBlockInformationVisitor {
void visitLazyStatic(HLazyStatic node) {
Element element = node.element;
world.registerStaticUse(element);
- String lazyGetter = backend.namer.isolateLazyInitializerAccess(element);
- js.VariableUse target = new js.VariableUse(lazyGetter);
- js.Call call = new js.Call(target, <js.Expression>[]);
+ js.Expression lazyGetter = backend.namer.isolateLazyInitializerAccess(element);
floitsch 2014/04/28 14:17:51 long line.
sra1 2014/04/28 23:00:41 Done.
+ //js.VariableUse target = new js.VariableUse(lazyGetter);
floitsch 2014/04/28 14:17:51 dead code.
sra1 2014/04/28 23:00:41 Done.
+ js.Call call = new js.Call(lazyGetter, <js.Expression>[]);
push(call, node);
}
@@ -2083,10 +2078,9 @@ class SsaCodeGenerator implements HVisitor, HBlockInformationVisitor {
} else {
Element convertToString = backend.getStringInterpolationHelper();
world.registerStaticUse(convertToString);
- js.VariableUse variableUse =
- new js.VariableUse(backend.namer.isolateAccess(convertToString));
+ js.Expression jsHelper = backend.namer.elementAccess(convertToString);
use(input);
- push(new js.Call(variableUse, <js.Expression>[pop()]), node);
+ push(new js.Call(jsHelper, <js.Expression>[pop()]), node);
}
}

Powered by Google App Engine
This is Rietveld 408576698