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

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

Issue 10168009: Revert "Only emit typeguards if we think they are valuable." (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « frog/tests/leg/src/TypeInferenceTest.dart ('k') | lib/compiler/implementation/ssa/nodes.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 daf0e3018276fed4e59747d9d8d0f69fe2795e37..dcc64081ebc7df3f00dbfc8ae180aba2690a5e86 100644
--- a/lib/compiler/implementation/ssa/bailout.dart
+++ b/lib/compiler/implementation/ssa/bailout.dart
@@ -111,27 +111,6 @@ class SsaTypeGuardInserter extends HGraphVisitor implements OptimizationPhase {
}
}
- bool typeGuardWouldBeValuable(HInstruction instruction,
- HType speculativeType) {
- bool isNested(HBasicBlock inner, HBasicBlock outer) {
- if (inner === outer) return false;
- if (outer === null) return true;
- while (inner !== null) {
- if (inner === outer) return true;
- inner = inner.parentLoopHeader;
- }
- return false;
- }
-
- // If the instruction is not in a loop then the header will be null.
- HBasicBlock currentLoopHeader = instruction.block.enclosingLoopHeader;
- for (HInstruction user in instruction.usedBy) {
- HBasicBlock userLoopHeader = user.block.enclosingLoopHeader;
- if (isNested(userLoopHeader, currentLoopHeader)) return true;
- }
- return false;
- }
-
bool shouldInsertTypeGuard(HInstruction instruction) {
HType speculativeType = instruction.propagatedType;
HType computedType = instruction.computeTypeFromInputTypes();
@@ -149,9 +128,8 @@ class SsaTypeGuardInserter extends HGraphVisitor implements OptimizationPhase {
if (!speculativeType.isUseful()) return false;
// If the types agree we don't need to check.
if (speculativeType == computedType) return false;
- // If a bailout check is more expensive than doing the actual operation
- // don't do it either.
- return typeGuardWouldBeValuable(instruction, speculativeType);
+ // TODO(floitsch): Make the creation of type guards more conditional.
+ return true;
}
void visitInstruction(HInstruction instruction) {
« no previous file with comments | « frog/tests/leg/src/TypeInferenceTest.dart ('k') | lib/compiler/implementation/ssa/nodes.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698