| 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_MIPS | 7 #if V8_TARGET_ARCH_MIPS |
| 8 | 8 |
| 9 // Note on Mips implementation: | 9 // Note on Mips implementation: |
| 10 // | 10 // |
| (...skipping 393 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 404 __ Branch(&return_label_); | 404 __ Branch(&return_label_); |
| 405 } else { | 405 } else { |
| 406 __ bind(&return_label_); | 406 __ bind(&return_label_); |
| 407 if (FLAG_trace) { | 407 if (FLAG_trace) { |
| 408 // Push the return value on the stack as the parameter. | 408 // Push the return value on the stack as the parameter. |
| 409 // Runtime::TraceExit returns its parameter in v0. | 409 // Runtime::TraceExit returns its parameter in v0. |
| 410 __ push(v0); | 410 __ push(v0); |
| 411 __ CallRuntime(Runtime::kTraceExit, 1); | 411 __ CallRuntime(Runtime::kTraceExit, 1); |
| 412 } | 412 } |
| 413 // Pretend that the exit is a backwards jump to the entry. | 413 // Pretend that the exit is a backwards jump to the entry. |
| 414 int distance = masm_->pc_offset(); | 414 int weight = 1; |
| 415 int weight = | 415 if (info_->ShouldSelfOptimize()) { |
| 416 Min(kMaxBackEdgeWeight, Max(1, distance / kCodeSizeMultiplier)); | 416 weight = FLAG_interrupt_budget / FLAG_self_opt_count; |
| 417 } else { |
| 418 int distance = masm_->pc_offset(); |
| 419 weight = Min(kMaxBackEdgeWeight, |
| 420 Max(1, distance / kCodeSizeMultiplier)); |
| 421 } |
| 417 EmitProfilingCounterDecrement(weight); | 422 EmitProfilingCounterDecrement(weight); |
| 418 Label ok; | 423 Label ok; |
| 419 __ Branch(&ok, ge, a3, Operand(zero_reg)); | 424 __ Branch(&ok, ge, a3, Operand(zero_reg)); |
| 420 __ push(v0); | 425 __ push(v0); |
| 421 __ Call(isolate()->builtins()->InterruptCheck(), | 426 __ Call(isolate()->builtins()->InterruptCheck(), |
| 422 RelocInfo::CODE_TARGET); | 427 RelocInfo::CODE_TARGET); |
| 423 __ pop(v0); | 428 __ pop(v0); |
| 424 EmitProfilingCounterReset(); | 429 EmitProfilingCounterReset(); |
| 425 __ bind(&ok); | 430 __ bind(&ok); |
| 426 | 431 |
| (...skipping 4805 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5232 Assembler::target_address_at(pc_immediate_load_address)) == | 5237 Assembler::target_address_at(pc_immediate_load_address)) == |
| 5233 reinterpret_cast<uint32_t>( | 5238 reinterpret_cast<uint32_t>( |
| 5234 isolate->builtins()->OsrAfterStackCheck()->entry())); | 5239 isolate->builtins()->OsrAfterStackCheck()->entry())); |
| 5235 return OSR_AFTER_STACK_CHECK; | 5240 return OSR_AFTER_STACK_CHECK; |
| 5236 } | 5241 } |
| 5237 | 5242 |
| 5238 | 5243 |
| 5239 } } // namespace v8::internal | 5244 } } // namespace v8::internal |
| 5240 | 5245 |
| 5241 #endif // V8_TARGET_ARCH_MIPS | 5246 #endif // V8_TARGET_ARCH_MIPS |
| OLD | NEW |