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

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

Issue 10539156: Track fields which are known to be always set to integer constants (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Addressed second round of comments 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
« no previous file with comments | « lib/compiler/implementation/enqueue.dart ('k') | lib/compiler/implementation/ssa/codegen.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/compiler/implementation/ssa/bailout.dart
diff --git a/lib/compiler/implementation/ssa/bailout.dart b/lib/compiler/implementation/ssa/bailout.dart
index cc9bd4bc22a1afd78ea53670860ce3a8c19b1daf..ba2423c5680efd5bd7ce4a045aaefb28272d35be 100644
--- a/lib/compiler/implementation/ssa/bailout.dart
+++ b/lib/compiler/implementation/ssa/bailout.dart
@@ -29,7 +29,7 @@ class Environment {
// If the instruction is a type guard, we add its checked input
// instead. This allows sharing the same environment between
// different type guards.
- //
+ //
// Also, we don't need to add code motion invariant instructions
// in the live set (because we generate them at use-site), except
// for parameters that are not 'this', which is always passed as
@@ -75,6 +75,7 @@ class SsaTypeGuardInserter extends HGraphVisitor implements OptimizationPhase {
final String name = 'SsaTypeGuardInserter';
final WorkItem work;
bool calledInLoop = false;
+ bool highTypeLikelyhood = false;
bool isRecursiveMethod = false;
int stateId = 1;
@@ -83,6 +84,7 @@ class SsaTypeGuardInserter extends HGraphVisitor implements OptimizationPhase {
void visitGraph(HGraph graph) {
isRecursiveMethod = graph.isRecursiveMethod;
calledInLoop = graph.calledInLoop;
+ highTypeLikelyhood = graph.highTypeLikelyhood;
work.guards = <HTypeGuard>[];
visitDominatorTree(graph);
}
@@ -145,7 +147,7 @@ class SsaTypeGuardInserter extends HGraphVisitor implements OptimizationPhase {
// Insert type guards if the method is likely to be called in a
// loop.
- return calledInLoop;
+ return calledInLoop || highTypeLikelyhood;
}
bool shouldInsertTypeGuard(HInstruction instruction) {
« no previous file with comments | « lib/compiler/implementation/enqueue.dart ('k') | lib/compiler/implementation/ssa/codegen.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698