OLD | NEW |
1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 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/compiler/code-generator.h" | 5 #include "src/compiler/code-generator.h" |
6 | 6 |
7 #include "src/ast/scopes.h" | 7 #include "src/ast/scopes.h" |
8 #include "src/compiler/code-generator-impl.h" | 8 #include "src/compiler/code-generator-impl.h" |
9 #include "src/compiler/gap-resolver.h" | 9 #include "src/compiler/gap-resolver.h" |
10 #include "src/compiler/node-matchers.h" | 10 #include "src/compiler/node-matchers.h" |
(...skipping 592 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
603 __ bind(&done); \ | 603 __ bind(&done); \ |
604 DCHECK_EQ(LeaveRC, i.OutputRCBit()); \ | 604 DCHECK_EQ(LeaveRC, i.OutputRCBit()); \ |
605 } while (0) | 605 } while (0) |
606 | 606 |
607 | 607 |
608 void CodeGenerator::AssembleDeconstructActivationRecord(int stack_param_delta) { | 608 void CodeGenerator::AssembleDeconstructActivationRecord(int stack_param_delta) { |
609 int sp_slot_delta = TailCallFrameStackSlotDelta(stack_param_delta); | 609 int sp_slot_delta = TailCallFrameStackSlotDelta(stack_param_delta); |
610 if (sp_slot_delta > 0) { | 610 if (sp_slot_delta > 0) { |
611 __ Add(sp, sp, sp_slot_delta * kPointerSize, r0); | 611 __ Add(sp, sp, sp_slot_delta * kPointerSize, r0); |
612 } | 612 } |
613 if (frame()->needs_frame()) { | |
614 if (FLAG_enable_embedded_constant_pool) { | |
615 __ Pop(r0, fp, kConstantPoolRegister); | |
616 } else { | |
617 __ Pop(r0, fp); | |
618 } | |
619 __ mtlr(r0); | |
620 } | |
621 frame_access_state()->SetFrameAccessToDefault(); | 613 frame_access_state()->SetFrameAccessToDefault(); |
622 } | 614 } |
623 | 615 |
624 | 616 |
625 void CodeGenerator::AssemblePrepareTailCall(int stack_param_delta) { | 617 void CodeGenerator::AssemblePrepareTailCall(int stack_param_delta) { |
626 int sp_slot_delta = TailCallFrameStackSlotDelta(stack_param_delta); | 618 int sp_slot_delta = TailCallFrameStackSlotDelta(stack_param_delta); |
627 if (sp_slot_delta < 0) { | 619 if (sp_slot_delta < 0) { |
628 __ Add(sp, sp, sp_slot_delta * kPointerSize, r0); | 620 __ Add(sp, sp, sp_slot_delta * kPointerSize, r0); |
629 frame_access_state()->IncreaseSPDelta(-sp_slot_delta); | 621 frame_access_state()->IncreaseSPDelta(-sp_slot_delta); |
630 } | 622 } |
| 623 if (frame()->needs_frame()) { |
| 624 if (FLAG_enable_embedded_constant_pool) { |
| 625 __ LoadP(kConstantPoolRegister, |
| 626 MemOperand(fp, StandardFrameConstants::kConstantPoolOffset)); |
| 627 } |
| 628 __ LoadP(r0, MemOperand(fp, StandardFrameConstants::kCallerPCOffset)); |
| 629 __ LoadP(fp, MemOperand(fp, StandardFrameConstants::kCallerFPOffset)); |
| 630 __ mtlr(r0); |
| 631 } |
631 frame_access_state()->SetFrameAccessToSP(); | 632 frame_access_state()->SetFrameAccessToSP(); |
632 } | 633 } |
633 | 634 |
634 | 635 |
635 // Assembles an instruction after register allocation, producing machine code. | 636 // Assembles an instruction after register allocation, producing machine code. |
636 void CodeGenerator::AssembleArchInstruction(Instruction* instr) { | 637 void CodeGenerator::AssembleArchInstruction(Instruction* instr) { |
637 PPCOperandConverter i(this, instr); | 638 PPCOperandConverter i(this, instr); |
638 ArchOpcode opcode = ArchOpcodeField::decode(instr->opcode()); | 639 ArchOpcode opcode = ArchOpcodeField::decode(instr->opcode()); |
639 | 640 |
640 switch (opcode) { | 641 switch (opcode) { |
(...skipping 1128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1769 padding_size -= v8::internal::Assembler::kInstrSize; | 1770 padding_size -= v8::internal::Assembler::kInstrSize; |
1770 } | 1771 } |
1771 } | 1772 } |
1772 } | 1773 } |
1773 | 1774 |
1774 #undef __ | 1775 #undef __ |
1775 | 1776 |
1776 } // namespace compiler | 1777 } // namespace compiler |
1777 } // namespace internal | 1778 } // namespace internal |
1778 } // namespace v8 | 1779 } // namespace v8 |
OLD | NEW |