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_ARM | 7 #if V8_TARGET_ARCH_ARM |
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 480 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
491 EmitProfilingCounterDecrement(weight); | 491 EmitProfilingCounterDecrement(weight); |
492 Label ok; | 492 Label ok; |
493 __ b(pl, &ok); | 493 __ b(pl, &ok); |
494 __ push(r0); | 494 __ push(r0); |
495 __ Call(isolate()->builtins()->InterruptCheck(), | 495 __ Call(isolate()->builtins()->InterruptCheck(), |
496 RelocInfo::CODE_TARGET); | 496 RelocInfo::CODE_TARGET); |
497 __ pop(r0); | 497 __ pop(r0); |
498 EmitProfilingCounterReset(); | 498 EmitProfilingCounterReset(); |
499 __ bind(&ok); | 499 __ bind(&ok); |
500 | 500 |
501 #ifdef DEBUG | |
502 // Add a label for checking the size of the code used for returning. | |
503 Label check_exit_codesize; | |
504 __ bind(&check_exit_codesize); | |
505 #endif | |
506 // Make sure that the constant pool is not emitted inside of the return | 501 // Make sure that the constant pool is not emitted inside of the return |
507 // sequence. | 502 // sequence. |
508 { Assembler::BlockConstPoolScope block_const_pool(masm_); | 503 { Assembler::BlockConstPoolScope block_const_pool(masm_); |
509 int32_t arg_count = info_->scope()->num_parameters() + 1; | 504 int32_t arg_count = info_->scope()->num_parameters() + 1; |
510 int32_t sp_delta = arg_count * kPointerSize; | 505 int32_t sp_delta = arg_count * kPointerSize; |
511 SetReturnPosition(function()); | 506 SetReturnPosition(function()); |
512 // TODO(svenpanne) The code below is sometimes 4 words, sometimes 5! | 507 // TODO(svenpanne) The code below is sometimes 4 words, sometimes 5! |
513 PredictableCodeSizeScope predictable(masm_, -1); | 508 PredictableCodeSizeScope predictable(masm_, -1); |
514 __ RecordJSReturn(); | |
515 int no_frame_start = __ LeaveFrame(StackFrame::JAVA_SCRIPT); | 509 int no_frame_start = __ LeaveFrame(StackFrame::JAVA_SCRIPT); |
516 { ConstantPoolUnavailableScope constant_pool_unavailable(masm_); | 510 { ConstantPoolUnavailableScope constant_pool_unavailable(masm_); |
517 __ add(sp, sp, Operand(sp_delta)); | 511 __ add(sp, sp, Operand(sp_delta)); |
518 __ Jump(lr); | 512 __ Jump(lr); |
519 info_->AddNoFrameRange(no_frame_start, masm_->pc_offset()); | 513 info_->AddNoFrameRange(no_frame_start, masm_->pc_offset()); |
520 } | 514 } |
521 } | 515 } |
522 | |
523 #ifdef DEBUG | |
524 // Check that the size of the code used for returning is large enough | |
525 // for the debugger's requirements. | |
526 DCHECK(Assembler::kJSReturnSequenceInstructions <= | |
527 masm_->InstructionsGeneratedSince(&check_exit_codesize)); | |
528 #endif | |
529 } | 516 } |
530 } | 517 } |
531 | 518 |
532 | 519 |
533 void FullCodeGenerator::EffectContext::Plug(Variable* var) const { | 520 void FullCodeGenerator::EffectContext::Plug(Variable* var) const { |
534 DCHECK(var->IsStackAllocated() || var->IsContextSlot()); | 521 DCHECK(var->IsStackAllocated() || var->IsContextSlot()); |
535 } | 522 } |
536 | 523 |
537 | 524 |
538 void FullCodeGenerator::AccumulatorValueContext::Plug(Variable* var) const { | 525 void FullCodeGenerator::AccumulatorValueContext::Plug(Variable* var) const { |
(...skipping 5087 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5626 DCHECK(interrupt_address == | 5613 DCHECK(interrupt_address == |
5627 isolate->builtins()->OsrAfterStackCheck()->entry()); | 5614 isolate->builtins()->OsrAfterStackCheck()->entry()); |
5628 return OSR_AFTER_STACK_CHECK; | 5615 return OSR_AFTER_STACK_CHECK; |
5629 } | 5616 } |
5630 | 5617 |
5631 | 5618 |
5632 } // namespace internal | 5619 } // namespace internal |
5633 } // namespace v8 | 5620 } // namespace v8 |
5634 | 5621 |
5635 #endif // V8_TARGET_ARCH_ARM | 5622 #endif // V8_TARGET_ARCH_ARM |
OLD | NEW |