summaryrefslogtreecommitdiff
path: root/deps/v8/src/s390
diff options
context:
space:
mode:
Diffstat (limited to 'deps/v8/src/s390')
-rw-r--r--deps/v8/src/s390/assembler-s390-inl.h42
-rw-r--r--deps/v8/src/s390/assembler-s390.cc38
-rw-r--r--deps/v8/src/s390/assembler-s390.h5
-rw-r--r--deps/v8/src/s390/code-stubs-s390.cc34
-rw-r--r--deps/v8/src/s390/codegen-s390.cc6
-rw-r--r--deps/v8/src/s390/constants-s390.cc312
-rw-r--r--deps/v8/src/s390/interface-descriptors-s390.cc8
-rw-r--r--deps/v8/src/s390/macro-assembler-s390.cc55
-rw-r--r--deps/v8/src/s390/macro-assembler-s390.h6
-rw-r--r--deps/v8/src/s390/simulator-s390.cc198
-rw-r--r--deps/v8/src/s390/simulator-s390.h110
11 files changed, 303 insertions, 511 deletions
diff --git a/deps/v8/src/s390/assembler-s390-inl.h b/deps/v8/src/s390/assembler-s390-inl.h
index d8d7ce4256..6323730b99 100644
--- a/deps/v8/src/s390/assembler-s390-inl.h
+++ b/deps/v8/src/s390/assembler-s390-inl.h
@@ -69,9 +69,9 @@ void RelocInfo::apply(intptr_t delta) {
} else {
// mov sequence
DCHECK(IsInternalReferenceEncoded(rmode_));
- Address target = Assembler::target_address_at(pc_, host_);
- Assembler::set_target_address_at(nullptr, pc_, host_, target + delta,
- SKIP_ICACHE_FLUSH);
+ Address target = Assembler::target_address_at(pc_, constant_pool_);
+ Assembler::set_target_address_at(nullptr, pc_, constant_pool_,
+ target + delta, SKIP_ICACHE_FLUSH);
}
}
@@ -82,7 +82,7 @@ Address RelocInfo::target_internal_reference() {
} else {
// mov sequence
DCHECK(IsInternalReferenceEncoded(rmode_));
- return Assembler::target_address_at(pc_, host_);
+ return Assembler::target_address_at(pc_, constant_pool_);
}
}
@@ -93,7 +93,7 @@ Address RelocInfo::target_internal_reference_address() {
Address RelocInfo::target_address() {
DCHECK(IsCodeTarget(rmode_) || IsRuntimeEntry(rmode_) || IsWasmCall(rmode_));
- return Assembler::target_address_at(pc_, host_);
+ return Assembler::target_address_at(pc_, constant_pool_);
}
Address RelocInfo::target_address_address() {
@@ -118,18 +118,6 @@ Address RelocInfo::constant_pool_entry_address() {
int RelocInfo::target_address_size() { return Assembler::kSpecialTargetSize; }
-Address Assembler::target_address_at(Address pc, Code* code) {
- Address constant_pool = code ? code->constant_pool() : nullptr;
- return target_address_at(pc, constant_pool);
-}
-
-void Assembler::set_target_address_at(Isolate* isolate, Address pc, Code* code,
- Address target,
- ICacheFlushMode icache_flush_mode) {
- Address constant_pool = code ? code->constant_pool() : nullptr;
- set_target_address_at(isolate, pc, constant_pool, target, icache_flush_mode);
-}
-
Address Assembler::target_address_from_return_address(Address pc) {
// Returns the address of the call target from the return address that will
// be returned to after a call.
@@ -153,15 +141,15 @@ Handle<Object> Assembler::code_target_object_handle_at(Address pc) {
HeapObject* RelocInfo::target_object() {
DCHECK(IsCodeTarget(rmode_) || rmode_ == EMBEDDED_OBJECT);
- return HeapObject::cast(
- reinterpret_cast<Object*>(Assembler::target_address_at(pc_, host_)));
+ return HeapObject::cast(reinterpret_cast<Object*>(
+ Assembler::target_address_at(pc_, constant_pool_)));
}
Handle<HeapObject> RelocInfo::target_object_handle(Assembler* origin) {
DCHECK(IsCodeTarget(rmode_) || rmode_ == EMBEDDED_OBJECT);
if (rmode_ == EMBEDDED_OBJECT) {
return Handle<HeapObject>(reinterpret_cast<HeapObject**>(
- Assembler::target_address_at(pc_, host_)));
+ Assembler::target_address_at(pc_, constant_pool_)));
} else {
return Handle<HeapObject>::cast(origin->code_target_object_handle_at(pc_));
}
@@ -171,7 +159,7 @@ void RelocInfo::set_target_object(HeapObject* target,
WriteBarrierMode write_barrier_mode,
ICacheFlushMode icache_flush_mode) {
DCHECK(IsCodeTarget(rmode_) || rmode_ == EMBEDDED_OBJECT);
- Assembler::set_target_address_at(target->GetIsolate(), pc_, host_,
+ Assembler::set_target_address_at(target->GetIsolate(), pc_, constant_pool_,
reinterpret_cast<Address>(target),
icache_flush_mode);
if (write_barrier_mode == UPDATE_WRITE_BARRIER && host() != nullptr) {
@@ -183,7 +171,7 @@ void RelocInfo::set_target_object(HeapObject* target,
Address RelocInfo::target_external_reference() {
DCHECK(rmode_ == EXTERNAL_REFERENCE);
- return Assembler::target_address_at(pc_, host_);
+ return Assembler::target_address_at(pc_, constant_pool_);
}
Address RelocInfo::target_runtime_entry(Assembler* origin) {
@@ -209,10 +197,10 @@ void RelocInfo::WipeOut(Isolate* isolate) {
} else if (IsInternalReferenceEncoded(rmode_)) {
// mov sequence
// Currently used only by deserializer, no need to flush.
- Assembler::set_target_address_at(isolate, pc_, host_, nullptr,
+ Assembler::set_target_address_at(isolate, pc_, constant_pool_, nullptr,
SKIP_ICACHE_FLUSH);
} else {
- Assembler::set_target_address_at(isolate, pc_, host_, nullptr);
+ Assembler::set_target_address_at(isolate, pc_, constant_pool_, nullptr);
}
}
@@ -294,14 +282,14 @@ Address Assembler::target_address_at(Address pc, Address constant_pool) {
// There is a FIXED_SEQUENCE assumption here
void Assembler::deserialization_set_special_target_at(
Isolate* isolate, Address instruction_payload, Code* code, Address target) {
- set_target_address_at(isolate, instruction_payload, code, target);
+ set_target_address_at(isolate, instruction_payload,
+ code ? code->constant_pool() : nullptr, target);
}
void Assembler::deserialization_set_target_internal_reference_at(
Isolate* isolate, Address pc, Address target, RelocInfo::Mode mode) {
if (RelocInfo::IsInternalReferenceEncoded(mode)) {
- Code* code = nullptr;
- set_target_address_at(isolate, pc, code, target, SKIP_ICACHE_FLUSH);
+ set_target_address_at(isolate, pc, nullptr, target, SKIP_ICACHE_FLUSH);
} else {
Memory::Address_at(pc) = target;
}
diff --git a/deps/v8/src/s390/assembler-s390.cc b/deps/v8/src/s390/assembler-s390.cc
index 70701beb72..166da1c451 100644
--- a/deps/v8/src/s390/assembler-s390.cc
+++ b/deps/v8/src/s390/assembler-s390.cc
@@ -271,22 +271,23 @@ bool RelocInfo::IsCodedSpecially() {
bool RelocInfo::IsInConstantPool() { return false; }
Address RelocInfo::embedded_address() const {
- return Assembler::target_address_at(pc_, host_);
+ return Assembler::target_address_at(pc_, constant_pool_);
}
uint32_t RelocInfo::embedded_size() const {
- return static_cast<uint32_t>(
- reinterpret_cast<intptr_t>(Assembler::target_address_at(pc_, host_)));
+ return static_cast<uint32_t>(reinterpret_cast<intptr_t>(
+ Assembler::target_address_at(pc_, constant_pool_)));
}
void RelocInfo::set_embedded_address(Isolate* isolate, Address address,
ICacheFlushMode flush_mode) {
- Assembler::set_target_address_at(isolate, pc_, host_, address, flush_mode);
+ Assembler::set_target_address_at(isolate, pc_, constant_pool_, address,
+ flush_mode);
}
void RelocInfo::set_embedded_size(Isolate* isolate, uint32_t size,
ICacheFlushMode flush_mode) {
- Assembler::set_target_address_at(isolate, pc_, host_,
+ Assembler::set_target_address_at(isolate, pc_, constant_pool_,
reinterpret_cast<Address>(size), flush_mode);
}
@@ -441,7 +442,7 @@ int Assembler::target_at(int pos) {
} else if (LLILF == opcode || BRCL == opcode || LARL == opcode ||
BRASL == opcode) {
int32_t imm32 =
- static_cast<int32_t>(instr & (static_cast<uint64_t>(0xffffffff)));
+ static_cast<int32_t>(instr & (static_cast<uint64_t>(0xFFFFFFFF)));
if (LLILF != opcode)
imm32 <<= 1; // BR* + LARL treat immediate in # of halfwords
if (imm32 == 0) return kEndOfChain;
@@ -465,14 +466,14 @@ void Assembler::target_at_put(int pos, int target_pos, bool* is_branch) {
if (BRC == opcode || BRCT == opcode || BRCTG == opcode) {
int16_t imm16 = target_pos - pos;
- instr &= (~0xffff);
+ instr &= (~0xFFFF);
DCHECK(is_int16(imm16));
instr_at_put<FourByteInstr>(pos, instr | (imm16 >> 1));
return;
} else if (BRCL == opcode || LARL == opcode || BRASL == opcode) {
// Immediate is in # of halfwords
int32_t imm32 = target_pos - pos;
- instr &= (~static_cast<uint64_t>(0xffffffff));
+ instr &= (~static_cast<uint64_t>(0xFFFFFFFF));
instr_at_put<SixByteInstr>(pos, instr | (imm32 >> 1));
return;
} else if (LLILF == opcode) {
@@ -480,7 +481,7 @@ void Assembler::target_at_put(int pos, int target_pos, bool* is_branch) {
// Emitted label constant, not part of a branch.
// Make label relative to Code* of generated Code object.
int32_t imm32 = target_pos + (Code::kHeaderSize - kHeapObjectTag);
- instr &= (~static_cast<uint64_t>(0xffffffff));
+ instr &= (~static_cast<uint64_t>(0xFFFFFFFF));
instr_at_put<SixByteInstr>(pos, instr | imm32);
return;
}
@@ -1491,8 +1492,8 @@ void Assembler::ark(Register r1, Register r2, Register r3) {
void Assembler::asi(const MemOperand& opnd, const Operand& imm) {
DCHECK(is_int8(imm.immediate()));
DCHECK(is_int20(opnd.offset()));
- siy_form(ASI, Operand(0xff & imm.immediate()), opnd.rb(),
- 0xfffff & opnd.offset());
+ siy_form(ASI, Operand(0xFF & imm.immediate()), opnd.rb(),
+ 0xFFFFF & opnd.offset());
}
// -----------------------
@@ -1515,8 +1516,8 @@ void Assembler::agrk(Register r1, Register r2, Register r3) {
void Assembler::agsi(const MemOperand& opnd, const Operand& imm) {
DCHECK(is_int8(imm.immediate()));
DCHECK(is_int20(opnd.offset()));
- siy_form(AGSI, Operand(0xff & imm.immediate()), opnd.rb(),
- 0xfffff & opnd.offset());
+ siy_form(AGSI, Operand(0xFF & imm.immediate()), opnd.rb(),
+ 0xFFFFF & opnd.offset());
}
// -------------------------------
@@ -2091,9 +2092,9 @@ void Assembler::fidbra(DoubleRegister d1, DoubleRegister d2, FIDBRA_MASK3 m3) {
bool Assembler::IsNop(SixByteInstr instr, int type) {
DCHECK((0 == type) || (DEBUG_BREAK_NOP == type));
if (DEBUG_BREAK_NOP == type) {
- return ((instr & 0xffffffff) == 0xa53b0000); // oill r3, 0
+ return ((instr & 0xFFFFFFFF) == 0xA53B0000); // oill r3, 0
}
- return ((instr & 0xffff) == 0x1800); // lr r0,r0
+ return ((instr & 0xFFFF) == 0x1800); // lr r0,r0
}
// dummy instruction reserved for special use.
@@ -2213,8 +2214,7 @@ void Assembler::EmitRelocations() {
it != relocations_.end(); it++) {
RelocInfo::Mode rmode = it->rmode();
Address pc = buffer_ + it->position();
- Code* code = nullptr;
- RelocInfo rinfo(pc, rmode, it->data(), code);
+ RelocInfo rinfo(pc, rmode, it->data(), nullptr);
// Fix up internal references now that they are guaranteed to be bound.
if (RelocInfo::IsInternalReference(rmode)) {
@@ -2223,8 +2223,8 @@ void Assembler::EmitRelocations() {
Memory::Address_at(pc) = buffer_ + pos;
} else if (RelocInfo::IsInternalReferenceEncoded(rmode)) {
// mov sequence
- intptr_t pos = reinterpret_cast<intptr_t>(target_address_at(pc, code));
- set_target_address_at(nullptr, pc, code, buffer_ + pos,
+ intptr_t pos = reinterpret_cast<intptr_t>(target_address_at(pc, nullptr));
+ set_target_address_at(nullptr, pc, nullptr, buffer_ + pos,
SKIP_ICACHE_FLUSH);
}
diff --git a/deps/v8/src/s390/assembler-s390.h b/deps/v8/src/s390/assembler-s390.h
index e9863197a7..4a5945de87 100644
--- a/deps/v8/src/s390/assembler-s390.h
+++ b/deps/v8/src/s390/assembler-s390.h
@@ -276,6 +276,7 @@ constexpr Register kLithiumScratch = r1; // lithium scratch.
constexpr Register kRootRegister = r10; // Roots array pointer.
constexpr Register cp = r13; // JavaScript context pointer.
+constexpr bool kPadArguments = false;
constexpr bool kSimpleFPAliasing = true;
constexpr bool kSimdMaskRegisters = false;
@@ -556,10 +557,6 @@ class Assembler : public AssemblerBase {
INLINE(static void set_target_address_at(
Isolate* isolate, Address pc, Address constant_pool, Address target,
ICacheFlushMode icache_flush_mode = FLUSH_ICACHE_IF_NEEDED));
- INLINE(static Address target_address_at(Address pc, Code* code));
- INLINE(static void set_target_address_at(
- Isolate* isolate, Address pc, Code* code, Address target,
- ICacheFlushMode icache_flush_mode = FLUSH_ICACHE_IF_NEEDED));
// Return the code target address at a call site from the return address
// of that call in the instruction stream.
diff --git a/deps/v8/src/s390/code-stubs-s390.cc b/deps/v8/src/s390/code-stubs-s390.cc
index d33d09c657..783b995c72 100644
--- a/deps/v8/src/s390/code-stubs-s390.cc
+++ b/deps/v8/src/s390/code-stubs-s390.cc
@@ -122,8 +122,8 @@ void DoubleToIStub::Generate(MacroAssembler* masm) {
// scratch_high LSR 31 equals zero.
// New result = (result eor 0) + 0 = result.
// If the input was negative, we have to negate the result.
- // Input_high ASR 31 equals 0xffffffff and scratch_high LSR 31 equals 1.
- // New result = (result eor 0xffffffff) + 1 = 0 - result.
+ // Input_high ASR 31 equals 0xFFFFFFFF and scratch_high LSR 31 equals 1.
+ // New result = (result eor 0xFFFFFFFF) + 1 = 0 - result.
__ ShiftRightArith(r0, scratch_high, Operand(31));
#if V8_TARGET_ARCH_S390X
__ lgfr(r0, r0);
@@ -495,6 +495,7 @@ void JSEntryStub::Generate(MacroAssembler* masm) {
// kCEntryFPAddress
// Frame type
__ lay(sp, MemOperand(sp, -5 * kPointerSize));
+
// Push a bad frame pointer to fail if it is used.
__ LoadImmP(r10, Operand(-1));
@@ -512,6 +513,8 @@ void JSEntryStub::Generate(MacroAssembler* masm) {
__ lay(fp,
MemOperand(sp, -EntryFrameConstants::kCallerFPOffset + kPointerSize));
+ __ InitializeRootRegister();
+
// If this is the outermost JS call, set js_entry_sp value.
Label non_outermost_js;
ExternalReference js_entry_sp(IsolateAddressId::kJSEntrySPAddress, isolate());
@@ -564,12 +567,7 @@ void JSEntryStub::Generate(MacroAssembler* masm) {
// r4: receiver
// r5: argc
// r6: argv
- if (type() == StackFrame::CONSTRUCT_ENTRY) {
- __ Call(BUILTIN_CODE(isolate(), JSConstructEntryTrampoline),
- RelocInfo::CODE_TARGET);
- } else {
- __ Call(BUILTIN_CODE(isolate(), JSEntryTrampoline), RelocInfo::CODE_TARGET);
- }
+ __ Call(EntryTrampoline(), RelocInfo::CODE_TARGET);
// Unlink this frame from the handler chain.
__ PopStackHandler();
@@ -783,7 +781,7 @@ static void CreateArrayDispatch(MacroAssembler* masm,
}
// If we reached this point there is a problem.
- __ Abort(kUnexpectedElementsKindInArrayConstructor);
+ __ Abort(AbortReason::kUnexpectedElementsKindInArrayConstructor);
} else {
UNREACHABLE();
}
@@ -822,7 +820,7 @@ static void CreateArrayDispatchOneArgument(MacroAssembler* masm,
if (FLAG_debug_code) {
__ LoadP(r7, FieldMemOperand(r4, 0));
__ CompareRoot(r7, Heap::kAllocationSiteMapRootIndex);
- __ Assert(eq, kExpectedAllocationSite);
+ __ Assert(eq, AbortReason::kExpectedAllocationSite);
}
// Save the resulting elements kind in type info. We can't just store r5
@@ -846,7 +844,7 @@ static void CreateArrayDispatchOneArgument(MacroAssembler* masm,
}
// If we reached this point there is a problem.
- __ Abort(kUnexpectedElementsKindInArrayConstructor);
+ __ Abort(AbortReason::kUnexpectedElementsKindInArrayConstructor);
} else {
UNREACHABLE();
}
@@ -917,9 +915,9 @@ void ArrayConstructorStub::Generate(MacroAssembler* masm) {
__ LoadP(r6, FieldMemOperand(r3, JSFunction::kPrototypeOrInitialMapOffset));
// Will both indicate a nullptr and a Smi.
__ TestIfSmi(r6);
- __ Assert(ne, kUnexpectedInitialMapForArrayFunction, cr0);
+ __ Assert(ne, AbortReason::kUnexpectedInitialMapForArrayFunction, cr0);
__ CompareObjectType(r6, r6, r7, MAP_TYPE);
- __ Assert(eq, kUnexpectedInitialMapForArrayFunction);
+ __ Assert(eq, AbortReason::kUnexpectedInitialMapForArrayFunction);
// We should either have undefined in r4 or a valid AllocationSite
__ AssertUndefinedOrAllocationSite(r4, r6);
@@ -996,9 +994,9 @@ void InternalArrayConstructorStub::Generate(MacroAssembler* masm) {
__ LoadP(r5, FieldMemOperand(r3, JSFunction::kPrototypeOrInitialMapOffset));
// Will both indicate a nullptr and a Smi.
__ TestIfSmi(r5);
- __ Assert(ne, kUnexpectedInitialMapForArrayFunction, cr0);
+ __ Assert(ne, AbortReason::kUnexpectedInitialMapForArrayFunction, cr0);
__ CompareObjectType(r5, r5, r6, MAP_TYPE);
- __ Assert(eq, kUnexpectedInitialMapForArrayFunction);
+ __ Assert(eq, AbortReason::kUnexpectedInitialMapForArrayFunction);
}
// Figure out the right elements kind
@@ -1013,7 +1011,9 @@ void InternalArrayConstructorStub::Generate(MacroAssembler* masm) {
__ CmpP(r5, Operand(PACKED_ELEMENTS));
__ beq(&done);
__ CmpP(r5, Operand(HOLEY_ELEMENTS));
- __ Assert(eq, kInvalidElementsKindForInternalArrayOrInternalPackedArray);
+ __ Assert(
+ eq,
+ AbortReason::kInvalidElementsKindForInternalArrayOrInternalPackedArray);
__ bind(&done);
}
@@ -1118,7 +1118,7 @@ static void CallApiFunctionAndReturn(MacroAssembler* masm,
if (__ emit_debug_code()) {
__ LoadlW(r3, MemOperand(r9, kLevelOffset));
__ CmpP(r3, r8);
- __ Check(eq, kUnexpectedLevelAfterReturnFromApiCall);
+ __ Check(eq, AbortReason::kUnexpectedLevelAfterReturnFromApiCall);
}
__ SubP(r8, Operand(1));
__ StoreW(r8, MemOperand(r9, kLevelOffset));
diff --git a/deps/v8/src/s390/codegen-s390.cc b/deps/v8/src/s390/codegen-s390.cc
index e6c627da3a..df02570783 100644
--- a/deps/v8/src/s390/codegen-s390.cc
+++ b/deps/v8/src/s390/codegen-s390.cc
@@ -20,8 +20,7 @@ UnaryMathFunctionWithIsolate CreateSqrtFunction(Isolate* isolate) {
return nullptr;
#else
size_t allocated = 0;
- byte* buffer =
- AllocateSystemPage(isolate->heap()->GetRandomMmapAddr(), &allocated);
+ byte* buffer = AllocatePage(isolate->heap()->GetRandomMmapAddr(), &allocated);
if (buffer == nullptr) return nullptr;
MacroAssembler masm(isolate, buffer, static_cast<int>(allocated),
@@ -38,8 +37,7 @@ UnaryMathFunctionWithIsolate CreateSqrtFunction(Isolate* isolate) {
!RelocInfo::RequiresRelocation(isolate, desc));
Assembler::FlushICache(isolate, buffer, allocated);
- CHECK(base::OS::SetPermissions(buffer, allocated,
- base::OS::MemoryPermission::kReadExecute));
+ CHECK(SetPermissions(buffer, allocated, PageAllocator::kReadExecute));
return FUNCTION_CAST<UnaryMathFunctionWithIsolate>(buffer);
#endif
}
diff --git a/deps/v8/src/s390/constants-s390.cc b/deps/v8/src/s390/constants-s390.cc
index da53613bc7..bda7f61cf4 100644
--- a/deps/v8/src/s390/constants-s390.cc
+++ b/deps/v8/src/s390/constants-s390.cc
@@ -22,12 +22,12 @@ Instruction::OpcodeFormatType Instruction::OpcodeFormatTable[] = {
ONE_BYTE_OPCODE, // 0x07
ONE_BYTE_OPCODE, // 0x08
ONE_BYTE_OPCODE, // 0x09
- ONE_BYTE_OPCODE, // 0x0a
- ONE_BYTE_OPCODE, // 0x0b
- ONE_BYTE_OPCODE, // 0x0c
- ONE_BYTE_OPCODE, // 0x0d
- ONE_BYTE_OPCODE, // 0x0e
- ONE_BYTE_OPCODE, // 0x0f
+ ONE_BYTE_OPCODE, // 0x0A
+ ONE_BYTE_OPCODE, // 0x0B
+ ONE_BYTE_OPCODE, // 0x0C
+ ONE_BYTE_OPCODE, // 0x0D
+ ONE_BYTE_OPCODE, // 0x0E
+ ONE_BYTE_OPCODE, // 0x0F
ONE_BYTE_OPCODE, // 0x10
ONE_BYTE_OPCODE, // 0x11
ONE_BYTE_OPCODE, // 0x12
@@ -38,12 +38,12 @@ Instruction::OpcodeFormatType Instruction::OpcodeFormatTable[] = {
ONE_BYTE_OPCODE, // 0x17
ONE_BYTE_OPCODE, // 0x18
ONE_BYTE_OPCODE, // 0x19
- ONE_BYTE_OPCODE, // 0x1a
- ONE_BYTE_OPCODE, // 0x1b
- ONE_BYTE_OPCODE, // 0x1c
- ONE_BYTE_OPCODE, // 0x1d
- ONE_BYTE_OPCODE, // 0x1e
- ONE_BYTE_OPCODE, // 0x1f
+ ONE_BYTE_OPCODE, // 0x1A
+ ONE_BYTE_OPCODE, // 0x1B
+ ONE_BYTE_OPCODE, // 0x1C
+ ONE_BYTE_OPCODE, // 0x1D
+ ONE_BYTE_OPCODE, // 0x1E
+ ONE_BYTE_OPCODE, // 0x1F
ONE_BYTE_OPCODE, // 0x20
ONE_BYTE_OPCODE, // 0x21
ONE_BYTE_OPCODE, // 0x22
@@ -54,12 +54,12 @@ Instruction::OpcodeFormatType Instruction::OpcodeFormatTable[] = {
ONE_BYTE_OPCODE, // 0x27
ONE_BYTE_OPCODE, // 0x28
ONE_BYTE_OPCODE, // 0x29
- ONE_BYTE_OPCODE, // 0x2a
- ONE_BYTE_OPCODE, // 0x2b
- ONE_BYTE_OPCODE, // 0x2c
- ONE_BYTE_OPCODE, // 0x2d
- ONE_BYTE_OPCODE, // 0x2e
- ONE_BYTE_OPCODE, // 0x2f
+ ONE_BYTE_OPCODE, // 0x2A
+ ONE_BYTE_OPCODE, // 0x2B
+ ONE_BYTE_OPCODE, // 0x2C
+ ONE_BYTE_OPCODE, // 0x2D
+ ONE_BYTE_OPCODE, // 0x2E
+ ONE_BYTE_OPCODE, // 0x2F
ONE_BYTE_OPCODE, // 0x30
ONE_BYTE_OPCODE, // 0x31
ONE_BYTE_OPCODE, // 0x32
@@ -70,12 +70,12 @@ Instruction::OpcodeFormatType Instruction::OpcodeFormatTable[] = {
ONE_BYTE_OPCODE, // 0x37
ONE_BYTE_OPCODE, // 0x38
ONE_BYTE_OPCODE, // 0x39
- ONE_BYTE_OPCODE, // 0x3a
- ONE_BYTE_OPCODE, // 0x3b
- ONE_BYTE_OPCODE, // 0x3c
- ONE_BYTE_OPCODE, // 0x3d
- ONE_BYTE_OPCODE, // 0x3e
- ONE_BYTE_OPCODE, // 0x3f
+ ONE_BYTE_OPCODE, // 0x3A
+ ONE_BYTE_OPCODE, // 0x3B
+ ONE_BYTE_OPCODE, // 0x3C
+ ONE_BYTE_OPCODE, // 0x3D
+ ONE_BYTE_OPCODE, // 0x3E
+ ONE_BYTE_OPCODE, // 0x3F
ONE_BYTE_OPCODE, // 0x40
ONE_BYTE_OPCODE, // 0x41
ONE_BYTE_OPCODE, // 0x42
@@ -86,12 +86,12 @@ Instruction::OpcodeFormatType Instruction::OpcodeFormatTable[] = {
ONE_BYTE_OPCODE, // 0x47
ONE_BYTE_OPCODE, // 0x48
ONE_BYTE_OPCODE, // 0x49
- ONE_BYTE_OPCODE, // 0x4a
- ONE_BYTE_OPCODE, // 0x4b
- ONE_BYTE_OPCODE, // 0x4c
- ONE_BYTE_OPCODE, // 0x4d
- ONE_BYTE_OPCODE, // 0x4e
- ONE_BYTE_OPCODE, // 0x4f
+ ONE_BYTE_OPCODE, // 0x4A
+ ONE_BYTE_OPCODE, // 0x4B
+ ONE_BYTE_OPCODE, // 0x4C
+ ONE_BYTE_OPCODE, // 0x4D
+ ONE_BYTE_OPCODE, // 0x4E
+ ONE_BYTE_OPCODE, // 0x4F
ONE_BYTE_OPCODE, // 0x50
ONE_BYTE_OPCODE, // 0x51
ONE_BYTE_OPCODE, // 0x52
@@ -102,12 +102,12 @@ Instruction::OpcodeFormatType Instruction::OpcodeFormatTable[] = {
ONE_BYTE_OPCODE, // 0x57
ONE_BYTE_OPCODE, // 0x58
ONE_BYTE_OPCODE, // 0x59
- ONE_BYTE_OPCODE, // 0x5a
- ONE_BYTE_OPCODE, // 0x5b
- ONE_BYTE_OPCODE, // 0x5c
- ONE_BYTE_OPCODE, // 0x5d
- ONE_BYTE_OPCODE, // 0x5e
- ONE_BYTE_OPCODE, // 0x5f
+ ONE_BYTE_OPCODE, // 0x5A
+ ONE_BYTE_OPCODE, // 0x5B
+ ONE_BYTE_OPCODE, // 0x5C
+ ONE_BYTE_OPCODE, // 0x5D
+ ONE_BYTE_OPCODE, // 0x5E
+ ONE_BYTE_OPCODE, // 0x5F
ONE_BYTE_OPCODE, // 0x60
ONE_BYTE_OPCODE, // 0x61
ONE_BYTE_OPCODE, // 0x62
@@ -118,12 +118,12 @@ Instruction::OpcodeFormatType Instruction::OpcodeFormatTable[] = {
ONE_BYTE_OPCODE, // 0x67
ONE_BYTE_OPCODE, // 0x68
ONE_BYTE_OPCODE, // 0x69
- ONE_BYTE_OPCODE, // 0x6a
- ONE_BYTE_OPCODE, // 0x6b
- ONE_BYTE_OPCODE, // 0x6c
- ONE_BYTE_OPCODE, // 0x6d
- ONE_BYTE_OPCODE, // 0x6e
- ONE_BYTE_OPCODE, // 0x6f
+ ONE_BYTE_OPCODE, // 0x6A
+ ONE_BYTE_OPCODE, // 0x6B
+ ONE_BYTE_OPCODE, // 0x6C
+ ONE_BYTE_OPCODE, // 0x6D
+ ONE_BYTE_OPCODE, // 0x6E
+ ONE_BYTE_OPCODE, // 0x6F
ONE_BYTE_OPCODE, // 0x70
ONE_BYTE_OPCODE, // 0x71
ONE_BYTE_OPCODE, // 0x72
@@ -134,12 +134,12 @@ Instruction::OpcodeFormatType Instruction::OpcodeFormatTable[] = {
ONE_BYTE_OPCODE, // 0x77
ONE_BYTE_OPCODE, // 0x78
ONE_BYTE_OPCODE, // 0x79
- ONE_BYTE_OPCODE, // 0x7a
- ONE_BYTE_OPCODE, // 0x7b
- ONE_BYTE_OPCODE, // 0x7c
- ONE_BYTE_OPCODE, // 0x7d
- ONE_BYTE_OPCODE, // 0x7e
- ONE_BYTE_OPCODE, // 0x7f
+ ONE_BYTE_OPCODE, // 0x7A
+ ONE_BYTE_OPCODE, // 0x7B
+ ONE_BYTE_OPCODE, // 0x7C
+ ONE_BYTE_OPCODE, // 0x7D
+ ONE_BYTE_OPCODE, // 0x7E
+ ONE_BYTE_OPCODE, // 0x7F
ONE_BYTE_OPCODE, // 0x80
ONE_BYTE_OPCODE, // 0x81
ONE_BYTE_OPCODE, // 0x82
@@ -150,12 +150,12 @@ Instruction::OpcodeFormatType Instruction::OpcodeFormatTable[] = {
ONE_BYTE_OPCODE, // 0x87
ONE_BYTE_OPCODE, // 0x88
ONE_BYTE_OPCODE, // 0x89
- ONE_BYTE_OPCODE, // 0x8a
- ONE_BYTE_OPCODE, // 0x8b
- ONE_BYTE_OPCODE, // 0x8c
- ONE_BYTE_OPCODE, // 0x8d
- ONE_BYTE_OPCODE, // 0x8e
- ONE_BYTE_OPCODE, // 0x8f
+ ONE_BYTE_OPCODE, // 0x8A
+ ONE_BYTE_OPCODE, // 0x8B
+ ONE_BYTE_OPCODE, // 0x8C
+ ONE_BYTE_OPCODE, // 0x8D
+ ONE_BYTE_OPCODE, // 0x8E
+ ONE_BYTE_OPCODE, // 0x8F
ONE_BYTE_OPCODE, // 0x90
ONE_BYTE_OPCODE, // 0x91
ONE_BYTE_OPCODE, // 0x92
@@ -166,108 +166,108 @@ Instruction::OpcodeFormatType Instruction::OpcodeFormatTable[] = {
ONE_BYTE_OPCODE, // 0x97
ONE_BYTE_OPCODE, // 0x98
ONE_BYTE_OPCODE, // 0x99
- ONE_BYTE_OPCODE, // 0x9a
- ONE_BYTE_OPCODE, // 0x9b
- TWO_BYTE_DISJOINT_OPCODE, // 0x9c
- TWO_BYTE_DISJOINT_OPCODE, // 0x9d
- TWO_BYTE_DISJOINT_OPCODE, // 0x9e
- TWO_BYTE_DISJOINT_OPCODE, // 0x9f
- TWO_BYTE_DISJOINT_OPCODE, // 0xa0
- TWO_BYTE_DISJOINT_OPCODE, // 0xa1
- TWO_BYTE_DISJOINT_OPCODE, // 0xa2
- TWO_BYTE_DISJOINT_OPCODE, // 0xa3
- TWO_BYTE_DISJOINT_OPCODE, // 0xa4
- THREE_NIBBLE_OPCODE, // 0xa5
- TWO_BYTE_DISJOINT_OPCODE, // 0xa6
- THREE_NIBBLE_OPCODE, // 0xa7
- ONE_BYTE_OPCODE, // 0xa8
- ONE_BYTE_OPCODE, // 0xa9
- ONE_BYTE_OPCODE, // 0xaa
- ONE_BYTE_OPCODE, // 0xab
- ONE_BYTE_OPCODE, // 0xac
- ONE_BYTE_OPCODE, // 0xad
- ONE_BYTE_OPCODE, // 0xae
- ONE_BYTE_OPCODE, // 0xaf
- ONE_BYTE_OPCODE, // 0xb0
- ONE_BYTE_OPCODE, // 0xb1
- TWO_BYTE_OPCODE, // 0xb2
- TWO_BYTE_OPCODE, // 0xb3
- TWO_BYTE_DISJOINT_OPCODE, // 0xb4
- TWO_BYTE_DISJOINT_OPCODE, // 0xb5
- TWO_BYTE_DISJOINT_OPCODE, // 0xb6
- TWO_BYTE_DISJOINT_OPCODE, // 0xb7
- TWO_BYTE_DISJOINT_OPCODE, // 0xb8
- TWO_BYTE_OPCODE, // 0xb9
- ONE_BYTE_OPCODE, // 0xba
- ONE_BYTE_OPCODE, // 0xbb
- ONE_BYTE_OPCODE, // 0xbc
- ONE_BYTE_OPCODE, // 0xbd
- ONE_BYTE_OPCODE, // 0xbe
- ONE_BYTE_OPCODE, // 0xbf
- THREE_NIBBLE_OPCODE, // 0xc0
- THREE_NIBBLE_OPCODE, // 0xc1
- THREE_NIBBLE_OPCODE, // 0xc2
- THREE_NIBBLE_OPCODE, // 0xc3
- THREE_NIBBLE_OPCODE, // 0xc4
- THREE_NIBBLE_OPCODE, // 0xc5
- THREE_NIBBLE_OPCODE, // 0xc6
- ONE_BYTE_OPCODE, // 0xc7
- THREE_NIBBLE_OPCODE, // 0xc8
- THREE_NIBBLE_OPCODE, // 0xc9
- THREE_NIBBLE_OPCODE, // 0xca
- THREE_NIBBLE_OPCODE, // 0xcb
- THREE_NIBBLE_OPCODE, // 0xcc
- TWO_BYTE_DISJOINT_OPCODE, // 0xcd
- TWO_BYTE_DISJOINT_OPCODE, // 0xce
- TWO_BYTE_DISJOINT_OPCODE, // 0xcf
- ONE_BYTE_OPCODE, // 0xd0
- ONE_BYTE_OPCODE, // 0xd1
- ONE_BYTE_OPCODE, // 0xd2
- ONE_BYTE_OPCODE, // 0xd3
- ONE_BYTE_OPCODE, // 0xd4
- ONE_BYTE_OPCODE, // 0xd5
- ONE_BYTE_OPCODE, // 0xd6
- ONE_BYTE_OPCODE, // 0xd7
- ONE_BYTE_OPCODE, // 0xd8
- ONE_BYTE_OPCODE, // 0xd9
- ONE_BYTE_OPCODE, // 0xda
- ONE_BYTE_OPCODE, // 0xdb
- ONE_BYTE_OPCODE, // 0xdc
- ONE_BYTE_OPCODE, // 0xdd
- ONE_BYTE_OPCODE, // 0xde
- ONE_BYTE_OPCODE, // 0xdf
- ONE_BYTE_OPCODE, // 0xe0
- ONE_BYTE_OPCODE, // 0xe1
- ONE_BYTE_OPCODE, // 0xe2
- TWO_BYTE_DISJOINT_OPCODE, // 0xe3
- TWO_BYTE_DISJOINT_OPCODE, // 0xe4
- TWO_BYTE_OPCODE, // 0xe5
- TWO_BYTE_DISJOINT_OPCODE, // 0xe6
- TWO_BYTE_DISJOINT_OPCODE, // 0xe7
- ONE_BYTE_OPCODE, // 0xe8
- ONE_BYTE_OPCODE, // 0xe9
- ONE_BYTE_OPCODE, // 0xea
- TWO_BYTE_DISJOINT_OPCODE, // 0xeb
- TWO_BYTE_DISJOINT_OPCODE, // 0xec
- TWO_BYTE_DISJOINT_OPCODE, // 0xed
- ONE_BYTE_OPCODE, // 0xee
- ONE_BYTE_OPCODE, // 0xef
- ONE_BYTE_OPCODE, // 0xf0
- ONE_BYTE_OPCODE, // 0xf1
- ONE_BYTE_OPCODE, // 0xf2
- ONE_BYTE_OPCODE, // 0xf3
- ONE_BYTE_OPCODE, // 0xf4
- ONE_BYTE_OPCODE, // 0xf5
- ONE_BYTE_OPCODE, // 0xf6
- ONE_BYTE_OPCODE, // 0xf7
- ONE_BYTE_OPCODE, // 0xf8
- ONE_BYTE_OPCODE, // 0xf9
- ONE_BYTE_OPCODE, // 0xfa
- ONE_BYTE_OPCODE, // 0xfb
- ONE_BYTE_OPCODE, // 0xfc
- ONE_BYTE_OPCODE, // 0xfd
- TWO_BYTE_DISJOINT_OPCODE, // 0xfe
- TWO_BYTE_DISJOINT_OPCODE, // 0xff
+ ONE_BYTE_OPCODE, // 0x9A
+ ONE_BYTE_OPCODE, // 0x9B
+ TWO_BYTE_DISJOINT_OPCODE, // 0x9C
+ TWO_BYTE_DISJOINT_OPCODE, // 0x9D
+ TWO_BYTE_DISJOINT_OPCODE, // 0x9E
+ TWO_BYTE_DISJOINT_OPCODE, // 0x9F
+ TWO_BYTE_DISJOINT_OPCODE, // 0xA0
+ TWO_BYTE_DISJOINT_OPCODE, // 0xA1
+ TWO_BYTE_DISJOINT_OPCODE, // 0xA2
+ TWO_BYTE_DISJOINT_OPCODE, // 0xA3
+ TWO_BYTE_DISJOINT_OPCODE, // 0xA4
+ THREE_NIBBLE_OPCODE, // 0xA5
+ TWO_BYTE_DISJOINT_OPCODE, // 0xA6
+ THREE_NIBBLE_OPCODE, // 0xA7
+ ONE_BYTE_OPCODE, // 0xA8
+ ONE_BYTE_OPCODE, // 0xA9
+ ONE_BYTE_OPCODE, // 0xAA
+ ONE_BYTE_OPCODE, // 0xAB
+ ONE_BYTE_OPCODE, // 0xAC
+ ONE_BYTE_OPCODE, // 0xAD
+ ONE_BYTE_OPCODE, // 0xAE
+ ONE_BYTE_OPCODE, // 0xAF
+ ONE_BYTE_OPCODE, // 0xB0
+ ONE_BYTE_OPCODE, // 0xB1
+ TWO_BYTE_OPCODE, // 0xB2
+ TWO_BYTE_OPCODE, // 0xB3
+ TWO_BYTE_DISJOINT_OPCODE, // 0xB4
+ TWO_BYTE_DISJOINT_OPCODE, // 0xB5
+ TWO_BYTE_DISJOINT_OPCODE, // 0xB6
+ TWO_BYTE_DISJOINT_OPCODE, // 0xB7
+ TWO_BYTE_DISJOINT_OPCODE, // 0xB8
+ TWO_BYTE_OPCODE, // 0xB9
+ ONE_BYTE_OPCODE, // 0xBA
+ ONE_BYTE_OPCODE, // 0xBB
+ ONE_BYTE_OPCODE, // 0xBC
+ ONE_BYTE_OPCODE, // 0xBD
+ ONE_BYTE_OPCODE, // 0xBE
+ ONE_BYTE_OPCODE, // 0xBF
+ THREE_NIBBLE_OPCODE, // 0xC0
+ THREE_NIBBLE_OPCODE, // 0xC1
+ THREE_NIBBLE_OPCODE, // 0xC2
+ THREE_NIBBLE_OPCODE, // 0xC3
+ THREE_NIBBLE_OPCODE, // 0xC4
+ THREE_NIBBLE_OPCODE, // 0xC5
+ THREE_NIBBLE_OPCODE, // 0xC6
+ ONE_BYTE_OPCODE, // 0xC7
+ THREE_NIBBLE_OPCODE, // 0xC8
+ THREE_NIBBLE_OPCODE, // 0xC9
+ THREE_NIBBLE_OPCODE, // 0xCA
+ THREE_NIBBLE_OPCODE, // 0xCB
+ THREE_NIBBLE_OPCODE, // 0xCC
+ TWO_BYTE_DISJOINT_OPCODE, // 0xCD
+ TWO_BYTE_DISJOINT_OPCODE, // 0xCE
+ TWO_BYTE_DISJOINT_OPCODE, // 0xCF
+ ONE_BYTE_OPCODE, // 0xD0
+ ONE_BYTE_OPCODE, // 0xD1
+ ONE_BYTE_OPCODE, // 0xD2
+ ONE_BYTE_OPCODE, // 0xD3
+ ONE_BYTE_OPCODE, // 0xD4
+ ONE_BYTE_OPCODE, // 0xD5
+ ONE_BYTE_OPCODE, // 0xD6
+ ONE_BYTE_OPCODE, // 0xD7
+ ONE_BYTE_OPCODE, // 0xD8
+ ONE_BYTE_OPCODE, // 0xD9
+ ONE_BYTE_OPCODE, // 0xDA
+ ONE_BYTE_OPCODE, // 0xDB
+ ONE_BYTE_OPCODE, // 0xDC
+ ONE_BYTE_OPCODE, // 0xDD
+ ONE_BYTE_OPCODE, // 0xDE
+ ONE_BYTE_OPCODE, // 0xDF
+ ONE_BYTE_OPCODE, // 0xE0
+ ONE_BYTE_OPCODE, // 0xE1
+ ONE_BYTE_OPCODE, // 0xE2
+ TWO_BYTE_DISJOINT_OPCODE, // 0xE3
+ TWO_BYTE_DISJOINT_OPCODE, // 0xE4
+ TWO_BYTE_OPCODE, // 0xE5
+ TWO_BYTE_DISJOINT_OPCODE, // 0xE6
+ TWO_BYTE_DISJOINT_OPCODE, // 0xE7
+ ONE_BYTE_OPCODE, // 0xE8
+ ONE_BYTE_OPCODE, // 0xE9
+ ONE_BYTE_OPCODE, // 0xEA
+ TWO_BYTE_DISJOINT_OPCODE, // 0xEB
+ TWO_BYTE_DISJOINT_OPCODE, // 0xEC
+ TWO_BYTE_DISJOINT_OPCODE, // 0xED
+ ONE_BYTE_OPCODE, // 0xEE
+ ONE_BYTE_OPCODE, // 0xEF
+ ONE_BYTE_OPCODE, // 0xF0
+ ONE_BYTE_OPCODE, // 0xF1
+ ONE_BYTE_OPCODE, // 0xF2
+ ONE_BYTE_OPCODE, // 0xF3
+ ONE_BYTE_OPCODE, // 0xF4
+ ONE_BYTE_OPCODE, // 0xF5
+ ONE_BYTE_OPCODE, // 0xF6
+ ONE_BYTE_OPCODE, // 0xF7
+ ONE_BYTE_OPCODE, // 0xF8
+ ONE_BYTE_OPCODE, // 0xF9
+ ONE_BYTE_OPCODE, // 0xFA
+ ONE_BYTE_OPCODE, // 0xFB
+ ONE_BYTE_OPCODE, // 0xFC
+ ONE_BYTE_OPCODE, // 0xFD
+ TWO_BYTE_DISJOINT_OPCODE, // 0xFE
+ TWO_BYTE_DISJOINT_OPCODE, // 0xFF
};
// These register names are defined in a way to match the native disassembler
diff --git a/deps/v8/src/s390/interface-descriptors-s390.cc b/deps/v8/src/s390/interface-descriptors-s390.cc
index a8eb807131..3cb4f2e375 100644
--- a/deps/v8/src/s390/interface-descriptors-s390.cc
+++ b/deps/v8/src/s390/interface-descriptors-s390.cc
@@ -43,8 +43,6 @@ const Register LoadDescriptor::SlotRegister() { return r2; }
const Register LoadWithVectorDescriptor::VectorRegister() { return r5; }
-const Register LoadICProtoArrayDescriptor::HandlerRegister() { return r6; }
-
const Register StoreDescriptor::ReceiverRegister() { return r3; }
const Register StoreDescriptor::NameRegister() { return r4; }
const Register StoreDescriptor::ValueRegister() { return r2; }
@@ -198,6 +196,12 @@ void TransitionElementsKindDescriptor::InitializePlatformSpecific(
data->InitializePlatformSpecific(arraysize(registers), registers);
}
+void AbortJSDescriptor::InitializePlatformSpecific(
+ CallInterfaceDescriptorData* data) {
+ Register registers[] = {r3};
+ data->InitializePlatformSpecific(arraysize(registers), registers);
+}
+
void AllocateHeapNumberDescriptor::InitializePlatformSpecific(
CallInterfaceDescriptorData* data) {
data->InitializePlatformSpecific(0, nullptr, nullptr);
diff --git a/deps/v8/src/s390/macro-assembler-s390.cc b/deps/v8/src/s390/macro-assembler-s390.cc
index 44f1ba5abb..fe24884378 100644
--- a/deps/v8/src/s390/macro-assembler-s390.cc
+++ b/deps/v8/src/s390/macro-assembler-s390.cc
@@ -443,7 +443,7 @@ void MacroAssembler::RecordWrite(Register object, Register address,
DCHECK(object != value);
if (emit_debug_code()) {
CmpP(value, MemOperand(address));
- Check(eq, kWrongAddressOrValuePassedToRecordWrite);
+ Check(eq, AbortReason::kWrongAddressOrValuePassedToRecordWrite);
}
if (remembered_set_action == OMIT_REMEMBERED_SET &&
@@ -1057,9 +1057,10 @@ void MacroAssembler::LeaveExitFrame(bool save_doubles, Register argument_count,
LoadP(cp, MemOperand(ip));
#ifdef DEBUG
+ mov(r1, Operand(Context::kInvalidContext));
mov(ip,
Operand(ExternalReference(IsolateAddressId::kContextAddress, isolate())));
- StoreP(MemOperand(ip), Operand(0, kRelocInfo_NONEPTR), r0);
+ StoreP(r1, MemOperand(ip));
#endif
// Tear down the exit frame, pop the arguments, and return.
@@ -1115,7 +1116,7 @@ void TurboAssembler::PrepareForTailCall(const ParameterCount& callee_args_count,
if (FLAG_debug_code) {
CmpLogicalP(src_reg, dst_reg);
- Check(lt, kStackAccessBelowStackPointer);
+ Check(lt, AbortReason::kStackAccessBelowStackPointer);
}
// Restore caller's frame pointer and return address now as they will be
@@ -1352,7 +1353,7 @@ void MacroAssembler::MaybeDropFrames() {
void MacroAssembler::PushStackHandler() {
// Adjust this code if not the case.
- STATIC_ASSERT(StackHandlerConstants::kSize == 1 * kPointerSize);
+ STATIC_ASSERT(StackHandlerConstants::kSize == 2 * kPointerSize);
STATIC_ASSERT(StackHandlerConstants::kNextOffset == 0 * kPointerSize);
// Link the current handler as the next handler.
@@ -1362,6 +1363,10 @@ void MacroAssembler::PushStackHandler() {
// Buy the full stack frame for 5 slots.
lay(sp, MemOperand(sp, -StackHandlerConstants::kSize));
+ // Store padding.
+ mov(r0, Operand(Smi::kZero));
+ StoreP(r0, MemOperand(sp)); // Padding.
+
// Copy the old handler into the next handler slot.
mvc(MemOperand(sp, StackHandlerConstants::kNextOffset), MemOperand(r7),
kPointerSize);
@@ -1370,15 +1375,16 @@ void MacroAssembler::PushStackHandler() {
}
void MacroAssembler::PopStackHandler() {
- STATIC_ASSERT(StackHandlerConstants::kSize == 1 * kPointerSize);
+ STATIC_ASSERT(StackHandlerConstants::kSize == 2 * kPointerSize);
STATIC_ASSERT(StackHandlerConstants::kNextOffset == 0);
// Pop the Next Handler into r3 and store it into Handler Address reference.
Pop(r3);
mov(ip,
Operand(ExternalReference(IsolateAddressId::kHandlerAddress, isolate())));
-
StoreP(r3, MemOperand(ip));
+
+ Drop(1); // Drop padding.
}
void MacroAssembler::CompareObjectType(Register object, Register map,
@@ -1392,7 +1398,7 @@ void MacroAssembler::CompareObjectType(Register object, Register map,
void MacroAssembler::CompareInstanceType(Register map, Register type_reg,
InstanceType type) {
STATIC_ASSERT(Map::kInstanceTypeOffset < 4096);
- STATIC_ASSERT(LAST_TYPE <= 0xffff);
+ STATIC_ASSERT(LAST_TYPE <= 0xFFFF);
LoadHalfWordP(type_reg, FieldMemOperand(map, Map::kInstanceTypeOffset));
CmpP(type_reg, Operand(type));
}
@@ -1547,12 +1553,11 @@ void MacroAssembler::DecrementCounter(StatsCounter* counter, int value,
}
}
-void TurboAssembler::Assert(Condition cond, BailoutReason reason,
- CRegister cr) {
+void TurboAssembler::Assert(Condition cond, AbortReason reason, CRegister cr) {
if (emit_debug_code()) Check(cond, reason, cr);
}
-void TurboAssembler::Check(Condition cond, BailoutReason reason, CRegister cr) {
+void TurboAssembler::Check(Condition cond, AbortReason reason, CRegister cr) {
Label L;
b(cond, &L);
Abort(reason);
@@ -1560,11 +1565,11 @@ void TurboAssembler::Check(Condition cond, BailoutReason reason, CRegister cr) {
bind(&L);
}
-void TurboAssembler::Abort(BailoutReason reason) {
+void TurboAssembler::Abort(AbortReason reason) {
Label abort_start;
bind(&abort_start);
#ifdef DEBUG
- const char* msg = GetBailoutReason(reason);
+ const char* msg = GetAbortReason(reason);
if (msg != nullptr) {
RecordComment("Abort message: ");
RecordComment(msg);
@@ -1617,7 +1622,7 @@ void MacroAssembler::AssertNotSmi(Register object) {
if (emit_debug_code()) {
STATIC_ASSERT(kSmiTag == 0);
TestIfSmi(object);
- Check(ne, kOperandIsASmi, cr0);
+ Check(ne, AbortReason::kOperandIsASmi, cr0);
}
}
@@ -1625,7 +1630,7 @@ void MacroAssembler::AssertSmi(Register object) {
if (emit_debug_code()) {
STATIC_ASSERT(kSmiTag == 0);
TestIfSmi(object);
- Check(eq, kOperandIsNotSmi, cr0);
+ Check(eq, AbortReason::kOperandIsNotASmi, cr0);
}
}
@@ -1633,11 +1638,11 @@ void MacroAssembler::AssertFixedArray(Register object) {
if (emit_debug_code()) {
STATIC_ASSERT(kSmiTag == 0);
TestIfSmi(object);
- Check(ne, kOperandIsASmiAndNotAFixedArray, cr0);
+ Check(ne, AbortReason::kOperandIsASmiAndNotAFixedArray, cr0);
push(object);
CompareObjectType(object, object, object, FIXED_ARRAY_TYPE);
pop(object);
- Check(eq, kOperandIsNotAFixedArray);
+ Check(eq, AbortReason::kOperandIsNotAFixedArray);
}
}
@@ -1645,11 +1650,11 @@ void MacroAssembler::AssertFunction(Register object) {
if (emit_debug_code()) {
STATIC_ASSERT(kSmiTag == 0);
TestIfSmi(object);
- Check(ne, kOperandIsASmiAndNotAFunction, cr0);
+ Check(ne, AbortReason::kOperandIsASmiAndNotAFunction, cr0);
push(object);
CompareObjectType(object, object, object, JS_FUNCTION_TYPE);
pop(object);
- Check(eq, kOperandIsNotAFunction);
+ Check(eq, AbortReason::kOperandIsNotAFunction);
}
}
@@ -1657,18 +1662,18 @@ void MacroAssembler::AssertBoundFunction(Register object) {
if (emit_debug_code()) {
STATIC_ASSERT(kSmiTag == 0);
TestIfSmi(object);
- Check(ne, kOperandIsASmiAndNotABoundFunction, cr0);
+ Check(ne, AbortReason::kOperandIsASmiAndNotABoundFunction, cr0);
push(object);
CompareObjectType(object, object, object, JS_BOUND_FUNCTION_TYPE);
pop(object);
- Check(eq, kOperandIsNotABoundFunction);
+ Check(eq, AbortReason::kOperandIsNotABoundFunction);
}
}
void MacroAssembler::AssertGeneratorObject(Register object) {
if (!emit_debug_code()) return;
TestIfSmi(object);
- Check(ne, kOperandIsASmiAndNotAGeneratorObject, cr0);
+ Check(ne, AbortReason::kOperandIsASmiAndNotAGeneratorObject, cr0);
// Load map
Register map = object;
@@ -1687,7 +1692,7 @@ void MacroAssembler::AssertGeneratorObject(Register object) {
bind(&do_check);
// Restore generator object to register and perform assertion
pop(object);
- Check(eq, kOperandIsNotAGeneratorObject);
+ Check(eq, AbortReason::kOperandIsNotAGeneratorObject);
}
void MacroAssembler::AssertUndefinedOrAllocationSite(Register object,
@@ -1699,7 +1704,7 @@ void MacroAssembler::AssertUndefinedOrAllocationSite(Register object,
beq(&done_checking, Label::kNear);
LoadP(scratch, FieldMemOperand(object, HeapObject::kMapOffset));
CompareRoot(scratch, Heap::kAllocationSiteMapRootIndex);
- Assert(eq, kExpectedUndefinedOrCell);
+ Assert(eq, AbortReason::kExpectedUndefinedOrCell);
bind(&done_checking);
}
}
@@ -3301,7 +3306,7 @@ void TurboAssembler::LoadIntLiteral(Register dst, int value) {
void TurboAssembler::LoadSmiLiteral(Register dst, Smi* smi) {
intptr_t value = reinterpret_cast<intptr_t>(smi);
#if V8_TARGET_ARCH_S390X
- DCHECK_EQ(value & 0xffffffff, 0);
+ DCHECK_EQ(value & 0xFFFFFFFF, 0);
// The smi value is loaded in upper 32-bits. Lower 32-bit are zeros.
llihf(dst, Operand(value >> 32));
#else
@@ -3402,7 +3407,7 @@ void TurboAssembler::SubSmiLiteral(Register dst, Register src, Smi* smi,
void TurboAssembler::AndSmiLiteral(Register dst, Register src, Smi* smi) {
if (dst != src) LoadRR(dst, src);
#if V8_TARGET_ARCH_S390X
- DCHECK_EQ(reinterpret_cast<intptr_t>(smi) & 0xffffffff, 0);
+ DCHECK_EQ(reinterpret_cast<intptr_t>(smi) & 0xFFFFFFFF, 0);
int value = static_cast<int>(reinterpret_cast<intptr_t>(smi) >> 32);
nihf(dst, Operand(value));
#else
diff --git a/deps/v8/src/s390/macro-assembler-s390.h b/deps/v8/src/s390/macro-assembler-s390.h
index 4076c171ad..fcc62f21a9 100644
--- a/deps/v8/src/s390/macro-assembler-s390.h
+++ b/deps/v8/src/s390/macro-assembler-s390.h
@@ -873,13 +873,13 @@ class TurboAssembler : public Assembler {
// Calls Abort(msg) if the condition cond is not satisfied.
// Use --debug_code to enable.
- void Assert(Condition cond, BailoutReason reason, CRegister cr = cr7);
+ void Assert(Condition cond, AbortReason reason, CRegister cr = cr7);
// Like Assert(), but always enabled.
- void Check(Condition cond, BailoutReason reason, CRegister cr = cr7);
+ void Check(Condition cond, AbortReason reason, CRegister cr = cr7);
// Print a message to stdout and abort execution.
- void Abort(BailoutReason reason);
+ void Abort(AbortReason reason);
void set_has_frame(bool value) { has_frame_ = value; }
bool has_frame() { return has_frame_; }
diff --git a/deps/v8/src/s390/simulator-s390.cc b/deps/v8/src/s390/simulator-s390.cc
index a130f359f0..f6754bdd4b 100644
--- a/deps/v8/src/s390/simulator-s390.cc
+++ b/deps/v8/src/s390/simulator-s390.cc
@@ -227,7 +227,7 @@ void S390Debugger::Debug() {
// If at a breakpoint, proceed past it.
if ((reinterpret_cast<Instruction*>(sim_->get_pc()))
- ->InstructionBits() == 0x7d821008) {
+ ->InstructionBits() == 0x7D821008) {
sim_->set_pc(sim_->get_pc() + sizeof(FourByteInstr));
} else {
sim_->ExecuteInstruction(
@@ -273,7 +273,7 @@ void S390Debugger::Debug() {
} else if ((strcmp(cmd, "c") == 0) || (strcmp(cmd, "cont") == 0)) {
// If at a breakpoint, proceed past it.
if ((reinterpret_cast<Instruction*>(sim_->get_pc()))
- ->InstructionBits() == 0x7d821008) {
+ ->InstructionBits() == 0x7D821008) {
sim_->set_pc(sim_->get_pc() + sizeof(FourByteInstr));
} else {
// Execute the one instruction we broke at with breakpoints disabled.
@@ -331,7 +331,7 @@ void S390Debugger::Debug() {
PrintF("%3s: %f 0x%08x %08x\n",
GetRegConfig()->GetDoubleRegisterName(i), dvalue,
static_cast<uint32_t>(as_words >> 32),
- static_cast<uint32_t>(as_words & 0xffffffff));
+ static_cast<uint32_t>(as_words & 0xFFFFFFFF));
}
} else if (arg1[0] == 'r' &&
(arg1[1] >= '0' && arg1[1] <= '2' &&
@@ -353,7 +353,7 @@ void S390Debugger::Debug() {
uint64_t as_words = bit_cast<uint64_t>(dvalue);
PrintF("%s: %f 0x%08x %08x\n", arg1, dvalue,
static_cast<uint32_t>(as_words >> 32),
- static_cast<uint32_t>(as_words & 0xffffffff));
+ static_cast<uint32_t>(as_words & 0xFFFFFFFF));
} else {
PrintF("%s unrecognized\n", arg1);
}
@@ -661,6 +661,15 @@ void Simulator::set_last_debugger_input(char* input) {
last_debugger_input_ = input;
}
+void Simulator::SetRedirectInstruction(Instruction* instruction) {
+// we use TRAP4 here (0xBF22)
+#if V8_TARGET_LITTLE_ENDIAN
+ instruction->SetInstructionBits(0x1000FFB2);
+#else
+ instruction->SetInstructionBits(0xB2FF0000 | kCallRtRedirected);
+#endif
+}
+
void Simulator::FlushICache(base::CustomMatcherHashMap* i_cache,
void* start_addr, size_t size) {
intptr_t start = reinterpret_cast<intptr_t>(start_addr);
@@ -728,15 +737,6 @@ void Simulator::CheckICache(base::CustomMatcherHashMap* i_cache,
}
}
-void Simulator::Initialize(Isolate* isolate) {
- if (isolate->simulator_initialized()) return;
- isolate->set_simulator_initialized(true);
- ::v8::internal::ExternalReference::set_redirector(isolate,
- &RedirectExternalReference);
- static base::OnceType once = V8_ONCE_INIT;
- base::CallOnce(&once, &Simulator::EvalTableInit);
-}
-
Simulator::EvaluateFuncType Simulator::EvalTable[] = {nullptr};
void Simulator::EvalTableInit() {
@@ -1493,7 +1493,8 @@ Simulator::Simulator(Isolate* isolate) : isolate_(isolate) {
i_cache_ = new base::CustomMatcherHashMap(&ICacheMatch);
isolate_->set_simulator_i_cache(i_cache_);
}
- Initialize(isolate);
+ static base::OnceType once = V8_ONCE_INIT;
+ base::CallOnce(&once, &Simulator::EvalTableInit);
// Set up simulator support first. Some of this information is needed to
// setup the architecture state.
#if V8_TARGET_ARCH_S390X
@@ -1538,119 +1539,6 @@ Simulator::Simulator(Isolate* isolate) : isolate_(isolate) {
Simulator::~Simulator() { free(stack_); }
-// When the generated code calls an external reference we need to catch that in
-// the simulator. The external reference will be a function compiled for the
-// host architecture. We need to call that function instead of trying to
-// execute it with the simulator. We do that by redirecting the external
-// reference to a svc (Supervisor Call) instruction that is handled by
-// the simulator. We write the original destination of the jump just at a known
-// offset from the svc instruction so the simulator knows what to call.
-class Redirection {
- public:
- Redirection(Isolate* isolate, void* external_function,
- ExternalReference::Type type)
- : external_function_(external_function),
-// we use TRAP4 here (0xBF22)
-#if V8_TARGET_LITTLE_ENDIAN
- swi_instruction_(0x1000FFB2),
-#else
- swi_instruction_(0xB2FF0000 | kCallRtRedirected),
-#endif
- type_(type),
- next_(nullptr) {
- next_ = isolate->simulator_redirection();
- Simulator::current(isolate)->FlushICache(
- isolate->simulator_i_cache(),
- reinterpret_cast<void*>(&swi_instruction_), sizeof(FourByteInstr));
- isolate->set_simulator_redirection(this);
- if (ABI_USES_FUNCTION_DESCRIPTORS) {
- function_descriptor_[0] = reinterpret_cast<intptr_t>(&swi_instruction_);
- function_descriptor_[1] = 0;
- function_descriptor_[2] = 0;
- }
- }
-
- void* address() {
- if (ABI_USES_FUNCTION_DESCRIPTORS) {
- return reinterpret_cast<void*>(function_descriptor_);
- } else {
- return reinterpret_cast<void*>(&swi_instruction_);
- }
- }
-
- void* external_function() { return external_function_; }
- ExternalReference::Type type() { return type_; }
-
- static Redirection* Get(Isolate* isolate, void* external_function,
- ExternalReference::Type type) {
- Redirection* current = isolate->simulator_redirection();
- for (; current != nullptr; current = current->next_) {
- if (current->external_function_ == external_function &&
- current->type_ == type) {
- return current;
- }
- }
- return new Redirection(isolate, external_function, type);
- }
-
- static Redirection* FromSwiInstruction(Instruction* swi_instruction) {
- char* addr_of_swi = reinterpret_cast<char*>(swi_instruction);
- char* addr_of_redirection =
- addr_of_swi - offsetof(Redirection, swi_instruction_);
- return reinterpret_cast<Redirection*>(addr_of_redirection);
- }
-
- static Redirection* FromAddress(void* address) {
- int delta = ABI_USES_FUNCTION_DESCRIPTORS
- ? offsetof(Redirection, function_descriptor_)
- : offsetof(Redirection, swi_instruction_);
- char* addr_of_redirection = reinterpret_cast<char*>(address) - delta;
- return reinterpret_cast<Redirection*>(addr_of_redirection);
- }
-
- static void* ReverseRedirection(intptr_t reg) {
- Redirection* redirection = FromAddress(reinterpret_cast<void*>(reg));
- return redirection->external_function();
- }
-
- static void DeleteChain(Redirection* redirection) {
- while (redirection != nullptr) {
- Redirection* next = redirection->next_;
- delete redirection;
- redirection = next;
- }
- }
-
- private:
- void* external_function_;
- uint32_t swi_instruction_;
- ExternalReference::Type type_;
- Redirection* next_;
- intptr_t function_descriptor_[3];
-};
-
-// static
-void Simulator::TearDown(base::CustomMatcherHashMap* i_cache,
- Redirection* first) {
- Redirection::DeleteChain(first);
- if (i_cache != nullptr) {
- for (base::HashMap::Entry* entry = i_cache->Start(); entry != nullptr;
- entry = i_cache->Next(entry)) {
- delete static_cast<CachePage*>(entry->value);
- }
- delete i_cache;
- }
-}
-
-void* Simulator::RedirectExternalReference(Isolate* isolate,
- void* external_function,
- ExternalReference::Type type) {
- base::LockGuard<base::Mutex> lock_guard(
- isolate->simulator_redirection_mutex());
- Redirection* redirection = Redirection::Get(isolate, external_function, type);
- return redirection->address();
-}
-
// Get the active Simulator for the current thread.
Simulator* Simulator::current(Isolate* isolate) {
v8::internal::Isolate::PerIsolateThreadData* isolate_data =
@@ -1761,9 +1649,9 @@ void Simulator::SetFpResult(const double& result) {
void Simulator::TrashCallerSaveRegisters() {
// We don't trash the registers with the return value.
#if 0 // A good idea to trash volatile registers, needs to be done
- registers_[2] = 0x50Bad4U;
- registers_[3] = 0x50Bad4U;
- registers_[12] = 0x50Bad4U;
+ registers_[2] = 0x50BAD4U;
+ registers_[3] = 0x50BAD4U;
+ registers_[12] = 0x50BAD4U;
#endif
}
@@ -1884,7 +1772,7 @@ void Simulator::Format(Instruction* instr, const char* format) {
bool Simulator::CarryFrom(int32_t left, int32_t right, int32_t carry) {
uint32_t uleft = static_cast<uint32_t>(left);
uint32_t uright = static_cast<uint32_t>(right);
- uint32_t urest = 0xffffffffU - uleft;
+ uint32_t urest = 0xFFFFFFFFU - uleft;
return (uright > urest) ||
(carry && (((uright + 1) > urest) || (uright > (urest - 1))));
@@ -1971,7 +1859,7 @@ void Simulator::SoftwareInterrupt(Instruction* instr) {
bool stack_aligned =
(get_register(sp) & (::v8::internal::FLAG_sim_stack_alignment - 1)) ==
0;
- Redirection* redirection = Redirection::FromSwiInstruction(instr);
+ Redirection* redirection = Redirection::FromInstruction(instr);
const int kArgCount = 9;
const int kRegisterArgCount = 5;
int arg0_regnum = 2;
@@ -2342,7 +2230,7 @@ void Simulator::DisableStop(uint32_t code) {
void Simulator::IncreaseStopCounter(uint32_t code) {
DCHECK_LE(code, kMaxStopCode);
DCHECK(isWatchedStop(code));
- if ((watched_stops_[code].count & ~(1 << 31)) == 0x7fffffff) {
+ if ((watched_stops_[code].count & ~(1 << 31)) == 0x7FFFFFFF) {
PrintF(
"Stop counter for code %i has overflowed.\n"
"Enabling this code and reseting the counter to 0.\n",
@@ -2409,7 +2297,7 @@ int16_t Simulator::ByteReverse(int16_t hword) {
#if defined(__GNUC__)
return __builtin_bswap16(hword);
#else
- return (hword << 8) | ((hword >> 8) & 0x00ff);
+ return (hword << 8) | ((hword >> 8) & 0x00FF);
#endif
}
@@ -2418,9 +2306,9 @@ int32_t Simulator::ByteReverse(int32_t word) {
return __builtin_bswap32(word);
#else
int32_t result = word << 24;
- result |= (word << 8) & 0x00ff0000;
- result |= (word >> 8) & 0x0000ff00;
- result |= (word >> 24) & 0x00000ff;
+ result |= (word << 8) & 0x00FF0000;
+ result |= (word >> 8) & 0x0000FF00;
+ result |= (word >> 24) & 0x00000FF;
return result;
#endif
}
@@ -2592,7 +2480,8 @@ void Simulator::CallInternal(byte* entry, int reg_arg_count) {
set_register(r13, r13_val);
}
-intptr_t Simulator::Call(byte* entry, int argument_count, ...) {
+intptr_t Simulator::CallImpl(byte* entry, int argument_count,
+ const intptr_t* arguments) {
// Adjust JS-based stack limit to C-based stack limit.
isolate_->stack_guard()->AdjustStackLimitForSimulator();
@@ -2606,16 +2495,13 @@ intptr_t Simulator::Call(byte* entry, int argument_count, ...) {
int64_t r12_val = get_register(r12);
int64_t r13_val = get_register(r13);
- va_list parameters;
- va_start(parameters, argument_count);
// Set up arguments
// First 5 arguments passed in registers r2-r6.
- int reg_arg_count = (argument_count > 5) ? 5 : argument_count;
+ int reg_arg_count = std::min(5, argument_count);
int stack_arg_count = argument_count - reg_arg_count;
for (int i = 0; i < reg_arg_count; i++) {
- intptr_t value = va_arg(parameters, intptr_t);
- set_register(i + 2, value);
+ set_register(i + 2, arguments[i]);
}
// Remaining arguments passed on stack.
@@ -2631,11 +2517,8 @@ intptr_t Simulator::Call(byte* entry, int argument_count, ...) {
// Store remaining arguments on stack, from low to high memory.
intptr_t* stack_argument =
reinterpret_cast<intptr_t*>(entry_stack + kCalleeRegisterSaveAreaSize);
- for (int i = 0; i < stack_arg_count; i++) {
- intptr_t value = va_arg(parameters, intptr_t);
- stack_argument[i] = value;
- }
- va_end(parameters);
+ memcpy(stack_argument, arguments + reg_arg_count,
+ stack_arg_count * sizeof(*arguments));
set_register(sp, entry_stack);
// Prepare to execute the code at entry
@@ -2716,8 +2599,7 @@ intptr_t Simulator::Call(byte* entry, int argument_count, ...) {
set_register(sp, original_stack);
// Return value register
- intptr_t result = get_register(r2);
- return result;
+ return get_register(r2);
}
void Simulator::CallFP(byte* entry, double d0, double d1) {
@@ -3663,7 +3545,7 @@ EVALUATE(EX) {
char new_instr_buf[8];
char* addr = reinterpret_cast<char*>(&new_instr_buf[0]);
- the_instr |= static_cast<SixByteInstr>(r1_val & 0xff)
+ the_instr |= static_cast<SixByteInstr>(r1_val & 0xFF)
<< (8 * inst_length - 16);
Instruction::SetInstructionBits<SixByteInstr>(
reinterpret_cast<byte*>(addr), static_cast<SixByteInstr>(the_instr));
@@ -4004,9 +3886,9 @@ EVALUATE(BXH) {
DECODE_RS_A_INSTRUCTION(r1, r3, b2, d2);
// r1_val is the first operand, r3_val is the increment
- int32_t r1_val = r1 == 0 ? 0 : get_register(r1);
- int32_t r3_val = r2 == 0 ? 0 : get_register(r3);
- intptr_t b2_val = b2 == 0 ? 0 : get_register(b2);
+ int32_t r1_val = (r1 == 0) ? 0 : get_register(r1);
+ int32_t r3_val = (r3 == 0) ? 0 : get_register(r3);
+ intptr_t b2_val = (b2 == 0) ? 0 : get_register(b2);
intptr_t branch_address = b2_val + d2;
// increment r1_val
r1_val += r3_val;
@@ -5464,7 +5346,7 @@ EVALUATE(TRAP4) {
int64_t sp_addr = get_register(sp);
for (int i = 0; i < kCalleeRegisterSaveAreaSize / kPointerSize; ++i) {
// we dont want to whack the RA (r14)
- if (i != 14) (reinterpret_cast<intptr_t*>(sp_addr))[i] = 0xdeadbabe;
+ if (i != 14) (reinterpret_cast<intptr_t*>(sp_addr))[i] = 0xDEADBABE;
}
SoftwareInterrupt(instr);
return length;
@@ -6948,7 +6830,7 @@ EVALUATE(LLGFR) {
DCHECK_OPCODE(LLGFR);
DECODE_RRE_INSTRUCTION(r1, r2);
int32_t r2_val = get_low_register<int32_t>(r2);
- uint64_t r2_finalval = (static_cast<uint64_t>(r2_val) & 0x00000000ffffffff);
+ uint64_t r2_finalval = (static_cast<uint64_t>(r2_val) & 0x00000000FFFFFFFF);
set_register(r1, r2_finalval);
return length;
}
@@ -8017,8 +7899,8 @@ EVALUATE(LRVH) {
int64_t b2_val = (b2 == 0) ? 0 : get_register(b2);
intptr_t mem_addr = b2_val + x2_val + d2;
int16_t mem_val = ReadH(mem_addr, instr);
- int32_t result = ByteReverse(mem_val) & 0x0000ffff;
- result |= r1_val & 0xffff0000;
+ int32_t result = ByteReverse(mem_val) & 0x0000FFFF;
+ result |= r1_val & 0xFFFF0000;
set_low_register(r1, result);
return length;
}
diff --git a/deps/v8/src/s390/simulator-s390.h b/deps/v8/src/s390/simulator-s390.h
index a214b198df..1ff8020e6a 100644
--- a/deps/v8/src/s390/simulator-s390.h
+++ b/deps/v8/src/s390/simulator-s390.h
@@ -5,7 +5,7 @@
// Declares a Simulator for S390 instructions if we are not generating a native
// S390 binary. This Simulator allows us to run and debug S390 code generation
// on regular desktop machines.
-// V8 calls into generated code by "calling" the CALL_GENERATED_CODE macro,
+// V8 calls into generated code via the GeneratedCode wrapper,
// which will start execution in the Simulator or forwards to the real entry
// on a S390 hardware platform.
@@ -14,56 +14,13 @@
#include "src/allocation.h"
-#if !defined(USE_SIMULATOR)
-// Running without a simulator on a native s390 platform.
-
-namespace v8 {
-namespace internal {
-
-// When running without a simulator we call the entry directly.
-#define CALL_GENERATED_CODE(isolate, entry, p0, p1, p2, p3, p4) \
- (entry(p0, p1, p2, p3, p4))
-
-typedef int (*s390_regexp_matcher)(String*, int, const byte*, const byte*, int*,
- int, Address, int, Isolate*);
-
-// Call the generated regexp code directly. The code at the entry address
-// should act as a function matching the type ppc_regexp_matcher.
-#define CALL_GENERATED_REGEXP_CODE(isolate, entry, p0, p1, p2, p3, p4, p5, p6, \
- p7, p8) \
- (FUNCTION_CAST<s390_regexp_matcher>(entry)(p0, p1, p2, p3, p4, p5, p6, p7, \
- p8))
-
-// The stack limit beyond which we will throw stack overflow errors in
-// generated code. Because generated code on s390 uses the C stack, we
-// just use the C stack limit.
-class SimulatorStack : public v8::internal::AllStatic {
- public:
- static inline uintptr_t JsLimitFromCLimit(v8::internal::Isolate* isolate,
- uintptr_t c_limit) {
- USE(isolate);
- return c_limit;
- }
-
- static inline uintptr_t RegisterCTryCatch(v8::internal::Isolate* isolate,
- uintptr_t try_catch_address) {
- USE(isolate);
- return try_catch_address;
- }
-
- static inline void UnregisterCTryCatch(v8::internal::Isolate* isolate) {
- USE(isolate);
- }
-};
-} // namespace internal
-} // namespace v8
-
-#else // !defined(USE_SIMULATOR)
+#if defined(USE_SIMULATOR)
// Running with a simulator.
#include "src/assembler.h"
#include "src/base/hashmap.h"
#include "src/s390/constants-s390.h"
+#include "src/simulator-base.h"
namespace v8 {
namespace internal {
@@ -94,7 +51,7 @@ class CachePage {
char validity_map_[kValidityMapSize]; // One byte per line.
};
-class Simulator {
+class Simulator : public SimulatorBase {
public:
friend class S390Debugger;
enum Register {
@@ -206,15 +163,11 @@ class Simulator {
// Executes S390 instructions until the PC reaches end_sim_pc.
void Execute();
- // Call on program start.
- static void Initialize(Isolate* isolate);
-
- static void TearDown(base::CustomMatcherHashMap* i_cache, Redirection* first);
+ template <typename Return, typename... Args>
+ Return Call(byte* entry, Args... args) {
+ return VariadicCall<Return>(this, &Simulator::CallImpl, entry, args...);
+ }
- // V8 generally calls into generated JS code with 5 parameters and into
- // generated RegExp code with 7 parameters. This is a convenience function,
- // which sets up the simulator state and grabs the result on return.
- intptr_t Call(byte* entry, int argument_count, ...);
// Alternative: call a 2-argument double function.
void CallFP(byte* entry, double d0, double d1);
int32_t CallFPReturnsInt(byte* entry, double d0, double d1);
@@ -230,6 +183,9 @@ class Simulator {
void set_last_debugger_input(char* input);
char* last_debugger_input() { return last_debugger_input_; }
+ // Redirection support.
+ static void SetRedirectInstruction(Instruction* instruction);
+
// ICache checking.
static void FlushICache(base::CustomMatcherHashMap* i_cache, void* start,
size_t size);
@@ -250,6 +206,8 @@ class Simulator {
end_sim_pc = -2
};
+ intptr_t CallImpl(byte* entry, int argument_count, const intptr_t* arguments);
+
// Unsupported instructions use Format to print an error and stop execution.
void Format(Instruction* instr, const char* format);
@@ -440,11 +398,6 @@ class Simulator {
static CachePage* GetCachePage(base::CustomMatcherHashMap* i_cache,
void* page);
- // Runtime call support. Uses the isolate in a thread-safe way.
- static void* RedirectExternalReference(
- Isolate* isolate, void* external_function,
- v8::internal::ExternalReference::Type type);
-
// Handle arguments and return value for runtime FP functions.
void GetFpArgs(double* x, double* y, intptr_t* z);
void SetFpResult(const double& result);
@@ -1248,43 +1201,8 @@ class Simulator {
#undef EVALUATE
};
-// When running with the simulator transition into simulated execution at this
-// point.
-#define CALL_GENERATED_CODE(isolate, entry, p0, p1, p2, p3, p4) \
- reinterpret_cast<Object*>(Simulator::current(isolate)->Call( \
- FUNCTION_ADDR(entry), 5, (intptr_t)p0, (intptr_t)p1, (intptr_t)p2, \
- (intptr_t)p3, (intptr_t)p4))
-
-#define CALL_GENERATED_REGEXP_CODE(isolate, entry, p0, p1, p2, p3, p4, p5, p6, \
- p7, p8) \
- Simulator::current(isolate)->Call( \
- entry, 9, (intptr_t)p0, (intptr_t)p1, (intptr_t)p2, (intptr_t)p3, \
- (intptr_t)p4, (intptr_t)p5, (intptr_t)p6, (intptr_t)p7, (intptr_t)p8)
-
-// The simulator has its own stack. Thus it has a different stack limit from
-// the C-based native code. The JS-based limit normally points near the end of
-// the simulator stack. When the C-based limit is exhausted we reflect that by
-// lowering the JS-based limit as well, to make stack checks trigger.
-class SimulatorStack : public v8::internal::AllStatic {
- public:
- static inline uintptr_t JsLimitFromCLimit(v8::internal::Isolate* isolate,
- uintptr_t c_limit) {
- return Simulator::current(isolate)->StackLimit(c_limit);
- }
-
- static inline uintptr_t RegisterCTryCatch(v8::internal::Isolate* isolate,
- uintptr_t try_catch_address) {
- Simulator* sim = Simulator::current(isolate);
- return sim->PushAddress(try_catch_address);
- }
-
- static inline void UnregisterCTryCatch(v8::internal::Isolate* isolate) {
- Simulator::current(isolate)->PopAddress();
- }
-};
-
} // namespace internal
} // namespace v8
-#endif // !defined(USE_SIMULATOR)
+#endif // defined(USE_SIMULATOR)
#endif // V8_S390_SIMULATOR_S390_H_