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

Unified Diff: lib/compiler/implementation/ssa/codegen.dart

Issue 10534109: Use simple loop tracking instead of size to determine if (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Add comment. Created 8 years, 6 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 side-by-side diff with in-line comments
Download patch
Index: lib/compiler/implementation/ssa/codegen.dart
diff --git a/lib/compiler/implementation/ssa/codegen.dart b/lib/compiler/implementation/ssa/codegen.dart
index 1b7e7d16c32cdbe58adca3905b604347a719b59a..67d4934fb3a59407466d634b6e7e31e19e86492b 100644
--- a/lib/compiler/implementation/ssa/codegen.dart
+++ b/lib/compiler/implementation/ssa/codegen.dart
@@ -1585,13 +1585,17 @@ class SsaCodeGenerator implements HVisitor, HBlockInformationVisitor {
buffer.add(compiler.namer.instanceMethodInvocationName(
currentLibrary, node.name, node.selector));
visitArguments(node.inputs);
+ var inLoop = node.block.enclosingLoopHeader !== null;
if (node.element !== null) {
// If we know we're calling a specific method, register that
// method only.
+ if (inLoop) node.element.calledInLoop = true;
world.registerDynamicInvocationOf(node.element);
} else {
world.registerDynamicInvocation(
- node.name, getOptimizedSelectorFor(node, node.selector));
+ node.name,
+ getOptimizedSelectorFor(node, node.selector),
+ inLoop: inLoop);
}
}
endExpression(JSPrecedence.CALL_PRECEDENCE);
@@ -2623,12 +2627,12 @@ class SsaUnoptimizedCodeGenerator extends SsaCodeGenerator {
// find the name of its checked input. Note that there must be a
// name, otherwise the instruction would not be in the live
// environment.
- HInstruction unwrap(argument) {
+ HInstruction unwrap(argument) {
while (argument is HCheck && !variableNames.hasName(argument)) {
argument = argument.checkedInput;
}
assert(variableNames.hasName(argument));
- return argument;
+ return argument;
}
void visitTypeGuard(HTypeGuard node) {

Powered by Google App Engine
This is Rietveld 408576698