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/crankshaft/arm64/lithium-codegen-arm64.h" | 5 #include "src/crankshaft/arm64/lithium-codegen-arm64.h" |
6 | 6 |
7 #include "src/arm64/frames-arm64.h" | 7 #include "src/arm64/frames-arm64.h" |
8 #include "src/base/bits.h" | 8 #include "src/base/bits.h" |
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 556 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
567 DCHECK(is_generating()); | 567 DCHECK(is_generating()); |
568 | 568 |
569 if (info()->IsOptimizing()) { | 569 if (info()->IsOptimizing()) { |
570 ProfileEntryHookStub::MaybeCallEntryHook(masm_); | 570 ProfileEntryHookStub::MaybeCallEntryHook(masm_); |
571 } | 571 } |
572 | 572 |
573 DCHECK(__ StackPointer().Is(jssp)); | 573 DCHECK(__ StackPointer().Is(jssp)); |
574 info()->set_prologue_offset(masm_->pc_offset()); | 574 info()->set_prologue_offset(masm_->pc_offset()); |
575 if (NeedsEagerFrame()) { | 575 if (NeedsEagerFrame()) { |
576 if (info()->IsStub()) { | 576 if (info()->IsStub()) { |
577 __ StubPrologue(); | 577 __ StubPrologue( |
| 578 StackFrame::STUB, |
| 579 GetStackSlotCount() + TypedFrameConstants::kFixedSlotCount); |
578 } else { | 580 } else { |
579 __ Prologue(info()->GeneratePreagedPrologue()); | 581 __ Prologue(info()->GeneratePreagedPrologue()); |
| 582 // Reserve space for the stack slots needed by the code. |
| 583 int slots = GetStackSlotCount(); |
| 584 if (slots > 0) { |
| 585 __ Claim(slots, kPointerSize); |
| 586 } |
580 } | 587 } |
581 frame_is_built_ = true; | 588 frame_is_built_ = true; |
582 } | 589 } |
583 | 590 |
584 // Reserve space for the stack slots needed by the code. | |
585 int slots = GetStackSlotCount(); | |
586 if (slots > 0) { | |
587 __ Claim(slots, kPointerSize); | |
588 } | |
589 | |
590 if (info()->saves_caller_doubles()) { | 591 if (info()->saves_caller_doubles()) { |
591 SaveCallerDoubles(); | 592 SaveCallerDoubles(); |
592 } | 593 } |
593 return !is_aborted(); | 594 return !is_aborted(); |
594 } | 595 } |
595 | 596 |
596 | 597 |
597 void LCodeGen::DoPrologue(LPrologue* instr) { | 598 void LCodeGen::DoPrologue(LPrologue* instr) { |
598 Comment(";;; Prologue begin"); | 599 Comment(";;; Prologue begin"); |
599 | 600 |
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
701 code->instr()->hydrogen_value()->id(), | 702 code->instr()->hydrogen_value()->id(), |
702 code->instr()->Mnemonic()); | 703 code->instr()->Mnemonic()); |
703 | 704 |
704 __ Bind(code->entry()); | 705 __ Bind(code->entry()); |
705 | 706 |
706 if (NeedsDeferredFrame()) { | 707 if (NeedsDeferredFrame()) { |
707 Comment(";;; Build frame"); | 708 Comment(";;; Build frame"); |
708 DCHECK(!frame_is_built_); | 709 DCHECK(!frame_is_built_); |
709 DCHECK(info()->IsStub()); | 710 DCHECK(info()->IsStub()); |
710 frame_is_built_ = true; | 711 frame_is_built_ = true; |
711 __ Push(lr, fp, cp); | 712 __ Push(lr, fp); |
712 __ Mov(fp, Smi::FromInt(StackFrame::STUB)); | 713 __ Mov(fp, Smi::FromInt(StackFrame::STUB)); |
713 __ Push(fp); | 714 __ Push(fp); |
714 __ Add(fp, __ StackPointer(), | 715 __ Add(fp, __ StackPointer(), |
715 StandardFrameConstants::kFixedFrameSizeFromFp); | 716 TypedFrameConstants::kFixedFrameSizeFromFp); |
716 Comment(";;; Deferred code"); | 717 Comment(";;; Deferred code"); |
717 } | 718 } |
718 | 719 |
719 code->Generate(); | 720 code->Generate(); |
720 | 721 |
721 if (NeedsDeferredFrame()) { | 722 if (NeedsDeferredFrame()) { |
722 Comment(";;; Destroy frame"); | 723 Comment(";;; Destroy frame"); |
723 DCHECK(frame_is_built_); | 724 DCHECK(frame_is_built_); |
724 __ Pop(xzr, cp, fp, lr); | 725 __ Pop(xzr, fp, lr); |
725 frame_is_built_ = false; | 726 frame_is_built_ = false; |
726 } | 727 } |
727 | 728 |
728 __ B(code->exit()); | 729 __ B(code->exit()); |
729 } | 730 } |
730 } | 731 } |
731 | 732 |
732 // Force constant pool emission at the end of the deferred code to make | 733 // Force constant pool emission at the end of the deferred code to make |
733 // sure that no constant pools are emitted after deferred code because | 734 // sure that no constant pools are emitted after deferred code because |
734 // deferred code generation is the last step which generates code. The two | 735 // deferred code generation is the last step which generates code. The two |
(...skipping 817 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1552 // In the inlined case we need to subtract the size of 2 words to jssp to | 1553 // In the inlined case we need to subtract the size of 2 words to jssp to |
1553 // get a pointer which will work well with LAccessArgumentsAt. | 1554 // get a pointer which will work well with LAccessArgumentsAt. |
1554 DCHECK(masm()->StackPointer().Is(jssp)); | 1555 DCHECK(masm()->StackPointer().Is(jssp)); |
1555 __ Sub(result, jssp, 2 * kPointerSize); | 1556 __ Sub(result, jssp, 2 * kPointerSize); |
1556 } else { | 1557 } else { |
1557 DCHECK(instr->temp() != NULL); | 1558 DCHECK(instr->temp() != NULL); |
1558 Register previous_fp = ToRegister(instr->temp()); | 1559 Register previous_fp = ToRegister(instr->temp()); |
1559 | 1560 |
1560 __ Ldr(previous_fp, | 1561 __ Ldr(previous_fp, |
1561 MemOperand(fp, StandardFrameConstants::kCallerFPOffset)); | 1562 MemOperand(fp, StandardFrameConstants::kCallerFPOffset)); |
1562 __ Ldr(result, | 1563 __ Ldr(result, MemOperand(previous_fp, |
1563 MemOperand(previous_fp, StandardFrameConstants::kContextOffset)); | 1564 CommonFrameConstants::kContextOrFrameTypeOffset)); |
1564 __ Cmp(result, Smi::FromInt(StackFrame::ARGUMENTS_ADAPTOR)); | 1565 __ Cmp(result, Smi::FromInt(StackFrame::ARGUMENTS_ADAPTOR)); |
1565 __ Csel(result, fp, previous_fp, ne); | 1566 __ Csel(result, fp, previous_fp, ne); |
1566 } | 1567 } |
1567 } | 1568 } |
1568 | 1569 |
1569 | 1570 |
1570 void LCodeGen::DoArgumentsLength(LArgumentsLength* instr) { | 1571 void LCodeGen::DoArgumentsLength(LArgumentsLength* instr) { |
1571 Register elements = ToRegister(instr->elements()); | 1572 Register elements = ToRegister(instr->elements()); |
1572 Register result = ToRegister32(instr->result()); | 1573 Register result = ToRegister32(instr->result()); |
1573 Label done; | 1574 Label done; |
(...skipping 4079 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5653 | 5654 |
5654 | 5655 |
5655 void LCodeGen::DoStoreFrameContext(LStoreFrameContext* instr) { | 5656 void LCodeGen::DoStoreFrameContext(LStoreFrameContext* instr) { |
5656 Register context = ToRegister(instr->context()); | 5657 Register context = ToRegister(instr->context()); |
5657 __ Str(context, MemOperand(fp, StandardFrameConstants::kContextOffset)); | 5658 __ Str(context, MemOperand(fp, StandardFrameConstants::kContextOffset)); |
5658 } | 5659 } |
5659 | 5660 |
5660 | 5661 |
5661 } // namespace internal | 5662 } // namespace internal |
5662 } // namespace v8 | 5663 } // namespace v8 |
OLD | NEW |