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

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

Issue 11413184: Create specialized versions of getInterceptor. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 1 month 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 | « sdk/lib/_internal/compiler/implementation/ssa/nodes.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/_internal/compiler/implementation/ssa/optimize.dart
===================================================================
--- sdk/lib/_internal/compiler/implementation/ssa/optimize.dart (revision 15381)
+++ sdk/lib/_internal/compiler/implementation/ssa/optimize.dart (working copy)
@@ -681,33 +681,36 @@
HInstruction visitInterceptor(HInterceptor node) {
if (node.isConstant()) return node;
HType type = types[node.inputs[0]];
- Element constantInterceptor;
+ ClassElement constantInterceptor;
if (type.isInteger()) {
- constantInterceptor = backend.intInterceptor;
+ constantInterceptor = backend.jsIntClass;
} else if (type.isDouble()) {
- constantInterceptor = backend.doubleInterceptor;
+ constantInterceptor = backend.jsDoubleClass;
} else if (type.isBoolean()) {
- constantInterceptor = backend.boolInterceptor;
+ constantInterceptor = backend.jsBoolClass;
} else if (type.isString()) {
- constantInterceptor = backend.stringInterceptor;
+ constantInterceptor = backend.jsStringClass;
} else if (type.isArray()) {
- constantInterceptor = backend.arrayInterceptor;
+ constantInterceptor = backend.jsArrayClass;
} else if (type.isNull()) {
- constantInterceptor = backend.nullInterceptor;
+ constantInterceptor = backend.jsIntClass;
} else if (type.isNumber()) {
Set<ClassElement> intercepted = node.interceptedClasses;
// If the method being intercepted is not defined in [int] or
// [double] we can safely use the number interceptor.
if (!intercepted.contains(compiler.intClass)
&& !intercepted.contains(compiler.doubleClass)) {
- constantInterceptor = backend.numberInterceptor;
+ constantInterceptor = backend.jsNumberClass;
}
}
if (constantInterceptor == null) return node;
ConstantHandler handler = compiler.constantHandler;
- return graph.addConstant(handler.compileVariable(constantInterceptor));
+ Constant constant = new ConstructedConstant(
+ constantInterceptor.computeType(compiler), <Constant>[]);
+ handler.registerCompileTimeConstant(constant);
+ return graph.addConstant(constant);
}
}
« no previous file with comments | « sdk/lib/_internal/compiler/implementation/ssa/nodes.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698