| 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 <assert.h> // For assert | 5 #include <assert.h> // For assert |
| 6 #include <limits.h> // For LONG_MIN, LONG_MAX. | 6 #include <limits.h> // For LONG_MIN, LONG_MAX. |
| 7 | 7 |
| 8 #if V8_TARGET_ARCH_PPC | 8 #if V8_TARGET_ARCH_PPC |
| 9 | 9 |
| 10 #include "src/base/bits.h" | 10 #include "src/base/bits.h" |
| (...skipping 735 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 746 add_label_offset(kConstantPoolRegister, base, ConstantPoolPosition(), | 746 add_label_offset(kConstantPoolRegister, base, ConstantPoolPosition(), |
| 747 code_start_delta); | 747 code_start_delta); |
| 748 } | 748 } |
| 749 | 749 |
| 750 | 750 |
| 751 void MacroAssembler::LoadConstantPoolPointerRegister() { | 751 void MacroAssembler::LoadConstantPoolPointerRegister() { |
| 752 mov_label_addr(kConstantPoolRegister, ConstantPoolPosition()); | 752 mov_label_addr(kConstantPoolRegister, ConstantPoolPosition()); |
| 753 } | 753 } |
| 754 | 754 |
| 755 | 755 |
| 756 void MacroAssembler::StubPrologue(int prologue_offset) { | 756 void MacroAssembler::StubPrologue(Register base, int prologue_offset) { |
| 757 LoadSmiLiteral(r11, Smi::FromInt(StackFrame::STUB)); | 757 LoadSmiLiteral(r11, Smi::FromInt(StackFrame::STUB)); |
| 758 PushFixedFrame(r11); | 758 PushFixedFrame(r11); |
| 759 // Adjust FP to point to saved FP. | 759 // Adjust FP to point to saved FP. |
| 760 addi(fp, sp, Operand(StandardFrameConstants::kFixedFrameSizeFromFp)); | 760 addi(fp, sp, Operand(StandardFrameConstants::kFixedFrameSizeFromFp)); |
| 761 if (FLAG_enable_embedded_constant_pool) { | 761 if (FLAG_enable_embedded_constant_pool) { |
| 762 // ip contains prologue address | 762 if (!base.is(no_reg)) { |
| 763 LoadConstantPoolPointerRegister(ip, -prologue_offset); | 763 // base contains prologue address |
| 764 LoadConstantPoolPointerRegister(base, -prologue_offset); |
| 765 } else { |
| 766 LoadConstantPoolPointerRegister(); |
| 767 } |
| 764 set_constant_pool_available(true); | 768 set_constant_pool_available(true); |
| 765 } | 769 } |
| 766 } | 770 } |
| 767 | 771 |
| 768 | 772 |
| 769 void MacroAssembler::Prologue(bool code_pre_aging, int prologue_offset) { | 773 void MacroAssembler::Prologue(bool code_pre_aging, Register base, |
| 774 int prologue_offset) { |
| 775 DCHECK(base.is(ip)); |
| 770 { | 776 { |
| 771 PredictableCodeSizeScope predictible_code_size_scope( | 777 PredictableCodeSizeScope predictible_code_size_scope( |
| 772 this, kNoCodeAgeSequenceLength); | 778 this, kNoCodeAgeSequenceLength); |
| 773 Assembler::BlockTrampolinePoolScope block_trampoline_pool(this); | 779 Assembler::BlockTrampolinePoolScope block_trampoline_pool(this); |
| 774 // The following instructions must remain together and unmodified | 780 // The following instructions must remain together and unmodified |
| 775 // for code aging to work properly. | 781 // for code aging to work properly. |
| 776 if (code_pre_aging) { | 782 if (code_pre_aging) { |
| 777 // Pre-age the code. | 783 // Pre-age the code. |
| 778 // This matches the code found in PatchPlatformCodeAge() | 784 // This matches the code found in PatchPlatformCodeAge() |
| 779 Code* stub = Code::GetPreAgedCodeAgeStub(isolate()); | 785 Code* stub = Code::GetPreAgedCodeAgeStub(isolate()); |
| 780 intptr_t target = reinterpret_cast<intptr_t>(stub->instruction_start()); | 786 intptr_t target = reinterpret_cast<intptr_t>(stub->instruction_start()); |
| 781 // Don't use Call -- we need to preserve ip and lr | 787 // Don't use Call -- we need to preserve ip and lr |
| 782 nop(); // marker to detect sequence (see IsOld) | 788 nop(); // marker to detect sequence (see IsOld) |
| 783 mov(r3, Operand(target)); | 789 mov(r3, Operand(target)); |
| 784 Jump(r3); | 790 Jump(r3); |
| 785 for (int i = 0; i < kCodeAgingSequenceNops; i++) { | 791 for (int i = 0; i < kCodeAgingSequenceNops; i++) { |
| 786 nop(); | 792 nop(); |
| 787 } | 793 } |
| 788 } else { | 794 } else { |
| 789 // This matches the code found in GetNoCodeAgeSequence() | 795 // This matches the code found in GetNoCodeAgeSequence() |
| 790 PushFixedFrame(r4); | 796 PushFixedFrame(r4); |
| 791 // Adjust fp to point to saved fp. | 797 // Adjust fp to point to saved fp. |
| 792 addi(fp, sp, Operand(StandardFrameConstants::kFixedFrameSizeFromFp)); | 798 addi(fp, sp, Operand(StandardFrameConstants::kFixedFrameSizeFromFp)); |
| 793 for (int i = 0; i < kNoCodeAgeSequenceNops; i++) { | 799 for (int i = 0; i < kNoCodeAgeSequenceNops; i++) { |
| 794 nop(); | 800 nop(); |
| 795 } | 801 } |
| 796 } | 802 } |
| 797 } | 803 } |
| 798 if (FLAG_enable_embedded_constant_pool) { | 804 if (FLAG_enable_embedded_constant_pool) { |
| 799 // ip contains prologue address | 805 // base contains prologue address |
| 800 LoadConstantPoolPointerRegister(ip, -prologue_offset); | 806 LoadConstantPoolPointerRegister(base, -prologue_offset); |
| 801 set_constant_pool_available(true); | 807 set_constant_pool_available(true); |
| 802 } | 808 } |
| 803 } | 809 } |
| 804 | 810 |
| 805 | 811 |
| 806 void MacroAssembler::EmitLoadTypeFeedbackVector(Register vector) { | 812 void MacroAssembler::EmitLoadTypeFeedbackVector(Register vector) { |
| 807 LoadP(vector, MemOperand(fp, JavaScriptFrameConstants::kFunctionOffset)); | 813 LoadP(vector, MemOperand(fp, JavaScriptFrameConstants::kFunctionOffset)); |
| 808 LoadP(vector, FieldMemOperand(vector, JSFunction::kSharedFunctionInfoOffset)); | 814 LoadP(vector, FieldMemOperand(vector, JSFunction::kSharedFunctionInfoOffset)); |
| 809 LoadP(vector, | 815 LoadP(vector, |
| 810 FieldMemOperand(vector, SharedFunctionInfo::kFeedbackVectorOffset)); | 816 FieldMemOperand(vector, SharedFunctionInfo::kFeedbackVectorOffset)); |
| (...skipping 3487 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4298 } | 4304 } |
| 4299 if (mag.shift > 0) srawi(result, result, mag.shift); | 4305 if (mag.shift > 0) srawi(result, result, mag.shift); |
| 4300 ExtractBit(r0, dividend, 31); | 4306 ExtractBit(r0, dividend, 31); |
| 4301 add(result, result, r0); | 4307 add(result, result, r0); |
| 4302 } | 4308 } |
| 4303 | 4309 |
| 4304 } // namespace internal | 4310 } // namespace internal |
| 4305 } // namespace v8 | 4311 } // namespace v8 |
| 4306 | 4312 |
| 4307 #endif // V8_TARGET_ARCH_PPC | 4313 #endif // V8_TARGET_ARCH_PPC |
| OLD | NEW |