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

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

Issue 1421003004: Add CoreClasses (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Updated cf. comment. Created 5 years, 2 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
« no previous file with comments | « pkg/compiler/lib/src/resolution/resolution.dart ('k') | pkg/compiler/lib/src/ssa/codegen.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/ssa/builder.dart
diff --git a/pkg/compiler/lib/src/ssa/builder.dart b/pkg/compiler/lib/src/ssa/builder.dart
index 62376a40cbca76389b627a29993e89471d779c6d..644c88d67d69054dcd528660ffdd52e28b0daeaa 100644
--- a/pkg/compiler/lib/src/ssa/builder.dart
+++ b/pkg/compiler/lib/src/ssa/builder.dart
@@ -1118,6 +1118,8 @@ class SsaBuilder extends ast.Visitor
DiagnosticReporter get reporter => compiler.reporter;
+ CoreClasses get coreClasses => compiler.coreClasses;
+
@override
SemanticSendVisitor get sendVisitor => this;
@@ -1378,7 +1380,7 @@ class SsaBuilder extends ast.Visitor
// Don't inline operator== methods if the parameter can be null.
if (element.name == '==') {
- if (element.enclosingClass != compiler.objectClass
+ if (element.enclosingClass != coreClasses.objectClass
&& providedArguments[1].canBeNull()) {
return false;
}
@@ -2576,9 +2578,9 @@ class SsaBuilder extends ast.Visitor
type = type.unaliased;
if (type.isDynamic) return original;
if (!type.isInterfaceType) return original;
+ if (type.isObject) return original;
// The type element is either a class or the void element.
Element element = type.element;
- if (element == compiler.objectClass) return original;
TypeMask mask = new TypeMask.subtype(element, compiler.world);
return new HTypeKnown.pinned(mask, original);
}
@@ -2652,7 +2654,7 @@ class SsaBuilder extends ast.Visitor
if (_checkOrTrustTypes) {
return potentiallyCheckOrTrustType(
value,
- compiler.boolClass.rawType,
+ compiler.coreTypes.boolType,
kind: HTypeConversion.BOOLEAN_CONVERSION_CHECK);
}
HInstruction result = new HBoolify(value, backend.boolType);
@@ -3245,7 +3247,7 @@ class SsaBuilder extends ast.Visitor
});
TypeMask type =
- new TypeMask.nonNullExact(compiler.functionClass, compiler.world);
+ new TypeMask.nonNullExact(coreClasses.functionClass, compiler.world);
push(new HForeignNew(closureClassElement, type, capturedVariables)
..sourceInformation = sourceInformationBuilder.buildCreate(node));
@@ -4543,8 +4545,7 @@ class SsaBuilder extends ast.Visitor
ClassElement cls = currentNonClosureClass;
Element element = cls.lookupSuperMember(Identifiers.noSuchMethod_);
- if (compiler.enabledInvokeOn
- && element.enclosingElement.declaration != compiler.objectClass) {
+ if (compiler.enabledInvokeOn && !element.enclosingClass.isObject) {
// Register the call as dynamic if [noSuchMethod] on the super
// class is _not_ the default implementation from [Object], in
// case the [noSuchMethod] implementation calls
@@ -5211,7 +5212,7 @@ class SsaBuilder extends ast.Visitor
// not know about the type argument. Therefore we special case
// this constructor to have the setRuntimeTypeInfo called where
// the 'new' is done.
- if (backend.classNeedsRti(compiler.listClass) &&
+ if (backend.classNeedsRti(coreClasses.listClass) &&
(isFixedListConstructorCall || isGrowableListConstructorCall ||
isJSArrayTypedConstructor)) {
newInstance = handleListConstructor(type, send, pop());
@@ -7154,7 +7155,7 @@ class SsaBuilder extends ast.Visitor
return type.isDynamic ||
type.isObject ||
(type is InterfaceType &&
- type.element == compiler.futureClass);
+ type.element == coreClasses.futureClass);
}
visitReturn(ast.Return node) {
@@ -7207,8 +7208,8 @@ class SsaBuilder extends ast.Visitor
visit(node.expression);
HInstruction awaited = pop();
// TODO(herhut): Improve this type.
- push(new HAwait(awaited, new TypeMask.subclass(compiler.objectClass,
- compiler.world)));
+ push(new HAwait(awaited, new TypeMask.subclass(
+ coreClasses.objectClass, compiler.world)));
}
visitTypeAnnotation(ast.TypeAnnotation node) {
@@ -7371,8 +7372,8 @@ class SsaBuilder extends ast.Visitor
TypeMask mask = elements.getMoveNextTypeMask(node);
pushInvokeDynamic(node, selector, mask, [streamIterator]);
HInstruction future = pop();
- push(new HAwait(future, new TypeMask.subclass(compiler.objectClass,
- compiler.world)));
+ push(new HAwait(future,
+ new TypeMask.subclass(coreClasses.objectClass, compiler.world)));
return popBoolified();
}
void buildBody() {
@@ -7419,8 +7420,8 @@ class SsaBuilder extends ast.Visitor
Selectors.cancel,
null,
[streamIterator]);
- push(new HAwait(pop(), new TypeMask.subclass(compiler.objectClass,
- compiler.world)));
+ push(new HAwait(pop(), new TypeMask.subclass(
+ coreClasses.objectClass, compiler.world)));
pop();
});
}
« no previous file with comments | « pkg/compiler/lib/src/resolution/resolution.dart ('k') | pkg/compiler/lib/src/ssa/codegen.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698