Removed confusing defensive programming in GenerateJumpTable.

For a given address/type pair we should always find a deoptimization
bailout ID, otherwise something is wrong. This was already asserted on
ARM, but we now do this consistently on all platforms.

Removed some usesless naming creativity on the way.

R=jarin@chromium.org

Review URL: https://codereview.chromium.org/587473003

git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@24077 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
This commit is contained in:
svenpanne@chromium.org 2014-09-19 11:06:59 +00:00
parent 9253510f5e
commit 33ddb37ba3
10 changed files with 24 additions and 48 deletions

View File

@ -52,11 +52,8 @@ bool LCodeGen::GenerateCode() {
// the frame (that is done in GeneratePrologue).
FrameScope frame_scope(masm_, StackFrame::NONE);
return GeneratePrologue() &&
GenerateBody() &&
GenerateDeferredCode() &&
GenerateDeoptJumpTable() &&
GenerateSafepointTable();
return GeneratePrologue() && GenerateBody() && GenerateDeferredCode() &&
GenerateJumpTable() && GenerateSafepointTable();
}
@ -313,7 +310,7 @@ bool LCodeGen::GenerateDeferredCode() {
}
bool LCodeGen::GenerateDeoptJumpTable() {
bool LCodeGen::GenerateJumpTable() {
// Check that the jump table is accessible from everywhere in the function
// code, i.e. that offsets to the table can be encoded in the 24bit signed
// immediate of a branch instruction.
@ -343,7 +340,7 @@ bool LCodeGen::GenerateDeoptJumpTable() {
DCHECK(type == deopt_jump_table_[0].bailout_type);
Address entry = table_entry->address;
int id = Deoptimizer::GetDeoptimizationId(isolate(), entry, type);
DCHECK(id != Deoptimizer::kNotDeoptimizationEntry);
DCHECK_NE(Deoptimizer::kNotDeoptimizationEntry, id);
Comment(";;; jump table entry %d: deoptimization bailout %d.", i, id);
DeoptComment(table_entry->mnemonic, table_entry->reason);

View File

@ -172,7 +172,7 @@ class LCodeGen: public LCodeGenBase {
void GenerateBodyInstructionPre(LInstruction* instr) OVERRIDE;
bool GeneratePrologue();
bool GenerateDeferredCode();
bool GenerateDeoptJumpTable();
bool GenerateJumpTable();
bool GenerateSafepointTable();
// Generates the custom OSR entrypoint and sets the osr_pc_offset.

View File

@ -842,11 +842,8 @@ bool LCodeGen::GenerateJumpTable() {
Deoptimizer::BailoutType type = table_entry->bailout_type;
Address entry = table_entry->address;
int id = Deoptimizer::GetDeoptimizationId(isolate(), entry, type);
if (id == Deoptimizer::kNotDeoptimizationEntry) {
Comment(";;; jump table entry %d.", i);
} else {
DCHECK_NE(Deoptimizer::kNotDeoptimizationEntry, id);
Comment(";;; jump table entry %d: deoptimization bailout %d.", i, id);
}
DeoptComment(table_entry->mnemonic, table_entry->reason);
// Second-level deopt table entries are contiguous and small, so instead

View File

@ -388,11 +388,8 @@ bool LCodeGen::GenerateJumpTable() {
Address entry = table_entry->address;
Deoptimizer::BailoutType type = table_entry->bailout_type;
int id = Deoptimizer::GetDeoptimizationId(isolate(), entry, type);
if (id == Deoptimizer::kNotDeoptimizationEntry) {
Comment(";;; jump table entry %d.", i);
} else {
DCHECK_NE(Deoptimizer::kNotDeoptimizationEntry, id);
Comment(";;; jump table entry %d: deoptimization bailout %d.", i, id);
}
DeoptComment(table_entry->mnemonic, table_entry->reason);
if (table_entry->needs_frame) {
DCHECK(!info()->saves_caller_doubles());

View File

@ -76,11 +76,8 @@ bool LCodeGen::GenerateCode() {
// the frame (that is done in GeneratePrologue).
FrameScope frame_scope(masm_, StackFrame::NONE);
return GeneratePrologue() &&
GenerateBody() &&
GenerateDeferredCode() &&
GenerateDeoptJumpTable() &&
GenerateSafepointTable();
return GeneratePrologue() && GenerateBody() && GenerateDeferredCode() &&
GenerateJumpTable() && GenerateSafepointTable();
}
@ -326,7 +323,7 @@ bool LCodeGen::GenerateDeferredCode() {
}
bool LCodeGen::GenerateDeoptJumpTable() {
bool LCodeGen::GenerateJumpTable() {
if (deopt_jump_table_.length() > 0) {
Label needs_frame, call_deopt_entry;
@ -343,7 +340,7 @@ bool LCodeGen::GenerateDeoptJumpTable() {
DCHECK(type == deopt_jump_table_[0].bailout_type);
Address entry = deopt_jump_table_[i].address;
int id = Deoptimizer::GetDeoptimizationId(isolate(), entry, type);
DCHECK(id != Deoptimizer::kNotDeoptimizationEntry);
DCHECK_NE(Deoptimizer::kNotDeoptimizationEntry, id);
Comment(";;; jump table entry %d: deoptimization bailout %d.", i, id);
// Second-level deopt table entries are contiguous and small, so instead

View File

@ -172,7 +172,7 @@ class LCodeGen: public LCodeGenBase {
void GenerateBodyInstructionPre(LInstruction* instr) OVERRIDE;
bool GeneratePrologue();
bool GenerateDeferredCode();
bool GenerateDeoptJumpTable();
bool GenerateJumpTable();
bool GenerateSafepointTable();
// Generates the custom OSR entrypoint and sets the osr_pc_offset.

View File

@ -51,11 +51,8 @@ bool LCodeGen::GenerateCode() {
// the frame (that is done in GeneratePrologue).
FrameScope frame_scope(masm_, StackFrame::NONE);
return GeneratePrologue() &&
GenerateBody() &&
GenerateDeferredCode() &&
GenerateDeoptJumpTable() &&
GenerateSafepointTable();
return GeneratePrologue() && GenerateBody() && GenerateDeferredCode() &&
GenerateJumpTable() && GenerateSafepointTable();
}
@ -302,7 +299,7 @@ bool LCodeGen::GenerateDeferredCode() {
}
bool LCodeGen::GenerateDeoptJumpTable() {
bool LCodeGen::GenerateJumpTable() {
if (deopt_jump_table_.length() > 0) {
Comment(";;; -------------------- Jump table --------------------");
}
@ -315,11 +312,8 @@ bool LCodeGen::GenerateDeoptJumpTable() {
Address entry = deopt_jump_table_[i].address;
Deoptimizer::BailoutType type = deopt_jump_table_[i].bailout_type;
int id = Deoptimizer::GetDeoptimizationId(isolate(), entry, type);
if (id == Deoptimizer::kNotDeoptimizationEntry) {
Comment(";;; jump table entry %d.", i);
} else {
DCHECK_NE(Deoptimizer::kNotDeoptimizationEntry, id);
Comment(";;; jump table entry %d: deoptimization bailout %d.", i, id);
}
__ li(t9, Operand(ExternalReference::ForDeoptEntry(entry)));
if (deopt_jump_table_[i].needs_frame) {
DCHECK(!info()->saves_caller_doubles());

View File

@ -173,7 +173,7 @@ class LCodeGen: public LCodeGenBase {
void GenerateBodyInstructionPre(LInstruction* instr) OVERRIDE;
bool GeneratePrologue();
bool GenerateDeferredCode();
bool GenerateDeoptJumpTable();
bool GenerateJumpTable();
bool GenerateSafepointTable();
// Generates the custom OSR entrypoint and sets the osr_pc_offset.

View File

@ -308,11 +308,8 @@ bool LCodeGen::GenerateJumpTable() {
Address entry = table_entry->address;
Deoptimizer::BailoutType type = table_entry->bailout_type;
int id = Deoptimizer::GetDeoptimizationId(isolate(), entry, type);
if (id == Deoptimizer::kNotDeoptimizationEntry) {
Comment(";;; jump table entry %d.", i);
} else {
DCHECK_NE(Deoptimizer::kNotDeoptimizationEntry, id);
Comment(";;; jump table entry %d: deoptimization bailout %d.", i, id);
}
DeoptComment(table_entry->mnemonic, table_entry->reason);
if (table_entry->needs_frame) {
DCHECK(!info()->saves_caller_doubles());

View File

@ -369,11 +369,8 @@ bool LCodeGen::GenerateJumpTable() {
Address entry = table_entry->address;
Deoptimizer::BailoutType type = table_entry->bailout_type;
int id = Deoptimizer::GetDeoptimizationId(isolate(), entry, type);
if (id == Deoptimizer::kNotDeoptimizationEntry) {
Comment(";;; jump table entry %d.", i);
} else {
DCHECK_NE(Deoptimizer::kNotDeoptimizationEntry, id);
Comment(";;; jump table entry %d: deoptimization bailout %d.", i, id);
}
DeoptComment(table_entry->mnemonic, table_entry->reason);
if (table_entry->needs_frame) {
DCHECK(!info()->saves_caller_doubles());