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

Side by Side Diff: pkg/compiler/lib/src/ssa/codegen.dart

Issue 1020853003: Split HForeign into HForeignCode and abstract base class. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Formatting Created 5 years, 9 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 | Annotate | Revision Log
OLDNEW
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 part of ssa; 5 part of ssa;
6 6
7 class SsaCodeGeneratorTask extends CompilerTask { 7 class SsaCodeGeneratorTask extends CompilerTask {
8 8
9 final JavaScriptBackend backend; 9 final JavaScriptBackend backend;
10 10
(...skipping 1725 matching lines...) Expand 10 before | Expand all | Expand 10 after
1736 void registerForeignTypes(HForeign node) { 1736 void registerForeignTypes(HForeign node) {
1737 native.NativeBehavior nativeBehavior = node.nativeBehavior; 1737 native.NativeBehavior nativeBehavior = node.nativeBehavior;
1738 if (nativeBehavior == null) return; 1738 if (nativeBehavior == null) return;
1739 nativeBehavior.typesReturned.forEach((type) { 1739 nativeBehavior.typesReturned.forEach((type) {
1740 if (type is InterfaceType) { 1740 if (type is InterfaceType) {
1741 registry.registerInstantiatedType(type); 1741 registry.registerInstantiatedType(type);
1742 } 1742 }
1743 }); 1743 });
1744 } 1744 }
1745 1745
1746 visitForeign(HForeign node) { 1746 visitForeignCode(HForeignCode node) {
1747 List<HInstruction> inputs = node.inputs; 1747 List<HInstruction> inputs = node.inputs;
1748 if (node.isJsStatement()) { 1748 if (node.isJsStatement()) {
1749 List<js.Expression> interpolatedExpressions = <js.Expression>[]; 1749 List<js.Expression> interpolatedExpressions = <js.Expression>[];
1750 for (int i = 0; i < inputs.length; i++) { 1750 for (int i = 0; i < inputs.length; i++) {
1751 use(inputs[i]); 1751 use(inputs[i]);
1752 interpolatedExpressions.add(pop()); 1752 interpolatedExpressions.add(pop());
1753 } 1753 }
1754 pushStatement(node.codeTemplate.instantiate(interpolatedExpressions)); 1754 pushStatement(node.codeTemplate.instantiate(interpolatedExpressions));
1755 } else { 1755 } else {
1756 List<js.Expression> interpolatedExpressions = <js.Expression>[]; 1756 List<js.Expression> interpolatedExpressions = <js.Expression>[];
(...skipping 910 matching lines...) Expand 10 before | Expand all | Expand 10 after
2667 js.PropertyAccess accessHelper(String name) { 2667 js.PropertyAccess accessHelper(String name) {
2668 Element helper = backend.findHelper(name); 2668 Element helper = backend.findHelper(name);
2669 if (helper == null) { 2669 if (helper == null) {
2670 // For mocked-up tests. 2670 // For mocked-up tests.
2671 return js.js('(void 0).$name'); 2671 return js.js('(void 0).$name');
2672 } 2672 }
2673 registry.registerStaticUse(helper); 2673 registry.registerStaticUse(helper);
2674 return backend.emitter.staticFunctionAccess(helper); 2674 return backend.emitter.staticFunctionAccess(helper);
2675 } 2675 }
2676 } 2676 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698