| Index: src/mips/full-codegen-mips.cc
|
| diff --git a/src/mips/full-codegen-mips.cc b/src/mips/full-codegen-mips.cc
|
| index b8b3ea159e8bb7071377acbc4e309d89e79934d6..f9f8c404c220cd194350229447257244d8817f48 100644
|
| --- a/src/mips/full-codegen-mips.cc
|
| +++ b/src/mips/full-codegen-mips.cc
|
| @@ -346,45 +346,34 @@ void FullCodeGenerator::EmitProfilingCounterReset() {
|
| }
|
|
|
|
|
| -void FullCodeGenerator::EmitStackCheck(IterationStatement* stmt,
|
| - Label* back_edge_target) {
|
| +void FullCodeGenerator::EmitBackEdgeBookkeeping(IterationStatement* stmt,
|
| + Label* back_edge_target) {
|
| // The generated code is used in Deoptimizer::PatchStackCheckCodeAt so we need
|
| // to make sure it is constant. Branch may emit a skip-or-jump sequence
|
| // instead of the normal Branch. It seems that the "skip" part of that
|
| // sequence is about as long as this Branch would be so it is safe to ignore
|
| // that.
|
| Assembler::BlockTrampolinePoolScope block_trampoline_pool(masm_);
|
| - Comment cmnt(masm_, "[ Stack check");
|
| + Comment cmnt(masm_, "[ Back edge bookkeeping");
|
| Label ok;
|
| - if (FLAG_count_based_interrupts) {
|
| - int weight = 1;
|
| - if (FLAG_weighted_back_edges) {
|
| - ASSERT(back_edge_target->is_bound());
|
| - int distance = masm_->SizeOfCodeGeneratedSince(back_edge_target);
|
| - weight = Min(kMaxBackEdgeWeight,
|
| - Max(1, distance / kBackEdgeDistanceUnit));
|
| - }
|
| - EmitProfilingCounterDecrement(weight);
|
| - __ slt(at, a3, zero_reg);
|
| - __ beq(at, zero_reg, &ok);
|
| - // CallStub will emit a li t9 first, so it is safe to use the delay slot.
|
| - InterruptStub stub;
|
| - __ CallStub(&stub);
|
| - } else {
|
| - __ LoadRoot(t0, Heap::kStackLimitRootIndex);
|
| - __ sltu(at, sp, t0);
|
| - __ beq(at, zero_reg, &ok);
|
| - // CallStub will emit a li t9 first, so it is safe to use the delay slot.
|
| - StackCheckStub stub;
|
| - __ CallStub(&stub);
|
| + int weight = 1;
|
| + if (FLAG_weighted_back_edges) {
|
| + ASSERT(back_edge_target->is_bound());
|
| + int distance = masm_->SizeOfCodeGeneratedSince(back_edge_target);
|
| + weight = Min(kMaxBackEdgeWeight,
|
| + Max(1, distance / kBackEdgeDistanceUnit));
|
| }
|
| + EmitProfilingCounterDecrement(weight);
|
| + __ slt(at, a3, zero_reg);
|
| + __ beq(at, zero_reg, &ok);
|
| + // CallStub will emit a li t9 first, so it is safe to use the delay slot.
|
| + InterruptStub stub;
|
| + __ CallStub(&stub);
|
| // Record a mapping of this PC offset to the OSR id. This is used to find
|
| // the AST id from the unoptimized code in order to use it as a key into
|
| // the deoptimization input data found in the optimized code.
|
| - RecordStackCheck(stmt->OsrEntryId());
|
| - if (FLAG_count_based_interrupts) {
|
| - EmitProfilingCounterReset();
|
| - }
|
| + RecordBackEdge(stmt->OsrEntryId());
|
| + EmitProfilingCounterReset();
|
|
|
| __ bind(&ok);
|
| PrepareForBailoutForId(stmt->EntryId(), NO_REGISTERS);
|
| @@ -1259,7 +1248,7 @@ void FullCodeGenerator::VisitForInStatement(ForInStatement* stmt) {
|
| __ Addu(a0, a0, Operand(Smi::FromInt(1)));
|
| __ push(a0);
|
|
|
| - EmitStackCheck(stmt, &loop);
|
| + EmitBackEdgeBookkeeping(stmt, &loop);
|
| __ Branch(&loop);
|
|
|
| // Remove the pointers stored on the stack.
|
|
|