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 #include "src/compilation-info.h" | 6 #include "src/compilation-info.h" |
7 #include "src/compiler/code-generator-impl.h" | 7 #include "src/compiler/code-generator-impl.h" |
8 #include "src/compiler/gap-resolver.h" | 8 #include "src/compiler/gap-resolver.h" |
9 #include "src/compiler/node-matchers.h" | 9 #include "src/compiler/node-matchers.h" |
10 #include "src/compiler/osr.h" | 10 #include "src/compiler/osr.h" |
(...skipping 759 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
770 __ sw(value, MemOperand(at)); | 770 __ sw(value, MemOperand(at)); |
771 __ CheckPageFlag(object, scratch0, | 771 __ CheckPageFlag(object, scratch0, |
772 MemoryChunk::kPointersFromHereAreInterestingMask, ne, | 772 MemoryChunk::kPointersFromHereAreInterestingMask, ne, |
773 ool->entry()); | 773 ool->entry()); |
774 __ bind(ool->exit()); | 774 __ bind(ool->exit()); |
775 break; | 775 break; |
776 } | 776 } |
777 case kArchStackSlot: { | 777 case kArchStackSlot: { |
778 FrameOffset offset = | 778 FrameOffset offset = |
779 frame_access_state()->GetFrameOffset(i.InputInt32(0)); | 779 frame_access_state()->GetFrameOffset(i.InputInt32(0)); |
780 __ Addu(i.OutputRegister(), offset.from_stack_pointer() ? sp : fp, | 780 Register base_reg = offset.from_stack_pointer() ? sp : fp; |
781 Operand(offset.offset())); | 781 __ Addu(i.OutputRegister(), base_reg, Operand(offset.offset())); |
| 782 int alignment = i.InputInt32(1); |
| 783 DCHECK(alignment == 0 || alignment == 4 || alignment == 8 || |
| 784 alignment == 16); |
| 785 if (FLAG_debug_code && alignment > 0) { |
| 786 // Verify that the output_register is properly aligned |
| 787 __ And(kScratchReg, i.OutputRegister(), Operand(kPointerSize - 1)); |
| 788 __ Assert(eq, kAllocationIsNotDoubleAligned, kScratchReg, |
| 789 Operand(zero_reg)); |
| 790 } |
| 791 |
| 792 if (alignment == 2 * kPointerSize) { |
| 793 Label done; |
| 794 __ Addu(kScratchReg, base_reg, Operand(offset.offset())); |
| 795 __ And(kScratchReg, kScratchReg, Operand(alignment - 1)); |
| 796 __ BranchShort(&done, eq, kScratchReg, Operand(zero_reg)); |
| 797 __ Addu(i.OutputRegister(), i.OutputRegister(), kPointerSize); |
| 798 __ bind(&done); |
| 799 } else if (alignment > 2 * kPointerSize) { |
| 800 Label done; |
| 801 __ Addu(kScratchReg, base_reg, Operand(offset.offset())); |
| 802 __ And(kScratchReg, kScratchReg, Operand(alignment - 1)); |
| 803 __ BranchShort(&done, eq, kScratchReg, Operand(zero_reg)); |
| 804 __ li(kScratchReg2, alignment); |
| 805 __ Subu(kScratchReg2, kScratchReg2, Operand(kScratchReg)); |
| 806 __ Addu(i.OutputRegister(), i.OutputRegister(), kScratchReg2); |
| 807 __ bind(&done); |
| 808 } |
782 break; | 809 break; |
783 } | 810 } |
784 case kIeee754Float64Acos: | 811 case kIeee754Float64Acos: |
785 ASSEMBLE_IEEE754_UNOP(acos); | 812 ASSEMBLE_IEEE754_UNOP(acos); |
786 break; | 813 break; |
787 case kIeee754Float64Acosh: | 814 case kIeee754Float64Acosh: |
788 ASSEMBLE_IEEE754_UNOP(acosh); | 815 ASSEMBLE_IEEE754_UNOP(acosh); |
789 break; | 816 break; |
790 case kIeee754Float64Asin: | 817 case kIeee754Float64Asin: |
791 ASSEMBLE_IEEE754_UNOP(asin); | 818 ASSEMBLE_IEEE754_UNOP(asin); |
(...skipping 1871 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2663 padding_size -= v8::internal::Assembler::kInstrSize; | 2690 padding_size -= v8::internal::Assembler::kInstrSize; |
2664 } | 2691 } |
2665 } | 2692 } |
2666 } | 2693 } |
2667 | 2694 |
2668 #undef __ | 2695 #undef __ |
2669 | 2696 |
2670 } // namespace compiler | 2697 } // namespace compiler |
2671 } // namespace internal | 2698 } // namespace internal |
2672 } // namespace v8 | 2699 } // namespace v8 |
OLD | NEW |