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

Unified Diff: src/lithium-codegen.cc

Issue 222263002: Fix approximation of CanDeoptimize() and other small store elimination fixes. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: rebased Created 6 years, 9 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 | « src/hydrogen-store-elimination.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/lithium-codegen.cc
diff --git a/src/lithium-codegen.cc b/src/lithium-codegen.cc
index 93ae3101a7779e50b21fe4e542334974bc75758e..1ee23947426d0ce60c69ca26f35098ae206d8b5f 100644
--- a/src/lithium-codegen.cc
+++ b/src/lithium-codegen.cc
@@ -124,18 +124,22 @@ bool LCodeGenBase::GenerateBody() {
void LCodeGenBase::CheckEnvironmentUsage() {
#ifdef DEBUG
- bool live_block = true;
+ bool dead_block = false;
for (int i = 0; i < instructions_->length(); i++) {
LInstruction* instr = instructions_->at(i);
- if (instr->IsLabel()) live_block = !LLabel::cast(instr)->HasReplacement();
- if (live_block &&
- instr->hydrogen_value()->block()->IsReachable() &&
- instr->HasEnvironment() &&
- !instr->environment()->has_been_used()) {
- FunctionLiteral* lit = info_->function();
- V8_Fatal(__FILE__, __LINE__, "unused environment in %s <@%d,#%d> %s\n",
- lit == NULL ? "<UNKNOWN>" : lit->name()->ToCString().get(),
- i, instr->hydrogen_value()->id(), instr->Mnemonic());
+ HValue* hval = instr->hydrogen_value();
+ if (instr->IsLabel()) dead_block = LLabel::cast(instr)->HasReplacement();
+ if (dead_block || !hval->block()->IsReachable()) continue;
+
+ HInstruction* hinstr = HInstruction::cast(hval);
+ if (!hinstr->CanDeoptimize() && instr->HasEnvironment()) {
+ V8_Fatal(__FILE__, __LINE__, "CanDeoptimize is wrong for %s (%s)\n",
+ hinstr->Mnemonic(), instr->Mnemonic());
+ }
+
+ if (instr->HasEnvironment() && !instr->environment()->has_been_used()) {
+ V8_Fatal(__FILE__, __LINE__, "unused environment for %s (%s)\n",
+ hinstr->Mnemonic(), instr->Mnemonic());
}
}
#endif
« no previous file with comments | « src/hydrogen-store-elimination.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698