diff --git a/src/builtins/ppc/builtins-ppc.cc b/src/builtins/ppc/builtins-ppc.cc index 4993dfccde..be9784515a 100644 --- a/src/builtins/ppc/builtins-ppc.cc +++ b/src/builtins/ppc/builtins-ppc.cc @@ -433,7 +433,7 @@ void OnStackReplacement(MacroAssembler* masm, OsrSourceTier source, ConstantPoolUnavailableScope constant_pool_unavailable(masm); __ addi(r3, r3, Operand(Code::kHeaderSize - kHeapObjectTag)); // Code start - if (v8_flags.enable_embedded_constant_pool) { + if (V8_EMBEDDED_CONSTANT_POOL_BOOL) { __ LoadConstantPoolPointerRegisterFromCodeTargetAddress(r3); } @@ -845,7 +845,7 @@ void Generate_JSEntryVariant(MacroAssembler* masm, StackFrame::Type type, // r8: argv __ li(r0, Operand(-1)); // Push a bad frame pointer to fail if it is used. __ push(r0); - if (v8_flags.enable_embedded_constant_pool) { + if (V8_EMBEDDED_CONSTANT_POOL_BOOL) { __ li(kConstantPoolRegister, Operand::Zero()); __ push(kConstantPoolRegister); } @@ -1292,7 +1292,7 @@ void Builtins::Generate_BaselineOutOfLinePrologue(MacroAssembler* masm) { ASM_CODE_COMMENT_STRING(masm, "Optimized marker check"); // Drop the frame created by the baseline call. - if (v8_flags.enable_embedded_constant_pool) { + if (V8_EMBEDDED_CONSTANT_POOL_BOOL) { __ Pop(r0, fp, kConstantPoolRegister); } else { __ Pop(r0, fp); @@ -3055,7 +3055,7 @@ void Builtins::Generate_CEntry(MacroAssembler* masm, int result_size, ConstantPoolUnavailableScope constant_pool_unavailable(masm); __ Move(ip, pending_handler_entrypoint_address); __ LoadU64(ip, MemOperand(ip)); - if (v8_flags.enable_embedded_constant_pool) { + if (V8_EMBEDDED_CONSTANT_POOL_BOOL) { __ Move(kConstantPoolRegister, pending_handler_constant_pool_address); __ LoadU64(kConstantPoolRegister, MemOperand(kConstantPoolRegister)); } diff --git a/src/codegen/assembler.h b/src/codegen/assembler.h index 8a8164d073..1073a9d4f6 100644 --- a/src/codegen/assembler.h +++ b/src/codegen/assembler.h @@ -245,7 +245,7 @@ class V8_EXPORT_PRIVATE AssemblerBase : public Malloced { } bool is_constant_pool_available() const { - if (v8_flags.enable_embedded_constant_pool) { + if (V8_EMBEDDED_CONSTANT_POOL_BOOL) { // We need to disable constant pool here for embeded builtins // because the metadata section is not adjacent to instructions return constant_pool_available_ && !options().isolate_independent_code; @@ -374,7 +374,7 @@ class V8_EXPORT_PRIVATE AssemblerBase : public Malloced { byte* pc_; void set_constant_pool_available(bool available) { - if (v8_flags.enable_embedded_constant_pool) { + if (V8_EMBEDDED_CONSTANT_POOL_BOOL) { constant_pool_available_ = available; } else { // Embedded constant pool not supported on this architecture. diff --git a/src/codegen/macro-assembler.h b/src/codegen/macro-assembler.h index aaf30dea62..61b26a320f 100644 --- a/src/codegen/macro-assembler.h +++ b/src/codegen/macro-assembler.h @@ -136,10 +136,10 @@ class V8_NODISCARD FrameAndConstantPoolScope { : masm_(masm), type_(type), old_has_frame_(masm->has_frame()), - old_constant_pool_available_(v8_flags.enable_embedded_constant_pool && + old_constant_pool_available_(V8_EMBEDDED_CONSTANT_POOL_BOOL && masm->is_constant_pool_available()) { masm->set_has_frame(true); - if (v8_flags.enable_embedded_constant_pool) { + if (V8_EMBEDDED_CONSTANT_POOL_BOOL) { masm->set_constant_pool_available(true); } if (type_ != StackFrame::MANUAL && type_ != StackFrame::NO_FRAME_TYPE) { @@ -150,7 +150,7 @@ class V8_NODISCARD FrameAndConstantPoolScope { ~FrameAndConstantPoolScope() { masm_->LeaveFrame(type_); masm_->set_has_frame(old_has_frame_); - if (v8_flags.enable_embedded_constant_pool) { + if (V8_EMBEDDED_CONSTANT_POOL_BOOL) { masm_->set_constant_pool_available(old_constant_pool_available_); } } @@ -169,14 +169,14 @@ class V8_NODISCARD ConstantPoolUnavailableScope { public: explicit ConstantPoolUnavailableScope(Assembler* assembler) : assembler_(assembler), - old_constant_pool_available_(v8_flags.enable_embedded_constant_pool && + old_constant_pool_available_(V8_EMBEDDED_CONSTANT_POOL_BOOL && assembler->is_constant_pool_available()) { - if (v8_flags.enable_embedded_constant_pool) { + if (V8_EMBEDDED_CONSTANT_POOL_BOOL) { assembler->set_constant_pool_available(false); } } ~ConstantPoolUnavailableScope() { - if (v8_flags.enable_embedded_constant_pool) { + if (V8_EMBEDDED_CONSTANT_POOL_BOOL) { assembler_->set_constant_pool_available(old_constant_pool_available_); } } diff --git a/src/codegen/ppc/assembler-ppc-inl.h b/src/codegen/ppc/assembler-ppc-inl.h index e130cf5870..898f132520 100644 --- a/src/codegen/ppc/assembler-ppc-inl.h +++ b/src/codegen/ppc/assembler-ppc-inl.h @@ -87,7 +87,7 @@ Address RelocInfo::target_address() { Address RelocInfo::target_address_address() { DCHECK(HasTargetAddressAddress()); - if (v8_flags.enable_embedded_constant_pool && + if (V8_EMBEDDED_CONSTANT_POOL_BOOL && Assembler::IsConstantPoolLoadStart(pc_)) { // We return the PC for embedded constant pool since this function is used // by the serializer and expects the address to reside within the code @@ -108,7 +108,7 @@ Address RelocInfo::target_address_address() { } Address RelocInfo::constant_pool_entry_address() { - if (v8_flags.enable_embedded_constant_pool) { + if (V8_EMBEDDED_CONSTANT_POOL_BOOL) { DCHECK(constant_pool_); ConstantPoolEntry::Access access; if (Assembler::IsConstantPoolLoadStart(pc_, &access)) @@ -250,7 +250,7 @@ void Assembler::UntrackBranch() { // Fetch the 32bit value from the FIXED_SEQUENCE lis/ori Address Assembler::target_address_at(Address pc, Address constant_pool) { - if (v8_flags.enable_embedded_constant_pool && constant_pool) { + if (V8_EMBEDDED_CONSTANT_POOL_BOOL && constant_pool) { ConstantPoolEntry::Access access; if (IsConstantPoolLoadStart(pc, &access)) return Memory
(target_constant_pool_address_at( @@ -425,7 +425,7 @@ void Assembler::deserialization_set_target_internal_reference_at( void Assembler::set_target_address_at(Address pc, Address constant_pool, Address target, ICacheFlushMode icache_flush_mode) { - if (v8_flags.enable_embedded_constant_pool && constant_pool) { + if (V8_EMBEDDED_CONSTANT_POOL_BOOL && constant_pool) { ConstantPoolEntry::Access access; if (IsConstantPoolLoadStart(pc, &access)) { Memory(target_constant_pool_address_at( diff --git a/src/codegen/ppc/assembler-ppc.cc b/src/codegen/ppc/assembler-ppc.cc index 844d27995f..5ba168228b 100644 --- a/src/codegen/ppc/assembler-ppc.cc +++ b/src/codegen/ppc/assembler-ppc.cc @@ -167,8 +167,7 @@ bool RelocInfo::IsCodedSpecially() { } bool RelocInfo::IsInConstantPool() { - if (v8_flags.enable_embedded_constant_pool && - constant_pool_ != kNullAddress) { + if (V8_EMBEDDED_CONSTANT_POOL_BOOL && constant_pool_ != kNullAddress) { return Assembler::IsConstantPoolLoadStart(pc_); } return false; @@ -1310,8 +1309,7 @@ int Assembler::instructions_required_for_mov(Register dst, bool Assembler::use_constant_pool_for_mov(Register dst, const Operand& src, bool canOptimize) const { - if (!v8_flags.enable_embedded_constant_pool || - !is_constant_pool_available()) { + if (!V8_EMBEDDED_CONSTANT_POOL_BOOL || !is_constant_pool_available()) { // If there is no constant pool available, we must use a mov // immediate sequence. return false; diff --git a/src/codegen/ppc/assembler-ppc.h b/src/codegen/ppc/assembler-ppc.h index 6563287d0a..a6db48b4a8 100644 --- a/src/codegen/ppc/assembler-ppc.h +++ b/src/codegen/ppc/assembler-ppc.h @@ -309,10 +309,9 @@ class Assembler : public AssemblerBase { static constexpr int kMovInstructionsNoConstantPool = 2; static constexpr int kTaggedLoadInstructions = 1; #endif - static constexpr int kMovInstructions = - v8_flags.enable_embedded_constant_pool.value() - ? kMovInstructionsConstantPool - : kMovInstructionsNoConstantPool; + static constexpr int kMovInstructions = V8_EMBEDDED_CONSTANT_POOL_BOOL + ? kMovInstructionsConstantPool + : kMovInstructionsNoConstantPool; static inline int encode_crbit(const CRegister& cr, enum CRBit crbit) { return ((cr.code() * CRWIDTH) + crbit); diff --git a/src/codegen/ppc/macro-assembler-ppc.cc b/src/codegen/ppc/macro-assembler-ppc.cc index 0095f451c3..bfc8d0f8b5 100644 --- a/src/codegen/ppc/macro-assembler-ppc.cc +++ b/src/codegen/ppc/macro-assembler-ppc.cc @@ -898,7 +898,7 @@ void MacroAssembler::RecordWrite(Register object, Register slot_address, void TurboAssembler::PushCommonFrame(Register marker_reg) { int fp_delta = 0; mflr(r0); - if (v8_flags.enable_embedded_constant_pool) { + if (V8_EMBEDDED_CONSTANT_POOL_BOOL) { if (marker_reg.is_valid()) { Push(r0, fp, kConstantPoolRegister, marker_reg); fp_delta = 2; @@ -921,7 +921,7 @@ void TurboAssembler::PushCommonFrame(Register marker_reg) { void TurboAssembler::PushStandardFrame(Register function_reg) { int fp_delta = 0; mflr(r0); - if (v8_flags.enable_embedded_constant_pool) { + if (V8_EMBEDDED_CONSTANT_POOL_BOOL) { if (function_reg.is_valid()) { Push(r0, fp, kConstantPoolRegister, cp, function_reg); fp_delta = 3; @@ -943,7 +943,7 @@ void TurboAssembler::PushStandardFrame(Register function_reg) { } void TurboAssembler::RestoreFrameStateForTailCall() { - if (v8_flags.enable_embedded_constant_pool) { + if (V8_EMBEDDED_CONSTANT_POOL_BOOL) { LoadU64(kConstantPoolRegister, MemOperand(fp, StandardFrameConstants::kConstantPoolOffset)); set_constant_pool_available(false); @@ -1230,7 +1230,7 @@ void TurboAssembler::StubPrologue(StackFrame::Type type) { mov(r11, Operand(StackFrame::TypeToMarker(type))); PushCommonFrame(r11); } - if (v8_flags.enable_embedded_constant_pool) { + if (V8_EMBEDDED_CONSTANT_POOL_BOOL) { LoadConstantPoolPointerRegister(); set_constant_pool_available(true); } @@ -1238,7 +1238,7 @@ void TurboAssembler::StubPrologue(StackFrame::Type type) { void TurboAssembler::Prologue() { PushStandardFrame(r4); - if (v8_flags.enable_embedded_constant_pool) { + if (V8_EMBEDDED_CONSTANT_POOL_BOOL) { // base contains prologue address LoadConstantPoolPointerRegister(); set_constant_pool_available(true); @@ -1288,8 +1288,7 @@ void TurboAssembler::DropArgumentsAndPushNewReceiver(Register argc, void TurboAssembler::EnterFrame(StackFrame::Type type, bool load_constant_pool_pointer_reg) { - if (v8_flags.enable_embedded_constant_pool && - load_constant_pool_pointer_reg) { + if (V8_EMBEDDED_CONSTANT_POOL_BOOL && load_constant_pool_pointer_reg) { // Push type explicitly so we can leverage the constant pool. // This path cannot rely on ip containing code entry. PushCommonFrame(); @@ -1322,7 +1321,7 @@ int TurboAssembler::LeaveFrame(StackFrame::Type type, int stack_adjustment) { int frame_ends; LoadU64(r0, MemOperand(fp, StandardFrameConstants::kCallerPCOffset)); LoadU64(ip, MemOperand(fp, StandardFrameConstants::kCallerFPOffset)); - if (v8_flags.enable_embedded_constant_pool) { + if (V8_EMBEDDED_CONSTANT_POOL_BOOL) { LoadU64(kConstantPoolRegister, MemOperand(fp, StandardFrameConstants::kConstantPoolOffset)); } @@ -1373,7 +1372,7 @@ void MacroAssembler::EnterExitFrame(bool save_doubles, int stack_space, li(r8, Operand::Zero()); StoreU64(r8, MemOperand(fp, ExitFrameConstants::kSPOffset)); } - if (v8_flags.enable_embedded_constant_pool) { + if (V8_EMBEDDED_CONSTANT_POOL_BOOL) { StoreU64(kConstantPoolRegister, MemOperand(fp, ExitFrameConstants::kConstantPoolOffset)); } @@ -2654,7 +2653,7 @@ void TurboAssembler::LoadSmiLiteral(Register dst, Smi smi) { void TurboAssembler::LoadDoubleLiteral(DoubleRegister result, base::Double value, Register scratch) { - if (v8_flags.enable_embedded_constant_pool && is_constant_pool_available() && + if (V8_EMBEDDED_CONSTANT_POOL_BOOL && is_constant_pool_available() && !(scratch == r0 && ConstantPoolAccessIsInOverflow())) { ConstantPoolEntry::Access access = ConstantPoolAddEntry(value); if (access == ConstantPoolEntry::OVERFLOWED) { diff --git a/src/codegen/ppc/register-ppc.h b/src/codegen/ppc/register-ppc.h index bbcaa525e4..b85e7868e1 100644 --- a/src/codegen/ppc/register-ppc.h +++ b/src/codegen/ppc/register-ppc.h @@ -17,7 +17,7 @@ namespace internal { V(r16) V(r17) V(r18) V(r19) V(r20) V(r21) V(r22) V(r23) \ V(r24) V(r25) V(r26) V(r27) V(r28) V(r29) V(r30) V(fp) -#if V8_EMBEDDED_CONSTANT_POOL +#if V8_EMBEDDED_CONSTANT_POOL_BOOL #define ALLOCATABLE_GENERAL_REGISTERS(V) \ V(r3) V(r4) V(r5) V(r6) V(r7) \ V(r8) V(r9) V(r10) V(r14) V(r15) \ diff --git a/src/codegen/s390/macro-assembler-s390.cc b/src/codegen/s390/macro-assembler-s390.cc index 95d1246455..c693fbc3ac 100644 --- a/src/codegen/s390/macro-assembler-s390.cc +++ b/src/codegen/s390/macro-assembler-s390.cc @@ -1165,12 +1165,12 @@ void TurboAssembler::PushStandardFrame(Register function_reg) { } void TurboAssembler::RestoreFrameStateForTailCall() { - // if (v8_flags.enable_embedded_constant_pool) { + // if (V8_EMBEDDED_CONSTANT_POOL_BOOL) { // LoadU64(kConstantPoolRegister, // MemOperand(fp, StandardFrameConstants::kConstantPoolOffset)); // set_constant_pool_available(false); // } - DCHECK(!v8_flags.enable_embedded_constant_pool); + DCHECK(!V8_EMBEDDED_CONSTANT_POOL_BOOL); LoadU64(r14, MemOperand(fp, StandardFrameConstants::kCallerPCOffset)); LoadU64(fp, MemOperand(fp, StandardFrameConstants::kCallerFPOffset)); } diff --git a/src/common/globals.h b/src/common/globals.h index 9b317345c1..5b77f58225 100644 --- a/src/common/globals.h +++ b/src/common/globals.h @@ -72,9 +72,9 @@ namespace internal { // Determine whether the architecture uses an embedded constant pool // (contiguous constant pool embedded in code object). #if V8_TARGET_ARCH_PPC || V8_TARGET_ARCH_PPC64 -#define V8_EMBEDDED_CONSTANT_POOL true +#define V8_EMBEDDED_CONSTANT_POOL_BOOL true #else -#define V8_EMBEDDED_CONSTANT_POOL false +#define V8_EMBEDDED_CONSTANT_POOL_BOOL false #endif #ifdef DEBUG diff --git a/src/compiler/backend/code-generator.cc b/src/compiler/backend/code-generator.cc index a5dcbdbe27..929fc7eb77 100644 --- a/src/compiler/backend/code-generator.cc +++ b/src/compiler/backend/code-generator.cc @@ -314,7 +314,7 @@ void CodeGenerator::AssembleCode() { // within the block. tasm()->VU.clear(); #endif - if (v8_flags.enable_embedded_constant_pool && !block->needs_frame()) { + if (V8_EMBEDDED_CONSTANT_POOL_BOOL && !block->needs_frame()) { ConstantPoolUnavailableScope constant_pool_unavailable(tasm()); result_ = AssembleBlock(block); } else { diff --git a/src/compiler/backend/ppc/code-generator-ppc.cc b/src/compiler/backend/ppc/code-generator-ppc.cc index b98a329c3c..efb233ea85 100644 --- a/src/compiler/backend/ppc/code-generator-ppc.cc +++ b/src/compiler/backend/ppc/code-generator-ppc.cc @@ -3572,13 +3572,13 @@ void CodeGenerator::FinishFrame(Frame* frame) { } // Save callee-saved registers. const RegList saves = - v8_flags.enable_embedded_constant_pool + V8_EMBEDDED_CONSTANT_POOL_BOOL ? call_descriptor->CalleeSavedRegisters() - kConstantPoolRegister : call_descriptor->CalleeSavedRegisters(); if (!saves.is_empty()) { // register save area does not include the fp or constant pool pointer. const int num_saves = - kNumCalleeSaved - 1 - (v8_flags.enable_embedded_constant_pool ? 1 : 0); + kNumCalleeSaved - 1 - (V8_EMBEDDED_CONSTANT_POOL_BOOL ? 1 : 0); frame->AllocateSavedCalleeRegisterSlots(num_saves); } } @@ -3598,7 +3598,7 @@ void CodeGenerator::AssembleConstructFrame() { #endif // V8_ENABLE_WEBASSEMBLY } else { __ mflr(r0); - if (v8_flags.enable_embedded_constant_pool) { + if (V8_EMBEDDED_CONSTANT_POOL_BOOL) { __ Push(r0, fp, kConstantPoolRegister); // Adjust FP to point to saved FP. __ SubS64(fp, sp, @@ -3647,7 +3647,7 @@ void CodeGenerator::AssembleConstructFrame() { const DoubleRegList saves_fp = call_descriptor->CalleeSavedFPRegisters(); const RegList saves = - v8_flags.enable_embedded_constant_pool + V8_EMBEDDED_CONSTANT_POOL_BOOL ? call_descriptor->CalleeSavedRegisters() - kConstantPoolRegister : call_descriptor->CalleeSavedRegisters(); @@ -3723,7 +3723,7 @@ void CodeGenerator::AssembleReturn(InstructionOperand* additional_pop_count) { // Restore registers. const RegList saves = - v8_flags.enable_embedded_constant_pool + V8_EMBEDDED_CONSTANT_POOL_BOOL ? call_descriptor->CalleeSavedRegisters() - kConstantPoolRegister : call_descriptor->CalleeSavedRegisters(); if (!saves.is_empty()) { diff --git a/src/compiler/linkage.h b/src/compiler/linkage.h index e65efa8db6..3b41f3bc19 100644 --- a/src/compiler/linkage.h +++ b/src/compiler/linkage.h @@ -108,7 +108,7 @@ class LinkageLocation { } static LinkageLocation ForSavedCallerConstantPool() { - DCHECK(V8_EMBEDDED_CONSTANT_POOL); + DCHECK(V8_EMBEDDED_CONSTANT_POOL_BOOL); return ForCalleeFrameSlot((StandardFrameConstants::kCallerPCOffset - StandardFrameConstants::kConstantPoolOffset) / kSystemPointerSize, diff --git a/src/deoptimizer/deoptimizer.cc b/src/deoptimizer/deoptimizer.cc index 1f58108b73..376ce2f24a 100644 --- a/src/deoptimizer/deoptimizer.cc +++ b/src/deoptimizer/deoptimizer.cc @@ -813,7 +813,7 @@ void Deoptimizer::DoComputeOutputFrames() { actual_argument_count_ = static_cast