Index: src/x87/full-codegen-x87.cc |
diff --git a/src/x87/full-codegen-x87.cc b/src/x87/full-codegen-x87.cc |
index 86613229f924c040745fba0d61c5d4de0931aac4..fa9088cdf549e3c0e4220fb6ce3581552f648dc6 100644 |
--- a/src/x87/full-codegen-x87.cc |
+++ b/src/x87/full-codegen-x87.cc |
@@ -380,9 +380,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; |
__ j(positive, &ok, Label::kNear); |