| Index: src/arm/lithium-codegen-arm.cc
|
| diff --git a/src/arm/lithium-codegen-arm.cc b/src/arm/lithium-codegen-arm.cc
|
| index 5c15d49787daba9fc4e5a539d99fe4425eb4c079..24231c594b5d234f88657865e572a1ea8ec60346 100644
|
| --- a/src/arm/lithium-codegen-arm.cc
|
| +++ b/src/arm/lithium-codegen-arm.cc
|
| @@ -264,38 +264,21 @@ bool LCodeGen::GenerateBody() {
|
| !is_aborted() && current_instruction_ < instructions_->length();
|
| current_instruction_++) {
|
| LInstruction* instr = instructions_->at(current_instruction_);
|
| +
|
| + // Don't emit code for basic blocks with a replacement.
|
| if (instr->IsLabel()) {
|
| - LLabel* label = LLabel::cast(instr);
|
| - emit_instructions = !label->HasReplacement();
|
| + emit_instructions = !LLabel::cast(instr)->HasReplacement();
|
| }
|
| + if (!emit_instructions) continue;
|
|
|
| - if (emit_instructions) {
|
| - if (FLAG_code_comments) {
|
| - HValue* hydrogen = instr->hydrogen_value();
|
| - if (hydrogen != NULL) {
|
| - if (hydrogen->IsChange()) {
|
| - HValue* changed_value = HChange::cast(hydrogen)->value();
|
| - int use_id = 0;
|
| - const char* use_mnemo = "dead";
|
| - if (hydrogen->UseCount() >= 1) {
|
| - HValue* use_value = hydrogen->uses().value();
|
| - use_id = use_value->id();
|
| - use_mnemo = use_value->Mnemonic();
|
| - }
|
| - Comment(";;; @%d: %s. <of #%d %s for #%d %s>",
|
| - current_instruction_, instr->Mnemonic(),
|
| - changed_value->id(), changed_value->Mnemonic(),
|
| - use_id, use_mnemo);
|
| - } else {
|
| - Comment(";;; @%d: %s. <#%d>", current_instruction_,
|
| - instr->Mnemonic(), hydrogen->id());
|
| - }
|
| - } else {
|
| - Comment(";;; @%d: %s.", current_instruction_, instr->Mnemonic());
|
| - }
|
| - }
|
| - instr->CompileToNative(this);
|
| + if (FLAG_code_comments && instr->HasInterestingComment(this)) {
|
| + Comment(";;; <@%d,#%d> %s",
|
| + current_instruction_,
|
| + instr->hydrogen_value()->id(),
|
| + instr->Mnemonic());
|
| }
|
| +
|
| + instr->CompileToNative(this);
|
| }
|
| EnsureSpaceForLazyDeopt();
|
| return !is_aborted();
|
| @@ -307,11 +290,14 @@ bool LCodeGen::GenerateDeferredCode() {
|
| if (deferred_.length() > 0) {
|
| for (int i = 0; !is_aborted() && i < deferred_.length(); i++) {
|
| LDeferredCode* code = deferred_[i];
|
| + Comment(";;; <@%d,#%d> "
|
| + "-------------------- Deferred %s --------------------",
|
| + code->instruction_index(),
|
| + code->instr()->hydrogen_value()->id(),
|
| + code->instr()->Mnemonic());
|
| __ bind(code->entry());
|
| if (NeedsDeferredFrame()) {
|
| - Comment(";;; Deferred build frame @%d: %s.",
|
| - code->instruction_index(),
|
| - code->instr()->Mnemonic());
|
| + Comment(";;; Build frame");
|
| ASSERT(!frame_is_built_);
|
| ASSERT(info()->IsStub());
|
| frame_is_built_ = true;
|
| @@ -319,15 +305,11 @@ bool LCodeGen::GenerateDeferredCode() {
|
| __ mov(scratch0(), Operand(Smi::FromInt(StackFrame::STUB)));
|
| __ push(scratch0());
|
| __ add(fp, sp, Operand(2 * kPointerSize));
|
| + Comment(";;; Deferred code");
|
| }
|
| - Comment(";;; Deferred code @%d: %s.",
|
| - code->instruction_index(),
|
| - code->instr()->Mnemonic());
|
| code->Generate();
|
| if (NeedsDeferredFrame()) {
|
| - Comment(";;; Deferred destroy frame @%d: %s.",
|
| - code->instruction_index(),
|
| - code->instr()->Mnemonic());
|
| + Comment(";;; Destroy frame");
|
| ASSERT(frame_is_built_);
|
| __ pop(ip);
|
| __ ldm(ia_w, sp, cp.bit() | fp.bit() | lr.bit());
|
| @@ -358,7 +340,9 @@ bool LCodeGen::GenerateDeoptJumpTable() {
|
| Abort("Generated code is too large");
|
| }
|
|
|
| - __ RecordComment("[ Deoptimisation jump table");
|
| + if (deopt_jump_table_.length() > 0) {
|
| + Comment(";;; -------------------- Jump table --------------------");
|
| + }
|
| Label table_start;
|
| __ bind(&table_start);
|
| Label needs_frame_not_call;
|
| @@ -419,7 +403,6 @@ bool LCodeGen::GenerateDeoptJumpTable() {
|
| }
|
| masm()->CheckConstPool(false, false);
|
| }
|
| - __ RecordComment("]");
|
|
|
| // Force constant pool emission at the end of the deopt jump table to make
|
| // sure that no constant pools are emitted after.
|
| @@ -1047,10 +1030,19 @@ void LCodeGen::RecordPosition(int position) {
|
| }
|
|
|
|
|
| +static const char* LabelType(LLabel* label) {
|
| + if (label->is_loop_header()) return " (loop header)";
|
| + if (label->is_osr_entry()) return " (OSR entry)";
|
| + return "";
|
| +}
|
| +
|
| +
|
| void LCodeGen::DoLabel(LLabel* label) {
|
| - Comment(";;; -------------------- B%d%s --------------------",
|
| + Comment(";;; <@%d,#%d> -------------------- B%d%s --------------------",
|
| + current_instruction_,
|
| + label->hydrogen_value()->id(),
|
| label->block_id(),
|
| - label->is_loop_header() ? " (loop header)" : "");
|
| + LabelType(label));
|
| __ bind(label->label());
|
| current_block_ = label->block_id();
|
| DoGap(label);
|
| @@ -2175,7 +2167,7 @@ void LCodeGen::DoArithmeticT(LArithmeticT* instr) {
|
| }
|
|
|
|
|
| -int LCodeGen::GetNextEmittedBlock() {
|
| +int LCodeGen::GetNextEmittedBlock() const {
|
| for (int i = current_block_ + 1; i < graph()->blocks()->length(); ++i) {
|
| if (!chunk_->GetLabel(i)->HasReplacement()) return i;
|
| }
|
| @@ -2321,9 +2313,8 @@ void LCodeGen::DoBranch(LBranch* instr) {
|
|
|
|
|
| void LCodeGen::EmitGoto(int block) {
|
| - int destination = chunk_->LookupDestination(block);
|
| - if (destination != GetNextEmittedBlock()) {
|
| - __ jmp(chunk_->GetAssemblyLabel(destination));
|
| + if (!IsNextEmittedBlock(block)) {
|
| + __ jmp(chunk_->GetAssemblyLabel(chunk_->LookupDestination(block)));
|
| }
|
| }
|
|
|
|
|