Index: src/arm/full-codegen-arm.cc |
diff --git a/src/arm/full-codegen-arm.cc b/src/arm/full-codegen-arm.cc |
index 631e10176dcd7f3a8e6ce768b16ddb0b61bc6511..3b560fedfaefd2e12fcb41d505c5fa908b5769b4 100644 |
--- a/src/arm/full-codegen-arm.cc |
+++ b/src/arm/full-codegen-arm.cc |
@@ -347,42 +347,31 @@ void FullCodeGenerator::EmitProfilingCounterReset() { |
} |
-void FullCodeGenerator::EmitStackCheck(IterationStatement* stmt, |
- Label* back_edge_target) { |
- Comment cmnt(masm_, "[ Stack check"); |
+void FullCodeGenerator::EmitBackEdgeBookkeeping(IterationStatement* stmt, |
+ Label* back_edge_target) { |
+ Comment cmnt(masm_, "[ Back edge bookkeeping"); |
// Block literal pools whilst emitting stack check code. |
Assembler::BlockConstPoolScope block_const_pool(masm_); |
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); |
- __ b(pl, &ok); |
- InterruptStub stub; |
- __ CallStub(&stub); |
- } else { |
- __ LoadRoot(ip, Heap::kStackLimitRootIndex); |
- __ cmp(sp, Operand(ip)); |
- __ b(hs, &ok); |
- PredictableCodeSizeScope predictable(masm_, 2 * Assembler::kInstrSize); |
- 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); |
+ __ b(pl, &ok); |
+ 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()); |
+ RecordBackEdge(stmt->OsrEntryId()); |
- if (FLAG_count_based_interrupts) { |
- EmitProfilingCounterReset(); |
- } |
+ EmitProfilingCounterReset(); |
__ bind(&ok); |
PrepareForBailoutForId(stmt->EntryId(), NO_REGISTERS); |
@@ -1251,7 +1240,7 @@ void FullCodeGenerator::VisitForInStatement(ForInStatement* stmt) { |
__ add(r0, r0, Operand(Smi::FromInt(1))); |
__ push(r0); |
- EmitStackCheck(stmt, &loop); |
+ EmitBackEdgeBookkeeping(stmt, &loop); |
__ b(&loop); |
// Remove the pointers stored on the stack. |