OLD | NEW |
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 Loading... |
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 Loading... |
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 } |
OLD | NEW |