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 360 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
371 /** | 371 /** |
372 * Try to inline [element] within the correct context of the builder. The | 372 * Try to inline [element] within the correct context of the builder. The |
373 * insertion point is the state of the builder. | 373 * insertion point is the state of the builder. |
374 */ | 374 */ |
375 bool tryInlineMethod(Element element, Selector selector, TypeMask mask, | 375 bool tryInlineMethod(Element element, Selector selector, TypeMask mask, |
376 List<HInstruction> providedArguments, ast.Node currentNode, | 376 List<HInstruction> providedArguments, ast.Node currentNode, |
377 {InterfaceType instanceType}) { | 377 {InterfaceType instanceType}) { |
378 // TODO(johnniwinther): Register this on the [registry]. Currently the | 378 // TODO(johnniwinther): Register this on the [registry]. Currently the |
379 // [CodegenRegistry] calls the enqueuer, but [element] should _not_ be | 379 // [CodegenRegistry] calls the enqueuer, but [element] should _not_ be |
380 // enqueued. | 380 // enqueued. |
381 backend.registerStaticUse(element, forResolution: false); | 381 backend.registerStaticUse(compiler.enqueuer.codegen, element); |
382 | 382 |
383 if (backend.isJsInterop(element) && !element.isFactoryConstructor) { | 383 if (backend.isJsInterop(element) && !element.isFactoryConstructor) { |
384 // We only inline factory JavaScript interop constructors. | 384 // We only inline factory JavaScript interop constructors. |
385 return false; | 385 return false; |
386 } | 386 } |
387 | 387 |
388 // Ensure that [element] is an implementation element. | 388 // Ensure that [element] is an implementation element. |
389 element = element.implementation; | 389 element = element.implementation; |
390 | 390 |
391 if (compiler.elementHasCompileTimeError(element)) return false; | 391 if (compiler.elementHasCompileTimeError(element)) return false; |
(...skipping 6667 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7059 if (unaliased is TypedefType) throw 'unable to unalias $type'; | 7059 if (unaliased is TypedefType) throw 'unable to unalias $type'; |
7060 unaliased.accept(this, builder); | 7060 unaliased.accept(this, builder); |
7061 } | 7061 } |
7062 | 7062 |
7063 void visitDynamicType(DynamicType type, SsaBuilder builder) { | 7063 void visitDynamicType(DynamicType type, SsaBuilder builder) { |
7064 JavaScriptBackend backend = builder.compiler.backend; | 7064 JavaScriptBackend backend = builder.compiler.backend; |
7065 ClassElement cls = backend.helpers.DynamicRuntimeType; | 7065 ClassElement cls = backend.helpers.DynamicRuntimeType; |
7066 builder.push(new HDynamicType(type, new TypeMask.exact(cls, closedWorld))); | 7066 builder.push(new HDynamicType(type, new TypeMask.exact(cls, closedWorld))); |
7067 } | 7067 } |
7068 } | 7068 } |
OLD | NEW |