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

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

Issue 1050343002: Revert "Avoid getInterceptor calls in cases were the interceptor would be constant if it were not `… (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 8 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
« no previous file with comments | « no previous file | pkg/compiler/lib/src/ssa/interceptor_simplifier.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 1454 matching lines...) Expand 10 before | Expand all | Expand 10 after
1465 // branches, and is not the join block. 1465 // branches, and is not the join block.
1466 // Depending on how the then/else branches terminate 1466 // Depending on how the then/else branches terminate
1467 // (e.g., return/throw/break) there can be any number of these. 1467 // (e.g., return/throw/break) there can be any number of these.
1468 List<HBasicBlock> dominated = node.block.dominatedBlocks; 1468 List<HBasicBlock> dominated = node.block.dominatedBlocks;
1469 for (int i = 2; i < dominated.length; i++) { 1469 for (int i = 2; i < dominated.length; i++) {
1470 visitBasicBlock(dominated[i]); 1470 visitBasicBlock(dominated[i]);
1471 } 1471 }
1472 } 1472 }
1473 1473
1474 void visitInterceptor(HInterceptor node) { 1474 void visitInterceptor(HInterceptor node) {
1475 if (node.isConditionalConstantInterceptor) { 1475 registry.registerSpecializedGetInterceptor(node.interceptedClasses);
1476 assert(node.inputs.length == 2); 1476 String name = backend.namer.nameForGetInterceptor(node.interceptedClasses);
1477 use(node.receiver); 1477 var isolate = new js.VariableUse(
1478 js.Expression receiverExpression = pop(); 1478 backend.namer.globalObjectFor(backend.interceptorsLibrary));
1479 use(node.conditionalConstantInterceptor); 1479 use(node.receiver);
1480 js.Expression constant = pop(); 1480 List<js.Expression> arguments = <js.Expression>[pop()];
1481 push(js.js('# && #', [receiverExpression, constant])); 1481 push(js.propertyCall(isolate, name, arguments), node);
1482 } else { 1482 registry.registerUseInterceptor();
1483 assert(node.inputs.length == 1);
1484 registry.registerSpecializedGetInterceptor(node.interceptedClasses);
1485 String name =
1486 backend.namer.nameForGetInterceptor(node.interceptedClasses);
1487 var isolate = new js.VariableUse(
1488 backend.namer.globalObjectFor(backend.interceptorsLibrary));
1489 use(node.receiver);
1490 List<js.Expression> arguments = <js.Expression>[pop()];
1491 push(js.propertyCall(isolate, name, arguments), node);
1492 registry.registerUseInterceptor();
1493 }
1494 } 1483 }
1495 1484
1496 visitInvokeDynamicMethod(HInvokeDynamicMethod node) { 1485 visitInvokeDynamicMethod(HInvokeDynamicMethod node) {
1497 use(node.receiver); 1486 use(node.receiver);
1498 js.Expression object = pop(); 1487 js.Expression object = pop();
1499 String name = node.selector.name; 1488 String name = node.selector.name;
1500 String methodName; 1489 String methodName;
1501 List<js.Expression> arguments = visitArguments(node.inputs); 1490 List<js.Expression> arguments = visitArguments(node.inputs);
1502 Element target = node.element; 1491 Element target = node.element;
1503 1492
(...skipping 1174 matching lines...) Expand 10 before | Expand all | Expand 10 after
2678 js.PropertyAccess accessHelper(String name) { 2667 js.PropertyAccess accessHelper(String name) {
2679 Element helper = backend.findHelper(name); 2668 Element helper = backend.findHelper(name);
2680 if (helper == null) { 2669 if (helper == null) {
2681 // For mocked-up tests. 2670 // For mocked-up tests.
2682 return js.js('(void 0).$name'); 2671 return js.js('(void 0).$name');
2683 } 2672 }
2684 registry.registerStaticUse(helper); 2673 registry.registerStaticUse(helper);
2685 return backend.emitter.staticFunctionAccess(helper); 2674 return backend.emitter.staticFunctionAccess(helper);
2686 } 2675 }
2687 } 2676 }
OLDNEW
« no previous file with comments | « no previous file | pkg/compiler/lib/src/ssa/interceptor_simplifier.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698