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

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

Issue 10870035: Fix bug 4648: invalidate type parameter optimization on a method if a call with a selector that has… (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 3 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 2358 matching lines...) Expand 10 before | Expand all | Expand 10 after
2369 inputs.add(target); 2369 inputs.add(target);
2370 if (element.kind == ElementKind.FUNCTION) { 2370 if (element.kind == ElementKind.FUNCTION) {
2371 bool succeeded = addStaticSendArgumentsToList(selector, node.arguments, 2371 bool succeeded = addStaticSendArgumentsToList(selector, node.arguments,
2372 element, inputs); 2372 element, inputs);
2373 if (!succeeded) { 2373 if (!succeeded) {
2374 // TODO(ngeoffray): Match the VM behavior and throw an 2374 // TODO(ngeoffray): Match the VM behavior and throw an
2375 // exception at runtime. 2375 // exception at runtime.
2376 compiler.cancel('Unimplemented non-matching static call', node: node); 2376 compiler.cancel('Unimplemented non-matching static call', node: node);
2377 } 2377 }
2378 HInvokeStatic instruction = new HInvokeStatic(inputs); 2378 HInvokeStatic instruction = new HInvokeStatic(inputs);
2379 // TODO(ngeoffray): Only do this if knowing the return type is
2380 // useful.
2379 HType returnType = 2381 HType returnType =
2380 builder.backend.optimisticReturnTypesWithRecompilationOnTypeChange( 2382 builder.backend.optimisticReturnTypesWithRecompilationOnTypeChange(
2381 work.element, element); 2383 work.element, element);
2382 if (returnType != null) instruction.guaranteedType = returnType; 2384 if (returnType != null) instruction.guaranteedType = returnType;
2383 pushWithPosition(instruction, node); 2385 pushWithPosition(instruction, node);
2384 } else { 2386 } else {
2385 if (element.kind == ElementKind.GETTER) { 2387 if (element.kind == ElementKind.GETTER) {
2386 target = new HInvokeStatic(inputs); 2388 target = new HInvokeStatic(inputs);
2387 add(target); 2389 add(target);
2388 inputs = <HInstruction>[target]; 2390 inputs = <HInstruction>[target];
(...skipping 1257 matching lines...) Expand 10 before | Expand all | Expand 10 after
3646 new HSubGraphBlockInformation(elseBranch.graph)); 3648 new HSubGraphBlockInformation(elseBranch.graph));
3647 3649
3648 HBasicBlock conditionStartBlock = conditionBranch.block; 3650 HBasicBlock conditionStartBlock = conditionBranch.block;
3649 conditionStartBlock.setBlockFlow(info, joinBlock); 3651 conditionStartBlock.setBlockFlow(info, joinBlock);
3650 SubGraph conditionGraph = conditionBranch.graph; 3652 SubGraph conditionGraph = conditionBranch.graph;
3651 HIf branch = conditionGraph.end.last; 3653 HIf branch = conditionGraph.end.last;
3652 assert(branch is HIf); 3654 assert(branch is HIf);
3653 branch.blockInformation = conditionStartBlock.blockFlow; 3655 branch.blockInformation = conditionStartBlock.blockFlow;
3654 } 3656 }
3655 } 3657 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698