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

Unified Diff: pkg/compiler/lib/src/cps_ir/cps_ir_builder_task.dart

Issue 1639313002: dart2js CPS: implement special handling of the Symbol constructor. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 11 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 | « no previous file | tests/co19/co19-dart2js.status » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/cps_ir/cps_ir_builder_task.dart
diff --git a/pkg/compiler/lib/src/cps_ir/cps_ir_builder_task.dart b/pkg/compiler/lib/src/cps_ir/cps_ir_builder_task.dart
index 550cc634c2e4bc5634da80fc64a9c44652c52f2a..2fed730ff6b74032c55015cd81d6d4572b443624 100644
--- a/pkg/compiler/lib/src/cps_ir/cps_ir_builder_task.dart
+++ b/pkg/compiler/lib/src/cps_ir/cps_ir_builder_task.dart
@@ -2131,7 +2131,17 @@ class IrBuilderVisitor extends ast.Visitor<ir.Primitive>
List<ir.Primitive> arguments = argumentsNode.nodes.mapToList(visit);
// Use default values from the effective target, not the immediate target.
- ConstructorElement target = constructor.implementation;
+ ConstructorElement target;
+ if (constructor == compiler.symbolConstructor) {
+ // The Symbol constructor should perform validation of its argument
+ // which is not expressible as a Dart const constructor. Instead, the
+ // libraries contain a dummy const constructor implementation that
+ // doesn't perform validation and the compiler compiles a call to
+ // (non-const) Symbol.validated when it sees new Symbol(...).
+ target = compiler.symbolValidatedConstructor;
+ } else {
+ target = constructor.implementation;
+ }
while (target.isRedirectingFactory && !target.isCyclicRedirection) {
target = target.effectiveTarget.implementation;
}
« no previous file with comments | « no previous file | tests/co19/co19-dart2js.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698