diff options
Diffstat (limited to 'deps/v8/src/codegen/s390/macro-assembler-s390.h')
-rw-r--r-- | deps/v8/src/codegen/s390/macro-assembler-s390.h | 134 |
1 files changed, 63 insertions, 71 deletions
diff --git a/deps/v8/src/codegen/s390/macro-assembler-s390.h b/deps/v8/src/codegen/s390/macro-assembler-s390.h index 6a91f1c096..06edec6516 100644 --- a/deps/v8/src/codegen/s390/macro-assembler-s390.h +++ b/deps/v8/src/codegen/s390/macro-assembler-s390.h @@ -41,9 +41,9 @@ Register GetRegisterThatIsNotOneOf(Register reg1, Register reg2 = no_reg, Register reg5 = no_reg, Register reg6 = no_reg); -class V8_EXPORT_PRIVATE TurboAssembler : public TurboAssemblerBase { +class V8_EXPORT_PRIVATE MacroAssembler : public MacroAssemblerBase { public: - using TurboAssemblerBase::TurboAssemblerBase; + using MacroAssemblerBase::MacroAssemblerBase; void CallBuiltin(Builtin builtin, Condition cond = al); void TailCallBuiltin(Builtin builtin, Condition cond = al); @@ -136,7 +136,9 @@ class V8_EXPORT_PRIVATE TurboAssembler : public TurboAssemblerBase { void LoadEntryFromBuiltinIndex(Register builtin_index); void LoadEntryFromBuiltin(Builtin builtin, Register destination); MemOperand EntryFromBuiltinAsOperand(Builtin builtin); - void LoadCodeObjectEntry(Register destination, Register code_object); + + // Load the code entry point from the Code object. + void LoadCodeEntry(Register destination, Register code_object); void CallCodeObject(Register code_object); void JumpCodeObject(Register code_object, JumpMode jump_mode = JumpMode::kJump); @@ -220,6 +222,7 @@ class V8_EXPORT_PRIVATE TurboAssembler : public TurboAssemblerBase { LoadRoot(destination, index, al); } void LoadRoot(Register destination, RootIndex index, Condition cond); + void LoadTaggedRoot(Register destination, RootIndex index); //-------------------------------------------------------------------------- // S390 Macro Assemblers for Instructions //-------------------------------------------------------------------------- @@ -914,12 +917,23 @@ class V8_EXPORT_PRIVATE TurboAssembler : public TurboAssemblerBase { // garbage collection, since that might move the code and invalidate the // return address (unless this is somehow accounted for by the called // function). - void CallCFunction(ExternalReference function, int num_arguments); - void CallCFunction(Register function, int num_arguments); - void CallCFunction(ExternalReference function, int num_reg_arguments, - int num_double_arguments); - void CallCFunction(Register function, int num_reg_arguments, - int num_double_arguments); + enum class SetIsolateDataSlots { + kNo, + kYes, + }; + void CallCFunction( + ExternalReference function, int num_arguments, + SetIsolateDataSlots set_isolate_data_slots = SetIsolateDataSlots::kYes); + void CallCFunction( + Register function, int num_arguments, + SetIsolateDataSlots set_isolate_data_slots = SetIsolateDataSlots::kYes); + void CallCFunction( + ExternalReference function, int num_reg_arguments, + int num_double_arguments, + SetIsolateDataSlots set_isolate_data_slots = SetIsolateDataSlots::kYes); + void CallCFunction( + Register function, int num_reg_arguments, int num_double_arguments, + SetIsolateDataSlots set_isolate_data_slots = SetIsolateDataSlots::kYes); void MovFromFloatParameter(DoubleRegister dst); void MovFromFloatResult(DoubleRegister dst); @@ -940,11 +954,11 @@ class V8_EXPORT_PRIVATE TurboAssembler : public TurboAssemblerBase { // Calls Abort(msg) if the condition cond is not satisfied. // Use --debug_code to enable. void Assert(Condition cond, AbortReason reason, - CRegister cr = cr7) NOOP_UNLESS_DEBUG_CODE + CRegister cr = cr7) NOOP_UNLESS_DEBUG_CODE; // Like Assert(), but without condition. // Use --debug-code to enable. - void AssertUnreachable(AbortReason reason) NOOP_UNLESS_DEBUG_CODE + void AssertUnreachable(AbortReason reason) NOOP_UNLESS_DEBUG_CODE; // Like Assert(), but always enabled. void Check(Condition cond, AbortReason reason, CRegister cr = cr7); @@ -1079,8 +1093,8 @@ class V8_EXPORT_PRIVATE TurboAssembler : public TurboAssemblerBase { } // Abort execution if argument is a smi, enabled via --debug-code. - void AssertNotSmi(Register object) NOOP_UNLESS_DEBUG_CODE - void AssertSmi(Register object) NOOP_UNLESS_DEBUG_CODE + void AssertNotSmi(Register object) NOOP_UNLESS_DEBUG_CODE; + void AssertSmi(Register object) NOOP_UNLESS_DEBUG_CODE; // Activation support. void EnterFrame(StackFrame::Type type, @@ -1209,6 +1223,11 @@ class V8_EXPORT_PRIVATE TurboAssembler : public TurboAssemblerBase { Simd128Register scratch3); void I32x4DotI16x8S(Simd128Register dst, Simd128Register src1, Simd128Register src2, Simd128Register scratch); + void I16x8DotI8x16S(Simd128Register dst, Simd128Register src1, + Simd128Register src2, Simd128Register scratch); + void I32x4DotI8x16AddS(Simd128Register dst, Simd128Register src1, + Simd128Register src2, Simd128Register src3, + Simd128Register scratch1, Simd128Register scratch2); void I16x8Q15MulRSatS(Simd128Register dst, Simd128Register src1, Simd128Register src2, Simd128Register scratch1, Simd128Register scratch2, Simd128Register scratch3); @@ -1455,17 +1474,11 @@ class V8_EXPORT_PRIVATE TurboAssembler : public TurboAssemblerBase { #endif } - // Loads a field containing a HeapObject and decompresses it if pointer - // compression is enabled. - void LoadTaggedPointerField(const Register& destination, - const MemOperand& field_operand, - const Register& scratch = no_reg); - void LoadTaggedSignedField(Register destination, MemOperand field_operand); - // Loads a field containing any tagged value and decompresses it if necessary. - void LoadAnyTaggedField(const Register& destination, - const MemOperand& field_operand, - const Register& scratch = no_reg); + void LoadTaggedField(const Register& destination, + const MemOperand& field_operand, + const Register& scratch = no_reg); + void LoadTaggedSignedField(Register destination, MemOperand field_operand); // Loads a field containing smi value and untags it. void SmiUntagField(Register dst, const MemOperand& src); @@ -1477,10 +1490,9 @@ class V8_EXPORT_PRIVATE TurboAssembler : public TurboAssemblerBase { void DecompressTaggedSigned(Register destination, MemOperand field_operand); void DecompressTaggedSigned(Register destination, Register src); - void DecompressTaggedPointer(Register destination, MemOperand field_operand); - void DecompressTaggedPointer(Register destination, Register source); - void DecompressAnyTagged(Register destination, MemOperand field_operand); - void DecompressAnyTagged(Register destination, Register source); + void DecompressTagged(Register destination, MemOperand field_operand); + void DecompressTagged(Register destination, Register source); + void DecompressTagged(const Register& destination, Tagged_t immediate); // CountLeadingZeros will corrupt the scratch register pair (eg. r0:r1) void CountLeadingZerosU32(Register dst, Register src, @@ -1492,22 +1504,6 @@ class V8_EXPORT_PRIVATE TurboAssembler : public TurboAssemblerBase { void CountTrailingZerosU64(Register dst, Register src, Register scratch_pair = r0); - private: - static const int kSmiShift = kSmiTagSize + kSmiShiftSize; - - void CallCFunctionHelper(Register function, int num_reg_arguments, - int num_double_arguments); - - void Jump(intptr_t target, RelocInfo::Mode rmode, Condition cond = al); - int CalculateStackPassedWords(int num_reg_arguments, - int num_double_arguments); -}; - -// MacroAssembler implements a collection of frequently used macros. -class V8_EXPORT_PRIVATE MacroAssembler : public TurboAssembler { - public: - using TurboAssembler::TurboAssembler; - void LoadStackLimit(Register destination, StackLimitKind kind); // It assumes that the arguments are located below the stack pointer. // argc is the number of arguments not including the receiver. @@ -1521,24 +1517,17 @@ class V8_EXPORT_PRIVATE MacroAssembler : public TurboAssembler { StoreU64(rec, MemOperand(sp, 0)); } - void CallRuntime(const Runtime::Function* f, int num_arguments, - SaveFPRegsMode save_doubles = SaveFPRegsMode::kIgnore); - void CallRuntimeSaveDoubles(Runtime::FunctionId fid) { - const Runtime::Function* function = Runtime::FunctionForId(fid); - CallRuntime(function, function->nargs, SaveFPRegsMode::kSave); - } + void CallRuntime(const Runtime::Function* f, int num_arguments); // Convenience function: Same as above, but takes the fid instead. - void CallRuntime(Runtime::FunctionId fid, - SaveFPRegsMode save_doubles = SaveFPRegsMode::kIgnore) { + void CallRuntime(Runtime::FunctionId fid) { const Runtime::Function* function = Runtime::FunctionForId(fid); - CallRuntime(function, function->nargs, save_doubles); + CallRuntime(function, function->nargs); } // Convenience function: Same as above, but takes the fid instead. - void CallRuntime(Runtime::FunctionId fid, int num_arguments, - SaveFPRegsMode save_doubles = SaveFPRegsMode::kIgnore) { - CallRuntime(Runtime::FunctionForId(fid), num_arguments, save_doubles); + void CallRuntime(Runtime::FunctionId fid, int num_arguments) { + CallRuntime(Runtime::FunctionForId(fid), num_arguments); } // Convenience function: tail call a runtime routine (jump). @@ -1592,9 +1581,6 @@ class V8_EXPORT_PRIVATE MacroAssembler : public TurboAssembler { void JumpToExternalReference(const ExternalReference& builtin, bool builtin_exit_frame = false); - // Generates a trampoline to jump to the off-heap instruction stream. - void JumpToOffHeapInstructionStream(Address entry); - // Compare the object in a register to a value and jump if they are equal. void JumpIfRoot(Register with, RootIndex index, Label* if_equal) { CompareRoot(with, index); @@ -1686,15 +1672,12 @@ class V8_EXPORT_PRIVATE MacroAssembler : public TurboAssembler { // Enter exit frame. // stack_space - extra stack space, used for parameters before call to C. - // At least one slot (for the return address) should be provided. - void EnterExitFrame(bool save_doubles, int stack_space = 1, - StackFrame::Type frame_type = StackFrame::EXIT); + void EnterExitFrame(int stack_space, StackFrame::Type frame_type); // Leave the current exit frame. Expects the return value in r0. // Expect the number of values, pushed prior to the exit frame, to // remove in a register (or no_reg, if there is nothing to remove). - void LeaveExitFrame(bool save_doubles, Register argument_count, - bool argument_count_is_length = false); + void LeaveExitFrame(Register argument_count, bool argument_count_is_length); // Load the global proxy from the current context. void LoadGlobalProxy(Register dst) { @@ -1726,27 +1709,27 @@ class V8_EXPORT_PRIVATE MacroAssembler : public TurboAssembler { // Abort execution if argument is not a Constructor, enabled via --debug-code. void AssertConstructor(Register object, - Register scratch) NOOP_UNLESS_DEBUG_CODE + Register scratch) NOOP_UNLESS_DEBUG_CODE; // Abort execution if argument is not a JSFunction, enabled via --debug-code. - void AssertFunction(Register object) NOOP_UNLESS_DEBUG_CODE + void AssertFunction(Register object) NOOP_UNLESS_DEBUG_CODE; // Abort execution if argument is not a callable JSFunction, enabled via // --debug-code. - void AssertCallableFunction(Register object) NOOP_UNLESS_DEBUG_CODE + void AssertCallableFunction(Register object) NOOP_UNLESS_DEBUG_CODE; // Abort execution if argument is not a JSBoundFunction, // enabled via --debug-code. - void AssertBoundFunction(Register object) NOOP_UNLESS_DEBUG_CODE + void AssertBoundFunction(Register object) NOOP_UNLESS_DEBUG_CODE; // Abort execution if argument is not a JSGeneratorObject (or subclass), // enabled via --debug-code. - void AssertGeneratorObject(Register object) NOOP_UNLESS_DEBUG_CODE + void AssertGeneratorObject(Register object) NOOP_UNLESS_DEBUG_CODE; // Abort execution if argument is not undefined or an AllocationSite, enabled // via --debug-code. void AssertUndefinedOrAllocationSite(Register object, - Register scratch) NOOP_UNLESS_DEBUG_CODE + Register scratch) NOOP_UNLESS_DEBUG_CODE; template <typename Field> void DecodeField(Register dst, Register src) { @@ -1760,7 +1743,7 @@ class V8_EXPORT_PRIVATE MacroAssembler : public TurboAssembler { // Tiering support. void AssertFeedbackVector(Register object, - Register scratch) NOOP_UNLESS_DEBUG_CODE + Register scratch) NOOP_UNLESS_DEBUG_CODE; void ReplaceClosureCodeWithOptimizedCode(Register optimized_code, Register closure, Register scratch1, Register slot_address); @@ -1798,11 +1781,20 @@ class V8_EXPORT_PRIVATE MacroAssembler : public TurboAssembler { LinkRegisterStatus lr_status, SaveFPRegsMode save_fp, SmiCheck smi_check = SmiCheck::kInline); - void TestCodeTIsMarkedForDeoptimization(Register codet, Register scratch); + void TestCodeIsMarkedForDeoptimization(Register code, Register scratch); Operand ClearedValue() const; private: static const int kSmiShift = kSmiTagSize + kSmiShiftSize; + + void CallCFunctionHelper(Register function, int num_reg_arguments, + int num_double_arguments, + SetIsolateDataSlots set_isolate_data_slots); + + void Jump(intptr_t target, RelocInfo::Mode rmode, Condition cond = al); + int CalculateStackPassedWords(int num_reg_arguments, + int num_double_arguments); + // Helper functions for generating invokes. void InvokePrologue(Register expected_parameter_count, Register actual_parameter_count, Label* done, |