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 474 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
485 EmitProfilingCounterDecrement(weight); | 485 EmitProfilingCounterDecrement(weight); |
486 Label ok; | 486 Label ok; |
487 __ B(pl, &ok); | 487 __ B(pl, &ok); |
488 __ Push(x0); | 488 __ Push(x0); |
489 __ Call(isolate()->builtins()->InterruptCheck(), | 489 __ Call(isolate()->builtins()->InterruptCheck(), |
490 RelocInfo::CODE_TARGET); | 490 RelocInfo::CODE_TARGET); |
491 __ Pop(x0); | 491 __ Pop(x0); |
492 EmitProfilingCounterReset(); | 492 EmitProfilingCounterReset(); |
493 __ Bind(&ok); | 493 __ Bind(&ok); |
494 | 494 |
495 // Make sure that the constant pool is not emitted inside of the return | 495 SetReturnPosition(function()); |
496 // sequence. This sequence can get patched when the debugger is used. See | 496 const Register& current_sp = __ StackPointer(); |
497 // debug-arm64.cc:BreakLocation::SetDebugBreakAtReturn(). | 497 // Nothing ensures 16 bytes alignment here. |
498 { | 498 DCHECK(!current_sp.Is(csp)); |
499 InstructionAccurateScope scope(masm_, | 499 __ Mov(current_sp, fp); |
500 Assembler::kJSReturnSequenceInstructions); | 500 int no_frame_start = masm_->pc_offset(); |
501 SetReturnPosition(function()); | 501 __ Ldp(fp, lr, MemOperand(current_sp, 2 * kXRegSize, PostIndex)); |
502 __ RecordJSReturn(); | 502 // Drop the arguments and receiver and return. |
503 // This code is generated using Assembler methods rather than Macro | 503 // TODO(all): This implementation is overkill as it supports 2**31+1 |
504 // Assembler methods because it will be patched later on, and so the size | 504 // arguments, consider how to improve it without creating a security |
505 // of the generated code must be consistent. | 505 // hole. |
506 const Register& current_sp = __ StackPointer(); | 506 __ ldr_pcrel(ip0, (3 * kInstructionSize) >> kLoadLiteralScaleLog2); |
507 // Nothing ensures 16 bytes alignment here. | 507 __ Add(current_sp, current_sp, ip0); |
508 DCHECK(!current_sp.Is(csp)); | 508 __ Ret(); |
509 __ mov(current_sp, fp); | 509 int32_t arg_count = info_->scope()->num_parameters() + 1; |
510 int no_frame_start = masm_->pc_offset(); | 510 __ dc64(kXRegSize * arg_count); |
511 __ ldp(fp, lr, MemOperand(current_sp, 2 * kXRegSize, PostIndex)); | 511 info_->AddNoFrameRange(no_frame_start, masm_->pc_offset()); |
512 // Drop the arguments and receiver and return. | |
513 // TODO(all): This implementation is overkill as it supports 2**31+1 | |
514 // arguments, consider how to improve it without creating a security | |
515 // hole. | |
516 __ ldr_pcrel(ip0, (3 * kInstructionSize) >> kLoadLiteralScaleLog2); | |
517 __ add(current_sp, current_sp, ip0); | |
518 __ ret(); | |
519 int32_t arg_count = info_->scope()->num_parameters() + 1; | |
520 __ dc64(kXRegSize * arg_count); | |
521 info_->AddNoFrameRange(no_frame_start, masm_->pc_offset()); | |
522 } | |
523 } | 512 } |
524 } | 513 } |
525 | 514 |
526 | 515 |
527 void FullCodeGenerator::EffectContext::Plug(Variable* var) const { | 516 void FullCodeGenerator::EffectContext::Plug(Variable* var) const { |
528 DCHECK(var->IsStackAllocated() || var->IsContextSlot()); | 517 DCHECK(var->IsStackAllocated() || var->IsContextSlot()); |
529 } | 518 } |
530 | 519 |
531 | 520 |
532 void FullCodeGenerator::AccumulatorValueContext::Plug(Variable* var) const { | 521 void FullCodeGenerator::AccumulatorValueContext::Plug(Variable* var) const { |
(...skipping 5070 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5603 } | 5592 } |
5604 | 5593 |
5605 return INTERRUPT; | 5594 return INTERRUPT; |
5606 } | 5595 } |
5607 | 5596 |
5608 | 5597 |
5609 } // namespace internal | 5598 } // namespace internal |
5610 } // namespace v8 | 5599 } // namespace v8 |
5611 | 5600 |
5612 #endif // V8_TARGET_ARCH_ARM64 | 5601 #endif // V8_TARGET_ARCH_ARM64 |
OLD | NEW |