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

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

Issue 15724021: Move array and string related HType from const to a field in the backend. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 6 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/interceptor_simplifier.dart
===================================================================
--- sdk/lib/_internal/compiler/implementation/ssa/interceptor_simplifier.dart (revision 23841)
+++ sdk/lib/_internal/compiler/implementation/ssa/interceptor_simplifier.dart (working copy)
@@ -91,18 +91,20 @@
HType type = input.instructionType;
ClassElement constantInterceptor;
JavaScriptBackend backend = compiler.backend;
- if (type.isInteger()) {
+ if (type.canBeNull()) {
+ if (type.isNull()) {
+ constantInterceptor = backend.jsNullClass;
+ }
+ } else if (type.isInteger()) {
constantInterceptor = backend.jsIntClass;
} else if (type.isDouble()) {
constantInterceptor = backend.jsDoubleClass;
} else if (type.isBoolean()) {
constantInterceptor = backend.jsBoolClass;
- } else if (type.isString()) {
+ } else if (type.isString(compiler)) {
constantInterceptor = backend.jsStringClass;
} else if (type.isArray(compiler)) {
constantInterceptor = backend.jsArrayClass;
- } else if (type.isNull()) {
- constantInterceptor = backend.jsNullClass;
} else if (type.isNumber()
&& !interceptedClasses.contains(backend.jsIntClass)
&& !interceptedClasses.contains(backend.jsDoubleClass)) {
@@ -122,12 +124,9 @@
// for a subclass or call methods defined on a subclass. Provided the
// code is completely insensitive to the specific instance subclasses, we
// can use the non-leaf class directly.
-
- if (!type.canBeNull()) {
- ClassElement element = type.computeMask(compiler).singleClass(compiler);
- if (element != null && element.isNative()) {
- constantInterceptor = element;
- }
+ ClassElement element = type.computeMask(compiler).singleClass(compiler);
+ if (element != null && element.isNative()) {
+ constantInterceptor = element;
}
}
@@ -138,7 +137,7 @@
Constant constant = new InterceptorConstant(
constantInterceptor.computeType(compiler));
- return graph.addConstant(constant);
+ return graph.addConstant(constant, compiler);
}
HInstruction findDominator(Iterable<HInstruction> instructions) {
@@ -229,7 +228,7 @@
if (!user.hasSameLoopHeaderAs(node)) return false;
// Replace the user with a [HOneShotInterceptor].
- HConstant nullConstant = graph.addConstantNull(constantSystem);
+ HConstant nullConstant = graph.addConstantNull(compiler);
List<HInstruction> inputs = new List<HInstruction>.from(user.inputs);
inputs[0] = nullConstant;
HOneShotInterceptor interceptor = new HOneShotInterceptor(

Powered by Google App Engine
This is Rietveld 408576698