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

Side by Side 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 unified diff | Download patch
« no previous file with comments | « no previous file | tests/co19/co19-dart2js.status » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 library dart2js.ir_builder_task; 5 library dart2js.ir_builder_task;
6 6
7 import '../closure.dart' as closure; 7 import '../closure.dart' as closure;
8 import '../common.dart'; 8 import '../common.dart';
9 import '../common/names.dart' show 9 import '../common/names.dart' show
10 Names, 10 Names,
(...skipping 2113 matching lines...) Expand 10 before | Expand all | Expand 10 after
2124 ConstructorElement current = constructor; 2124 ConstructorElement current = constructor;
2125 while (current.isRedirectingFactory) { 2125 while (current.isRedirectingFactory) {
2126 var prefix = current.redirectionDeferredPrefix; 2126 var prefix = current.redirectionDeferredPrefix;
2127 if (prefix != null) buildCheckDeferredIsLoaded(prefix, send); 2127 if (prefix != null) buildCheckDeferredIsLoaded(prefix, send);
2128 current = current.immediateRedirectionTarget; 2128 current = current.immediateRedirectionTarget;
2129 } 2129 }
2130 } 2130 }
2131 2131
2132 List<ir.Primitive> arguments = argumentsNode.nodes.mapToList(visit); 2132 List<ir.Primitive> arguments = argumentsNode.nodes.mapToList(visit);
2133 // Use default values from the effective target, not the immediate target. 2133 // Use default values from the effective target, not the immediate target.
2134 ConstructorElement target = constructor.implementation; 2134 ConstructorElement target;
2135 if (constructor == compiler.symbolConstructor) {
2136 // The Symbol constructor should perform validation of its argument
2137 // which is not expressible as a Dart const constructor. Instead, the
2138 // libraries contain a dummy const constructor implementation that
2139 // doesn't perform validation and the compiler compiles a call to
2140 // (non-const) Symbol.validated when it sees new Symbol(...).
2141 target = compiler.symbolValidatedConstructor;
2142 } else {
2143 target = constructor.implementation;
2144 }
2135 while (target.isRedirectingFactory && !target.isCyclicRedirection) { 2145 while (target.isRedirectingFactory && !target.isCyclicRedirection) {
2136 target = target.effectiveTarget.implementation; 2146 target = target.effectiveTarget.implementation;
2137 } 2147 }
2138 2148
2139 callStructure = normalizeStaticArguments(callStructure, target, arguments); 2149 callStructure = normalizeStaticArguments(callStructure, target, arguments);
2140 TypeMask allocationSiteType; 2150 TypeMask allocationSiteType;
2141 2151
2142 if (Elements.isFixedListConstructorCall(constructor, send, compiler) || 2152 if (Elements.isFixedListConstructorCall(constructor, send, compiler) ||
2143 Elements.isGrowableListConstructorCall(constructor, send, compiler) || 2153 Elements.isGrowableListConstructorCall(constructor, send, compiler) ||
2144 Elements.isFilledListConstructorCall(constructor, send, compiler) || 2154 Elements.isFilledListConstructorCall(constructor, send, compiler) ||
(...skipping 1678 matching lines...) Expand 10 before | Expand all | Expand 10 after
3823 } 3833 }
3824 3834
3825 Element get closureConverter { 3835 Element get closureConverter {
3826 return _backend.helpers.closureConverter; 3836 return _backend.helpers.closureConverter;
3827 } 3837 }
3828 3838
3829 void addNativeMethod(FunctionElement function) { 3839 void addNativeMethod(FunctionElement function) {
3830 _backend.emitter.nativeEmitter.nativeMethods.add(function); 3840 _backend.emitter.nativeEmitter.nativeMethods.add(function);
3831 } 3841 }
3832 } 3842 }
OLDNEW
« 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