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

Side by Side Diff: lib/compiler/implementation/ssa/builder.dart

Issue 10832109: Refactor the way we emit no such method handlers so it's easier to optimize it later. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Improve NSM handling. Created 8 years, 4 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 class Interceptors { 5 class Interceptors {
6 Compiler compiler; 6 Compiler compiler;
7 Interceptors(Compiler this.compiler); 7 Interceptors(Compiler this.compiler);
8 8
9 SourceString mapOperatorToMethodName(Operator op) { 9 SourceString mapOperatorToMethodName(Operator op) {
10 String name = op.source.stringValue; 10 String name = op.source.stringValue;
(...skipping 2158 matching lines...) Expand 10 before | Expand all | Expand 10 after
2169 FunctionElement function = element; 2169 FunctionElement function = element;
2170 FunctionSignature params = function.computeSignature(compiler); 2170 FunctionSignature params = function.computeSignature(compiler);
2171 if (params.optionalParameterCount !== 0) { 2171 if (params.optionalParameterCount !== 0) {
2172 compiler.cancel( 2172 compiler.cancel(
2173 'JS_TO_CLOSURE does not handle closure with optional parameters', 2173 'JS_TO_CLOSURE does not handle closure with optional parameters',
2174 node: closure); 2174 node: closure);
2175 } 2175 }
2176 visit(closure); 2176 visit(closure);
2177 List<HInstruction> inputs = <HInstruction>[pop()]; 2177 List<HInstruction> inputs = <HInstruction>[pop()];
2178 String invocationName = compiler.namer.closureInvocationName( 2178 String invocationName = compiler.namer.closureInvocationName(
2179 new Selector(SelectorKind.INVOCATION, params.requiredParameterCount)); 2179 new Selector.invocation(params.requiredParameterCount));
2180 push(new HForeign(new DartString.literal('#.$invocationName'), 2180 push(new HForeign(new DartString.literal('#.$invocationName'),
2181 const LiteralDartString('var'), 2181 const LiteralDartString('var'),
2182 inputs)); 2182 inputs));
2183 } 2183 }
2184 2184
2185 visitForeignSend(Send node) { 2185 visitForeignSend(Send node) {
2186 Element element = elements[node]; 2186 Element element = elements[node];
2187 if (element.name == const SourceString('JS')) { 2187 if (element.name == const SourceString('JS')) {
2188 handleForeignJs(node); 2188 handleForeignJs(node);
2189 } else if (element.name == const SourceString('UNINTERCEPTED')) { 2189 } else if (element.name == const SourceString('UNINTERCEPTED')) {
(...skipping 1395 matching lines...) Expand 10 before | Expand all | Expand 10 after
3585 new HSubGraphBlockInformation(elseBranch.graph)); 3585 new HSubGraphBlockInformation(elseBranch.graph));
3586 3586
3587 HBasicBlock conditionStartBlock = conditionBranch.block; 3587 HBasicBlock conditionStartBlock = conditionBranch.block;
3588 conditionStartBlock.setBlockFlow(info, joinBlock); 3588 conditionStartBlock.setBlockFlow(info, joinBlock);
3589 SubGraph conditionGraph = conditionBranch.graph; 3589 SubGraph conditionGraph = conditionBranch.graph;
3590 HIf branch = conditionGraph.end.last; 3590 HIf branch = conditionGraph.end.last;
3591 assert(branch is HIf); 3591 assert(branch is HIf);
3592 branch.blockInformation = conditionStartBlock.blockFlow; 3592 branch.blockInformation = conditionStartBlock.blockFlow;
3593 } 3593 }
3594 } 3594 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698