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

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

Issue 70703002: Add constructors for JSArray (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 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
Index: sdk/lib/_internal/compiler/implementation/ssa/builder.dart
diff --git a/sdk/lib/_internal/compiler/implementation/ssa/builder.dart b/sdk/lib/_internal/compiler/implementation/ssa/builder.dart
index a3961539821fa4c87beee1abb8bebee7b587bfb0..edaff49a8ffc4c7c82028a461fb9e8ccade14f37 100644
--- a/sdk/lib/_internal/compiler/implementation/ssa/builder.dart
+++ b/sdk/lib/_internal/compiler/implementation/ssa/builder.dart
@@ -3788,7 +3788,6 @@ class SsaBuilder extends ResolvedVisitor implements Visitor {
handleNewSend(NewExpression node) {
Send send = node.send;
- bool isListConstructor = false;
bool isFixedList = false;
TypeMask computeType(element) {
@@ -3796,7 +3795,6 @@ class SsaBuilder extends ResolvedVisitor implements Visitor {
if (Elements.isFixedListConstructorCall(originalElement, send, compiler)
|| Elements.isFilledListConstructorCall(
originalElement, send, compiler)) {
- isListConstructor = true;
isFixedList = true;
TypeMask inferred =
TypeMaskFactory.inferredForNode(currentElement, send, compiler);
@@ -3805,7 +3803,6 @@ class SsaBuilder extends ResolvedVisitor implements Visitor {
: inferred;
} else if (Elements.isGrowableListConstructorCall(
originalElement, send, compiler)) {
- isListConstructor = true;
TypeMask inferred =
TypeMaskFactory.inferredForNode(currentElement, send, compiler);
return inferred.containsAll(compiler)
@@ -3836,6 +3833,8 @@ class SsaBuilder extends ResolvedVisitor implements Visitor {
final bool isSymbolConstructor =
functionElement == compiler.symbolConstructor;
+ final bool isJSArrayTypedConstructor =
+ functionElement == backend.jsArrayTypedConstructor;
if (isSymbolConstructor) {
constructor = compiler.symbolValidatedConstructor;
@@ -3901,7 +3900,8 @@ class SsaBuilder extends ResolvedVisitor implements Visitor {
// not know about the type argument. Therefore we special case
// this constructor to have the setRuntimeTypeInfo called where
// the 'new' is done.
- if (isListConstructor && backend.classNeedsRti(compiler.listClass)) {
+ if (isJSArrayTypedConstructor &&
+ backend.classNeedsRti(compiler.listClass)) {
handleListConstructor(type, send, newInstance);
}
« no previous file with comments | « sdk/lib/_internal/compiler/implementation/js_backend/backend.dart ('k') | sdk/lib/_internal/lib/core_patch.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698