OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "src/v8.h" | 5 #include "src/v8.h" |
6 | 6 |
7 #if V8_TARGET_ARCH_X87 | 7 #if V8_TARGET_ARCH_X87 |
8 | 8 |
9 #include "src/code-factory.h" | 9 #include "src/code-factory.h" |
10 #include "src/code-stubs.h" | 10 #include "src/code-stubs.h" |
(...skipping 362 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
373 if (return_label_.is_bound()) { | 373 if (return_label_.is_bound()) { |
374 __ jmp(&return_label_); | 374 __ jmp(&return_label_); |
375 } else { | 375 } else { |
376 // Common return label | 376 // Common return label |
377 __ bind(&return_label_); | 377 __ bind(&return_label_); |
378 if (FLAG_trace) { | 378 if (FLAG_trace) { |
379 __ push(eax); | 379 __ push(eax); |
380 __ CallRuntime(Runtime::kTraceExit, 1); | 380 __ CallRuntime(Runtime::kTraceExit, 1); |
381 } | 381 } |
382 // Pretend that the exit is a backwards jump to the entry. | 382 // Pretend that the exit is a backwards jump to the entry. |
383 int distance = masm_->pc_offset(); | 383 int weight = 1; |
384 int weight = | 384 if (info_->ShouldSelfOptimize()) { |
385 Min(kMaxBackEdgeWeight, Max(1, distance / kCodeSizeMultiplier)); | 385 weight = FLAG_interrupt_budget / FLAG_self_opt_count; |
| 386 } else { |
| 387 int distance = masm_->pc_offset(); |
| 388 weight = Min(kMaxBackEdgeWeight, |
| 389 Max(1, distance / kCodeSizeMultiplier)); |
| 390 } |
386 EmitProfilingCounterDecrement(weight); | 391 EmitProfilingCounterDecrement(weight); |
387 Label ok; | 392 Label ok; |
388 __ j(positive, &ok, Label::kNear); | 393 __ j(positive, &ok, Label::kNear); |
389 __ push(eax); | 394 __ push(eax); |
390 __ call(isolate()->builtins()->InterruptCheck(), | 395 __ call(isolate()->builtins()->InterruptCheck(), |
391 RelocInfo::CODE_TARGET); | 396 RelocInfo::CODE_TARGET); |
392 __ pop(eax); | 397 __ pop(eax); |
393 EmitProfilingCounterReset(); | 398 EmitProfilingCounterReset(); |
394 __ bind(&ok); | 399 __ bind(&ok); |
395 #ifdef DEBUG | 400 #ifdef DEBUG |
(...skipping 4761 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5157 DCHECK_EQ(isolate->builtins()->OsrAfterStackCheck()->entry(), | 5162 DCHECK_EQ(isolate->builtins()->OsrAfterStackCheck()->entry(), |
5158 Assembler::target_address_at(call_target_address, | 5163 Assembler::target_address_at(call_target_address, |
5159 unoptimized_code)); | 5164 unoptimized_code)); |
5160 return OSR_AFTER_STACK_CHECK; | 5165 return OSR_AFTER_STACK_CHECK; |
5161 } | 5166 } |
5162 | 5167 |
5163 | 5168 |
5164 } } // namespace v8::internal | 5169 } } // namespace v8::internal |
5165 | 5170 |
5166 #endif // V8_TARGET_ARCH_X87 | 5171 #endif // V8_TARGET_ARCH_X87 |
OLD | NEW |