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_IA32 | 7 #if V8_TARGET_ARCH_IA32 |
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 365 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
376 if (return_label_.is_bound()) { | 376 if (return_label_.is_bound()) { |
377 __ jmp(&return_label_); | 377 __ jmp(&return_label_); |
378 } else { | 378 } else { |
379 // Common return label | 379 // Common return label |
380 __ bind(&return_label_); | 380 __ bind(&return_label_); |
381 if (FLAG_trace) { | 381 if (FLAG_trace) { |
382 __ push(eax); | 382 __ push(eax); |
383 __ CallRuntime(Runtime::kTraceExit, 1); | 383 __ CallRuntime(Runtime::kTraceExit, 1); |
384 } | 384 } |
385 // Pretend that the exit is a backwards jump to the entry. | 385 // Pretend that the exit is a backwards jump to the entry. |
386 int distance = masm_->pc_offset(); | 386 int weight = 1; |
387 int weight = | 387 if (info_->ShouldSelfOptimize()) { |
388 Min(kMaxBackEdgeWeight, Max(1, distance / kCodeSizeMultiplier)); | 388 weight = FLAG_interrupt_budget / FLAG_self_opt_count; |
| 389 } else { |
| 390 int distance = masm_->pc_offset(); |
| 391 weight = Min(kMaxBackEdgeWeight, |
| 392 Max(1, distance / kCodeSizeMultiplier)); |
| 393 } |
389 EmitProfilingCounterDecrement(weight); | 394 EmitProfilingCounterDecrement(weight); |
390 Label ok; | 395 Label ok; |
391 __ j(positive, &ok, Label::kNear); | 396 __ j(positive, &ok, Label::kNear); |
392 __ push(eax); | 397 __ push(eax); |
393 __ call(isolate()->builtins()->InterruptCheck(), | 398 __ call(isolate()->builtins()->InterruptCheck(), |
394 RelocInfo::CODE_TARGET); | 399 RelocInfo::CODE_TARGET); |
395 __ pop(eax); | 400 __ pop(eax); |
396 EmitProfilingCounterReset(); | 401 EmitProfilingCounterReset(); |
397 __ bind(&ok); | 402 __ bind(&ok); |
398 #ifdef DEBUG | 403 #ifdef DEBUG |
(...skipping 4772 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5171 DCHECK_EQ(isolate->builtins()->OsrAfterStackCheck()->entry(), | 5176 DCHECK_EQ(isolate->builtins()->OsrAfterStackCheck()->entry(), |
5172 Assembler::target_address_at(call_target_address, | 5177 Assembler::target_address_at(call_target_address, |
5173 unoptimized_code)); | 5178 unoptimized_code)); |
5174 return OSR_AFTER_STACK_CHECK; | 5179 return OSR_AFTER_STACK_CHECK; |
5175 } | 5180 } |
5176 | 5181 |
5177 | 5182 |
5178 } } // namespace v8::internal | 5183 } } // namespace v8::internal |
5179 | 5184 |
5180 #endif // V8_TARGET_ARCH_IA32 | 5185 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |