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

Unified Diff: pkg/compiler/lib/src/ssa/codegen.dart

Issue 779593002: Move elementAccess() from namer to emitter. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Addressed comments. Created 6 years 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
« no previous file with comments | « pkg/compiler/lib/src/ssa/builder.dart ('k') | pkg/compiler/lib/src/ssa/ssa.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/ssa/codegen.dart
diff --git a/pkg/compiler/lib/src/ssa/codegen.dart b/pkg/compiler/lib/src/ssa/codegen.dart
index ae57bc2c4bf40c79e17def56488cac6cce9c7cbd..e7f870b4e638070c7fb0f257857a05be06e7df8c 100644
--- a/pkg/compiler/lib/src/ssa/codegen.dart
+++ b/pkg/compiler/lib/src/ssa/codegen.dart
@@ -1641,7 +1641,7 @@ class SsaCodeGenerator implements HVisitor, HBlockInformationVisitor {
});
}
- push(backend.namer.elementAccess(node.element));
+ push(backend.emitter.staticFunctionAccess(node.element));
push(new js.Call(pop(), visitArguments(node.inputs, start: 0)), node);
}
@@ -1682,7 +1682,7 @@ class SsaCodeGenerator implements HVisitor, HBlockInformationVisitor {
methodName = backend.namer.getNameOfInstanceMember(superMethod);
}
push(js.js('#.prototype.#.call(#)',
- [backend.namer.elementAccess(superClass),
+ [backend.emitter.classAccess(superClass),
methodName, visitArguments(node.inputs, start: 0)]),
node);
} else {
@@ -1785,7 +1785,8 @@ class SsaCodeGenerator implements HVisitor, HBlockInformationVisitor {
}
visitForeignNew(HForeignNew node) {
- js.Expression jsClassReference = backend.namer.elementAccess(node.element);
+ js.Expression jsClassReference =
+ backend.emitter.classAccess(node.element);
List<js.Expression> arguments = visitArguments(node.inputs, start: 0);
push(new js.New(jsClassReference, arguments), node);
registerForeignTypes(node);
@@ -2023,7 +2024,7 @@ class SsaCodeGenerator implements HVisitor, HBlockInformationVisitor {
void generateThrowWithHelper(String helperName, argument) {
Element helper = backend.findHelper(helperName);
registry.registerStaticUse(helper);
- js.Expression jsHelper = backend.namer.elementAccess(helper);
+ js.Expression jsHelper = backend.emitter.staticFunctionAccess(helper);
List arguments = [];
var location;
if (argument is List) {
@@ -2056,7 +2057,7 @@ class SsaCodeGenerator implements HVisitor, HBlockInformationVisitor {
Element helper = backend.findHelper("throwExpression");
registry.registerStaticUse(helper);
- js.Expression jsHelper = backend.namer.elementAccess(helper);
+ js.Expression jsHelper = backend.emitter.staticFunctionAccess(helper);
js.Call value = new js.Call(jsHelper, [pop()]);
value = attachLocation(value, argument);
push(value, node);
@@ -2068,10 +2069,11 @@ class SsaCodeGenerator implements HVisitor, HBlockInformationVisitor {
void visitStatic(HStatic node) {
Element element = node.element;
+ assert(element.isFunction || element.isField);
if (element.isFunction) {
push(backend.namer.isolateStaticClosureAccess(node.element));
} else {
- push(backend.namer.elementAccess(node.element));
+ push(backend.emitter.staticFieldAccess(node.element));
}
registry.registerStaticUse(element);
}
@@ -2087,7 +2089,7 @@ class SsaCodeGenerator implements HVisitor, HBlockInformationVisitor {
void visitStaticStore(HStaticStore node) {
registry.registerStaticUse(node.element);
- js.Node variable = backend.namer.elementAccess(node.element);
+ js.Node variable = backend.emitter.staticFieldAccess(node.element);
use(node.inputs[0]);
push(new js.Assignment(variable, pop()), node);
}
@@ -2118,7 +2120,8 @@ class SsaCodeGenerator implements HVisitor, HBlockInformationVisitor {
} else {
Element convertToString = backend.getStringInterpolationHelper();
registry.registerStaticUse(convertToString);
- js.Expression jsHelper = backend.namer.elementAccess(convertToString);
+ js.Expression jsHelper =
+ backend.emitter.staticFunctionAccess(convertToString);
use(input);
push(new js.Call(jsHelper, <js.Expression>[pop()]), node);
}
@@ -2673,7 +2676,8 @@ class SsaCodeGenerator implements HVisitor, HBlockInformationVisitor {
if (backend.isInterceptorClass(element.enclosingClass)) {
int index = RuntimeTypes.getTypeVariableIndex(element);
js.Expression receiver = pop();
- js.Expression helper = backend.namer.elementAccess(helperElement);
+ js.Expression helper = backend.emitter
+ .staticFunctionAccess(helperElement);
push(js.js(r'#(#.$builtinTypeInfo && #.$builtinTypeInfo[#])',
[helper, receiver, receiver, js.js.number(index)]));
} else {
@@ -2683,7 +2687,7 @@ class SsaCodeGenerator implements HVisitor, HBlockInformationVisitor {
}
} else {
push(js.js('#(#)', [
- backend.namer.elementAccess(
+ backend.emitter.staticFunctionAccess(
backend.findHelper('convertRtiToRuntimeType')),
pop()]));
}
@@ -2697,7 +2701,7 @@ class SsaCodeGenerator implements HVisitor, HBlockInformationVisitor {
}
ClassElement cls = node.dartType.element;
- var arguments = [backend.namer.elementAccess(cls)];
+ var arguments = [backend.emitter.classAccess(cls)];
if (!typeArguments.isEmpty) {
arguments.add(new js.ArrayInitializer(typeArguments));
}
@@ -2719,6 +2723,6 @@ class SsaCodeGenerator implements HVisitor, HBlockInformationVisitor {
return js.js('(void 0).$name');
}
registry.registerStaticUse(helper);
- return backend.namer.elementAccess(helper);
+ return backend.emitter.staticFunctionAccess(helper);
}
}
« no previous file with comments | « pkg/compiler/lib/src/ssa/builder.dart ('k') | pkg/compiler/lib/src/ssa/ssa.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698