From: svenpanne@chromium.org Date: Mon, 28 Jan 2013 14:50:47 +0000 (+0000) Subject: Improved printing of jump tables. X-Git-Tag: upstream/4.7.83~15189 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=905548d2f65383ddb7a4f3b3dfddf70c6f899476;p=platform%2Fupstream%2Fv8.git Improved printing of jump tables. Review URL: https://codereview.chromium.org/12093016 git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@13531 ce2b1a6d-e550-0410-aec6-3dcde31c8c00 --- diff --git a/src/arm/lithium-codegen-arm.cc b/src/arm/lithium-codegen-arm.cc index 701c8db..d9f82ce 100644 --- a/src/arm/lithium-codegen-arm.cc +++ b/src/arm/lithium-codegen-arm.cc @@ -330,9 +330,18 @@ bool LCodeGen::GenerateDeoptJumpTable() { for (int i = 0; i < deopt_jump_table_.length(); i++) { __ bind(&deopt_jump_table_[i].label); Address entry = deopt_jump_table_[i].address; + bool is_lazy_deopt = deopt_jump_table_[i].is_lazy_deopt; + Deoptimizer::BailoutType type = + is_lazy_deopt ? Deoptimizer::LAZY : Deoptimizer::EAGER; + int id = Deoptimizer::GetDeoptimizationId(entry, type); + if (id == Deoptimizer::kNotDeoptimizationEntry) { + Comment(";;; jump table entry %d.", i); + } else { + Comment(";;; jump table entry %d: deoptimization bailout %d.", i, id); + } if (deopt_jump_table_[i].needs_frame) { __ mov(ip, Operand(ExternalReference::ForDeoptEntry(entry))); - if (deopt_jump_table_[i].is_lazy_deopt) { + if (is_lazy_deopt) { if (needs_frame_is_call.is_bound()) { __ b(&needs_frame_is_call); } else { @@ -365,7 +374,7 @@ bool LCodeGen::GenerateDeoptJumpTable() { } } } else { - if (deopt_jump_table_[i].is_lazy_deopt) { + if (is_lazy_deopt) { __ mov(lr, Operand(pc), LeaveCC, al); __ mov(pc, Operand(ExternalReference::ForDeoptEntry(entry))); } else { diff --git a/src/ia32/lithium-codegen-ia32.cc b/src/ia32/lithium-codegen-ia32.cc index fd4000b..4b9a62d 100644 --- a/src/ia32/lithium-codegen-ia32.cc +++ b/src/ia32/lithium-codegen-ia32.cc @@ -349,9 +349,18 @@ bool LCodeGen::GenerateJumpTable() { for (int i = 0; i < jump_table_.length(); i++) { __ bind(&jump_table_[i].label); Address entry = jump_table_[i].address; + bool is_lazy_deopt = jump_table_[i].is_lazy_deopt; + Deoptimizer::BailoutType type = + is_lazy_deopt ? Deoptimizer::LAZY : Deoptimizer::EAGER; + int id = Deoptimizer::GetDeoptimizationId(entry, type); + if (id == Deoptimizer::kNotDeoptimizationEntry) { + Comment(";;; jump table entry %d.", i); + } else { + Comment(";;; jump table entry %d: deoptimization bailout %d.", i, id); + } if (jump_table_[i].needs_frame) { __ push(Immediate(ExternalReference::ForDeoptEntry(entry))); - if (jump_table_[i].is_lazy_deopt) { + if (is_lazy_deopt) { if (needs_frame_is_call.is_bound()) { __ jmp(&needs_frame_is_call); } else { @@ -396,7 +405,7 @@ bool LCodeGen::GenerateJumpTable() { } } } else { - if (jump_table_[i].is_lazy_deopt) { + if (is_lazy_deopt) { __ call(entry, RelocInfo::RUNTIME_ENTRY); } else { __ jmp(entry, RelocInfo::RUNTIME_ENTRY); diff --git a/src/mips/lithium-codegen-mips.cc b/src/mips/lithium-codegen-mips.cc index 79f48d9..b8cb044 100644 --- a/src/mips/lithium-codegen-mips.cc +++ b/src/mips/lithium-codegen-mips.cc @@ -326,9 +326,18 @@ bool LCodeGen::GenerateDeoptJumpTable() { for (int i = 0; i < deopt_jump_table_.length(); i++) { __ bind(&deopt_jump_table_[i].label); Address entry = deopt_jump_table_[i].address; + bool is_lazy_deopt = deopt_jump_table_[i].is_lazy_deopt; + Deoptimizer::BailoutType type = + is_lazy_deopt ? Deoptimizer::LAZY : Deoptimizer::EAGER; + int id = Deoptimizer::GetDeoptimizationId(entry, type); + if (id == Deoptimizer::kNotDeoptimizationEntry) { + Comment(";;; jump table entry %d.", i); + } else { + Comment(";;; jump table entry %d: deoptimization bailout %d.", i, id); + } __ li(t9, Operand(ExternalReference::ForDeoptEntry(entry))); if (deopt_jump_table_[i].needs_frame) { - if (deopt_jump_table_[i].is_lazy_deopt) { + if (is_lazy_deopt) { if (needs_frame_is_call.is_bound()) { __ Branch(&needs_frame_is_call); } else { @@ -360,7 +369,7 @@ bool LCodeGen::GenerateDeoptJumpTable() { } } } else { - if (deopt_jump_table_[i].is_lazy_deopt) { + if (is_lazy_deopt) { __ Call(t9); } else { __ Jump(t9); diff --git a/src/x64/lithium-codegen-x64.cc b/src/x64/lithium-codegen-x64.cc index cf192f4..3424857 100644 --- a/src/x64/lithium-codegen-x64.cc +++ b/src/x64/lithium-codegen-x64.cc @@ -281,9 +281,18 @@ bool LCodeGen::GenerateJumpTable() { for (int i = 0; i < jump_table_.length(); i++) { __ bind(&jump_table_[i].label); Address entry = jump_table_[i].address; + bool is_lazy_deopt = jump_table_[i].is_lazy_deopt; + Deoptimizer::BailoutType type = + is_lazy_deopt ? Deoptimizer::LAZY : Deoptimizer::EAGER; + int id = Deoptimizer::GetDeoptimizationId(entry, type); + if (id == Deoptimizer::kNotDeoptimizationEntry) { + Comment(";;; jump table entry %d.", i); + } else { + Comment(";;; jump table entry %d: deoptimization bailout %d.", i, id); + } if (jump_table_[i].needs_frame) { __ movq(kScratchRegister, ExternalReference::ForDeoptEntry(entry)); - if (jump_table_[i].is_lazy_deopt) { + if (is_lazy_deopt) { if (needs_frame_is_call.is_bound()) { __ jmp(&needs_frame_is_call); } else { @@ -319,7 +328,7 @@ bool LCodeGen::GenerateJumpTable() { } } } else { - if (jump_table_[i].is_lazy_deopt) { + if (is_lazy_deopt) { __ Call(entry, RelocInfo::RUNTIME_ENTRY); } else { __ Jump(entry, RelocInfo::RUNTIME_ENTRY);