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 828 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1563 // In the inlined case we need to subtract the size of 2 words to jssp to | 1564 // In the inlined case we need to subtract the size of 2 words to jssp to |
1564 // get a pointer which will work well with LAccessArgumentsAt. | 1565 // get a pointer which will work well with LAccessArgumentsAt. |
1565 DCHECK(masm()->StackPointer().Is(jssp)); | 1566 DCHECK(masm()->StackPointer().Is(jssp)); |
1566 __ Sub(result, jssp, 2 * kPointerSize); | 1567 __ Sub(result, jssp, 2 * kPointerSize); |
1567 } else { | 1568 } else { |
1568 DCHECK(instr->temp() != NULL); | 1569 DCHECK(instr->temp() != NULL); |
1569 Register previous_fp = ToRegister(instr->temp()); | 1570 Register previous_fp = ToRegister(instr->temp()); |
1570 | 1571 |
1571 __ Ldr(previous_fp, | 1572 __ Ldr(previous_fp, |
1572 MemOperand(fp, StandardFrameConstants::kCallerFPOffset)); | 1573 MemOperand(fp, StandardFrameConstants::kCallerFPOffset)); |
1573 __ Ldr(result, | 1574 __ Ldr(result, MemOperand(previous_fp, |
1574 MemOperand(previous_fp, StandardFrameConstants::kContextOffset)); | 1575 CommonFrameConstants::kContextOrFrameTypeOffset)); |
1575 __ Cmp(result, Smi::FromInt(StackFrame::ARGUMENTS_ADAPTOR)); | 1576 __ Cmp(result, Smi::FromInt(StackFrame::ARGUMENTS_ADAPTOR)); |
1576 __ Csel(result, fp, previous_fp, ne); | 1577 __ Csel(result, fp, previous_fp, ne); |
1577 } | 1578 } |
1578 } | 1579 } |
1579 | 1580 |
1580 | 1581 |
1581 void LCodeGen::DoArgumentsLength(LArgumentsLength* instr) { | 1582 void LCodeGen::DoArgumentsLength(LArgumentsLength* instr) { |
1582 Register elements = ToRegister(instr->elements()); | 1583 Register elements = ToRegister(instr->elements()); |
1583 Register result = ToRegister32(instr->result()); | 1584 Register result = ToRegister32(instr->result()); |
1584 Label done; | 1585 Label done; |
(...skipping 4150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5735 | 5736 |
5736 | 5737 |
5737 void LCodeGen::DoStoreFrameContext(LStoreFrameContext* instr) { | 5738 void LCodeGen::DoStoreFrameContext(LStoreFrameContext* instr) { |
5738 Register context = ToRegister(instr->context()); | 5739 Register context = ToRegister(instr->context()); |
5739 __ Str(context, MemOperand(fp, StandardFrameConstants::kContextOffset)); | 5740 __ Str(context, MemOperand(fp, StandardFrameConstants::kContextOffset)); |
5740 } | 5741 } |
5741 | 5742 |
5742 | 5743 |
5743 } // namespace internal | 5744 } // namespace internal |
5744 } // namespace v8 | 5745 } // namespace v8 |
OLD | NEW |