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 2689 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2700 } | 2700 } |
2701 push(new HStringConcat(inputs[0], inputs[1], backend.stringType)); | 2701 push(new HStringConcat(inputs[0], inputs[1], backend.stringType)); |
2702 } | 2702 } |
2703 | 2703 |
2704 void handleForeignJsCurrentIsolateContext(ast.Send node) { | 2704 void handleForeignJsCurrentIsolateContext(ast.Send node) { |
2705 if (!node.arguments.isEmpty) { | 2705 if (!node.arguments.isEmpty) { |
2706 reporter.internalError( | 2706 reporter.internalError( |
2707 node, 'Too many arguments to JS_CURRENT_ISOLATE_CONTEXT.'); | 2707 node, 'Too many arguments to JS_CURRENT_ISOLATE_CONTEXT.'); |
2708 } | 2708 } |
2709 | 2709 |
2710 if (!compiler.hasIsolateSupport) { | 2710 if (!backend.hasIsolateSupport) { |
2711 // If the isolate library is not used, we just generate code | 2711 // If the isolate library is not used, we just generate code |
2712 // to fetch the static state. | 2712 // to fetch the static state. |
2713 String name = backend.namer.staticStateHolder; | 2713 String name = backend.namer.staticStateHolder; |
2714 push(new HForeignCode( | 2714 push(new HForeignCode( |
2715 js.js.parseForeignJS(name), backend.dynamicType, <HInstruction>[], | 2715 js.js.parseForeignJS(name), backend.dynamicType, <HInstruction>[], |
2716 nativeBehavior: native.NativeBehavior.DEPENDS_OTHER)); | 2716 nativeBehavior: native.NativeBehavior.DEPENDS_OTHER)); |
2717 } else { | 2717 } else { |
2718 // Call a helper method from the isolate library. The isolate | 2718 // Call a helper method from the isolate library. The isolate |
2719 // library uses its own isolate structure, that encapsulates | 2719 // library uses its own isolate structure, that encapsulates |
2720 // Leg's isolate. | 2720 // Leg's isolate. |
(...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2896 } | 2896 } |
2897 } | 2897 } |
2898 } | 2898 } |
2899 reporter.reportErrorMessage( | 2899 reporter.reportErrorMessage( |
2900 node, MessageKind.WRONG_ARGUMENT_FOR_JS_INTERCEPTOR_CONSTANT); | 2900 node, MessageKind.WRONG_ARGUMENT_FOR_JS_INTERCEPTOR_CONSTANT); |
2901 stack.add(graph.addConstantNull(compiler)); | 2901 stack.add(graph.addConstantNull(compiler)); |
2902 } | 2902 } |
2903 | 2903 |
2904 void handleForeignJsCallInIsolate(ast.Send node) { | 2904 void handleForeignJsCallInIsolate(ast.Send node) { |
2905 Link<ast.Node> link = node.arguments; | 2905 Link<ast.Node> link = node.arguments; |
2906 if (!compiler.hasIsolateSupport) { | 2906 if (!backend.hasIsolateSupport) { |
2907 // If the isolate library is not used, we just invoke the | 2907 // If the isolate library is not used, we just invoke the |
2908 // closure. | 2908 // closure. |
2909 visit(link.tail.head); | 2909 visit(link.tail.head); |
2910 push(new HInvokeClosure(new Selector.callClosure(0), | 2910 push(new HInvokeClosure(new Selector.callClosure(0), |
2911 <HInstruction>[pop()], backend.dynamicType)); | 2911 <HInstruction>[pop()], backend.dynamicType)); |
2912 } else { | 2912 } else { |
2913 // Call a helper method from the isolate library. | 2913 // Call a helper method from the isolate library. |
2914 Element element = helpers.callInIsolate; | 2914 Element element = helpers.callInIsolate; |
2915 if (element == null) { | 2915 if (element == null) { |
2916 reporter.internalError(node, 'Isolate library and compiler mismatch.'); | 2916 reporter.internalError(node, 'Isolate library and compiler mismatch.'); |
(...skipping 3834 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6751 this.oldReturnLocal, | 6751 this.oldReturnLocal, |
6752 this.oldReturnType, | 6752 this.oldReturnType, |
6753 this.oldResolvedAst, | 6753 this.oldResolvedAst, |
6754 this.oldStack, | 6754 this.oldStack, |
6755 this.oldLocalsHandler, | 6755 this.oldLocalsHandler, |
6756 this.inTryStatement, | 6756 this.inTryStatement, |
6757 this.allFunctionsCalledOnce, | 6757 this.allFunctionsCalledOnce, |
6758 this.oldElementInferenceResults) | 6758 this.oldElementInferenceResults) |
6759 : super(function); | 6759 : super(function); |
6760 } | 6760 } |
OLD | NEW |