| 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 weight = 1; | 416 int distance = masm_->pc_offset() + kCodeSizeMultiplier / 2; |
| 417 if (info_->ShouldSelfOptimize()) { | 417 int weight = |
| 418 weight = FLAG_interrupt_budget / FLAG_self_opt_count; | 418 Min(kMaxBackEdgeWeight, Max(1, distance / kCodeSizeMultiplier)); |
| 419 } else { | |
| 420 int distance = masm_->pc_offset() + kCodeSizeMultiplier / 2; | |
| 421 weight = Min(kMaxBackEdgeWeight, | |
| 422 Max(1, distance / kCodeSizeMultiplier)); | |
| 423 } | |
| 424 EmitProfilingCounterDecrement(weight); | 419 EmitProfilingCounterDecrement(weight); |
| 425 Label ok; | 420 Label ok; |
| 426 __ B(pl, &ok); | 421 __ B(pl, &ok); |
| 427 __ Push(x0); | 422 __ Push(x0); |
| 428 __ Call(isolate()->builtins()->InterruptCheck(), | 423 __ Call(isolate()->builtins()->InterruptCheck(), |
| 429 RelocInfo::CODE_TARGET); | 424 RelocInfo::CODE_TARGET); |
| 430 __ Pop(x0); | 425 __ Pop(x0); |
| 431 EmitProfilingCounterReset(); | 426 EmitProfilingCounterReset(); |
| 432 __ Bind(&ok); | 427 __ Bind(&ok); |
| 433 | 428 |
| (...skipping 4844 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5278 return previous_; | 5273 return previous_; |
| 5279 } | 5274 } |
| 5280 | 5275 |
| 5281 | 5276 |
| 5282 #undef __ | 5277 #undef __ |
| 5283 | 5278 |
| 5284 | 5279 |
| 5285 } } // namespace v8::internal | 5280 } } // namespace v8::internal |
| 5286 | 5281 |
| 5287 #endif // V8_TARGET_ARCH_ARM64 | 5282 #endif // V8_TARGET_ARCH_ARM64 |
| OLD | NEW |