| OLD | NEW |
| 1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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_ARM64 | 7 #if V8_TARGET_ARCH_ARM64 |
| 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 395 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 406 } else { | 406 } else { |
| 407 __ Bind(&return_label_); | 407 __ Bind(&return_label_); |
| 408 if (FLAG_trace) { | 408 if (FLAG_trace) { |
| 409 // Push the return value on the stack as the parameter. | 409 // Push the return value on the stack as the parameter. |
| 410 // Runtime::TraceExit returns its parameter in x0. | 410 // Runtime::TraceExit returns its parameter in x0. |
| 411 __ Push(result_register()); | 411 __ Push(result_register()); |
| 412 __ CallRuntime(Runtime::kTraceExit, 1); | 412 __ CallRuntime(Runtime::kTraceExit, 1); |
| 413 DCHECK(x0.Is(result_register())); | 413 DCHECK(x0.Is(result_register())); |
| 414 } | 414 } |
| 415 // Pretend that the exit is a backwards jump to the entry. | 415 // Pretend that the exit is a backwards jump to the entry. |
| 416 int distance = masm_->pc_offset() + kCodeSizeMultiplier / 2; | 416 int weight = 1; |
| 417 int weight = | 417 if (info_->ShouldSelfOptimize()) { |
| 418 Min(kMaxBackEdgeWeight, Max(1, distance / kCodeSizeMultiplier)); | 418 weight = FLAG_interrupt_budget / FLAG_self_opt_count; |
| 419 } else { |
| 420 int distance = masm_->pc_offset() + kCodeSizeMultiplier / 2; |
| 421 weight = Min(kMaxBackEdgeWeight, |
| 422 Max(1, distance / kCodeSizeMultiplier)); |
| 423 } |
| 419 EmitProfilingCounterDecrement(weight); | 424 EmitProfilingCounterDecrement(weight); |
| 420 Label ok; | 425 Label ok; |
| 421 __ B(pl, &ok); | 426 __ B(pl, &ok); |
| 422 __ Push(x0); | 427 __ Push(x0); |
| 423 __ Call(isolate()->builtins()->InterruptCheck(), | 428 __ Call(isolate()->builtins()->InterruptCheck(), |
| 424 RelocInfo::CODE_TARGET); | 429 RelocInfo::CODE_TARGET); |
| 425 __ Pop(x0); | 430 __ Pop(x0); |
| 426 EmitProfilingCounterReset(); | 431 EmitProfilingCounterReset(); |
| 427 __ Bind(&ok); | 432 __ Bind(&ok); |
| 428 | 433 |
| (...skipping 4844 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5273 return previous_; | 5278 return previous_; |
| 5274 } | 5279 } |
| 5275 | 5280 |
| 5276 | 5281 |
| 5277 #undef __ | 5282 #undef __ |
| 5278 | 5283 |
| 5279 | 5284 |
| 5280 } } // namespace v8::internal | 5285 } } // namespace v8::internal |
| 5281 | 5286 |
| 5282 #endif // V8_TARGET_ARCH_ARM64 | 5287 #endif // V8_TARGET_ARCH_ARM64 |
| OLD | NEW |