OLD | NEW |
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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 import 'dart:collection'; | 5 import 'dart:collection'; |
6 | 6 |
7 import 'package:js_runtime/shared/embedded_names.dart'; | 7 import 'package:js_runtime/shared/embedded_names.dart'; |
8 | 8 |
9 import '../closure.dart'; | 9 import '../closure.dart'; |
10 import '../common.dart'; | 10 import '../common.dart'; |
(...skipping 376 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
387 /** | 387 /** |
388 * Try to inline [element] within the correct context of the builder. The | 388 * Try to inline [element] within the correct context of the builder. The |
389 * insertion point is the state of the builder. | 389 * insertion point is the state of the builder. |
390 */ | 390 */ |
391 bool tryInlineMethod(Element element, Selector selector, TypeMask mask, | 391 bool tryInlineMethod(Element element, Selector selector, TypeMask mask, |
392 List<HInstruction> providedArguments, ast.Node currentNode, | 392 List<HInstruction> providedArguments, ast.Node currentNode, |
393 {InterfaceType instanceType}) { | 393 {InterfaceType instanceType}) { |
394 // TODO(johnniwinther): Register this on the [registry]. Currently the | 394 // TODO(johnniwinther): Register this on the [registry]. Currently the |
395 // [CodegenRegistry] calls the enqueuer, but [element] should _not_ be | 395 // [CodegenRegistry] calls the enqueuer, but [element] should _not_ be |
396 // enqueued. | 396 // enqueued. |
397 backend.registerStaticUse(element, compiler.enqueuer.codegen); | 397 backend.registerStaticUse(element, forResolution: false); |
398 | 398 |
399 if (backend.isJsInterop(element) && !element.isFactoryConstructor) { | 399 if (backend.isJsInterop(element) && !element.isFactoryConstructor) { |
400 // We only inline factory JavaScript interop constructors. | 400 // We only inline factory JavaScript interop constructors. |
401 return false; | 401 return false; |
402 } | 402 } |
403 | 403 |
404 // Ensure that [element] is an implementation element. | 404 // Ensure that [element] is an implementation element. |
405 element = element.implementation; | 405 element = element.implementation; |
406 | 406 |
407 if (compiler.elementHasCompileTimeError(element)) return false; | 407 if (compiler.elementHasCompileTimeError(element)) return false; |
(...skipping 6655 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7063 if (unaliased is TypedefType) throw 'unable to unalias $type'; | 7063 if (unaliased is TypedefType) throw 'unable to unalias $type'; |
7064 unaliased.accept(this, builder); | 7064 unaliased.accept(this, builder); |
7065 } | 7065 } |
7066 | 7066 |
7067 void visitDynamicType(DynamicType type, SsaBuilder builder) { | 7067 void visitDynamicType(DynamicType type, SsaBuilder builder) { |
7068 JavaScriptBackend backend = builder.compiler.backend; | 7068 JavaScriptBackend backend = builder.compiler.backend; |
7069 ClassElement cls = backend.helpers.DynamicRuntimeType; | 7069 ClassElement cls = backend.helpers.DynamicRuntimeType; |
7070 builder.push(new HDynamicType(type, new TypeMask.exact(cls, closedWorld))); | 7070 builder.push(new HDynamicType(type, new TypeMask.exact(cls, closedWorld))); |
7071 } | 7071 } |
7072 } | 7072 } |
OLD | NEW |