summaryrefslogtreecommitdiff
path: root/deps/v8/src/compiler/backend/ia32/code-generator-ia32.cc
diff options
context:
space:
mode:
Diffstat (limited to 'deps/v8/src/compiler/backend/ia32/code-generator-ia32.cc')
-rw-r--r--deps/v8/src/compiler/backend/ia32/code-generator-ia32.cc44
1 files changed, 17 insertions, 27 deletions
diff --git a/deps/v8/src/compiler/backend/ia32/code-generator-ia32.cc b/deps/v8/src/compiler/backend/ia32/code-generator-ia32.cc
index 5541f64897..5db3f20fa4 100644
--- a/deps/v8/src/compiler/backend/ia32/code-generator-ia32.cc
+++ b/deps/v8/src/compiler/backend/ia32/code-generator-ia32.cc
@@ -2083,22 +2083,12 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction(
case kIA32I64x2ShrS: {
XMMRegister dst = i.OutputSimd128Register();
XMMRegister src = i.InputSimd128Register(0);
- XMMRegister tmp = i.TempSimd128Register(0);
- XMMRegister tmp2 = i.TempSimd128Register(1);
- Operand shift = i.InputOperand(1);
-
- // Take shift value modulo 64.
- __ and_(shift, Immediate(63));
- __ Movd(tmp, shift);
-
- // Set up a mask [0x80000000,0,0x80000000,0].
- __ Pcmpeqb(tmp2, tmp2);
- __ Psllq(tmp2, tmp2, byte{63});
-
- __ Psrlq(tmp2, tmp2, tmp);
- __ Psrlq(dst, src, tmp);
- __ Pxor(dst, tmp2);
- __ Psubq(dst, tmp2);
+ if (HasImmediateInput(instr, 1)) {
+ __ I64x2ShrS(dst, src, i.InputInt6(1), kScratchDoubleReg);
+ } else {
+ __ I64x2ShrS(dst, src, i.InputRegister(1), kScratchDoubleReg,
+ i.TempSimd128Register(0), i.TempRegister(1));
+ }
break;
}
case kIA32I64x2Add: {
@@ -4537,7 +4527,7 @@ void CodeGenerator::AssembleConstructFrame() {
if (required_slots > 0) {
DCHECK(frame_access_state()->has_frame());
#if V8_ENABLE_WEBASSEMBLY
- if (info()->IsWasm() && required_slots > 128) {
+ if (info()->IsWasm() && required_slots * kSystemPointerSize > 4 * KB) {
// For WebAssembly functions with big frames we have to do the stack
// overflow check before we construct the frame. Otherwise we may not
// have enough space on the stack to call the runtime for the stack
@@ -4547,7 +4537,7 @@ void CodeGenerator::AssembleConstructFrame() {
// If the frame is bigger than the stack, we throw the stack overflow
// exception unconditionally. Thereby we can avoid the integer overflow
// check in the condition code.
- if (required_slots * kSystemPointerSize < FLAG_stack_size * 1024) {
+ if (required_slots * kSystemPointerSize < FLAG_stack_size * KB) {
Register scratch = esi;
__ push(scratch);
__ mov(scratch,
@@ -4562,6 +4552,8 @@ void CodeGenerator::AssembleConstructFrame() {
__ wasm_call(wasm::WasmCode::kWasmStackOverflow,
RelocInfo::WASM_STUB_CALL);
+ // The call does not return, hence we can ignore any references and just
+ // define an empty safepoint.
ReferenceMap* reference_map = zone()->New<ReferenceMap>(zone());
RecordSafepoint(reference_map);
__ AssertUnreachable(AbortReason::kUnexpectedReturnFromWasmTrap);
@@ -4652,11 +4644,11 @@ void CodeGenerator::AssembleReturn(InstructionOperand* additional_pop_count) {
}
if (drop_jsargs) {
- // We must pop all arguments from the stack (including the receiver). This
- // number of arguments is given by max(1 + argc_reg, parameter_slots).
- int parameter_slots_without_receiver =
- parameter_slots - 1; // Exclude the receiver to simplify the
- // computation. We'll account for it at the end.
+ // We must pop all arguments from the stack (including the receiver).
+ // The number of arguments without the receiver is
+ // max(argc_reg, parameter_slots-1), and the receiver is added in
+ // DropArguments().
+ int parameter_slots_without_receiver = parameter_slots - 1;
Label mismatch_return;
Register scratch_reg = edx;
DCHECK_NE(argc_reg, scratch_reg);
@@ -4666,11 +4658,9 @@ void CodeGenerator::AssembleReturn(InstructionOperand* additional_pop_count) {
__ j(greater, &mismatch_return, Label::kNear);
__ Ret(parameter_slots * kSystemPointerSize, scratch_reg);
__ bind(&mismatch_return);
- __ PopReturnAddressTo(scratch_reg);
- __ lea(esp, Operand(esp, argc_reg, times_system_pointer_size,
- kSystemPointerSize)); // Also pop the receiver.
+ __ DropArguments(argc_reg, scratch_reg, TurboAssembler::kCountIsInteger,
+ TurboAssembler::kCountExcludesReceiver);
// We use a return instead of a jump for better return address prediction.
- __ PushReturnAddressFrom(scratch_reg);
__ Ret();
} else if (additional_pop_count->IsImmediate()) {
int additional_count = g.ToConstant(additional_pop_count).ToInt32();