aboutsummaryrefslogtreecommitdiff
path: root/deps/v8/src/ppc
diff options
context:
space:
mode:
authorMichaël Zasso <targos@protonmail.com>2018-09-21 09:14:51 +0200
committerMichaël Zasso <targos@protonmail.com>2018-09-22 18:29:25 +0200
commit0e7ddbd3d7e9439c67573b854c49cf82c398ae82 (patch)
tree2afe372acde921cb57ddb3444ff00c5adef8848c /deps/v8/src/ppc
parent13245dc50da4cb7443c39ef6c68d419d5e6336d4 (diff)
downloadandroid-node-v8-0e7ddbd3d7e9439c67573b854c49cf82c398ae82.tar.gz
android-node-v8-0e7ddbd3d7e9439c67573b854c49cf82c398ae82.tar.bz2
android-node-v8-0e7ddbd3d7e9439c67573b854c49cf82c398ae82.zip
deps: update V8 to 7.0.276.20
PR-URL: https://github.com/nodejs/node/pull/22754 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Ali Ijaz Sheikh <ofrobots@google.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Diffstat (limited to 'deps/v8/src/ppc')
-rw-r--r--deps/v8/src/ppc/assembler-ppc-inl.h22
-rw-r--r--deps/v8/src/ppc/assembler-ppc.cc4
-rw-r--r--deps/v8/src/ppc/assembler-ppc.h5
-rw-r--r--deps/v8/src/ppc/code-stubs-ppc.cc12
-rw-r--r--deps/v8/src/ppc/codegen-ppc.cc3
-rw-r--r--deps/v8/src/ppc/constants-ppc.h23
-rw-r--r--deps/v8/src/ppc/disasm-ppc.cc17
-rw-r--r--deps/v8/src/ppc/interface-descriptors-ppc.cc24
-rw-r--r--deps/v8/src/ppc/macro-assembler-ppc.cc108
-rw-r--r--deps/v8/src/ppc/macro-assembler-ppc.h52
-rw-r--r--deps/v8/src/ppc/simulator-ppc.cc32
11 files changed, 70 insertions, 232 deletions
diff --git a/deps/v8/src/ppc/assembler-ppc-inl.h b/deps/v8/src/ppc/assembler-ppc-inl.h
index 73c2e8dfe2..e3dbaa96c9 100644
--- a/deps/v8/src/ppc/assembler-ppc-inl.h
+++ b/deps/v8/src/ppc/assembler-ppc-inl.h
@@ -54,8 +54,8 @@ void RelocInfo::apply(intptr_t delta) {
// absolute code pointer inside code object moves with the code object.
if (IsInternalReference(rmode_)) {
// Jump table entry
- Address target = Memory::Address_at(pc_);
- Memory::Address_at(pc_) = target + delta;
+ Address target = Memory<Address>(pc_);
+ Memory<Address>(pc_) = target + delta;
} else {
// mov sequence
DCHECK(IsInternalReferenceEncoded(rmode_));
@@ -69,7 +69,7 @@ void RelocInfo::apply(intptr_t delta) {
Address RelocInfo::target_internal_reference() {
if (IsInternalReference(rmode_)) {
// Jump table entry
- return Memory::Address_at(pc_);
+ return Memory<Address>(pc_);
} else {
// mov sequence
DCHECK(IsInternalReferenceEncoded(rmode_));
@@ -181,8 +181,7 @@ void RelocInfo::set_target_object(Heap* heap, HeapObject* target,
reinterpret_cast<Address>(target),
icache_flush_mode);
if (write_barrier_mode == UPDATE_WRITE_BARRIER && host() != nullptr) {
- heap->incremental_marking()->RecordWriteIntoCode(host(), this, target);
- heap->RecordWriteIntoCode(host(), this, target);
+ WriteBarrierForCode(host(), this, target);
}
}
@@ -220,11 +219,12 @@ Address RelocInfo::target_off_heap_target() {
void RelocInfo::WipeOut() {
DCHECK(IsEmbeddedObject(rmode_) || IsCodeTarget(rmode_) ||
IsRuntimeEntry(rmode_) || IsExternalReference(rmode_) ||
- IsInternalReference(rmode_) || IsInternalReferenceEncoded(rmode_));
+ IsInternalReference(rmode_) || IsInternalReferenceEncoded(rmode_) ||
+ IsOffHeapTarget(rmode_));
if (IsInternalReference(rmode_)) {
// Jump table entry
- Memory::Address_at(pc_) = kNullAddress;
- } else if (IsInternalReferenceEncoded(rmode_)) {
+ Memory<Address>(pc_) = kNullAddress;
+ } else if (IsInternalReferenceEncoded(rmode_) || IsOffHeapTarget(rmode_)) {
// mov sequence
// Currently used only by deserializer, no need to flush.
Assembler::set_target_address_at(pc_, constant_pool_, kNullAddress,
@@ -272,7 +272,7 @@ Address Assembler::target_address_at(Address pc, Address constant_pool) {
if (FLAG_enable_embedded_constant_pool && constant_pool) {
ConstantPoolEntry::Access access;
if (IsConstantPoolLoadStart(pc, &access))
- return Memory::Address_at(target_constant_pool_address_at(
+ return Memory<Address>(target_constant_pool_address_at(
pc, constant_pool, access, ConstantPoolEntry::INTPTR));
}
@@ -441,7 +441,7 @@ void Assembler::deserialization_set_target_internal_reference_at(
if (RelocInfo::IsInternalReferenceEncoded(mode)) {
set_target_address_at(pc, kNullAddress, target, SKIP_ICACHE_FLUSH);
} else {
- Memory::Address_at(pc) = target;
+ Memory<Address>(pc) = target;
}
}
@@ -453,7 +453,7 @@ void Assembler::set_target_address_at(Address pc, Address constant_pool,
if (FLAG_enable_embedded_constant_pool && constant_pool) {
ConstantPoolEntry::Access access;
if (IsConstantPoolLoadStart(pc, &access)) {
- Memory::Address_at(target_constant_pool_address_at(
+ Memory<Address>(target_constant_pool_address_at(
pc, constant_pool, access, ConstantPoolEntry::INTPTR)) = target;
return;
}
diff --git a/deps/v8/src/ppc/assembler-ppc.cc b/deps/v8/src/ppc/assembler-ppc.cc
index c43b955210..24d9d2b8f3 100644
--- a/deps/v8/src/ppc/assembler-ppc.cc
+++ b/deps/v8/src/ppc/assembler-ppc.cc
@@ -2094,8 +2094,8 @@ void Assembler::EmitRelocations() {
// Fix up internal references now that they are guaranteed to be bound.
if (RelocInfo::IsInternalReference(rmode)) {
// Jump table entry
- intptr_t pos = static_cast<intptr_t>(Memory::Address_at(pc));
- Memory::Address_at(pc) = reinterpret_cast<Address>(buffer_) + pos;
+ intptr_t pos = static_cast<intptr_t>(Memory<Address>(pc));
+ Memory<Address>(pc) = reinterpret_cast<Address>(buffer_) + pos;
} else if (RelocInfo::IsInternalReferenceEncoded(rmode)) {
// mov sequence
intptr_t pos = static_cast<intptr_t>(target_address_at(pc, kNullAddress));
diff --git a/deps/v8/src/ppc/assembler-ppc.h b/deps/v8/src/ppc/assembler-ppc.h
index 0fde450f07..b737320cbb 100644
--- a/deps/v8/src/ppc/assembler-ppc.h
+++ b/deps/v8/src/ppc/assembler-ppc.h
@@ -298,7 +298,6 @@ GENERAL_REGISTERS(DEFINE_REGISTER)
constexpr Register no_reg = Register::no_reg();
// Aliases
-constexpr Register kLithiumScratch = r11; // lithium scratch.
constexpr Register kConstantPoolRegister = r28; // Constant pool.
constexpr Register kRootRegister = r29; // Roots array pointer.
constexpr Register cp = r30; // JavaScript context pointer.
@@ -597,9 +596,6 @@ class Assembler : public AssemblerBase {
Address pc, Address target,
RelocInfo::Mode mode = RelocInfo::INTERNAL_REFERENCE);
- // Size of an instruction.
- static constexpr int kInstrSize = sizeof(Instr);
-
// Here we are patching the address in the LUI/ORI instruction pair.
// These values are used in the serialization process and must be zero for
// PPC platform, as Code, Embedded Object or External-reference pointers
@@ -663,7 +659,6 @@ class Assembler : public AssemblerBase {
template <class R> \
inline void name(const R rt, const Register ra, const Register rb, \
const RCBit rc = LeaveRC) { \
- DCHECK(ra != r0); \
x_form(instr_name, rt.code(), ra.code(), rb.code(), rc); \
} \
template <class R> \
diff --git a/deps/v8/src/ppc/code-stubs-ppc.cc b/deps/v8/src/ppc/code-stubs-ppc.cc
index f4c286fdc7..cfa2709fd5 100644
--- a/deps/v8/src/ppc/code-stubs-ppc.cc
+++ b/deps/v8/src/ppc/code-stubs-ppc.cc
@@ -4,7 +4,7 @@
#if V8_TARGET_ARCH_PPC
-#include "src/api-arguments.h"
+#include "src/api-arguments-inl.h"
#include "src/assembler-inl.h"
#include "src/base/bits.h"
#include "src/bootstrapper.h"
@@ -222,9 +222,9 @@ void ProfileEntryHookStub::MaybeCallEntryHookDelayed(TurboAssembler* tasm,
if (tasm->isolate()->function_entry_hook() != nullptr) {
PredictableCodeSizeScope predictable(tasm,
#if V8_TARGET_ARCH_PPC64
- 14 * Assembler::kInstrSize);
+ 14 * kInstrSize);
#else
- 11 * Assembler::kInstrSize);
+ 11 * kInstrSize);
#endif
tasm->mflr(r0);
tasm->Push(r0, ip);
@@ -238,9 +238,9 @@ void ProfileEntryHookStub::MaybeCallEntryHook(MacroAssembler* masm) {
if (masm->isolate()->function_entry_hook() != nullptr) {
PredictableCodeSizeScope predictable(masm,
#if V8_TARGET_ARCH_PPC64
- 14 * Assembler::kInstrSize);
+ 14 * kInstrSize);
#else
- 11 * Assembler::kInstrSize);
+ 11 * kInstrSize);
#endif
ProfileEntryHookStub stub(masm->isolate());
__ mflr(r0);
@@ -255,7 +255,7 @@ void ProfileEntryHookStub::MaybeCallEntryHook(MacroAssembler* masm) {
void ProfileEntryHookStub::Generate(MacroAssembler* masm) {
// The entry hook is a "push lr, ip" instruction, followed by a call.
const int32_t kReturnAddressDistanceFromFunctionStart =
- Assembler::kCallTargetAddressOffset + 3 * Assembler::kInstrSize;
+ Assembler::kCallTargetAddressOffset + 3 * kInstrSize;
// This should contain all kJSCallerSaved registers.
const RegList kSavedRegs = kJSCallerSaved | // Caller saved registers.
diff --git a/deps/v8/src/ppc/codegen-ppc.cc b/deps/v8/src/ppc/codegen-ppc.cc
index a2a9013b1c..65963b9af6 100644
--- a/deps/v8/src/ppc/codegen-ppc.cc
+++ b/deps/v8/src/ppc/codegen-ppc.cc
@@ -37,7 +37,8 @@ UnaryMathFunctionWithIsolate CreateSqrtFunction(Isolate* isolate) {
CodeDesc desc;
masm.GetCode(isolate, &desc);
- DCHECK(ABI_USES_FUNCTION_DESCRIPTORS || !RelocInfo::RequiresRelocation(desc));
+ DCHECK(ABI_USES_FUNCTION_DESCRIPTORS ||
+ !RelocInfo::RequiresRelocationAfterCodegen(desc));
Assembler::FlushICache(buffer, allocated);
CHECK(SetPermissions(buffer, allocated, PageAllocator::kReadExecute));
diff --git a/deps/v8/src/ppc/constants-ppc.h b/deps/v8/src/ppc/constants-ppc.h
index 673e5dc9b7..0f2679008c 100644
--- a/deps/v8/src/ppc/constants-ppc.h
+++ b/deps/v8/src/ppc/constants-ppc.h
@@ -88,22 +88,6 @@ inline Condition NegateCondition(Condition cond) {
}
-// Commute a condition such that {a cond b == b cond' a}.
-inline Condition CommuteCondition(Condition cond) {
- switch (cond) {
- case lt:
- return gt;
- case gt:
- return lt;
- case ge:
- return le;
- case le:
- return ge;
- default:
- return cond;
- }
-}
-
// -----------------------------------------------------------------------------
// Instructions encoding.
@@ -2756,10 +2740,13 @@ const Instr rtCallRedirInstr = TWI;
// return ((type == 0) || (type == 1)) && instr->HasS();
// }
//
+
+constexpr uint8_t kInstrSize = 4;
+constexpr uint8_t kInstrSizeLog2 = 2;
+constexpr uint8_t kPcLoadDelta = 8;
+
class Instruction {
public:
- enum { kInstrSize = 4, kInstrSizeLog2 = 2, kPCReadOffset = 8 };
-
// Helper macro to define static accessors.
// We use the cast to char* trick to bypass the strict anti-aliasing rules.
#define DECLARE_STATIC_TYPED_ACCESSOR(return_type, Name) \
diff --git a/deps/v8/src/ppc/disasm-ppc.cc b/deps/v8/src/ppc/disasm-ppc.cc
index 5564fd9c32..1b8a1139a3 100644
--- a/deps/v8/src/ppc/disasm-ppc.cc
+++ b/deps/v8/src/ppc/disasm-ppc.cc
@@ -1157,7 +1157,7 @@ int Decoder::InstructionDecode(byte* instr_ptr) {
// The first field will be identified as a jump table entry. We
// emit the rest of the structure as zero, so just skip past them.
Format(instr, "constant");
- return Instruction::kInstrSize;
+ return kInstrSize;
}
uint32_t opcode = instr->OpcodeValue() << 26;
@@ -1466,7 +1466,7 @@ int Decoder::InstructionDecode(byte* instr_ptr) {
}
}
- return Instruction::kInstrSize;
+ return kInstrSize;
}
} // namespace internal
} // namespace v8
@@ -1512,13 +1512,6 @@ const char* NameConverter::NameInCode(byte* addr) const {
//------------------------------------------------------------------------------
-Disassembler::Disassembler(const NameConverter& converter)
- : converter_(converter) {}
-
-
-Disassembler::~Disassembler() {}
-
-
int Disassembler::InstructionDecode(v8::internal::Vector<char> buffer,
byte* instruction) {
v8::internal::Decoder d(converter_, buffer);
@@ -1529,10 +1522,10 @@ int Disassembler::InstructionDecode(v8::internal::Vector<char> buffer,
// The PPC assembler does not currently use constant pools.
int Disassembler::ConstantPoolSizeAt(byte* instruction) { return -1; }
-
-void Disassembler::Disassemble(FILE* f, byte* begin, byte* end) {
+void Disassembler::Disassemble(FILE* f, byte* begin, byte* end,
+ UnimplementedOpcodeAction unimplemented_action) {
NameConverter converter;
- Disassembler d(converter);
+ Disassembler d(converter, unimplemented_action);
for (byte* pc = begin; pc < end;) {
v8::internal::EmbeddedVector<char, 128> buffer;
buffer[0] = '\0';
diff --git a/deps/v8/src/ppc/interface-descriptors-ppc.cc b/deps/v8/src/ppc/interface-descriptors-ppc.cc
index c446a74e10..857ab7a883 100644
--- a/deps/v8/src/ppc/interface-descriptors-ppc.cc
+++ b/deps/v8/src/ppc/interface-descriptors-ppc.cc
@@ -246,30 +246,6 @@ void InterpreterPushArgsThenConstructDescriptor::InitializePlatformSpecific(
data->InitializePlatformSpecific(arraysize(registers), registers);
}
-namespace {
-
-void InterpreterCEntryDescriptor_InitializePlatformSpecific(
- CallInterfaceDescriptorData* data) {
- Register registers[] = {
- r3, // argument count (argc)
- r5, // address of first argument (argv)
- r4 // the runtime function to call
- };
- data->InitializePlatformSpecific(arraysize(registers), registers);
-}
-
-} // namespace
-
-void InterpreterCEntry1Descriptor::InitializePlatformSpecific(
- CallInterfaceDescriptorData* data) {
- InterpreterCEntryDescriptor_InitializePlatformSpecific(data);
-}
-
-void InterpreterCEntry2Descriptor::InitializePlatformSpecific(
- CallInterfaceDescriptorData* data) {
- InterpreterCEntryDescriptor_InitializePlatformSpecific(data);
-}
-
void ResumeGeneratorDescriptor::InitializePlatformSpecific(
CallInterfaceDescriptorData* data) {
Register registers[] = {
diff --git a/deps/v8/src/ppc/macro-assembler-ppc.cc b/deps/v8/src/ppc/macro-assembler-ppc.cc
index 13e04a2c8c..5605907d6f 100644
--- a/deps/v8/src/ppc/macro-assembler-ppc.cc
+++ b/deps/v8/src/ppc/macro-assembler-ppc.cc
@@ -20,6 +20,7 @@
#include "src/register-configuration.h"
#include "src/runtime/runtime.h"
#include "src/snapshot/snapshot.h"
+#include "src/wasm/wasm-code-manager.h"
#include "src/ppc/macro-assembler-ppc.h"
@@ -196,6 +197,7 @@ void TurboAssembler::Jump(Handle<Code> code, RelocInfo::Mode rmode,
if (isolate()->builtins()->IsBuiltinHandle(code, &builtin_index) &&
Builtins::IsIsolateIndependent(builtin_index)) {
// Inline the trampoline.
+ RecordCommentForOffHeapTrampoline(builtin_index);
EmbeddedData d = EmbeddedData::FromBlob();
Address entry = d.InstructionStartOfBuiltin(builtin_index);
// Use ip directly instead of using UseScratchRegisterScope, as we do
@@ -212,18 +214,11 @@ void TurboAssembler::Jump(Handle<Code> code, RelocInfo::Mode rmode,
Jump(static_cast<intptr_t>(code.address()), rmode, cond, cr);
}
-int TurboAssembler::CallSize(Register target) { return 2 * kInstrSize; }
-
void TurboAssembler::Call(Register target) {
BlockTrampolinePoolScope block_trampoline_pool(this);
- Label start;
- bind(&start);
-
// branch via link register and set LK bit for return point
mtctr(target);
bctrl();
-
- DCHECK_EQ(CallSize(target), SizeOfCodeGeneratedSince(&start));
}
void MacroAssembler::CallJSEntry(Register target) {
@@ -231,12 +226,6 @@ void MacroAssembler::CallJSEntry(Register target) {
Call(target);
}
-int TurboAssembler::CallSize(Address target, RelocInfo::Mode rmode,
- Condition cond) {
- Operand mov_operand = Operand(target, rmode);
- return (2 + instructions_required_for_mov(ip, mov_operand)) * kInstrSize;
-}
-
int MacroAssembler::CallSizeNotPredictableCodeSize(Address target,
RelocInfo::Mode rmode,
Condition cond) {
@@ -248,13 +237,6 @@ void TurboAssembler::Call(Address target, RelocInfo::Mode rmode,
BlockTrampolinePoolScope block_trampoline_pool(this);
DCHECK(cond == al);
-#ifdef DEBUG
- // Check the expected size before generating code to ensure we assume the same
- // constant pool availability (e.g., whether constant pool is full or not).
- int expected_size = CallSize(target, rmode, cond);
- Label start;
- bind(&start);
-#endif
// This can likely be optimized to make use of bc() with 24bit relative
//
// RecordRelocInfo(x.rmode_, x.immediate);
@@ -264,13 +246,6 @@ void TurboAssembler::Call(Address target, RelocInfo::Mode rmode,
mov(ip, Operand(target, rmode));
mtctr(ip);
bctrl();
-
- DCHECK_EQ(expected_size, SizeOfCodeGeneratedSince(&start));
-}
-
-int TurboAssembler::CallSize(Handle<Code> code, RelocInfo::Mode rmode,
- Condition cond) {
- return CallSize(code.address(), rmode, cond);
}
void TurboAssembler::Call(Handle<Code> code, RelocInfo::Mode rmode,
@@ -294,6 +269,7 @@ void TurboAssembler::Call(Handle<Code> code, RelocInfo::Mode rmode,
if (isolate()->builtins()->IsBuiltinHandle(code, &builtin_index) &&
Builtins::IsIsolateIndependent(builtin_index)) {
// Inline the trampoline.
+ RecordCommentForOffHeapTrampoline(builtin_index);
DCHECK(Builtins::IsBuiltinId(builtin_index));
EmbeddedData d = EmbeddedData::FromBlob();
Address entry = d.InstructionStartOfBuiltin(builtin_index);
@@ -933,11 +909,10 @@ void TurboAssembler::LoadPC(Register dst) {
}
void TurboAssembler::ComputeCodeStartAddress(Register dst) {
- Label current_pc;
- mov_label_addr(dst, &current_pc);
-
- bind(&current_pc);
- subi(dst, dst, Operand(pc_offset()));
+ mflr(r0);
+ LoadPC(dst);
+ subi(dst, dst, Operand(pc_offset() - kInstrSize));
+ mtlr(r0);
}
void TurboAssembler::LoadConstantPoolPointerRegister() {
@@ -1789,6 +1764,18 @@ void TurboAssembler::Abort(AbortReason reason) {
return;
}
+ if (should_abort_hard()) {
+ // We don't care if we constructed a frame. Just pretend we did.
+ FrameScope assume_frame(this, StackFrame::NONE);
+ mov(r3, Operand(static_cast<int>(reason)));
+ PrepareCallCFunction(1, 0, r4);
+ Move(ip, ExternalReference::abort_with_reason());
+ // Use Call directly to avoid any unneeded overhead. The function won't
+ // return anyway.
+ Call(ip);
+ return;
+ }
+
LoadSmiLiteral(r4, Smi::FromInt(static_cast<int>(reason)));
// Disable stub call restrictions to always allow calls to abort.
@@ -2910,8 +2897,10 @@ void TurboAssembler::SwapP(Register src, Register dst, Register scratch) {
}
void TurboAssembler::SwapP(Register src, MemOperand dst, Register scratch) {
- if (dst.ra() != r0) DCHECK(!AreAliased(src, dst.ra(), scratch));
- if (dst.rb() != r0) DCHECK(!AreAliased(src, dst.rb(), scratch));
+ if (dst.ra() != r0 && dst.ra().is_valid())
+ DCHECK(!AreAliased(src, dst.ra(), scratch));
+ if (dst.rb() != r0 && dst.rb().is_valid())
+ DCHECK(!AreAliased(src, dst.rb(), scratch));
DCHECK(!AreAliased(src, scratch));
mr(scratch, src);
LoadP(src, dst, r0);
@@ -3004,57 +2993,6 @@ void TurboAssembler::SwapDouble(MemOperand src, MemOperand dst,
StoreDouble(scratch_1, src, r0);
}
-#ifdef DEBUG
-bool AreAliased(Register reg1, Register reg2, Register reg3, Register reg4,
- Register reg5, Register reg6, Register reg7, Register reg8,
- Register reg9, Register reg10) {
- int n_of_valid_regs = reg1.is_valid() + reg2.is_valid() + reg3.is_valid() +
- reg4.is_valid() + reg5.is_valid() + reg6.is_valid() +
- reg7.is_valid() + reg8.is_valid() + reg9.is_valid() +
- reg10.is_valid();
-
- RegList regs = 0;
- if (reg1.is_valid()) regs |= reg1.bit();
- if (reg2.is_valid()) regs |= reg2.bit();
- if (reg3.is_valid()) regs |= reg3.bit();
- if (reg4.is_valid()) regs |= reg4.bit();
- if (reg5.is_valid()) regs |= reg5.bit();
- if (reg6.is_valid()) regs |= reg6.bit();
- if (reg7.is_valid()) regs |= reg7.bit();
- if (reg8.is_valid()) regs |= reg8.bit();
- if (reg9.is_valid()) regs |= reg9.bit();
- if (reg10.is_valid()) regs |= reg10.bit();
- int n_of_non_aliasing_regs = NumRegs(regs);
-
- return n_of_valid_regs != n_of_non_aliasing_regs;
-}
-
-bool AreAliased(DoubleRegister reg1, DoubleRegister reg2, DoubleRegister reg3,
- DoubleRegister reg4, DoubleRegister reg5, DoubleRegister reg6,
- DoubleRegister reg7, DoubleRegister reg8, DoubleRegister reg9,
- DoubleRegister reg10) {
- int n_of_valid_regs = reg1.is_valid() + reg2.is_valid() + reg3.is_valid() +
- reg4.is_valid() + reg5.is_valid() + reg6.is_valid() +
- reg7.is_valid() + reg8.is_valid() + reg9.is_valid() +
- reg10.is_valid();
-
- RegList regs = 0;
- if (reg1.is_valid()) regs |= reg1.bit();
- if (reg2.is_valid()) regs |= reg2.bit();
- if (reg3.is_valid()) regs |= reg3.bit();
- if (reg4.is_valid()) regs |= reg4.bit();
- if (reg5.is_valid()) regs |= reg5.bit();
- if (reg6.is_valid()) regs |= reg6.bit();
- if (reg7.is_valid()) regs |= reg7.bit();
- if (reg8.is_valid()) regs |= reg8.bit();
- if (reg9.is_valid()) regs |= reg9.bit();
- if (reg10.is_valid()) regs |= reg10.bit();
- int n_of_non_aliasing_regs = NumRegs(regs);
-
- return n_of_valid_regs != n_of_non_aliasing_regs;
-}
-#endif
-
void TurboAssembler::ResetSpeculationPoisonRegister() {
mov(kSpeculationPoisonRegister, Operand(-1));
}
diff --git a/deps/v8/src/ppc/macro-assembler-ppc.h b/deps/v8/src/ppc/macro-assembler-ppc.h
index daf1fbdb6a..364b60d037 100644
--- a/deps/v8/src/ppc/macro-assembler-ppc.h
+++ b/deps/v8/src/ppc/macro-assembler-ppc.h
@@ -37,6 +37,7 @@ constexpr Register kJavaScriptCallExtraArg1Register = r5;
constexpr Register kOffHeapTrampolineRegister = ip;
constexpr Register kRuntimeCallFunctionRegister = r4;
constexpr Register kRuntimeCallArgCountRegister = r3;
+constexpr Register kRuntimeCallArgvRegister = r5;
constexpr Register kWasmInstanceRegister = r10;
// ----------------------------------------------------------------------------
@@ -47,16 +48,6 @@ inline MemOperand FieldMemOperand(Register object, int offset) {
return MemOperand(object, offset - kHeapObjectTag);
}
-
-// Flags used for AllocateHeapNumber
-enum TaggingMode {
- // Tag the result.
- TAG_RESULT,
- // Don't tag
- DONT_TAG_RESULT
-};
-
-
enum RememberedSetAction { EMIT_REMEMBERED_SET, OMIT_REMEMBERED_SET };
enum SmiCheck { INLINE_SMI_CHECK, OMIT_SMI_CHECK };
enum LinkRegisterStatus { kLRHasNotBeenSaved, kLRHasBeenSaved };
@@ -68,20 +59,6 @@ Register GetRegisterThatIsNotOneOf(Register reg1, Register reg2 = no_reg,
Register reg5 = no_reg,
Register reg6 = no_reg);
-
-#ifdef DEBUG
-bool AreAliased(Register reg1, Register reg2, Register reg3 = no_reg,
- Register reg4 = no_reg, Register reg5 = no_reg,
- Register reg6 = no_reg, Register reg7 = no_reg,
- Register reg8 = no_reg, Register reg9 = no_reg,
- Register reg10 = no_reg);
-bool AreAliased(DoubleRegister reg1, DoubleRegister reg2,
- DoubleRegister reg3 = no_dreg, DoubleRegister reg4 = no_dreg,
- DoubleRegister reg5 = no_dreg, DoubleRegister reg6 = no_dreg,
- DoubleRegister reg7 = no_dreg, DoubleRegister reg8 = no_dreg,
- DoubleRegister reg9 = no_dreg, DoubleRegister reg10 = no_dreg);
-#endif
-
// These exist to provide portability between 32 and 64bit
#if V8_TARGET_ARCH_PPC64
#define LoadPX ldx
@@ -96,8 +73,6 @@ bool AreAliased(DoubleRegister reg1, DoubleRegister reg2,
#define ShiftLeft_ sld
#define ShiftRight_ srd
#define ShiftRightArith srad
-#define Mul mulld
-#define Div divd
#else
#define LoadPX lwzx
#define LoadPUX lwzux
@@ -111,11 +86,9 @@ bool AreAliased(DoubleRegister reg1, DoubleRegister reg2,
#define ShiftLeft_ slw
#define ShiftRight_ srw
#define ShiftRightArith sraw
-#define Mul mullw
-#define Div divw
#endif
-class TurboAssembler : public TurboAssemblerBase {
+class V8_EXPORT_PRIVATE TurboAssembler : public TurboAssemblerBase {
public:
TurboAssembler(Isolate* isolate, const AssemblerOptions& options,
void* buffer, int buffer_size,
@@ -445,12 +418,6 @@ class TurboAssembler : public TurboAssemblerBase {
void LoadRootRegisterOffset(Register destination, intptr_t offset) override;
void LoadRootRelative(Register destination, int32_t offset) override;
- // Returns the size of a call in instructions. Note, the value returned is
- // only valid as long as no entries are added to the constant pool between
- // checking the call size and emitting the actual call.
- static int CallSize(Register target);
- int CallSize(Address target, RelocInfo::Mode rmode, Condition cond = al);
-
// Jump, Call, and Ret pseudo instructions implementing inter-working.
void Jump(Register target);
void Jump(Address target, RelocInfo::Mode rmode, Condition cond = al,
@@ -461,9 +428,6 @@ class TurboAssembler : public TurboAssemblerBase {
CRegister cr = cr7);
void Call(Register target);
void Call(Address target, RelocInfo::Mode rmode, Condition cond = al);
- int CallSize(Handle<Code> code,
- RelocInfo::Mode rmode = RelocInfo::CODE_TARGET,
- Condition cond = al);
void Call(Handle<Code> code, RelocInfo::Mode rmode = RelocInfo::CODE_TARGET,
Condition cond = al);
void Call(Label* target);
@@ -711,13 +675,6 @@ class MacroAssembler : public TurboAssembler {
void IncrementalMarkingRecordWriteHelper(Register object, Register value,
Register address);
- // Record in the remembered set the fact that we have a pointer to new space
- // at the address pointed to by the addr register. Only works if addr is not
- // in new space.
- void RememberedSetHelper(Register object, // Used for debug code.
- Register addr, Register scratch,
- SaveFPRegsMode save_fp);
-
void JumpToJSEntry(Register target);
// Check if object is in new space. Jumps if the object is not in new space.
// The register scratch can be object itself, but scratch will be clobbered.
@@ -768,11 +725,6 @@ class MacroAssembler : public TurboAssembler {
void PushSafepointRegisters();
void PopSafepointRegisters();
- // Flush the I-cache from asm code. You should use CpuFeatures::FlushICache
- // from C.
- // Does not handle errors.
- void FlushICache(Register address, size_t size, Register scratch);
-
// 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.
diff --git a/deps/v8/src/ppc/simulator-ppc.cc b/deps/v8/src/ppc/simulator-ppc.cc
index 350d4687ce..0fd03df30c 100644
--- a/deps/v8/src/ppc/simulator-ppc.cc
+++ b/deps/v8/src/ppc/simulator-ppc.cc
@@ -73,8 +73,7 @@ void PPCDebugger::Stop(Instruction* instr) {
// use of kStopCodeMask not right on PowerPC
uint32_t code = instr->SvcValue() & kStopCodeMask;
// Retrieve the encoded address, which comes just after this stop.
- char* msg =
- *reinterpret_cast<char**>(sim_->get_pc() + Instruction::kInstrSize);
+ char* msg = *reinterpret_cast<char**>(sim_->get_pc() + kInstrSize);
// Update this stop description.
if (sim_->isWatchedStop(code) && !sim_->watched_stops_[code].desc) {
sim_->watched_stops_[code].desc = msg;
@@ -85,7 +84,7 @@ void PPCDebugger::Stop(Instruction* instr) {
} else {
PrintF("Simulator hit %s\n", msg);
}
- sim_->set_pc(sim_->get_pc() + Instruction::kInstrSize + kPointerSize);
+ sim_->set_pc(sim_->get_pc() + kInstrSize + kPointerSize);
Debug();
}
@@ -233,7 +232,7 @@ void PPCDebugger::Debug() {
// If at a breakpoint, proceed past it.
if ((reinterpret_cast<Instruction*>(sim_->get_pc()))
->InstructionBits() == 0x7D821008) {
- sim_->set_pc(sim_->get_pc() + Instruction::kInstrSize);
+ sim_->set_pc(sim_->get_pc() + kInstrSize);
} else {
sim_->ExecuteInstruction(
reinterpret_cast<Instruction*>(sim_->get_pc()));
@@ -257,7 +256,7 @@ void PPCDebugger::Debug() {
// If at a breakpoint, proceed past it.
if ((reinterpret_cast<Instruction*>(sim_->get_pc()))
->InstructionBits() == 0x7D821008) {
- sim_->set_pc(sim_->get_pc() + Instruction::kInstrSize);
+ sim_->set_pc(sim_->get_pc() + kInstrSize);
} else {
// Execute the one instruction we broke at with breakpoints disabled.
sim_->ExecuteInstruction(
@@ -430,7 +429,7 @@ void PPCDebugger::Debug() {
if (argc == 1) {
cur = reinterpret_cast<byte*>(sim_->get_pc());
- end = cur + (10 * Instruction::kInstrSize);
+ end = cur + (10 * kInstrSize);
} else if (argc == 2) {
int regnum = Registers::Number(arg1);
if (regnum != kNoRegister || strncmp(arg1, "0x", 2) == 0) {
@@ -439,7 +438,7 @@ void PPCDebugger::Debug() {
if (GetValue(arg1, &value)) {
cur = reinterpret_cast<byte*>(value);
// Disassemble 10 instructions at <arg1>.
- end = cur + (10 * Instruction::kInstrSize);
+ end = cur + (10 * kInstrSize);
}
} else {
// The argument is the number of instructions.
@@ -447,7 +446,7 @@ void PPCDebugger::Debug() {
if (GetValue(arg1, &value)) {
cur = reinterpret_cast<byte*>(sim_->get_pc());
// Disassemble <arg1> instructions.
- end = cur + (value * Instruction::kInstrSize);
+ end = cur + (value * kInstrSize);
}
}
} else {
@@ -455,7 +454,7 @@ void PPCDebugger::Debug() {
intptr_t value2;
if (GetValue(arg1, &value1) && GetValue(arg2, &value2)) {
cur = reinterpret_cast<byte*>(value1);
- end = cur + (value2 * Instruction::kInstrSize);
+ end = cur + (value2 * kInstrSize);
}
}
@@ -498,11 +497,10 @@ void PPCDebugger::Debug() {
PrintF("FPSCR: %08x\n", sim_->fp_condition_reg_);
} else if (strcmp(cmd, "stop") == 0) {
intptr_t value;
- intptr_t stop_pc =
- sim_->get_pc() - (Instruction::kInstrSize + kPointerSize);
+ intptr_t stop_pc = sim_->get_pc() - (kInstrSize + kPointerSize);
Instruction* stop_instr = reinterpret_cast<Instruction*>(stop_pc);
Instruction* msg_address =
- reinterpret_cast<Instruction*>(stop_pc + Instruction::kInstrSize);
+ reinterpret_cast<Instruction*>(stop_pc + kInstrSize);
if ((argc == 2) && (strcmp(arg1, "unstop") == 0)) {
// Remove the current stop.
if (sim_->isStopInstruction(stop_instr)) {
@@ -725,9 +723,8 @@ void Simulator::CheckICache(base::CustomMatcherHashMap* i_cache,
char* cached_line = cache_page->CachedData(offset & ~CachePage::kLineMask);
if (cache_hit) {
// Check that the data in memory matches the contents of the I-cache.
- CHECK_EQ(0,
- memcmp(reinterpret_cast<void*>(instr),
- cache_page->CachedData(offset), Instruction::kInstrSize));
+ CHECK_EQ(0, memcmp(reinterpret_cast<void*>(instr),
+ cache_page->CachedData(offset), kInstrSize));
} else {
// Cache miss. Load memory into the cache.
memcpy(cached_line, line, CachePage::kLineLength);
@@ -1469,7 +1466,7 @@ void Simulator::SoftwareInterrupt(Instruction* instr) {
PPCDebugger dbg(this);
dbg.Stop(instr);
} else {
- set_pc(get_pc() + Instruction::kInstrSize + kPointerSize);
+ set_pc(get_pc() + kInstrSize + kPointerSize);
}
} else {
// This is not a valid svc code.
@@ -3922,11 +3919,10 @@ void Simulator::ExecuteInstruction(Instruction* instr) {
ExecuteGeneric(instr);
}
if (!pc_modified_) {
- set_pc(reinterpret_cast<intptr_t>(instr) + Instruction::kInstrSize);
+ set_pc(reinterpret_cast<intptr_t>(instr) + kInstrSize);
}
}
-
void Simulator::Execute() {
// Get the PC to simulate. Cannot use the accessor here as we need the
// raw PC value and not the one used as input to arithmetic instructions.