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 476 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
487 EmitProfilingCounterDecrement(weight); | 487 EmitProfilingCounterDecrement(weight); |
488 Label ok; | 488 Label ok; |
489 __ Branch(&ok, ge, a3, Operand(zero_reg)); | 489 __ Branch(&ok, ge, a3, Operand(zero_reg)); |
490 __ push(v0); | 490 __ push(v0); |
491 __ Call(isolate()->builtins()->InterruptCheck(), | 491 __ Call(isolate()->builtins()->InterruptCheck(), |
492 RelocInfo::CODE_TARGET); | 492 RelocInfo::CODE_TARGET); |
493 __ pop(v0); | 493 __ pop(v0); |
494 EmitProfilingCounterReset(); | 494 EmitProfilingCounterReset(); |
495 __ bind(&ok); | 495 __ bind(&ok); |
496 | 496 |
497 #ifdef DEBUG | |
498 // Add a label for checking the size of the code used for returning. | |
499 Label check_exit_codesize; | |
500 masm_->bind(&check_exit_codesize); | |
501 #endif | |
502 // Make sure that the constant pool is not emitted inside of the return | 497 // Make sure that the constant pool is not emitted inside of the return |
503 // sequence. | 498 // sequence. |
504 { Assembler::BlockTrampolinePoolScope block_trampoline_pool(masm_); | 499 { Assembler::BlockTrampolinePoolScope block_trampoline_pool(masm_); |
505 // Here we use masm_-> instead of the __ macro to avoid the code coverage | 500 // Here we use masm_-> instead of the __ macro to avoid the code coverage |
506 // tool from instrumenting as we rely on the code size here. | 501 // tool from instrumenting as we rely on the code size here. |
507 int32_t arg_count = info_->scope()->num_parameters() + 1; | 502 int32_t arg_count = info_->scope()->num_parameters() + 1; |
508 int32_t sp_delta = arg_count * kPointerSize; | 503 int32_t sp_delta = arg_count * kPointerSize; |
509 SetReturnPosition(function()); | 504 SetReturnPosition(function()); |
510 __ RecordJSReturn(); | |
511 masm_->mov(sp, fp); | 505 masm_->mov(sp, fp); |
512 int no_frame_start = masm_->pc_offset(); | 506 int no_frame_start = masm_->pc_offset(); |
513 masm_->MultiPop(static_cast<RegList>(fp.bit() | ra.bit())); | 507 masm_->MultiPop(static_cast<RegList>(fp.bit() | ra.bit())); |
514 masm_->Addu(sp, sp, Operand(sp_delta)); | 508 masm_->Addu(sp, sp, Operand(sp_delta)); |
515 masm_->Jump(ra); | 509 masm_->Jump(ra); |
516 info_->AddNoFrameRange(no_frame_start, masm_->pc_offset()); | 510 info_->AddNoFrameRange(no_frame_start, masm_->pc_offset()); |
517 } | 511 } |
518 | |
519 #ifdef DEBUG | |
520 // Check that the size of the code used for returning is large enough | |
521 // for the debugger's requirements. | |
522 DCHECK(Assembler::kJSReturnSequenceInstructions <= | |
523 masm_->InstructionsGeneratedSince(&check_exit_codesize)); | |
524 #endif | |
525 } | 512 } |
526 } | 513 } |
527 | 514 |
528 | 515 |
529 void FullCodeGenerator::EffectContext::Plug(Variable* var) const { | 516 void FullCodeGenerator::EffectContext::Plug(Variable* var) const { |
530 DCHECK(var->IsStackAllocated() || var->IsContextSlot()); | 517 DCHECK(var->IsStackAllocated() || var->IsContextSlot()); |
531 } | 518 } |
532 | 519 |
533 | 520 |
534 void FullCodeGenerator::AccumulatorValueContext::Plug(Variable* var) const { | 521 void FullCodeGenerator::AccumulatorValueContext::Plug(Variable* var) const { |
(...skipping 5049 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5584 reinterpret_cast<uint32_t>( | 5571 reinterpret_cast<uint32_t>( |
5585 isolate->builtins()->OsrAfterStackCheck()->entry())); | 5572 isolate->builtins()->OsrAfterStackCheck()->entry())); |
5586 return OSR_AFTER_STACK_CHECK; | 5573 return OSR_AFTER_STACK_CHECK; |
5587 } | 5574 } |
5588 | 5575 |
5589 | 5576 |
5590 } // namespace internal | 5577 } // namespace internal |
5591 } // namespace v8 | 5578 } // namespace v8 |
5592 | 5579 |
5593 #endif // V8_TARGET_ARCH_MIPS | 5580 #endif // V8_TARGET_ARCH_MIPS |
OLD | NEW |