diff options
Diffstat (limited to 'deps/v8/src/codegen/ia32/macro-assembler-ia32.h')
-rw-r--r-- | deps/v8/src/codegen/ia32/macro-assembler-ia32.h | 59 |
1 files changed, 57 insertions, 2 deletions
diff --git a/deps/v8/src/codegen/ia32/macro-assembler-ia32.h b/deps/v8/src/codegen/ia32/macro-assembler-ia32.h index 4d2ea96a92..40b542f375 100644 --- a/deps/v8/src/codegen/ia32/macro-assembler-ia32.h +++ b/deps/v8/src/codegen/ia32/macro-assembler-ia32.h @@ -24,6 +24,26 @@ using MemOperand = Operand; enum RememberedSetAction { EMIT_REMEMBERED_SET, OMIT_REMEMBERED_SET }; enum SmiCheck { INLINE_SMI_CHECK, OMIT_SMI_CHECK }; +// Convenient class to access arguments below the stack pointer. +class StackArgumentsAccessor { + public: + // argc = the number of arguments not including the receiver. + explicit StackArgumentsAccessor(Register argc) : argc_(argc) { + DCHECK_NE(argc_, no_reg); + } + + // Argument 0 is the receiver (despite argc not including the receiver). + Operand operator[](int index) const { return GetArgumentOperand(index); } + + Operand GetArgumentOperand(int index) const; + Operand GetReceiverOperand() const { return GetArgumentOperand(0); } + + private: + const Register argc_; + + DISALLOW_IMPLICIT_CONSTRUCTORS(StackArgumentsAccessor); +}; + class V8_EXPORT_PRIVATE TurboAssembler : public TurboAssemblerBase { public: using TurboAssemblerBase::TurboAssemblerBase; @@ -108,8 +128,10 @@ class V8_EXPORT_PRIVATE TurboAssembler : public TurboAssemblerBase { void RetpolineJump(Register reg); void Trap() override; + void DebugBreak() override; - void CallForDeoptimization(Address target, int deopt_id); + void CallForDeoptimization(Address target, int deopt_id, Label* exit, + DeoptimizeKind kind); // Jump the register contains a smi. inline void JumpIfSmi(Register value, Label* smi_label, @@ -215,7 +237,6 @@ class V8_EXPORT_PRIVATE TurboAssembler : public TurboAssemblerBase { void LoadAddress(Register destination, ExternalReference source); - void CompareRealStackLimit(Register with); void CompareRoot(Register with, RootIndex index); void CompareRoot(Register with, Register scratch, RootIndex index); @@ -284,6 +305,7 @@ class V8_EXPORT_PRIVATE TurboAssembler : public TurboAssemblerBase { AVX_OP3_XO(Packsswb, packsswb) AVX_OP3_XO(Packuswb, packuswb) AVX_OP3_XO(Paddusb, paddusb) + AVX_OP3_XO(Pand, pand) AVX_OP3_XO(Pcmpeqb, pcmpeqb) AVX_OP3_XO(Pcmpeqw, pcmpeqw) AVX_OP3_XO(Pcmpeqd, pcmpeqd) @@ -335,8 +357,14 @@ class V8_EXPORT_PRIVATE TurboAssembler : public TurboAssemblerBase { AVX_PACKED_OP3(Minpd, minpd) AVX_PACKED_OP3(Maxpd, maxpd) AVX_PACKED_OP3(Cmpunordpd, cmpunordpd) + AVX_PACKED_OP3(Psllw, psllw) + AVX_PACKED_OP3(Pslld, pslld) AVX_PACKED_OP3(Psllq, psllq) + AVX_PACKED_OP3(Psrlw, psrlw) + AVX_PACKED_OP3(Psrld, psrld) AVX_PACKED_OP3(Psrlq, psrlq) + AVX_PACKED_OP3(Psraw, psraw) + AVX_PACKED_OP3(Psrad, psrad) AVX_PACKED_OP3(Paddq, paddq) AVX_PACKED_OP3(Psubq, psubq) AVX_PACKED_OP3(Pmuludq, pmuludq) @@ -344,7 +372,14 @@ class V8_EXPORT_PRIVATE TurboAssembler : public TurboAssemblerBase { AVX_PACKED_OP3(Pavgw, pavgw) #undef AVX_PACKED_OP3 + AVX_PACKED_OP3_WITH_TYPE(Psllw, psllw, XMMRegister, uint8_t) + AVX_PACKED_OP3_WITH_TYPE(Pslld, pslld, XMMRegister, uint8_t) AVX_PACKED_OP3_WITH_TYPE(Psllq, psllq, XMMRegister, uint8_t) + AVX_PACKED_OP3_WITH_TYPE(Psrlw, psrlw, XMMRegister, uint8_t) + AVX_PACKED_OP3_WITH_TYPE(Psrld, psrld, XMMRegister, uint8_t) + AVX_PACKED_OP3_WITH_TYPE(Psrlq, psrlq, XMMRegister, uint8_t) + AVX_PACKED_OP3_WITH_TYPE(Psraw, psraw, XMMRegister, uint8_t) + AVX_PACKED_OP3_WITH_TYPE(Psrad, psrad, XMMRegister, uint8_t) #undef AVX_PACKED_OP3_WITH_TYPE // Non-SSE2 instructions. @@ -369,6 +404,16 @@ class V8_EXPORT_PRIVATE TurboAssembler : public TurboAssemblerBase { AVX_OP2_XO_SSE3(Movddup, movddup) #undef AVX_OP2_XO_SSE3 + +#define AVX_OP2_XO_SSSE3(macro_name, name) \ + AVX_OP2_WITH_TYPE_SCOPE(macro_name, name, XMMRegister, XMMRegister, SSSE3) \ + AVX_OP2_WITH_TYPE_SCOPE(macro_name, name, XMMRegister, Operand, SSSE3) + AVX_OP2_XO_SSSE3(Pabsb, pabsb) + AVX_OP2_XO_SSSE3(Pabsw, pabsw) + AVX_OP2_XO_SSSE3(Pabsd, pabsd) + +#undef AVX_OP2_XO_SSE3 + #define AVX_OP2_XO_SSE4(macro_name, name) \ AVX_OP2_WITH_TYPE_SCOPE(macro_name, name, XMMRegister, XMMRegister, SSE4_1) \ AVX_OP2_WITH_TYPE_SCOPE(macro_name, name, XMMRegister, Operand, SSE4_1) @@ -494,6 +539,16 @@ class V8_EXPORT_PRIVATE TurboAssembler : public TurboAssemblerBase { // TODO(860429): Remove remaining poisoning infrastructure on ia32. void ResetSpeculationPoisonRegister() { UNREACHABLE(); } + // Control-flow integrity: + + // Define a function entrypoint. This doesn't emit any code for this + // architecture, as control-flow integrity is not supported for it. + void CodeEntry() {} + // Define an exception handler. + void ExceptionHandler() {} + // Define an exception handler and bind a label. + void BindExceptionHandler(Label* label) { bind(label); } + void CallRecordWriteStub(Register object, Register address, RememberedSetAction remembered_set_action, SaveFPRegsMode fp_mode, Handle<Code> code_target, |