diff options
author | Michaël Zasso <targos@protonmail.com> | 2017-06-06 10:28:14 +0200 |
---|---|---|
committer | Michaël Zasso <targos@protonmail.com> | 2017-06-07 10:33:31 +0200 |
commit | 3dc8c3bed4cf3a77607edbb0b015e33f8b60fc09 (patch) | |
tree | 9dee56e142638b34f1eccbd0ad88c3bce5377c29 /deps/v8/src/compiler/ia32/code-generator-ia32.cc | |
parent | 91a1bbe3055a660194ca4d403795aa0c03e9d056 (diff) | |
download | node-new-3dc8c3bed4cf3a77607edbb0b015e33f8b60fc09.tar.gz |
deps: update V8 to 5.9.211.32
PR-URL: https://github.com/nodejs/node/pull/13263
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com>
Reviewed-By: Myles Borins <myles.borins@gmail.com>
Diffstat (limited to 'deps/v8/src/compiler/ia32/code-generator-ia32.cc')
-rw-r--r-- | deps/v8/src/compiler/ia32/code-generator-ia32.cc | 190 |
1 files changed, 150 insertions, 40 deletions
diff --git a/deps/v8/src/compiler/ia32/code-generator-ia32.cc b/deps/v8/src/compiler/ia32/code-generator-ia32.cc index 369699067e..9dbf19c3f5 100644 --- a/deps/v8/src/compiler/ia32/code-generator-ia32.cc +++ b/deps/v8/src/compiler/ia32/code-generator-ia32.cc @@ -760,6 +760,33 @@ class OutOfLineRecordWrite final : public OutOfLineCode { __ add(esp, Immediate(kDoubleSize)); \ } while (false) +#define ASSEMBLE_BINOP(asm_instr) \ + do { \ + if (AddressingModeField::decode(instr->opcode()) != kMode_None) { \ + size_t index = 1; \ + Operand right = i.MemoryOperand(&index); \ + __ asm_instr(i.InputRegister(0), right); \ + } else { \ + if (HasImmediateInput(instr, 1)) { \ + __ asm_instr(i.InputOperand(0), i.InputImmediate(1)); \ + } else { \ + __ asm_instr(i.InputRegister(0), i.InputOperand(1)); \ + } \ + } \ + } while (0) + +#define ASSEMBLE_ATOMIC_BINOP(bin_inst, mov_inst, cmpxchg_inst) \ + do { \ + Label binop; \ + __ bind(&binop); \ + __ mov_inst(eax, i.MemoryOperand(1)); \ + __ mov_inst(i.TempRegister(0), Operand(eax)); \ + __ bin_inst(i.TempRegister(0), i.InputRegister(0)); \ + __ lock(); \ + __ cmpxchg_inst(i.MemoryOperand(1), i.TempRegister(0)); \ + __ j(not_equal, &binop); \ + } while (false) + void CodeGenerator::AssembleDeconstructFrame() { __ mov(esp, ebp); __ pop(ebp); @@ -1130,18 +1157,10 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction( ASSEMBLE_IEEE754_UNOP(tanh); break; case kIA32Add: - if (HasImmediateInput(instr, 1)) { - __ add(i.InputOperand(0), i.InputImmediate(1)); - } else { - __ add(i.InputRegister(0), i.InputOperand(1)); - } + ASSEMBLE_BINOP(add); break; case kIA32And: - if (HasImmediateInput(instr, 1)) { - __ and_(i.InputOperand(0), i.InputImmediate(1)); - } else { - __ and_(i.InputRegister(0), i.InputOperand(1)); - } + ASSEMBLE_BINOP(and_); break; case kIA32Cmp: ASSEMBLE_COMPARE(cmp); @@ -1189,25 +1208,13 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction( __ neg(i.OutputOperand()); break; case kIA32Or: - if (HasImmediateInput(instr, 1)) { - __ or_(i.InputOperand(0), i.InputImmediate(1)); - } else { - __ or_(i.InputRegister(0), i.InputOperand(1)); - } + ASSEMBLE_BINOP(or_); break; case kIA32Xor: - if (HasImmediateInput(instr, 1)) { - __ xor_(i.InputOperand(0), i.InputImmediate(1)); - } else { - __ xor_(i.InputRegister(0), i.InputOperand(1)); - } + ASSEMBLE_BINOP(xor_); break; case kIA32Sub: - if (HasImmediateInput(instr, 1)) { - __ sub(i.InputOperand(0), i.InputImmediate(1)); - } else { - __ sub(i.InputRegister(0), i.InputOperand(1)); - } + ASSEMBLE_BINOP(sub); break; case kIA32Shl: if (HasImmediateInput(instr, 1)) { @@ -1614,10 +1621,10 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction( } break; case kSSEFloat64InsertLowWord32: - __ Pinsrd(i.OutputDoubleRegister(), i.InputOperand(1), 0); + __ Pinsrd(i.OutputDoubleRegister(), i.InputOperand(1), 0, true); break; case kSSEFloat64InsertHighWord32: - __ Pinsrd(i.OutputDoubleRegister(), i.InputOperand(1), 1); + __ Pinsrd(i.OutputDoubleRegister(), i.InputOperand(1), 1, true); break; case kSSEFloat64LoadLowWord32: __ movd(i.OutputDoubleRegister(), i.InputOperand(0)); @@ -1888,22 +1895,38 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction( } break; } - case kIA32Xchgb: { - size_t index = 0; - Operand operand = i.MemoryOperand(&index); - __ xchg_b(i.InputRegister(index), operand); + case kIA32I32x4Splat: { + XMMRegister dst = i.OutputSimd128Register(); + __ movd(dst, i.InputOperand(0)); + __ pshufd(dst, dst, 0x0); break; } - case kIA32Xchgw: { - size_t index = 0; - Operand operand = i.MemoryOperand(&index); - __ xchg_w(i.InputRegister(index), operand); + case kIA32I32x4ExtractLane: { + __ Pextrd(i.OutputRegister(), i.InputSimd128Register(0), i.InputInt8(1)); break; } - case kIA32Xchgl: { - size_t index = 0; - Operand operand = i.MemoryOperand(&index); - __ xchg(i.InputRegister(index), operand); + case kIA32I32x4ReplaceLane: { + __ Pinsrd(i.OutputSimd128Register(), i.InputOperand(2), i.InputInt8(1)); + break; + } + case kSSEI32x4Add: { + __ paddd(i.OutputSimd128Register(), i.InputOperand(1)); + break; + } + case kSSEI32x4Sub: { + __ psubd(i.OutputSimd128Register(), i.InputOperand(1)); + break; + } + case kAVXI32x4Add: { + CpuFeatureScope avx_scope(masm(), AVX); + __ vpaddd(i.OutputSimd128Register(), i.InputSimd128Register(0), + i.InputOperand(1)); + break; + } + case kAVXI32x4Sub: { + CpuFeatureScope avx_scope(masm(), AVX); + __ vpsubd(i.OutputSimd128Register(), i.InputSimd128Register(0), + i.InputOperand(1)); break; } case kCheckedLoadInt8: @@ -1952,6 +1975,90 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction( case kCheckedStoreWord64: UNREACHABLE(); // currently unsupported checked int64 load/store. break; + case kAtomicExchangeInt8: { + __ xchg_b(i.InputRegister(0), i.MemoryOperand(1)); + __ movsx_b(i.InputRegister(0), i.InputRegister(0)); + break; + } + case kAtomicExchangeUint8: { + __ xchg_b(i.InputRegister(0), i.MemoryOperand(1)); + __ movzx_b(i.InputRegister(0), i.InputRegister(0)); + break; + } + case kAtomicExchangeInt16: { + __ xchg_w(i.InputRegister(0), i.MemoryOperand(1)); + __ movsx_w(i.InputRegister(0), i.InputRegister(0)); + break; + } + case kAtomicExchangeUint16: { + __ xchg_w(i.InputRegister(0), i.MemoryOperand(1)); + __ movzx_w(i.InputRegister(0), i.InputRegister(0)); + break; + } + case kAtomicExchangeWord32: { + __ xchg(i.InputRegister(0), i.MemoryOperand(1)); + break; + } + case kAtomicCompareExchangeInt8: { + __ lock(); + __ cmpxchg_b(i.MemoryOperand(2), i.InputRegister(1)); + __ movsx_b(eax, eax); + break; + } + case kAtomicCompareExchangeUint8: { + __ lock(); + __ cmpxchg_b(i.MemoryOperand(2), i.InputRegister(1)); + __ movzx_b(eax, eax); + break; + } + case kAtomicCompareExchangeInt16: { + __ lock(); + __ cmpxchg_w(i.MemoryOperand(2), i.InputRegister(1)); + __ movsx_w(eax, eax); + break; + } + case kAtomicCompareExchangeUint16: { + __ lock(); + __ cmpxchg_w(i.MemoryOperand(2), i.InputRegister(1)); + __ movzx_w(eax, eax); + break; + } + case kAtomicCompareExchangeWord32: { + __ lock(); + __ cmpxchg(i.MemoryOperand(2), i.InputRegister(1)); + break; + } +#define ATOMIC_BINOP_CASE(op, inst) \ + case kAtomic##op##Int8: { \ + ASSEMBLE_ATOMIC_BINOP(inst, mov_b, cmpxchg_b); \ + __ movsx_b(eax, eax); \ + break; \ + } \ + case kAtomic##op##Uint8: { \ + ASSEMBLE_ATOMIC_BINOP(inst, mov_b, cmpxchg_b); \ + __ movzx_b(eax, eax); \ + break; \ + } \ + case kAtomic##op##Int16: { \ + ASSEMBLE_ATOMIC_BINOP(inst, mov_w, cmpxchg_w); \ + __ movsx_w(eax, eax); \ + break; \ + } \ + case kAtomic##op##Uint16: { \ + ASSEMBLE_ATOMIC_BINOP(inst, mov_w, cmpxchg_w); \ + __ movzx_w(eax, eax); \ + break; \ + } \ + case kAtomic##op##Word32: { \ + ASSEMBLE_ATOMIC_BINOP(inst, mov, cmpxchg); \ + break; \ + } + ATOMIC_BINOP_CASE(Add, add) + ATOMIC_BINOP_CASE(Sub, sub) + ATOMIC_BINOP_CASE(And, and_) + ATOMIC_BINOP_CASE(Or, or_) + ATOMIC_BINOP_CASE(Xor, xor_) +#undef ATOMIC_BINOP_CASE case kAtomicLoadInt8: case kAtomicLoadUint8: case kAtomicLoadInt16: @@ -2179,7 +2286,9 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleDeoptimizerCall( Address deopt_entry = Deoptimizer::GetDeoptimizationEntry( isolate(), deoptimization_id, bailout_type); if (deopt_entry == nullptr) return kTooManyDeoptimizationBailouts; - __ RecordDeoptReason(deoptimization_reason, pos, deoptimization_id); + if (isolate()->NeedsSourcePositionsForProfiling()) { + __ RecordDeoptReason(deoptimization_reason, pos, deoptimization_id); + } __ call(deopt_entry, RelocInfo::RUNTIME_ENTRY); return kSuccess; } @@ -2423,6 +2532,7 @@ void CodeGenerator::AssembleReturn(InstructionOperand* pop) { } } +void CodeGenerator::FinishCode() {} void CodeGenerator::AssembleMove(InstructionOperand* source, InstructionOperand* destination) { |