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

Unified Diff: src/interpreter/bytecode-generator.cc

Issue 1979523002: [interpreter] Remove BytecodeArrayBuilder::Illegal(). (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Rebase Created 4 years, 7 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/interpreter/bytecode-array-writer.cc ('k') | src/interpreter/bytecode-peephole-optimizer.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/interpreter/bytecode-generator.cc
diff --git a/src/interpreter/bytecode-generator.cc b/src/interpreter/bytecode-generator.cc
index 61f09ac2e3726d9cddd3a7d65075a53a11a23188..650234a58447d506cd28659f0a9c4c49bd38a332 100644
--- a/src/interpreter/bytecode-generator.cc
+++ b/src/interpreter/bytecode-generator.cc
@@ -655,10 +655,14 @@ void BytecodeGenerator::BuildIndexedJump(Register index, size_t start_index,
.CompareOperation(Token::Value::EQ_STRICT, index)
.JumpIfTrue(&(targets[i]));
}
- // TODO(oth): This should be an abort via the runtime with a
- // corresponding message., An illegal bytecode should never be
- // emitted in valid bytecode.
- builder()->Illegal(); // Should never get here.
+
+ RegisterAllocationScope register_scope(this);
+ Register reason = register_allocator()->NewRegister();
+ BailoutReason bailout_reason = BailoutReason::kInvalidJumpTableIndex;
+ builder()
+ ->LoadLiteral(Smi::FromInt(static_cast<int>(bailout_reason)))
+ .StoreAccumulatorInRegister(reason)
+ .CallRuntime(Runtime::kAbort, reason, 1);
}
void BytecodeGenerator::VisitIterationHeader(IterationStatement* stmt,
« no previous file with comments | « src/interpreter/bytecode-array-writer.cc ('k') | src/interpreter/bytecode-peephole-optimizer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698