Commit 634a29a0 authored by Igor Sheludko's avatar Igor Sheludko Committed by Commit Bot

[cleanup][ia32] Fix kPointerSize in ia32 builtins

Bug: v8:8477, v8:8834
Change-Id: If613bc4a32cdce68d9bcf747bf0bf528e3c2a90c
Reviewed-on: https://chromium-review.googlesource.com/c/1473290Reviewed-by: 's avatarBenedikt Meurer <bmeurer@chromium.org>
Reviewed-by: 's avatarJakob Gruber <jgruber@chromium.org>
Commit-Queue: Igor Sheludko <ishell@chromium.org>
Cr-Commit-Position: refs/heads/master@{#59620}
parent b3e0efc7
This diff is collapsed.
......@@ -4012,7 +4012,7 @@ void CodeGenerator::AssembleArchTableSwitch(Instruction* instr) {
Label* const table = AddJumpTable(cases, case_count);
__ cmp(input, Immediate(case_count));
__ j(above_equal, GetLabel(i.InputRpo(1)));
__ jmp(Operand::JumpTable(input, times_4, table));
__ jmp(Operand::JumpTable(input, times_system_pointer_size, table));
}
// The calling convention for JSFunctions on IA32 passes arguments on the
......@@ -4307,7 +4307,8 @@ void CodeGenerator::AssembleReturn(InstructionOperand* pop) {
Register pop_reg = g.ToRegister(pop);
Register scratch_reg = pop_reg == ecx ? edx : ecx;
__ pop(scratch_reg);
__ lea(esp, Operand(esp, pop_reg, times_4, static_cast<int>(pop_size)));
__ lea(esp, Operand(esp, pop_reg, times_system_pointer_size,
static_cast<int>(pop_size)));
__ jmp(scratch_reg);
}
}
......
......@@ -204,9 +204,11 @@ enum ScaleFactor {
times_4 = 2,
times_8 = 3,
times_int_size = times_4,
times_half_pointer_size = times_2,
times_pointer_size = times_4,
times_twice_pointer_size = times_8
times_half_system_pointer_size = times_2,
times_system_pointer_size = times_4,
times_tagged_size = times_4,
};
class V8_EXPORT_PRIVATE Operand {
......@@ -298,7 +300,7 @@ class V8_EXPORT_PRIVATE Operand {
friend class Assembler;
};
ASSERT_TRIVIALLY_COPYABLE(Operand);
static_assert(sizeof(Operand) <= 2 * kPointerSize,
static_assert(sizeof(Operand) <= 2 * kSystemPointerSize,
"Operand must be small enough to pass it by value");
// -----------------------------------------------------------------------------
......@@ -417,11 +419,11 @@ class V8_EXPORT_PRIVATE Assembler : public AssemblerBase {
Address pc, Address target,
RelocInfo::Mode mode = RelocInfo::INTERNAL_REFERENCE);
static constexpr int kSpecialTargetSize = kPointerSize;
static constexpr int kSpecialTargetSize = kSystemPointerSize;
// Distance between the address of the code target in the call instruction
// and the return address
static constexpr int kCallTargetAddressOffset = kPointerSize;
static constexpr int kCallTargetAddressOffset = kSystemPointerSize;
// One byte opcode for test al, 0xXX.
static constexpr byte kTestAlByte = 0xA8;
......
......@@ -33,7 +33,7 @@ void Deoptimizer::GenerateDeoptimizationEntries(MacroAssembler* masm,
__ movsd(Operand(esp, offset), xmm_reg);
}
STATIC_ASSERT(kFloatSize == kPointerSize);
STATIC_ASSERT(kFloatSize == kSystemPointerSize);
const int kFloatRegsSize = kFloatSize * XMMRegister::kNumRegisters;
__ sub(esp, Immediate(kFloatRegsSize));
for (int i = 0; i < config->num_allocatable_float_registers(); ++i) {
......@@ -49,15 +49,15 @@ void Deoptimizer::GenerateDeoptimizationEntries(MacroAssembler* masm,
ExternalReference::Create(IsolateAddressId::kCEntryFPAddress, isolate);
__ mov(masm->ExternalReferenceAsOperand(c_entry_fp_address, esi), ebp);
const int kSavedRegistersAreaSize =
kNumberOfRegisters * kPointerSize + kDoubleRegsSize + kFloatRegsSize;
const int kSavedRegistersAreaSize = kNumberOfRegisters * kSystemPointerSize +
kDoubleRegsSize + kFloatRegsSize;
// The bailout id is passed in ebx by the caller.
// Get the address of the location in the code object
// and compute the fp-to-sp delta in register edx.
__ mov(ecx, Operand(esp, kSavedRegistersAreaSize));
__ lea(edx, Operand(esp, kSavedRegistersAreaSize + 1 * kPointerSize));
__ lea(edx, Operand(esp, kSavedRegistersAreaSize + 1 * kSystemPointerSize));
__ sub(edx, ebp);
__ neg(edx);
......@@ -70,13 +70,13 @@ void Deoptimizer::GenerateDeoptimizationEntries(MacroAssembler* masm,
__ JumpIfSmi(edi, &context_check);
__ mov(eax, Operand(ebp, JavaScriptFrameConstants::kFunctionOffset));
__ bind(&context_check);
__ mov(Operand(esp, 0 * kPointerSize), eax); // Function.
__ mov(Operand(esp, 1 * kPointerSize),
__ mov(Operand(esp, 0 * kSystemPointerSize), eax); // Function.
__ mov(Operand(esp, 1 * kSystemPointerSize),
Immediate(static_cast<int>(deopt_kind)));
__ mov(Operand(esp, 2 * kPointerSize), ebx); // Bailout id.
__ mov(Operand(esp, 3 * kPointerSize), ecx); // Code address or 0.
__ mov(Operand(esp, 4 * kPointerSize), edx); // Fp-to-sp delta.
__ mov(Operand(esp, 5 * kPointerSize),
__ mov(Operand(esp, 2 * kSystemPointerSize), ebx); // Bailout id.
__ mov(Operand(esp, 3 * kSystemPointerSize), ecx); // Code address or 0.
__ mov(Operand(esp, 4 * kSystemPointerSize), edx); // Fp-to-sp delta.
__ mov(Operand(esp, 5 * kSystemPointerSize),
Immediate(ExternalReference::isolate_address(isolate)));
{
AllowExternalCallThatCantCauseGC scope(masm);
......@@ -89,7 +89,8 @@ void Deoptimizer::GenerateDeoptimizationEntries(MacroAssembler* masm,
// Fill in the input registers.
for (int i = kNumberOfRegisters - 1; i >= 0; i--) {
int offset = (i * kPointerSize) + FrameDescription::registers_offset();
int offset =
(i * kSystemPointerSize) + FrameDescription::registers_offset();
__ pop(Operand(esi, offset));
}
......@@ -116,7 +117,7 @@ void Deoptimizer::GenerateDeoptimizationEntries(MacroAssembler* masm,
__ fnclex();
// Remove the return address and the double registers.
__ add(esp, Immediate(kDoubleRegsSize + 1 * kPointerSize));
__ add(esp, Immediate(kDoubleRegsSize + 1 * kSystemPointerSize));
// Compute a pointer to the unwinding limit in register ecx; that is
// the first stack slot not part of the input frame.
......@@ -140,7 +141,7 @@ void Deoptimizer::GenerateDeoptimizationEntries(MacroAssembler* masm,
// Compute the output frame in the deoptimizer.
__ push(eax);
__ PrepareCallCFunction(1, esi);
__ mov(Operand(esp, 0 * kPointerSize), eax);
__ mov(Operand(esp, 0 * kSystemPointerSize), eax);
{
AllowExternalCallThatCantCauseGC scope(masm);
__ CallCFunction(ExternalReference::compute_output_frames_function(), 1);
......@@ -156,7 +157,7 @@ void Deoptimizer::GenerateDeoptimizationEntries(MacroAssembler* masm,
// past the last FrameDescription**.
__ mov(edx, Operand(eax, Deoptimizer::output_count_offset()));
__ mov(eax, Operand(eax, Deoptimizer::output_offset()));
__ lea(edx, Operand(eax, edx, times_4, 0));
__ lea(edx, Operand(eax, edx, times_system_pointer_size, 0));
__ jmp(&outer_loop_header);
__ bind(&outer_push_loop);
// Inner loop state: esi = current FrameDescription*, ecx = loop
......@@ -170,7 +171,7 @@ void Deoptimizer::GenerateDeoptimizationEntries(MacroAssembler* masm,
__ bind(&inner_loop_header);
__ test(ecx, ecx);
__ j(not_zero, &inner_push_loop);
__ add(eax, Immediate(kPointerSize));
__ add(eax, Immediate(kSystemPointerSize));
__ bind(&outer_loop_header);
__ cmp(eax, edx);
__ j(below, &outer_push_loop);
......@@ -189,7 +190,8 @@ void Deoptimizer::GenerateDeoptimizationEntries(MacroAssembler* masm,
// Push the registers from the last output frame.
for (int i = 0; i < kNumberOfRegisters; i++) {
int offset = (i * kPointerSize) + FrameDescription::registers_offset();
int offset =
(i * kSystemPointerSize) + FrameDescription::registers_offset();
__ push(Operand(esi, offset));
}
......
......@@ -15,21 +15,21 @@ class EntryFrameConstants : public AllStatic {
public:
// This is the offset to where JSEntry pushes the current value of
// Isolate::c_entry_fp onto the stack.
static constexpr int kCallerFPOffset = -6 * kPointerSize;
static constexpr int kCallerFPOffset = -6 * kSystemPointerSize;
// EntryFrame is used by JSEntry, JSConstructEntry and JSRunMicrotasksEntry.
// All of them take |root_register_value| as the first parameter.
static constexpr int kRootRegisterValueOffset = +2 * kPointerSize;
static constexpr int kRootRegisterValueOffset = +2 * kSystemPointerSize;
// Rest of parameters passed to JSEntry and JSConstructEntry.
static constexpr int kNewTargetArgOffset = +3 * kPointerSize;
static constexpr int kFunctionArgOffset = +4 * kPointerSize;
static constexpr int kReceiverArgOffset = +5 * kPointerSize;
static constexpr int kArgcOffset = +6 * kPointerSize;
static constexpr int kArgvOffset = +7 * kPointerSize;
static constexpr int kNewTargetArgOffset = +3 * kSystemPointerSize;
static constexpr int kFunctionArgOffset = +4 * kSystemPointerSize;
static constexpr int kReceiverArgOffset = +5 * kSystemPointerSize;
static constexpr int kArgcOffset = +6 * kSystemPointerSize;
static constexpr int kArgvOffset = +7 * kSystemPointerSize;
// Rest of parameters passed to JSRunMicrotasksEntry.
static constexpr int kMicrotaskQueueArgOffset = +3 * kPointerSize;
static constexpr int kMicrotaskQueueArgOffset = +3 * kSystemPointerSize;
};
class ExitFrameConstants : public TypedFrameConstants {
......@@ -38,12 +38,12 @@ class ExitFrameConstants : public TypedFrameConstants {
static constexpr int kCodeOffset = TYPED_FRAME_PUSHED_VALUE_OFFSET(1);
DEFINE_TYPED_FRAME_SIZES(2);
static constexpr int kCallerFPOffset = 0 * kPointerSize;
static constexpr int kCallerPCOffset = +1 * kPointerSize;
static constexpr int kCallerFPOffset = 0 * kSystemPointerSize;
static constexpr int kCallerPCOffset = +1 * kSystemPointerSize;
// FP-relative displacement of the caller's SP. It points just
// below the saved PC.
static constexpr int kCallerSPDisplacement = +2 * kPointerSize;
static constexpr int kCallerSPDisplacement = +2 * kSystemPointerSize;
static constexpr int kConstantPoolOffset = 0; // Not used
};
......@@ -57,7 +57,7 @@ class WasmCompileLazyFrameConstants : public TypedFrameConstants {
static constexpr int kWasmInstanceOffset = TYPED_FRAME_PUSHED_VALUE_OFFSET(0);
static constexpr int kFixedFrameSizeFromFp =
TypedFrameConstants::kFixedFrameSizeFromFp +
kNumberOfSavedGpParamRegs * kPointerSize +
kNumberOfSavedGpParamRegs * kSystemPointerSize +
kNumberOfSavedFpParamRegs * kSimd128Size;
};
......@@ -66,13 +66,13 @@ class JavaScriptFrameConstants : public AllStatic {
// FP-relative.
static constexpr int kLocal0Offset =
StandardFrameConstants::kExpressionsOffset;
static constexpr int kLastParameterOffset = +2 * kPointerSize;
static constexpr int kLastParameterOffset = +2 * kSystemPointerSize;
static constexpr int kFunctionOffset =
StandardFrameConstants::kFunctionOffset;
// Caller SP-relative.
static constexpr int kParam0Offset = -2 * kPointerSize;
static constexpr int kReceiverOffset = -1 * kPointerSize;
static constexpr int kParam0Offset = -2 * kSystemPointerSize;
static constexpr int kReceiverOffset = -1 * kSystemPointerSize;
};
} // namespace internal
......
This diff is collapsed.
......@@ -708,18 +708,12 @@ inline Operand FieldOperand(Register object, Register index, ScaleFactor scale,
return Operand(object, index, scale, offset - kHeapObjectTag);
}
inline Operand FixedArrayElementOperand(Register array, Register index_as_smi,
int additional_offset = 0) {
int offset = FixedArray::kHeaderSize + additional_offset * kPointerSize;
return FieldOperand(array, index_as_smi, times_half_pointer_size, offset);
}
inline Operand ContextOperand(Register context, int index) {
return Operand(context, Context::SlotOffset(index));
}
inline Operand ContextOperand(Register context, Register index) {
return Operand(context, index, times_pointer_size, Context::SlotOffset(0));
return Operand(context, index, times_tagged_size, Context::SlotOffset(0));
}
inline Operand NativeContextOperand() {
......
......@@ -187,7 +187,7 @@ void RegExpMacroAssemblerIA32::CheckGreedyLoop(Label* on_equal) {
Label fallthrough;
__ cmp(edi, Operand(backtrack_stackpointer(), 0));
__ j(not_equal, &fallthrough);
__ add(backtrack_stackpointer(), Immediate(kPointerSize)); // Pop.
__ add(backtrack_stackpointer(), Immediate(kSystemPointerSize)); // Pop.
BranchOrBacktrack(no_condition, on_equal);
__ bind(&fallthrough);
}
......@@ -278,7 +278,7 @@ void RegExpMacroAssemblerIA32::CheckNotBackReferenceIgnoreCase(
// Restore original value before continuing.
__ pop(backtrack_stackpointer());
// Drop original value of character position.
__ add(esp, Immediate(kPointerSize));
__ add(esp, Immediate(kSystemPointerSize));
// Compute new value of character position after the matched part.
__ sub(edi, esi);
if (read_backward) {
......@@ -306,15 +306,15 @@ void RegExpMacroAssemblerIA32::CheckNotBackReferenceIgnoreCase(
// Set isolate.
#ifdef V8_INTL_SUPPORT
if (unicode) {
__ mov(Operand(esp, 3 * kPointerSize), Immediate(0));
__ mov(Operand(esp, 3 * kSystemPointerSize), Immediate(0));
} else // NOLINT
#endif // V8_INTL_SUPPORT
{
__ mov(Operand(esp, 3 * kPointerSize),
__ mov(Operand(esp, 3 * kSystemPointerSize),
Immediate(ExternalReference::isolate_address(isolate())));
}
// Set byte_length.
__ mov(Operand(esp, 2 * kPointerSize), ebx);
__ mov(Operand(esp, 2 * kSystemPointerSize), ebx);
// Set byte_offset2.
// Found by adding negative string-end offset of current position (edi)
// to end of string.
......@@ -322,11 +322,11 @@ void RegExpMacroAssemblerIA32::CheckNotBackReferenceIgnoreCase(
if (read_backward) {
__ sub(edi, ebx); // Offset by length when matching backwards.
}
__ mov(Operand(esp, 1 * kPointerSize), edi);
__ mov(Operand(esp, 1 * kSystemPointerSize), edi);
// Set byte_offset1.
// Start of capture, where edx already holds string-end negative offset.
__ add(edx, esi);
__ mov(Operand(esp, 0 * kPointerSize), edx);
__ mov(Operand(esp, 0 * kSystemPointerSize), edx);
{
AllowExternalCallThatCantCauseGC scope(masm_);
......@@ -691,7 +691,7 @@ Handle<HeapObject> RegExpMacroAssemblerIA32::GetCode(Handle<String> source) {
__ j(below_equal, &stack_limit_hit);
// Check if there is room for the variable number of registers above
// the stack limit.
__ cmp(ecx, num_registers_ * kPointerSize);
__ cmp(ecx, num_registers_ * kSystemPointerSize);
__ j(above_equal, &stack_ok);
// Exit with OutOfMemory exception. There is not enough space on the stack
// for our working registers.
......@@ -709,7 +709,7 @@ Handle<HeapObject> RegExpMacroAssemblerIA32::GetCode(Handle<String> source) {
__ mov(ebx, Operand(ebp, kStartIndex));
// Allocate space on stack for registers.
__ sub(esp, Immediate(num_registers_ * kPointerSize));
__ sub(esp, Immediate(num_registers_ * kSystemPointerSize));
// Load string length.
__ mov(esi, Operand(ebp, kInputEnd));
// Load input position.
......@@ -733,7 +733,7 @@ Handle<HeapObject> RegExpMacroAssemblerIA32::GetCode(Handle<String> source) {
// Ensure that we write to each stack page, in order. Skipping a page
// on Windows can cause segmentation faults. Assuming page size is 4k.
const int kPageSize = 4096;
const int kRegistersPerPage = kPageSize / kPointerSize;
const int kRegistersPerPage = kPageSize / kSystemPointerSize;
for (int i = num_saved_registers_ + kRegistersPerPage - 1;
i < num_registers_;
i += kRegistersPerPage) {
......@@ -764,8 +764,8 @@ Handle<HeapObject> RegExpMacroAssemblerIA32::GetCode(Handle<String> source) {
Label init_loop;
__ bind(&init_loop);
__ mov(Operand(ebp, ecx, times_1, 0), eax);
__ sub(ecx, Immediate(kPointerSize));
__ cmp(ecx, kRegisterZero - num_saved_registers_ * kPointerSize);
__ sub(ecx, Immediate(kSystemPointerSize));
__ cmp(ecx, kRegisterZero - num_saved_registers_ * kSystemPointerSize);
__ j(greater, &init_loop);
} else { // Unroll the loop.
for (int i = 0; i < num_saved_registers_; i++) {
......@@ -805,7 +805,7 @@ Handle<HeapObject> RegExpMacroAssemblerIA32::GetCode(Handle<String> source) {
if (mode_ == UC16) {
__ sar(eax, 1); // Convert byte index to character index.
}
__ mov(Operand(ebx, i * kPointerSize), eax);
__ mov(Operand(ebx, i * kSystemPointerSize), eax);
}
}
......@@ -824,7 +824,7 @@ Handle<HeapObject> RegExpMacroAssemblerIA32::GetCode(Handle<String> source) {
__ mov(Operand(ebp, kNumOutputRegisters), ecx);
// Advance the location for output.
__ add(Operand(ebp, kRegisterOutput),
Immediate(num_saved_registers_ * kPointerSize));
Immediate(num_saved_registers_ * kSystemPointerSize));
// Prepare eax to initialize registers with its value in the next run.
__ mov(eax, Operand(ebp, kStringStartMinusOne));
......@@ -911,11 +911,11 @@ Handle<HeapObject> RegExpMacroAssemblerIA32::GetCode(Handle<String> source) {
// Call GrowStack(backtrack_stackpointer())
static const int num_arguments = 3;
__ PrepareCallCFunction(num_arguments, ebx);
__ mov(Operand(esp, 2 * kPointerSize),
__ mov(Operand(esp, 2 * kSystemPointerSize),
Immediate(ExternalReference::isolate_address(isolate())));
__ lea(eax, Operand(ebp, kStackHighEnd));
__ mov(Operand(esp, 1 * kPointerSize), eax);
__ mov(Operand(esp, 0 * kPointerSize), backtrack_stackpointer());
__ mov(Operand(esp, 1 * kSystemPointerSize), eax);
__ mov(Operand(esp, 0 * kSystemPointerSize), backtrack_stackpointer());
ExternalReference grow_stack =
ExternalReference::re_grow_stack(isolate());
__ CallCFunction(grow_stack, num_arguments);
......@@ -1097,12 +1097,12 @@ void RegExpMacroAssemblerIA32::CallCheckStackGuardState(Register scratch) {
static const int num_arguments = 3;
__ PrepareCallCFunction(num_arguments, scratch);
// RegExp code frame pointer.
__ mov(Operand(esp, 2 * kPointerSize), ebp);
__ mov(Operand(esp, 2 * kSystemPointerSize), ebp);
// Code of self.
__ mov(Operand(esp, 1 * kPointerSize), Immediate(masm_->CodeObject()));
__ mov(Operand(esp, 1 * kSystemPointerSize), Immediate(masm_->CodeObject()));
// Next address on the stack (will be address of return address).
__ lea(eax, Operand(esp, -kPointerSize));
__ mov(Operand(esp, 0 * kPointerSize), eax);
__ lea(eax, Operand(esp, -kSystemPointerSize));
__ mov(Operand(esp, 0 * kSystemPointerSize), eax);
ExternalReference check_stack_guard =
ExternalReference::re_check_stack_guard_state(isolate());
__ CallCFunction(check_stack_guard, num_arguments);
......@@ -1143,7 +1143,7 @@ Operand RegExpMacroAssemblerIA32::register_location(int register_index) {
if (num_registers_ <= register_index) {
num_registers_ = register_index + 1;
}
return Operand(ebp, kRegisterZero - register_index * kPointerSize);
return Operand(ebp, kRegisterZero - register_index * kSystemPointerSize);
}
......@@ -1201,14 +1201,14 @@ void RegExpMacroAssemblerIA32::SafeCallTarget(Label* name) {
void RegExpMacroAssemblerIA32::Push(Register source) {
DCHECK(source != backtrack_stackpointer());
// Notice: This updates flags, unlike normal Push.
__ sub(backtrack_stackpointer(), Immediate(kPointerSize));
__ sub(backtrack_stackpointer(), Immediate(kSystemPointerSize));
__ mov(Operand(backtrack_stackpointer(), 0), source);
}
void RegExpMacroAssemblerIA32::Push(Immediate value) {
// Notice: This updates flags, unlike normal Push.
__ sub(backtrack_stackpointer(), Immediate(kPointerSize));
__ sub(backtrack_stackpointer(), Immediate(kSystemPointerSize));
__ mov(Operand(backtrack_stackpointer(), 0), value);
}
......@@ -1217,7 +1217,7 @@ void RegExpMacroAssemblerIA32::Pop(Register target) {
DCHECK(target != backtrack_stackpointer());
__ mov(target, Operand(backtrack_stackpointer(), 0));
// Notice: This updates flags, unlike normal Pop.
__ add(backtrack_stackpointer(), Immediate(kPointerSize));
__ add(backtrack_stackpointer(), Immediate(kSystemPointerSize));
}
......
......@@ -96,31 +96,32 @@ class RegExpMacroAssemblerIA32: public NativeRegExpMacroAssembler {
// Offsets from ebp of function parameters and stored registers.
static const int kFramePointer = 0;
// Above the frame pointer - function parameters and return address.
static const int kReturn_eip = kFramePointer + kPointerSize;
static const int kFrameAlign = kReturn_eip + kPointerSize;
static const int kReturn_eip = kFramePointer + kSystemPointerSize;
static const int kFrameAlign = kReturn_eip + kSystemPointerSize;
// Parameters.
static const int kInputString = kFrameAlign;
static const int kStartIndex = kInputString + kPointerSize;
static const int kInputStart = kStartIndex + kPointerSize;
static const int kInputEnd = kInputStart + kPointerSize;
static const int kRegisterOutput = kInputEnd + kPointerSize;
static const int kStartIndex = kInputString + kSystemPointerSize;
static const int kInputStart = kStartIndex + kSystemPointerSize;
static const int kInputEnd = kInputStart + kSystemPointerSize;
static const int kRegisterOutput = kInputEnd + kSystemPointerSize;
// For the case of global regular expression, we have room to store at least
// one set of capture results. For the case of non-global regexp, we ignore
// this value.
static const int kNumOutputRegisters = kRegisterOutput + kPointerSize;
static const int kStackHighEnd = kNumOutputRegisters + kPointerSize;
static const int kDirectCall = kStackHighEnd + kPointerSize;
static const int kIsolate = kDirectCall + kPointerSize;
static const int kNumOutputRegisters = kRegisterOutput + kSystemPointerSize;
static const int kStackHighEnd = kNumOutputRegisters + kSystemPointerSize;
static const int kDirectCall = kStackHighEnd + kSystemPointerSize;
static const int kIsolate = kDirectCall + kSystemPointerSize;
// Below the frame pointer - local stack variables.
// When adding local variables remember to push space for them in
// the frame in GetCode.
static const int kBackup_esi = kFramePointer - kPointerSize;
static const int kBackup_edi = kBackup_esi - kPointerSize;
static const int kBackup_ebx = kBackup_edi - kPointerSize;
static const int kSuccessfulCaptures = kBackup_ebx - kPointerSize;
static const int kStringStartMinusOne = kSuccessfulCaptures - kPointerSize;
static const int kBackup_esi = kFramePointer - kSystemPointerSize;
static const int kBackup_edi = kBackup_esi - kSystemPointerSize;
static const int kBackup_ebx = kBackup_edi - kSystemPointerSize;
static const int kSuccessfulCaptures = kBackup_ebx - kSystemPointerSize;
static const int kStringStartMinusOne =
kSuccessfulCaptures - kSystemPointerSize;
// First register address. Following registers are below it on the stack.
static const int kRegisterZero = kStringStartMinusOne - kPointerSize;
static const int kRegisterZero = kStringStartMinusOne - kSystemPointerSize;
// Initial size of code buffer.
static const int kRegExpCodeSize = 1024;
......
......@@ -250,8 +250,8 @@ TEST(AssemblerIa326) {
Assembler assm(AssemblerOptions{},
ExternalAssemblerBuffer(buffer, sizeof buffer));
__ movsd(xmm0, Operand(esp, 1 * kPointerSize));
__ movsd(xmm1, Operand(esp, 3 * kPointerSize));
__ movsd(xmm0, Operand(esp, 1 * kSystemPointerSize));
__ movsd(xmm1, Operand(esp, 3 * kSystemPointerSize));
__ addsd(xmm0, xmm1);
__ mulsd(xmm0, xmm1);
__ subsd(xmm0, xmm1);
......@@ -522,8 +522,8 @@ TEST(AssemblerIa32SSE) {
MacroAssembler assm(isolate, v8::internal::CodeObjectRequired::kYes,
ExternalAssemblerBuffer(buffer, sizeof(buffer)));
{
__ movss(xmm0, Operand(esp, kPointerSize));
__ movss(xmm1, Operand(esp, 2 * kPointerSize));
__ movss(xmm0, Operand(esp, kSystemPointerSize));
__ movss(xmm1, Operand(esp, 2 * kSystemPointerSize));
__ shufps(xmm0, xmm0, 0x0);
__ shufps(xmm1, xmm1, 0x0);
__ movaps(xmm2, xmm1);
......@@ -559,8 +559,8 @@ TEST(AssemblerIa32SSE3) {
ExternalAssemblerBuffer(buffer, sizeof(buffer)));
{
CpuFeatureScope fscope(&assm, SSE3);
__ movss(xmm0, Operand(esp, kPointerSize));
__ movss(xmm1, Operand(esp, 2 * kPointerSize));
__ movss(xmm0, Operand(esp, kSystemPointerSize));
__ movss(xmm1, Operand(esp, 2 * kSystemPointerSize));
__ shufps(xmm0, xmm0, 0x0);
__ shufps(xmm1, xmm1, 0x0);
__ haddps(xmm1, xmm0);
......@@ -594,9 +594,9 @@ TEST(AssemblerX64FMA_sd) {
{
CpuFeatureScope fscope(&assm, FMA3);
Label exit;
__ movsd(xmm0, Operand(esp, 1 * kPointerSize));
__ movsd(xmm1, Operand(esp, 3 * kPointerSize));
__ movsd(xmm2, Operand(esp, 5 * kPointerSize));
__ movsd(xmm0, Operand(esp, 1 * kSystemPointerSize));
__ movsd(xmm1, Operand(esp, 3 * kSystemPointerSize));
__ movsd(xmm2, Operand(esp, 5 * kSystemPointerSize));
// argument in xmm0, xmm1 and xmm2
// xmm0 * xmm1 + xmm2
__ movaps(xmm3, xmm0);
......@@ -823,9 +823,9 @@ TEST(AssemblerX64FMA_ss) {
{
CpuFeatureScope fscope(&assm, FMA3);
Label exit;
__ movss(xmm0, Operand(esp, 1 * kPointerSize));
__ movss(xmm1, Operand(esp, 2 * kPointerSize));
__ movss(xmm2, Operand(esp, 3 * kPointerSize));
__ movss(xmm0, Operand(esp, 1 * kSystemPointerSize));
__ movss(xmm1, Operand(esp, 2 * kSystemPointerSize));
__ movss(xmm2, Operand(esp, 3 * kSystemPointerSize));
// arguments in xmm0, xmm1 and xmm2
// xmm0 * xmm1 + xmm2
__ movaps(xmm3, xmm0);
......@@ -1403,7 +1403,7 @@ TEST(AssemblerIa32JumpTables1) {
Label done, table;
__ mov(eax, Operand(esp, 4));
__ jmp(Operand::JumpTable(eax, times_4, &table));
__ jmp(Operand::JumpTable(eax, times_system_pointer_size, &table));
__ ud2();
__ bind(&table);
for (int i = 0; i < kNumCases; ++i) {
......@@ -1450,7 +1450,7 @@ TEST(AssemblerIa32JumpTables2) {
Label done, table;
__ mov(eax, Operand(esp, 4));
__ jmp(Operand::JumpTable(eax, times_4, &table));
__ jmp(Operand::JumpTable(eax, times_system_pointer_size, &table));
__ ud2();
for (int i = 0; i < kNumCases; ++i) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment