Index: src/arm/full-codegen-arm.cc |
diff --git a/src/arm/full-codegen-arm.cc b/src/arm/full-codegen-arm.cc |
index 7dec9f2b6c58bc36529b852e2a5ffd1f91c9a11d..fbf3fec6c885ac0f23605ba0b02d93115a996593 100644 |
--- a/src/arm/full-codegen-arm.cc |
+++ b/src/arm/full-codegen-arm.cc |
@@ -424,9 +424,14 @@ void FullCodeGenerator::EmitReturnSequence() { |
__ CallRuntime(Runtime::kTraceExit, 1); |
} |
// Pretend that the exit is a backwards jump to the entry. |
- int distance = masm_->pc_offset(); |
- int weight = |
- Min(kMaxBackEdgeWeight, Max(1, distance / kCodeSizeMultiplier)); |
+ int weight = 1; |
+ if (info_->ShouldSelfOptimize()) { |
+ weight = FLAG_interrupt_budget / FLAG_self_opt_count; |
+ } else { |
+ int distance = masm_->pc_offset(); |
+ weight = Min(kMaxBackEdgeWeight, |
+ Max(1, distance / kCodeSizeMultiplier)); |
+ } |
EmitProfilingCounterDecrement(weight); |
Label ok; |
__ b(pl, &ok); |