diff options
Diffstat (limited to 'deps/v8/src/codegen/ppc/macro-assembler-ppc.cc')
-rw-r--r-- | deps/v8/src/codegen/ppc/macro-assembler-ppc.cc | 275 |
1 files changed, 199 insertions, 76 deletions
diff --git a/deps/v8/src/codegen/ppc/macro-assembler-ppc.cc b/deps/v8/src/codegen/ppc/macro-assembler-ppc.cc index ca6d472c93f..3cf819f1028 100644 --- a/deps/v8/src/codegen/ppc/macro-assembler-ppc.cc +++ b/deps/v8/src/codegen/ppc/macro-assembler-ppc.cc @@ -16,7 +16,7 @@ #include "src/codegen/register-configuration.h" #include "src/debug/debug.h" #include "src/execution/frames-inl.h" -#include "src/heap/heap-inl.h" // For MemoryChunk. +#include "src/heap/memory-chunk.h" #include "src/init/bootstrapper.h" #include "src/logging/counters.h" #include "src/runtime/runtime.h" @@ -50,7 +50,7 @@ int TurboAssembler::RequiredStackSizeForCallerSaved(SaveFPRegsMode fp_mode, } RegList list = kJSCallerSaved & ~exclusions; - bytes += NumRegs(list) * kPointerSize; + bytes += NumRegs(list) * kSystemPointerSize; if (fp_mode == kSaveFPRegs) { bytes += kNumCallerSavedDoubles * kDoubleSize; @@ -75,7 +75,7 @@ int TurboAssembler::PushCallerSaved(SaveFPRegsMode fp_mode, Register exclusion1, RegList list = kJSCallerSaved & ~exclusions; MultiPush(list); - bytes += NumRegs(list) * kPointerSize; + bytes += NumRegs(list) * kSystemPointerSize; if (fp_mode == kSaveFPRegs) { MultiPushDoubles(kCallerSavedDoubles); @@ -106,7 +106,7 @@ int TurboAssembler::PopCallerSaved(SaveFPRegsMode fp_mode, Register exclusion1, RegList list = kJSCallerSaved & ~exclusions; MultiPop(list); - bytes += NumRegs(list) * kPointerSize; + bytes += NumRegs(list) * kSystemPointerSize; return bytes; } @@ -120,13 +120,13 @@ void TurboAssembler::LoadFromConstantsTable(Register destination, int constant_index) { DCHECK(RootsTable::IsImmortalImmovable(RootIndex::kBuiltinsConstantsTable)); - const uint32_t offset = - FixedArray::kHeaderSize + constant_index * kPointerSize - kHeapObjectTag; - - CHECK(is_uint19(offset)); DCHECK_NE(destination, r0); LoadRoot(destination, RootIndex::kBuiltinsConstantsTable); - LoadP(destination, MemOperand(destination, offset), r0); + LoadTaggedPointerField( + destination, + FieldMemOperand(destination, + FixedArray::OffsetOfElementAt(constant_index)), + r0); } void TurboAssembler::LoadRootRelative(Register destination, int32_t offset) { @@ -202,7 +202,8 @@ void TurboAssembler::Jump(Handle<Code> code, RelocInfo::Mode rmode, bind(&skip); return; } - Jump(static_cast<intptr_t>(code.address()), rmode, cond, cr); + int32_t target_index = AddCodeTarget(code); + Jump(static_cast<intptr_t>(target_index), rmode, cond, cr); } void TurboAssembler::Jump(const ExternalReference& reference) { @@ -212,7 +213,8 @@ void TurboAssembler::Jump(const ExternalReference& reference) { if (ABI_USES_FUNCTION_DESCRIPTORS) { // AIX uses a function descriptor. When calling C code be // aware of this descriptor and pick up values from it. - LoadP(ToRegister(ABI_TOC_REGISTER), MemOperand(scratch, kPointerSize)); + LoadP(ToRegister(ABI_TOC_REGISTER), + MemOperand(scratch, kSystemPointerSize)); LoadP(scratch, MemOperand(scratch, 0)); } Jump(scratch); @@ -291,17 +293,18 @@ void TurboAssembler::Call(Handle<Code> code, RelocInfo::Mode rmode, return; } DCHECK(code->IsExecutable()); - Call(code.address(), rmode, cond); + int32_t target_index = AddCodeTarget(code); + Call(static_cast<Address>(target_index), rmode, cond); } void TurboAssembler::Drop(int count) { if (count > 0) { - Add(sp, sp, count * kPointerSize, r0); + Add(sp, sp, count * kSystemPointerSize, r0); } } void TurboAssembler::Drop(Register count, Register scratch) { - ShiftLeftImm(scratch, count, Operand(kPointerSizeLog2)); + ShiftLeftImm(scratch, count, Operand(kSystemPointerSizeLog2)); add(sp, sp, scratch); } @@ -317,15 +320,22 @@ void TurboAssembler::Push(Smi smi) { push(r0); } -void TurboAssembler::Move(Register dst, Handle<HeapObject> value) { +void TurboAssembler::Move(Register dst, Handle<HeapObject> value, + RelocInfo::Mode rmode) { // TODO(jgruber,v8:8887): Also consider a root-relative load when generating // non-isolate-independent code. In many cases it might be cheaper than // embedding the relocatable value. if (root_array_available_ && options().isolate_independent_code) { IndirectLoadConstant(dst, value); return; + } else if (RelocInfo::IsCompressedEmbeddedObject(rmode)) { + EmbeddedObjectIndex index = AddEmbeddedObject(value); + DCHECK(is_uint32(index)); + mov(dst, Operand(static_cast<int>(index), rmode)); + } else { + DCHECK(RelocInfo::IsFullEmbeddedObject(rmode)); + mov(dst, Operand(value.address(), rmode)); } - mov(dst, Operand(value)); } void TurboAssembler::Move(Register dst, ExternalReference reference) { @@ -354,12 +364,12 @@ void TurboAssembler::Move(DoubleRegister dst, DoubleRegister src) { void TurboAssembler::MultiPush(RegList regs, Register location) { int16_t num_to_push = base::bits::CountPopulation(regs); - int16_t stack_offset = num_to_push * kPointerSize; + int16_t stack_offset = num_to_push * kSystemPointerSize; subi(location, location, Operand(stack_offset)); for (int16_t i = Register::kNumRegisters - 1; i >= 0; i--) { if ((regs & (1 << i)) != 0) { - stack_offset -= kPointerSize; + stack_offset -= kSystemPointerSize; StoreP(ToRegister(i), MemOperand(location, stack_offset)); } } @@ -371,7 +381,7 @@ void TurboAssembler::MultiPop(RegList regs, Register location) { for (int16_t i = 0; i < Register::kNumRegisters; i++) { if ((regs & (1 << i)) != 0) { LoadP(ToRegister(i), MemOperand(location, stack_offset)); - stack_offset += kPointerSize; + stack_offset += kSystemPointerSize; } } addi(location, location, Operand(stack_offset)); @@ -411,6 +421,111 @@ void TurboAssembler::LoadRoot(Register destination, RootIndex index, MemOperand(kRootRegister, RootRegisterOffsetForRootIndex(index)), r0); } +void TurboAssembler::LoadTaggedPointerField(const Register& destination, + const MemOperand& field_operand, + const Register& scratch) { + if (COMPRESS_POINTERS_BOOL) { + DecompressTaggedPointer(destination, field_operand); + } else { + LoadP(destination, field_operand, scratch); + } +} + +void TurboAssembler::LoadAnyTaggedField(const Register& destination, + const MemOperand& field_operand, + const Register& scratch) { + if (COMPRESS_POINTERS_BOOL) { + DecompressAnyTagged(destination, field_operand); + } else { + LoadP(destination, field_operand, scratch); + } +} + +void TurboAssembler::SmiUntag(Register dst, const MemOperand& src, RCBit rc) { + if (SmiValuesAre31Bits()) { + lwz(dst, src); + } else { + LoadP(dst, src); + } + + SmiUntag(dst, rc); +} + +void TurboAssembler::SmiUntagField(Register dst, const MemOperand& src, + RCBit rc) { + SmiUntag(dst, src, rc); +} + +void TurboAssembler::StoreTaggedFieldX(const Register& value, + const MemOperand& dst_field_operand, + const Register& scratch) { + if (COMPRESS_POINTERS_BOOL) { + RecordComment("[ StoreTagged"); + stwx(value, dst_field_operand); + RecordComment("]"); + } else { + StorePX(value, dst_field_operand); + } +} + +void TurboAssembler::StoreTaggedField(const Register& value, + const MemOperand& dst_field_operand, + const Register& scratch) { + if (COMPRESS_POINTERS_BOOL) { + RecordComment("[ StoreTagged"); + StoreWord(value, dst_field_operand, scratch); + RecordComment("]"); + } else { + StoreP(value, dst_field_operand, scratch); + } +} + +void TurboAssembler::DecompressTaggedSigned(Register destination, + Register src) { + RecordComment("[ DecompressTaggedSigned"); + ZeroExtWord32(destination, src); + RecordComment("]"); +} + +void TurboAssembler::DecompressTaggedSigned(Register destination, + MemOperand field_operand) { + RecordComment("[ DecompressTaggedSigned"); + LoadWord(destination, field_operand, r0); + RecordComment("]"); +} + +void TurboAssembler::DecompressTaggedPointer(Register destination, + Register source) { + RecordComment("[ DecompressTaggedPointer"); + ZeroExtWord32(destination, source); + add(destination, destination, kRootRegister); + RecordComment("]"); +} + +void TurboAssembler::DecompressTaggedPointer(Register destination, + MemOperand field_operand) { + RecordComment("[ DecompressTaggedPointer"); + LoadWord(destination, field_operand, r0); + add(destination, destination, kRootRegister); + RecordComment("]"); +} + +void TurboAssembler::DecompressAnyTagged(Register destination, + MemOperand field_operand) { + RecordComment("[ DecompressAnyTagged"); + LoadWord(destination, field_operand, r0); + add(destination, destination, kRootRegister); + RecordComment("]"); +} + +void TurboAssembler::DecompressAnyTagged(Register destination, + Register source) { + RecordComment("[ DecompressAnyTagged"); + ZeroExtWord32(destination, source); + add(destination, destination, kRootRegister); + RecordComment("]"); +} + void MacroAssembler::RecordWriteField(Register object, int offset, Register value, Register dst, LinkRegisterStatus lr_status, @@ -427,13 +542,13 @@ void MacroAssembler::RecordWriteField(Register object, int offset, } // Although the object register is tagged, the offset is relative to the start - // of the object, so so offset must be a multiple of kPointerSize. - DCHECK(IsAligned(offset, kPointerSize)); + // of the object, so so offset must be a multiple of kSystemPointerSize. + DCHECK(IsAligned(offset, kTaggedSize)); Add(dst, object, offset - kHeapObjectTag, r0); if (emit_debug_code()) { Label ok; - andi(r0, dst, Operand(kPointerSize - 1)); + andi(r0, dst, Operand(kTaggedSize - 1)); beq(&ok, cr0); stop(); bind(&ok); @@ -569,7 +684,7 @@ void MacroAssembler::RecordWrite(Register object, Register address, SmiCheck smi_check) { DCHECK(object != value); if (emit_debug_code()) { - LoadP(r0, MemOperand(address)); + LoadTaggedPointerField(r0, MemOperand(address)); cmp(r0, value); Check(eq, AbortReason::kWrongAddressOrValuePassedToRecordWrite); } @@ -636,7 +751,7 @@ void TurboAssembler::PushCommonFrame(Register marker_reg) { fp_delta = 0; } } - addi(fp, sp, Operand(fp_delta * kPointerSize)); + addi(fp, sp, Operand(fp_delta * kSystemPointerSize)); } void TurboAssembler::PushStandardFrame(Register function_reg) { @@ -659,7 +774,7 @@ void TurboAssembler::PushStandardFrame(Register function_reg) { fp_delta = 1; } } - addi(fp, sp, Operand(fp_delta * kPointerSize)); + addi(fp, sp, Operand(fp_delta * kSystemPointerSize)); } void TurboAssembler::RestoreFrameStateForTailCall() { @@ -1012,9 +1127,9 @@ void MacroAssembler::EnterExitFrame(bool save_doubles, int stack_space, DCHECK(frame_type == StackFrame::EXIT || frame_type == StackFrame::BUILTIN_EXIT); // Set up the frame structure on the stack. - DCHECK_EQ(2 * kPointerSize, ExitFrameConstants::kCallerSPDisplacement); - DCHECK_EQ(1 * kPointerSize, ExitFrameConstants::kCallerPCOffset); - DCHECK_EQ(0 * kPointerSize, ExitFrameConstants::kCallerFPOffset); + DCHECK_EQ(2 * kSystemPointerSize, ExitFrameConstants::kCallerSPDisplacement); + DCHECK_EQ(1 * kSystemPointerSize, ExitFrameConstants::kCallerPCOffset); + DCHECK_EQ(0 * kSystemPointerSize, ExitFrameConstants::kCallerFPOffset); DCHECK_GT(stack_space, 0); // This is an opportunity to build a frame to wrap @@ -1052,22 +1167,23 @@ void MacroAssembler::EnterExitFrame(bool save_doubles, int stack_space, // since the sp slot and code slot were pushed after the fp. } - addi(sp, sp, Operand(-stack_space * kPointerSize)); + addi(sp, sp, Operand(-stack_space * kSystemPointerSize)); // Allocate and align the frame preparing for calling the runtime // function. const int frame_alignment = ActivationFrameAlignment(); - if (frame_alignment > kPointerSize) { + if (frame_alignment > kSystemPointerSize) { DCHECK(base::bits::IsPowerOfTwo(frame_alignment)); ClearRightImm(sp, sp, Operand(base::bits::WhichPowerOfTwo(frame_alignment))); } li(r0, Operand::Zero()); - StorePU(r0, MemOperand(sp, -kNumRequiredStackFrameSlots * kPointerSize)); + StorePU(r0, + MemOperand(sp, -kNumRequiredStackFrameSlots * kSystemPointerSize)); // Set the exit frame sp value to point just before the return address // location. - addi(r8, sp, Operand((kStackFrameExtraParamSlot + 1) * kPointerSize)); + addi(r8, sp, Operand((kStackFrameExtraParamSlot + 1) * kSystemPointerSize)); StoreP(r8, MemOperand(fp, ExitFrameConstants::kSPOffset)); } @@ -1123,7 +1239,8 @@ void MacroAssembler::LeaveExitFrame(bool save_doubles, Register argument_count, if (argument_count.is_valid()) { if (!argument_count_is_length) { - ShiftLeftImm(argument_count, argument_count, Operand(kPointerSizeLog2)); + ShiftLeftImm(argument_count, argument_count, + Operand(kSystemPointerSizeLog2)); } add(sp, sp, argument_count); } @@ -1143,19 +1260,19 @@ void TurboAssembler::PrepareForTailCall(Register callee_args_count, DCHECK(!AreAliased(callee_args_count, caller_args_count, scratch0, scratch1)); // Calculate the end of destination area where we will put the arguments - // after we drop current frame. We add kPointerSize to count the receiver - // argument which is not included into formal parameters count. + // after we drop current frame. We add kSystemPointerSize to count the + // receiver argument which is not included into formal parameters count. Register dst_reg = scratch0; - ShiftLeftImm(dst_reg, caller_args_count, Operand(kPointerSizeLog2)); + ShiftLeftImm(dst_reg, caller_args_count, Operand(kSystemPointerSizeLog2)); add(dst_reg, fp, dst_reg); addi(dst_reg, dst_reg, - Operand(StandardFrameConstants::kCallerSPOffset + kPointerSize)); + Operand(StandardFrameConstants::kCallerSPOffset + kSystemPointerSize)); Register src_reg = caller_args_count; - // Calculate the end of source area. +kPointerSize is for the receiver. - ShiftLeftImm(src_reg, callee_args_count, Operand(kPointerSizeLog2)); + // Calculate the end of source area. +kSystemPointerSize is for the receiver. + ShiftLeftImm(src_reg, callee_args_count, Operand(kSystemPointerSizeLog2)); add(src_reg, sp, src_reg); - addi(src_reg, src_reg, Operand(kPointerSize)); + addi(src_reg, src_reg, Operand(kSystemPointerSize)); if (FLAG_debug_code) { cmpl(src_reg, dst_reg); @@ -1176,8 +1293,8 @@ void TurboAssembler::PrepareForTailCall(Register callee_args_count, addi(tmp_reg, callee_args_count, Operand(1)); // +1 for receiver mtctr(tmp_reg); bind(&loop); - LoadPU(tmp_reg, MemOperand(src_reg, -kPointerSize)); - StorePU(tmp_reg, MemOperand(dst_reg, -kPointerSize)); + LoadPU(tmp_reg, MemOperand(src_reg, -kSystemPointerSize)); + StorePU(tmp_reg, MemOperand(dst_reg, -kSystemPointerSize)); bdnz(&loop); // Leave current frame. @@ -1233,7 +1350,7 @@ void MacroAssembler::CheckDebugHook(Register fun, Register new_target, { // Load receiver to pass it later to DebugOnFunctionCall hook. - ShiftLeftImm(r7, actual_parameter_count, Operand(kPointerSizeLog2)); + ShiftLeftImm(r7, actual_parameter_count, Operand(kSystemPointerSizeLog2)); LoadPX(r7, MemOperand(sp, r7)); FrameScope frame(this, has_frame() ? StackFrame::NONE : StackFrame::INTERNAL); @@ -1287,7 +1404,8 @@ void MacroAssembler::InvokeFunctionCode(Register function, Register new_target, // allow recompilation to take effect without changing any of the // call sites. Register code = kJavaScriptCallCodeStartRegister; - LoadP(code, FieldMemOperand(function, JSFunction::kCodeOffset)); + LoadTaggedPointerField(code, + FieldMemOperand(function, JSFunction::kCodeOffset)); if (flag == CALL_FUNCTION) { CallCodeObject(code); } else { @@ -1312,8 +1430,9 @@ void MacroAssembler::InvokeFunctionWithNewTarget( Register expected_reg = r5; Register temp_reg = r7; - LoadP(temp_reg, FieldMemOperand(r4, JSFunction::kSharedFunctionInfoOffset)); - LoadP(cp, FieldMemOperand(r4, JSFunction::kContextOffset)); + LoadTaggedPointerField( + temp_reg, FieldMemOperand(r4, JSFunction::kSharedFunctionInfoOffset)); + LoadTaggedPointerField(cp, FieldMemOperand(r4, JSFunction::kContextOffset)); LoadHalfWord(expected_reg, FieldMemOperand( temp_reg, SharedFunctionInfo::kFormalParameterCountOffset)); @@ -1333,7 +1452,7 @@ void MacroAssembler::InvokeFunction(Register function, DCHECK_EQ(function, r4); // Get the function and setup the context. - LoadP(cp, FieldMemOperand(r4, JSFunction::kContextOffset)); + LoadTaggedPointerField(cp, FieldMemOperand(r4, JSFunction::kContextOffset)); InvokeFunctionCode(r4, no_reg, expected_parameter_count, actual_parameter_count, flag); @@ -1352,8 +1471,8 @@ void MacroAssembler::MaybeDropFrames() { void MacroAssembler::PushStackHandler() { // Adjust this code if not the case. - STATIC_ASSERT(StackHandlerConstants::kSize == 2 * kPointerSize); - STATIC_ASSERT(StackHandlerConstants::kNextOffset == 0 * kPointerSize); + STATIC_ASSERT(StackHandlerConstants::kSize == 2 * kSystemPointerSize); + STATIC_ASSERT(StackHandlerConstants::kNextOffset == 0 * kSystemPointerSize); Push(Smi::zero()); // Padding. @@ -1369,7 +1488,7 @@ void MacroAssembler::PushStackHandler() { } void MacroAssembler::PopStackHandler() { - STATIC_ASSERT(StackHandlerConstants::kSize == 2 * kPointerSize); + STATIC_ASSERT(StackHandlerConstants::kSize == 2 * kSystemPointerSize); STATIC_ASSERT(StackHandlerConstants::kNextOffset == 0); pop(r4); @@ -1604,7 +1723,7 @@ void MacroAssembler::JumpToInstructionStream(Address entry) { void MacroAssembler::LoadWeakValue(Register out, Register in, Label* target_if_cleared) { - cmpi(in, Operand(kClearedWeakHeapObjectLower32)); + cmpwi(in, Operand(kClearedWeakHeapObjectLower32)); beq(target_if_cleared); mov(r0, Operand(~kWeakHeapObjectMask)); @@ -1690,14 +1809,16 @@ void TurboAssembler::Abort(AbortReason reason) { } void MacroAssembler::LoadMap(Register destination, Register object) { - LoadP(destination, FieldMemOperand(object, HeapObject::kMapOffset)); + LoadTaggedPointerField(destination, + FieldMemOperand(object, HeapObject::kMapOffset)); } void MacroAssembler::LoadNativeContextSlot(int index, Register dst) { LoadMap(dst, cp); - LoadP(dst, FieldMemOperand( - dst, Map::kConstructorOrBackPointerOrNativeContextOffset)); - LoadP(dst, MemOperand(dst, Context::SlotOffset(index))); + LoadTaggedPointerField( + dst, FieldMemOperand( + dst, Map::kConstructorOrBackPointerOrNativeContextOffset)); + LoadTaggedPointerField(dst, MemOperand(dst, Context::SlotOffset(index))); } void MacroAssembler::AssertNotSmi(Register object) { @@ -1821,15 +1942,16 @@ void TurboAssembler::PrepareCallCFunction(int num_reg_arguments, CalculateStackPassedWords(num_reg_arguments, num_double_arguments); int stack_space = kNumRequiredStackFrameSlots; - if (frame_alignment > kPointerSize) { + if (frame_alignment > kSystemPointerSize) { // Make stack end at alignment and make room for stack arguments // -- preserving original value of sp. mr(scratch, sp); - addi(sp, sp, Operand(-(stack_passed_arguments + 1) * kPointerSize)); + addi(sp, sp, Operand(-(stack_passed_arguments + 1) * kSystemPointerSize)); DCHECK(base::bits::IsPowerOfTwo(frame_alignment)); ClearRightImm(sp, sp, Operand(base::bits::WhichPowerOfTwo(frame_alignment))); - StoreP(scratch, MemOperand(sp, stack_passed_arguments * kPointerSize)); + StoreP(scratch, + MemOperand(sp, stack_passed_arguments * kSystemPointerSize)); } else { // Make room for stack arguments stack_space += stack_passed_arguments; @@ -1837,7 +1959,7 @@ void TurboAssembler::PrepareCallCFunction(int num_reg_arguments, // Allocate frame with required slots to make ABI work. li(r0, Operand::Zero()); - StorePU(r0, MemOperand(sp, -stack_space * kPointerSize)); + StorePU(r0, MemOperand(sp, -stack_space * kSystemPointerSize)); } void TurboAssembler::PrepareCallCFunction(int num_reg_arguments, @@ -1931,7 +2053,8 @@ void TurboAssembler::CallCFunctionHelper(Register function, if (ABI_USES_FUNCTION_DESCRIPTORS && has_function_descriptor) { // AIX/PPC64BE Linux uses a function descriptor. When calling C code be // aware of this descriptor and pick up values from it - LoadP(ToRegister(ABI_TOC_REGISTER), MemOperand(function, kPointerSize)); + LoadP(ToRegister(ABI_TOC_REGISTER), + MemOperand(function, kSystemPointerSize)); LoadP(ip, MemOperand(function, 0)); dest = ip; } else if (ABI_CALL_VIA_IP) { @@ -1963,10 +2086,10 @@ void TurboAssembler::CallCFunctionHelper(Register function, int stack_passed_arguments = CalculateStackPassedWords(num_reg_arguments, num_double_arguments); int stack_space = kNumRequiredStackFrameSlots + stack_passed_arguments; - if (ActivationFrameAlignment() > kPointerSize) { - LoadP(sp, MemOperand(sp, stack_space * kPointerSize)); + if (ActivationFrameAlignment() > kSystemPointerSize) { + LoadP(sp, MemOperand(sp, stack_space * kSystemPointerSize)); } else { - addi(sp, sp, Operand(stack_space * kPointerSize)); + addi(sp, sp, Operand(stack_space * kSystemPointerSize)); } } @@ -2368,7 +2491,7 @@ void MacroAssembler::Xor(Register ra, Register rs, const Operand& rb, void MacroAssembler::CmpSmiLiteral(Register src1, Smi smi, Register scratch, CRegister cr) { #if defined(V8_COMPRESS_POINTERS) || defined(V8_31BIT_SMIS_ON_64BIT_ARCH) - Cmpi(src1, Operand(smi), scratch, cr); + Cmpwi(src1, Operand(smi), scratch, cr); #else LoadSmiLiteral(scratch, smi); cmp(src1, scratch, cr); @@ -2538,7 +2661,7 @@ void TurboAssembler::LoadWordArith(Register dst, const MemOperand& mem, // Variable length depending on whether offset fits into immediate field // MemOperand currently only supports d-form -void MacroAssembler::LoadWord(Register dst, const MemOperand& mem, +void TurboAssembler::LoadWord(Register dst, const MemOperand& mem, Register scratch) { Register base = mem.ra(); int offset = mem.offset(); @@ -2553,7 +2676,7 @@ void MacroAssembler::LoadWord(Register dst, const MemOperand& mem, // Variable length depending on whether offset fits into immediate field // MemOperand current only supports d-form -void MacroAssembler::StoreWord(Register src, const MemOperand& mem, +void TurboAssembler::StoreWord(Register src, const MemOperand& mem, Register scratch) { Register base = mem.ra(); int offset = mem.offset(); @@ -2903,14 +3026,14 @@ void TurboAssembler::LoadEntryFromBuiltinIndex(Register builtin_index) { STATIC_ASSERT(kSmiTag == 0); // The builtin_index register contains the builtin index as a Smi. - // Untagging is folded into the indexing operand below. -#if defined(V8_COMPRESS_POINTERS) || defined(V8_31BIT_SMIS_ON_64BIT_ARCH) - ShiftLeftImm(builtin_index, builtin_index, - Operand(kSystemPointerSizeLog2 - kSmiShift)); -#else - ShiftRightArithImm(builtin_index, builtin_index, - kSmiShift - kSystemPointerSizeLog2); -#endif + if (SmiValuesAre32Bits()) { + ShiftRightArithImm(builtin_index, builtin_index, + kSmiShift - kSystemPointerSizeLog2); + } else { + DCHECK(SmiValuesAre31Bits()); + ShiftLeftImm(builtin_index, builtin_index, + Operand(kSystemPointerSizeLog2 - kSmiShift)); + } addi(builtin_index, builtin_index, Operand(IsolateData::builtin_entry_table_offset())); LoadPX(builtin_index, MemOperand(kRootRegister, builtin_index)); @@ -2996,7 +3119,7 @@ void TurboAssembler::StoreReturnAddressAndCall(Register target) { if (ABI_USES_FUNCTION_DESCRIPTORS) { // AIX/PPC64BE Linux uses a function descriptor. When calling C code be // aware of this descriptor and pick up values from it - LoadP(ToRegister(ABI_TOC_REGISTER), MemOperand(target, kPointerSize)); + LoadP(ToRegister(ABI_TOC_REGISTER), MemOperand(target, kSystemPointerSize)); LoadP(ip, MemOperand(target, 0)); dest = ip; } else if (ABI_CALL_VIA_IP && dest != ip) { @@ -3007,7 +3130,7 @@ void TurboAssembler::StoreReturnAddressAndCall(Register target) { LoadPC(r7); bind(&start_call); addi(r7, r7, Operand(after_call_offset)); - StoreP(r7, MemOperand(sp, kStackFrameExtraParamSlot * kPointerSize)); + StoreP(r7, MemOperand(sp, kStackFrameExtraParamSlot * kSystemPointerSize)); Call(dest); DCHECK_EQ(after_call_offset - kInstrSize, |