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 951 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
962 | 962 |
963 | 963 |
964 void MacroAssembler::LoadConstantPoolPointerRegister() { | 964 void MacroAssembler::LoadConstantPoolPointerRegister() { |
965 mov_label_addr(kConstantPoolRegister, ConstantPoolPosition()); | 965 mov_label_addr(kConstantPoolRegister, ConstantPoolPosition()); |
966 } | 966 } |
967 | 967 |
968 void MacroAssembler::StubPrologue(StackFrame::Type type, Register base, | 968 void MacroAssembler::StubPrologue(StackFrame::Type type, Register base, |
969 int prologue_offset) { | 969 int prologue_offset) { |
970 { | 970 { |
971 ConstantPoolUnavailableScope constant_pool_unavailable(this); | 971 ConstantPoolUnavailableScope constant_pool_unavailable(this); |
972 LoadSmiLiteral(r11, Smi::FromInt(type)); | 972 mov(r11, Operand(StackFrame::TypeToMarker(type))); |
973 PushCommonFrame(r11); | 973 PushCommonFrame(r11); |
974 } | 974 } |
975 if (FLAG_enable_embedded_constant_pool) { | 975 if (FLAG_enable_embedded_constant_pool) { |
976 if (!base.is(no_reg)) { | 976 if (!base.is(no_reg)) { |
977 // base contains prologue address | 977 // base contains prologue address |
978 LoadConstantPoolPointerRegister(base, -prologue_offset); | 978 LoadConstantPoolPointerRegister(base, -prologue_offset); |
979 } else { | 979 } else { |
980 LoadConstantPoolPointerRegister(); | 980 LoadConstantPoolPointerRegister(); |
981 } | 981 } |
982 set_constant_pool_available(true); | 982 set_constant_pool_available(true); |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1027 } | 1027 } |
1028 | 1028 |
1029 | 1029 |
1030 void MacroAssembler::EnterFrame(StackFrame::Type type, | 1030 void MacroAssembler::EnterFrame(StackFrame::Type type, |
1031 bool load_constant_pool_pointer_reg) { | 1031 bool load_constant_pool_pointer_reg) { |
1032 if (FLAG_enable_embedded_constant_pool && load_constant_pool_pointer_reg) { | 1032 if (FLAG_enable_embedded_constant_pool && load_constant_pool_pointer_reg) { |
1033 // Push type explicitly so we can leverage the constant pool. | 1033 // Push type explicitly so we can leverage the constant pool. |
1034 // This path cannot rely on ip containing code entry. | 1034 // This path cannot rely on ip containing code entry. |
1035 PushCommonFrame(); | 1035 PushCommonFrame(); |
1036 LoadConstantPoolPointerRegister(); | 1036 LoadConstantPoolPointerRegister(); |
1037 LoadSmiLiteral(ip, Smi::FromInt(type)); | 1037 mov(ip, Operand(StackFrame::TypeToMarker(type))); |
1038 push(ip); | 1038 push(ip); |
1039 } else { | 1039 } else { |
1040 LoadSmiLiteral(ip, Smi::FromInt(type)); | 1040 mov(ip, Operand(StackFrame::TypeToMarker(type))); |
1041 PushCommonFrame(ip); | 1041 PushCommonFrame(ip); |
1042 } | 1042 } |
1043 if (type == StackFrame::INTERNAL) { | 1043 if (type == StackFrame::INTERNAL) { |
1044 mov(r0, Operand(CodeObject())); | 1044 mov(r0, Operand(CodeObject())); |
1045 push(r0); | 1045 push(r0); |
1046 } | 1046 } |
1047 } | 1047 } |
1048 | 1048 |
1049 | 1049 |
1050 int MacroAssembler::LeaveFrame(StackFrame::Type type, int stack_adjustment) { | 1050 int MacroAssembler::LeaveFrame(StackFrame::Type type, int stack_adjustment) { |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1136 // Set up the frame structure on the stack. | 1136 // Set up the frame structure on the stack. |
1137 DCHECK_EQ(2 * kPointerSize, ExitFrameConstants::kCallerSPDisplacement); | 1137 DCHECK_EQ(2 * kPointerSize, ExitFrameConstants::kCallerSPDisplacement); |
1138 DCHECK_EQ(1 * kPointerSize, ExitFrameConstants::kCallerPCOffset); | 1138 DCHECK_EQ(1 * kPointerSize, ExitFrameConstants::kCallerPCOffset); |
1139 DCHECK_EQ(0 * kPointerSize, ExitFrameConstants::kCallerFPOffset); | 1139 DCHECK_EQ(0 * kPointerSize, ExitFrameConstants::kCallerFPOffset); |
1140 DCHECK(stack_space > 0); | 1140 DCHECK(stack_space > 0); |
1141 | 1141 |
1142 // This is an opportunity to build a frame to wrap | 1142 // This is an opportunity to build a frame to wrap |
1143 // all of the pushes that have happened inside of V8 | 1143 // all of the pushes that have happened inside of V8 |
1144 // since we were called from C code | 1144 // since we were called from C code |
1145 | 1145 |
1146 LoadSmiLiteral(ip, Smi::FromInt(frame_type)); | 1146 mov(ip, Operand(StackFrame::TypeToMarker(frame_type))); |
1147 PushCommonFrame(ip); | 1147 PushCommonFrame(ip); |
1148 // Reserve room for saved entry sp and code object. | 1148 // Reserve room for saved entry sp and code object. |
1149 subi(sp, fp, Operand(ExitFrameConstants::kFixedFrameSizeFromFp)); | 1149 subi(sp, fp, Operand(ExitFrameConstants::kFixedFrameSizeFromFp)); |
1150 | 1150 |
1151 if (emit_debug_code()) { | 1151 if (emit_debug_code()) { |
1152 li(r8, Operand::Zero()); | 1152 li(r8, Operand::Zero()); |
1153 StoreP(r8, MemOperand(fp, ExitFrameConstants::kSPOffset)); | 1153 StoreP(r8, MemOperand(fp, ExitFrameConstants::kSPOffset)); |
1154 } | 1154 } |
1155 if (FLAG_enable_embedded_constant_pool) { | 1155 if (FLAG_enable_embedded_constant_pool) { |
1156 StoreP(kConstantPoolRegister, | 1156 StoreP(kConstantPoolRegister, |
(...skipping 3197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4354 } | 4354 } |
4355 if (mag.shift > 0) srawi(result, result, mag.shift); | 4355 if (mag.shift > 0) srawi(result, result, mag.shift); |
4356 ExtractBit(r0, dividend, 31); | 4356 ExtractBit(r0, dividend, 31); |
4357 add(result, result, r0); | 4357 add(result, result, r0); |
4358 } | 4358 } |
4359 | 4359 |
4360 } // namespace internal | 4360 } // namespace internal |
4361 } // namespace v8 | 4361 } // namespace v8 |
4362 | 4362 |
4363 #endif // V8_TARGET_ARCH_PPC | 4363 #endif // V8_TARGET_ARCH_PPC |
OLD | NEW |