[cleanup][TurboProp] Unify DynamicMapChecks names.

Unifies various operators for dynamic map checks with the naming
scheme of DynamicCheckMaps (to be similar to CheckMaps.

BUG=v8:10582

Change-Id: I8ac842f55fe31cdc7b84968d077017a86ddf4442
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2567952
Auto-Submit: Ross McIlroy <rmcilroy@chromium.org>
Commit-Queue: Jakob Gruber <jgruber@chromium.org>
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/master@{#71559}
This commit is contained in:
Ross McIlroy 2020-12-02 09:34:53 +00:00 committed by Commit Bot
parent b178c52aed
commit 7730fd94a2
36 changed files with 124 additions and 120 deletions

View File

@ -1195,7 +1195,7 @@ torque_files = [
"src/builtins/function.tq",
"src/builtins/growable-fixed-array.tq",
"src/builtins/ic-callable.tq",
"src/builtins/ic-dynamic-map-checks.tq",
"src/builtins/ic-dynamic-check-maps.tq",
"src/builtins/ic.tq",
"src/builtins/internal-coverage.tq",
"src/builtins/internal.tq",

View File

@ -3385,23 +3385,23 @@ void Builtins::Generate_DeoptimizationEntry_Lazy(MacroAssembler* masm) {
Generate_DeoptimizationEntry(masm, DeoptimizeKind::kLazy);
}
void Builtins::Generate_DynamicMapChecksTrampoline(MacroAssembler* masm) {
void Builtins::Generate_DynamicCheckMapsTrampoline(MacroAssembler* masm) {
FrameScope scope(masm, StackFrame::MANUAL);
__ EnterFrame(StackFrame::INTERNAL);
// Only save the registers that the DynamicMapChecks builtin can clobber.
DynamicMapChecksDescriptor descriptor;
// Only save the registers that the DynamicCheckMaps builtin can clobber.
DynamicCheckMapsDescriptor descriptor;
RegList registers = descriptor.allocatable_registers();
// FLAG_debug_code is enabled CSA checks will call C function and so we need
// to save all CallerSaved registers too.
if (FLAG_debug_code) registers |= kCallerSaved;
__ SaveRegisters(registers);
__ Call(BUILTIN_CODE(masm->isolate(), DynamicMapChecks),
__ Call(BUILTIN_CODE(masm->isolate(), DynamicCheckMaps),
RelocInfo::CODE_TARGET);
Label deopt, bailout;
__ cmp_raw_immediate(r0, static_cast<int>(DynamicMapChecksStatus::kSuccess));
__ cmp_raw_immediate(r0, static_cast<int>(DynamicCheckMapsStatus::kSuccess));
__ b(ne, &deopt);
__ RestoreRegisters(registers);
@ -3409,12 +3409,12 @@ void Builtins::Generate_DynamicMapChecksTrampoline(MacroAssembler* masm) {
__ Ret();
__ bind(&deopt);
__ cmp_raw_immediate(r0, static_cast<int>(DynamicMapChecksStatus::kBailout));
__ cmp_raw_immediate(r0, static_cast<int>(DynamicCheckMapsStatus::kBailout));
__ b(eq, &bailout);
if (FLAG_debug_code) {
__ cmp_raw_immediate(r0, static_cast<int>(DynamicMapChecksStatus::kDeopt));
__ Assert(eq, AbortReason::kUnexpectedDynamicMapChecksStatus);
__ cmp_raw_immediate(r0, static_cast<int>(DynamicCheckMapsStatus::kDeopt));
__ Assert(eq, AbortReason::kUnexpectedDynamicCheckMapsStatus);
}
__ RestoreRegisters(registers);
__ LeaveFrame(StackFrame::INTERNAL);

View File

@ -3924,24 +3924,24 @@ void Builtins::Generate_DeoptimizationEntry_Lazy(MacroAssembler* masm) {
Generate_DeoptimizationEntry(masm, DeoptimizeKind::kLazy);
}
void Builtins::Generate_DynamicMapChecksTrampoline(MacroAssembler* masm) {
void Builtins::Generate_DynamicCheckMapsTrampoline(MacroAssembler* masm) {
FrameScope scope(masm, StackFrame::MANUAL);
__ EnterFrame(StackFrame::INTERNAL);
// Only save the registers that the DynamicMapChecks builtin can clobber.
DynamicMapChecksDescriptor descriptor;
// Only save the registers that the DynamicCheckMaps builtin can clobber.
DynamicCheckMapsDescriptor descriptor;
RegList registers = descriptor.allocatable_registers();
// FLAG_debug_code is enabled CSA checks will call C function and so we need
// to save all CallerSaved registers too.
if (FLAG_debug_code) registers |= kCallerSaved.list();
__ SaveRegisters(registers);
__ Call(BUILTIN_CODE(masm->isolate(), DynamicMapChecks),
__ Call(BUILTIN_CODE(masm->isolate(), DynamicCheckMaps),
RelocInfo::CODE_TARGET);
Label deopt, bailout;
__ CompareAndBranch(
x0, static_cast<int32_t>(DynamicMapChecksStatus::kSuccess), ne, &deopt);
x0, static_cast<int32_t>(DynamicCheckMapsStatus::kSuccess), ne, &deopt);
__ RestoreRegisters(registers);
__ LeaveFrame(StackFrame::INTERNAL);
@ -3949,11 +3949,11 @@ void Builtins::Generate_DynamicMapChecksTrampoline(MacroAssembler* masm) {
__ Bind(&deopt);
__ CompareAndBranch(
x0, static_cast<int32_t>(DynamicMapChecksStatus::kBailout), eq, &bailout);
x0, static_cast<int32_t>(DynamicCheckMapsStatus::kBailout), eq, &bailout);
if (FLAG_debug_code) {
__ Cmp(x0, Operand(static_cast<int>(DynamicMapChecksStatus::kDeopt)));
__ Assert(eq, AbortReason::kUnexpectedDynamicMapChecksStatus);
__ Cmp(x0, Operand(static_cast<int>(DynamicCheckMapsStatus::kDeopt)));
__ Assert(eq, AbortReason::kUnexpectedDynamicCheckMapsStatus);
}
__ RestoreRegisters(registers);
__ LeaveFrame(StackFrame::INTERNAL);

View File

@ -232,9 +232,9 @@ namespace internal {
TFH(KeyedHasIC_SloppyArguments, LoadWithVector) \
TFH(HasIndexedInterceptorIC, LoadWithVector) \
\
/* Dynamic map checks */ \
ASM(DynamicMapChecksTrampoline, DynamicMapChecks) \
TFC(DynamicMapChecks, DynamicMapChecks) \
/* Dynamic check maps */ \
ASM(DynamicCheckMapsTrampoline, DynamicCheckMaps) \
TFC(DynamicCheckMaps, DynamicCheckMaps) \
\
/* Microtask helpers */ \
TFS(EnqueueMicrotask, kMicrotask) \

View File

@ -55,11 +55,11 @@ IC_BUILTIN_PARAM(LoadGlobalICTrampoline, LoadGlobalICTrampoline,
IC_BUILTIN_PARAM(LoadGlobalICInsideTypeofTrampoline, LoadGlobalICTrampoline,
INSIDE_TYPEOF)
TF_BUILTIN(DynamicMapChecks, CodeStubAssembler) {
TF_BUILTIN(DynamicCheckMaps, CodeStubAssembler) {
auto slot = UncheckedParameter<IntPtrT>(Descriptor::kSlot);
auto map = Parameter<Map>(Descriptor::kMap);
auto handler = Parameter<Object>(Descriptor::kHandler);
TNode<Int32T> status = DynamicMapChecks(slot, map, handler);
TNode<Int32T> status = DynamicCheckMaps(slot, map, handler);
Return(status);
}

View File

@ -3987,23 +3987,23 @@ void Builtins::Generate_DeoptimizationEntry_Lazy(MacroAssembler* masm) {
Generate_DeoptimizationEntry(masm, DeoptimizeKind::kLazy);
}
void Builtins::Generate_DynamicMapChecksTrampoline(MacroAssembler* masm) {
void Builtins::Generate_DynamicCheckMapsTrampoline(MacroAssembler* masm) {
FrameScope scope(masm, StackFrame::MANUAL);
__ EnterFrame(StackFrame::INTERNAL);
// Only save the registers that the DynamicMapChecks builtin can clobber.
DynamicMapChecksDescriptor descriptor;
// Only save the registers that the DynamicCheckMaps builtin can clobber.
DynamicCheckMapsDescriptor descriptor;
RegList registers = descriptor.allocatable_registers();
// FLAG_debug_code is enabled CSA checks will call C function and so we need
// to save all CallerSaved registers too.
if (FLAG_debug_code) registers |= kJSCallerSaved;
__ SaveRegisters(registers);
__ Call(BUILTIN_CODE(masm->isolate(), DynamicMapChecks),
__ Call(BUILTIN_CODE(masm->isolate(), DynamicCheckMaps),
RelocInfo::CODE_TARGET);
Label deopt, bailout;
__ cmp(eax, Immediate(static_cast<int>(DynamicMapChecksStatus::kSuccess)));
__ cmp(eax, Immediate(static_cast<int>(DynamicCheckMapsStatus::kSuccess)));
__ j(not_equal, &deopt);
__ RestoreRegisters(registers);
@ -4011,12 +4011,12 @@ void Builtins::Generate_DynamicMapChecksTrampoline(MacroAssembler* masm) {
__ Ret();
__ bind(&deopt);
__ cmp(eax, Immediate(static_cast<int>(DynamicMapChecksStatus::kBailout)));
__ cmp(eax, Immediate(static_cast<int>(DynamicCheckMapsStatus::kBailout)));
__ j(equal, &bailout);
if (FLAG_debug_code) {
__ cmp(eax, Immediate(static_cast<int>(DynamicMapChecksStatus::kDeopt)));
__ Assert(equal, AbortReason::kUnexpectedDynamicMapChecksStatus);
__ cmp(eax, Immediate(static_cast<int>(DynamicCheckMapsStatus::kDeopt)));
__ Assert(equal, AbortReason::kUnexpectedDynamicCheckMapsStatus);
}
__ RestoreRegisters(registers);
__ LeaveFrame(StackFrame::INTERNAL);

View File

@ -5,11 +5,11 @@
namespace ic {
const kSuccess: constexpr int32
generates 'static_cast<int>(DynamicMapChecksStatus::kSuccess)';
generates 'static_cast<int>(DynamicCheckMapsStatus::kSuccess)';
const kBailout: constexpr int32
generates 'static_cast<int>(DynamicMapChecksStatus::kBailout)';
generates 'static_cast<int>(DynamicCheckMapsStatus::kBailout)';
const kDeopt: constexpr int32
generates 'static_cast<int>(DynamicMapChecksStatus::kDeopt)';
generates 'static_cast<int>(DynamicCheckMapsStatus::kDeopt)';
extern macro LoadFeedbackVectorForStubWithTrampoline(): FeedbackVector;
macro PerformPolymorphicCheck(
@ -81,7 +81,7 @@ macro PerformMonomorphicCheck(
// status to bailout to the interpreter and update the feedback. If we have seen
// the map, but the associated handler check fails then we return kDeopt status.
@export
macro DynamicMapChecks(
macro DynamicCheckMaps(
slotIndex: intptr, actualMap: Map, actualHandler: Smi|DataHandler): int32 {
const feedbackVector = LoadFeedbackVectorForStubWithTrampoline();
const feedback = feedbackVector[slotIndex];

View File

@ -4263,23 +4263,23 @@ void Builtins::Generate_DeoptimizationEntry_Lazy(MacroAssembler* masm) {
Generate_DeoptimizationEntry(masm, DeoptimizeKind::kLazy);
}
void Builtins::Generate_DynamicMapChecksTrampoline(MacroAssembler* masm) {
void Builtins::Generate_DynamicCheckMapsTrampoline(MacroAssembler* masm) {
FrameScope scope(masm, StackFrame::MANUAL);
__ EnterFrame(StackFrame::INTERNAL);
// Only save the registers that the DynamicMapChecks builtin can clobber.
DynamicMapChecksDescriptor descriptor;
// Only save the registers that the DynamicCheckMaps builtin can clobber.
DynamicCheckMapsDescriptor descriptor;
RegList registers = descriptor.allocatable_registers();
// FLAG_debug_code is enabled CSA checks will call C function and so we need
// to save all CallerSaved registers too.
if (FLAG_debug_code) registers |= kJSCallerSaved;
__ SaveRegisters(registers);
__ Call(BUILTIN_CODE(masm->isolate(), DynamicMapChecks),
__ Call(BUILTIN_CODE(masm->isolate(), DynamicCheckMaps),
RelocInfo::CODE_TARGET);
Label deopt, bailout;
__ cmpq(rax, Immediate(static_cast<int>(DynamicMapChecksStatus::kSuccess)));
__ cmpq(rax, Immediate(static_cast<int>(DynamicCheckMapsStatus::kSuccess)));
__ j(not_equal, &deopt);
__ RestoreRegisters(registers);
@ -4287,12 +4287,12 @@ void Builtins::Generate_DynamicMapChecksTrampoline(MacroAssembler* masm) {
__ Ret();
__ bind(&deopt);
__ cmpq(rax, Immediate(static_cast<int>(DynamicMapChecksStatus::kBailout)));
__ cmpq(rax, Immediate(static_cast<int>(DynamicCheckMapsStatus::kBailout)));
__ j(equal, &bailout);
if (FLAG_debug_code) {
__ cmpq(rax, Immediate(static_cast<int>(DynamicMapChecksStatus::kDeopt)));
__ Assert(equal, AbortReason::kUnexpectedDynamicMapChecksStatus);
__ cmpq(rax, Immediate(static_cast<int>(DynamicCheckMapsStatus::kDeopt)));
__ Assert(equal, AbortReason::kUnexpectedDynamicCheckMapsStatus);
}
__ RestoreRegisters(registers);
__ LeaveFrame(StackFrame::INTERNAL);

View File

@ -34,7 +34,7 @@ void RecordWriteDescriptor::InitializePlatformSpecific(
data->InitializePlatformSpecific(kParameterCount, default_stub_registers);
}
void DynamicMapChecksDescriptor::InitializePlatformSpecific(
void DynamicCheckMapsDescriptor::InitializePlatformSpecific(
CallInterfaceDescriptorData* data) {
Register default_stub_registers[] = {r0, r1, r2, r3, cp};

View File

@ -34,7 +34,7 @@ void RecordWriteDescriptor::InitializePlatformSpecific(
data->InitializePlatformSpecific(kParameterCount, default_stub_registers);
}
void DynamicMapChecksDescriptor::InitializePlatformSpecific(
void DynamicCheckMapsDescriptor::InitializePlatformSpecific(
CallInterfaceDescriptorData* data) {
Register default_stub_registers[] = {x0, x1, x2, x3, cp};

View File

@ -58,7 +58,7 @@ namespace internal {
V(kStackFrameTypesMustMatch, "Stack frame types must match") \
V(kUnalignedCellInWriteBarrier, "Unaligned cell in write barrier") \
V(kUnexpectedAdditionalPopValue, "Unexpected additional pop value") \
V(kUnexpectedDynamicMapChecksStatus, "Unexpected dynamic map checks status") \
V(kUnexpectedDynamicCheckMapsStatus, "Unexpected dynamic map checks status") \
V(kUnexpectedElementsKindInArrayConstructor, \
"Unexpected ElementsKind in array constructor") \
V(kUnexpectedFPCRMode, "Unexpected FPCR mode.") \

View File

@ -36,7 +36,7 @@ void RecordWriteDescriptor::InitializePlatformSpecific(
data->InitializePlatformSpecific(kParameterCount, default_stub_registers);
}
void DynamicMapChecksDescriptor::InitializePlatformSpecific(
void DynamicCheckMapsDescriptor::InitializePlatformSpecific(
CallInterfaceDescriptorData* data) {
Register default_stub_registers[] = {eax, ecx, edx, edi, esi};

View File

@ -58,7 +58,7 @@ namespace internal {
V(ConstructWithSpread_WithFeedback) \
V(ContextOnly) \
V(CppBuiltinAdaptor) \
V(DynamicMapChecks) \
V(DynamicCheckMaps) \
V(EphemeronKeyBarrier) \
V(FastNewObject) \
V(FrameDropperTrampoline) \
@ -874,7 +874,7 @@ class LoadGlobalWithVectorDescriptor : public LoadGlobalDescriptor {
#endif
};
class DynamicMapChecksDescriptor final : public CallInterfaceDescriptor {
class DynamicCheckMapsDescriptor final : public CallInterfaceDescriptor {
public:
DEFINE_PARAMETERS(kSlot, kMap, kHandler)
DEFINE_RESULT_AND_PARAMETER_TYPES(MachineType::Int32(), // return val
@ -882,7 +882,7 @@ class DynamicMapChecksDescriptor final : public CallInterfaceDescriptor {
MachineType::TaggedPointer(), // kMap
MachineType::TaggedSigned()) // kHandler
DECLARE_DESCRIPTOR(DynamicMapChecksDescriptor, CallInterfaceDescriptor)
DECLARE_DESCRIPTOR(DynamicCheckMapsDescriptor, CallInterfaceDescriptor)
};
class FastNewObjectDescriptor : public CallInterfaceDescriptor {

View File

@ -35,7 +35,7 @@ void RecordWriteDescriptor::InitializePlatformSpecific(
data->InitializePlatformSpecific(kParameterCount, default_stub_registers);
}
void DynamicMapChecksDescriptor::InitializePlatformSpecific(
void DynamicCheckMapsDescriptor::InitializePlatformSpecific(
CallInterfaceDescriptorData* data) {
Register default_stub_registers[] = {kReturnRegister0,
arg_reg_1,

View File

@ -1715,7 +1715,7 @@ enum class TraceRetainingPathMode { kEnabled, kDisabled };
// can be used in Torque.
enum class VariableAllocationInfo { NONE, STACK, CONTEXT, UNUSED };
enum class DynamicMapChecksStatus : uint8_t {
enum class DynamicCheckMapsStatus : uint8_t {
kSuccess = 0,
kBailout = 1,
kDeopt = 2

View File

@ -3247,7 +3247,7 @@ void CodeGenerator::PrepareForDeoptimizationExits(
// Check which deopt kinds exist in this Code object, to avoid emitting jumps
// to unused entries.
bool saw_deopt_kind[kDeoptimizeKindCount] = {false};
constexpr auto eager_with_resume_reason = DeoptimizeReason::kDynamicMapCheck;
constexpr auto eager_with_resume_reason = DeoptimizeReason::kDynamicCheckMaps;
for (auto exit : *exits) {
// TODO(rmcilroy): If we add any other kinds of kEagerWithResume deoptimize
// we will need to create a seperate array for each kEagerWithResume builtin

View File

@ -1382,8 +1382,8 @@ void InstructionSelector::VisitNode(Node* node) {
return VisitDeoptimizeIf(node);
case IrOpcode::kDeoptimizeUnless:
return VisitDeoptimizeUnless(node);
case IrOpcode::kDynamicMapCheckUnless:
return VisitDynamicMapCheckUnless(node);
case IrOpcode::kDynamicCheckMapsWithDeoptUnless:
return VisitDynamicCheckMapsWithDeoptUnless(node);
case IrOpcode::kTrapIf:
return VisitTrapIf(node, TrapIdOf(node->op()));
case IrOpcode::kTrapUnless:
@ -3177,12 +3177,12 @@ void InstructionSelector::VisitDeoptimizeUnless(Node* node) {
}
}
void InstructionSelector::VisitDynamicMapCheckUnless(Node* node) {
void InstructionSelector::VisitDynamicCheckMapsWithDeoptUnless(Node* node) {
OperandGenerator g(this);
DynamicMapChecksUnlessNode n(node);
DynamicCheckMapsWithDeoptUnlessNode n(node);
DeoptimizeParameters p = DeoptimizeParametersOf(node->op());
DynamicMapChecksDescriptor descriptor;
DynamicCheckMapsDescriptor descriptor;
// Note: We use Operator::kNoDeopt here because this builtin does not lazy
// deoptimize (which is the meaning of Operator::kNoDeopt), even though it can
// eagerly deoptimize.

View File

@ -620,7 +620,7 @@ class V8_EXPORT_PRIVATE InstructionSelector final {
void VisitCall(Node* call, BasicBlock* handler = nullptr);
void VisitDeoptimizeIf(Node* node);
void VisitDeoptimizeUnless(Node* node);
void VisitDynamicMapCheckUnless(Node* node);
void VisitDynamicCheckMapsWithDeoptUnless(Node* node);
void VisitTrapIf(Node* node, TrapId trap_id);
void VisitTrapUnless(Node* node, TrapId trap_id);
void VisitTailCall(Node* call);

View File

@ -113,7 +113,7 @@ DeoptimizeParameters const& DeoptimizeParametersOf(Operator const* const op) {
DCHECK(op->opcode() == IrOpcode::kDeoptimize ||
op->opcode() == IrOpcode::kDeoptimizeIf ||
op->opcode() == IrOpcode::kDeoptimizeUnless ||
op->opcode() == IrOpcode::kDynamicMapCheckUnless);
op->opcode() == IrOpcode::kDynamicCheckMapsWithDeoptUnless);
return OpParameter<DeoptimizeParameters>(op);
}
@ -785,17 +785,17 @@ struct CommonOperatorGlobalCache final {
struct DynamicMapCheckOperator final : Operator1<DeoptimizeParameters> {
DynamicMapCheckOperator()
: Operator1<DeoptimizeParameters>( // --
IrOpcode::kDynamicMapCheckUnless, // opcode
Operator::kFoldable | Operator::kNoThrow, // properties
"DynamicMapCheckUnless", // name
5, 1, 1, 0, 1, 1, // counts
: Operator1<DeoptimizeParameters>( // --
IrOpcode::kDynamicCheckMapsWithDeoptUnless, // opcode
Operator::kFoldable | Operator::kNoThrow, // properties
"DynamicCheckMapsWithDeoptUnless", // name
5, 1, 1, 0, 1, 1, // counts
DeoptimizeParameters(DeoptimizeKind::kEagerWithResume,
DeoptimizeReason::kDynamicMapCheck,
DeoptimizeReason::kDynamicCheckMaps,
FeedbackSource(),
IsSafetyCheck::kCriticalSafetyCheck)) {}
};
DynamicMapCheckOperator kDynamicMapCheckUnless;
DynamicMapCheckOperator kDynamicCheckMapsWithDeoptUnless;
template <TrapId trap_id>
struct TrapIfOperator final : public Operator1<TrapId> {
@ -1034,8 +1034,8 @@ const Operator* CommonOperatorBuilder::DeoptimizeUnless(
parameter); // parameter
}
const Operator* CommonOperatorBuilder::DynamicMapCheckUnless() {
return &cache_.kDynamicMapCheckUnless;
const Operator* CommonOperatorBuilder::DynamicCheckMapsWithDeoptUnless() {
return &cache_.kDynamicCheckMapsWithDeoptUnless;
}
const Operator* CommonOperatorBuilder::TrapIf(TrapId trap_id) {

View File

@ -488,9 +488,10 @@ class V8_EXPORT_PRIVATE CommonOperatorBuilder final
DeoptimizeKind kind, DeoptimizeReason reason,
FeedbackSource const& feedback,
IsSafetyCheck is_safety_check = IsSafetyCheck::kSafetyCheck);
// DynamicMapCheckUnless will call the dynamic map check builtin if the
// condition is false, which may then either deoptimize or resume execution.
const Operator* DynamicMapCheckUnless();
// DynamicCheckMapsWithDeoptUnless will call the dynamic map check builtin if
// the condition is false, which may then either deoptimize or resume
// execution.
const Operator* DynamicCheckMapsWithDeoptUnless();
const Operator* TrapIf(TrapId trap_id);
const Operator* TrapUnless(TrapId trap_id);
const Operator* Return(int value_input_count = 1);
@ -639,11 +640,12 @@ class StartNode final : public CommonNodeWrapperBase {
}
};
class DynamicMapChecksUnlessNode final : public CommonNodeWrapperBase {
class DynamicCheckMapsWithDeoptUnlessNode final : public CommonNodeWrapperBase {
public:
explicit constexpr DynamicMapChecksUnlessNode(Node* node)
explicit constexpr DynamicCheckMapsWithDeoptUnlessNode(Node* node)
: CommonNodeWrapperBase(node) {
CONSTEXPR_DCHECK(node->opcode() == IrOpcode::kDynamicMapCheckUnless);
CONSTEXPR_DCHECK(node->opcode() ==
IrOpcode::kDynamicCheckMapsWithDeoptUnless);
}
#define INPUTS(V) \

View File

@ -1907,8 +1907,8 @@ void EffectControlLinearizer::LowerDynamicCheckMaps(Node* node,
Node* map = __ HeapConstant(maps[i]);
Node* check = __ TaggedEqual(actual_value_map, map);
if (i == map_count - 1) {
__ DynamicMapCheckUnless(check, slot_index, actual_value_map,
actual_handler, frame_state);
__ DynamicCheckMapsWithDeoptUnless(check, slot_index, actual_value_map,
actual_handler, frame_state);
__ Goto(&done);
} else {
auto next_map = __ MakeLabel();

View File

@ -812,12 +812,13 @@ Node* GraphAssembler::DeoptimizeIfNot(DeoptimizeReason reason,
frame_state, is_safety_check);
}
Node* GraphAssembler::DynamicMapCheckUnless(Node* condition, Node* slot_index,
Node* value, Node* map,
Node* frame_state) {
return AddNode(graph()->NewNode(common()->DynamicMapCheckUnless(), condition,
slot_index, value, map, frame_state, effect(),
control()));
Node* GraphAssembler::DynamicCheckMapsWithDeoptUnless(Node* condition,
Node* slot_index,
Node* value, Node* map,
Node* frame_state) {
return AddNode(graph()->NewNode(common()->DynamicCheckMapsWithDeoptUnless(),
condition, slot_index, value, map,
frame_state, effect(), control()));
}
TNode<Object> GraphAssembler::Call(const CallDescriptor* call_descriptor,

View File

@ -330,8 +330,9 @@ class V8_EXPORT_PRIVATE GraphAssembler {
DeoptimizeReason reason, FeedbackSource const& feedback, Node* condition,
Node* frame_state,
IsSafetyCheck is_safety_check = IsSafetyCheck::kSafetyCheck);
Node* DynamicMapCheckUnless(Node* condition, Node* slot_index, Node* map,
Node* handler, Node* frame_state);
Node* DynamicCheckMapsWithDeoptUnless(Node* condition, Node* slot_index,
Node* map, Node* handler,
Node* frame_state);
TNode<Object> Call(const CallDescriptor* call_descriptor, int inputs_size,
Node** inputs);
TNode<Object> Call(const Operator* op, int inputs_size, Node** inputs);

View File

@ -10,28 +10,28 @@
#include "src/common/globals.h"
// Opcodes for control operators.
#define CONTROL_OP_LIST(V) \
V(Start) \
V(Loop) \
V(Branch) \
V(Switch) \
V(IfTrue) \
V(IfFalse) \
V(IfSuccess) \
V(IfException) \
V(IfValue) \
V(IfDefault) \
V(Merge) \
V(Deoptimize) \
V(DeoptimizeIf) \
V(DeoptimizeUnless) \
V(DynamicMapCheckUnless) \
V(TrapIf) \
V(TrapUnless) \
V(Return) \
V(TailCall) \
V(Terminate) \
V(Throw) \
#define CONTROL_OP_LIST(V) \
V(Start) \
V(Loop) \
V(Branch) \
V(Switch) \
V(IfTrue) \
V(IfFalse) \
V(IfSuccess) \
V(IfException) \
V(IfValue) \
V(IfDefault) \
V(Merge) \
V(Deoptimize) \
V(DeoptimizeIf) \
V(DeoptimizeUnless) \
V(DynamicCheckMapsWithDeoptUnless) \
V(TrapIf) \
V(TrapUnless) \
V(Return) \
V(TailCall) \
V(Terminate) \
V(Throw) \
V(End)
// Opcodes for constant operators.

View File

@ -115,7 +115,7 @@ class Typer::Visitor : public Reducer {
DECLARE_IMPOSSIBLE_CASE(Deoptimize)
DECLARE_IMPOSSIBLE_CASE(DeoptimizeIf)
DECLARE_IMPOSSIBLE_CASE(DeoptimizeUnless)
DECLARE_IMPOSSIBLE_CASE(DynamicMapCheckUnless)
DECLARE_IMPOSSIBLE_CASE(DynamicCheckMapsWithDeoptUnless)
DECLARE_IMPOSSIBLE_CASE(TrapIf)
DECLARE_IMPOSSIBLE_CASE(TrapUnless)
DECLARE_IMPOSSIBLE_CASE(Return)

View File

@ -355,7 +355,7 @@ void Verifier::Visitor::Check(Node* node, const AllNodes& all) {
break;
case IrOpcode::kDeoptimizeIf:
case IrOpcode::kDeoptimizeUnless:
case IrOpcode::kDynamicMapCheckUnless:
case IrOpcode::kDynamicCheckMapsWithDeoptUnless:
CheckNotTyped(node);
break;
case IrOpcode::kTrapIf:

View File

@ -17,7 +17,7 @@ namespace internal {
V(CouldNotGrowElements, "failed to grow elements store") \
V(DeoptimizeNow, "%_DeoptimizeNow") \
V(DivisionByZero, "division by zero") \
V(DynamicMapCheck, "dynamic map check failed") \
V(DynamicCheckMaps, "dynamic check maps failed") \
V(Hole, "hole") \
V(InstanceMigrationFailed, "instance migration failed") \
V(InsufficientTypeFeedbackForCall, "Insufficient type feedback for call") \

View File

@ -635,8 +635,8 @@ void Deoptimizer::DeleteFrameDescriptions() {
Builtins::Name Deoptimizer::GetDeoptWithResumeBuiltin(DeoptimizeReason reason) {
switch (reason) {
case DeoptimizeReason::kDynamicMapCheck:
return Builtins::kDynamicMapChecksTrampoline;
case DeoptimizeReason::kDynamicCheckMaps:
return Builtins::kDynamicCheckMapsTrampoline;
default:
UNREACHABLE();
}

View File

@ -250,7 +250,7 @@ RUNTIME_FUNCTION(Runtime_IsConcurrentRecompilationSupported) {
isolate->concurrent_recompilation_enabled());
}
RUNTIME_FUNCTION(Runtime_DynamicMapChecksEnabled) {
RUNTIME_FUNCTION(Runtime_DynamicCheckMapsEnabled) {
SealHandleScope shs(isolate);
DCHECK_EQ(0, args.length());
return isolate->heap()->ToBoolean(FLAG_turbo_dynamic_map_checks);

View File

@ -471,7 +471,7 @@ namespace internal {
F(DisallowCodegenFromStrings, 1, 1) \
F(DisallowWasmCodegen, 1, 1) \
F(DisassembleFunction, 1, 1) \
F(DynamicMapChecksEnabled, 0, 1) \
F(DynamicCheckMapsEnabled, 0, 1) \
F(EnableCodeLoggingForTesting, 0, 1) \
F(EnsureFeedbackVectorForFunction, 1, 1) \
F(FreezeWasmLazyCompilation, 1, 1) \

View File

@ -1533,7 +1533,7 @@ TEST(DeoptExitSizeIsFixed) {
masm.bind(&before_exit);
if (kind == DeoptimizeKind::kEagerWithResume) {
Builtins::Name target = Deoptimizer::GetDeoptWithResumeBuiltin(
DeoptimizeReason::kDynamicMapCheck);
DeoptimizeReason::kDynamicCheckMaps);
masm.CallForDeoptimization(target, 42, &before_exit, kind, &before_exit,
nullptr);
CHECK_EQ(masm.SizeOfCodeGeneratedSince(&before_exit),

View File

@ -326,7 +326,7 @@ TEST(DeoptExitSizeIsFixed) {
masm.bind(&before_exit);
if (kind == DeoptimizeKind::kEagerWithResume) {
Builtins::Name target = Deoptimizer::GetDeoptWithResumeBuiltin(
DeoptimizeReason::kDynamicMapCheck);
DeoptimizeReason::kDynamicCheckMaps);
masm.CallForDeoptimization(target, 42, &before_exit, kind, &before_exit,
nullptr);
CHECK_EQ(masm.SizeOfCodeGeneratedSince(&before_exit),

View File

@ -107,7 +107,7 @@ TEST(DeoptExitSizeIsFixed) {
if (kind == DeoptimizeKind::kEagerWithResume) {
masm.bind(&before_exit);
Builtins::Name target = Deoptimizer::GetDeoptWithResumeBuiltin(
DeoptimizeReason::kDynamicMapCheck);
DeoptimizeReason::kDynamicCheckMaps);
masm.CallForDeoptimization(target, 42, &before_exit, kind, &before_exit,
&before_exit);
CHECK_EQ(masm.SizeOfCodeGeneratedSince(&before_exit),

View File

@ -1049,7 +1049,7 @@ TEST(DeoptExitSizeIsFixed) {
masm.bind(&before_exit);
if (kind == DeoptimizeKind::kEagerWithResume) {
Builtins::Name target = Deoptimizer::GetDeoptWithResumeBuiltin(
DeoptimizeReason::kDynamicMapCheck);
DeoptimizeReason::kDynamicCheckMaps);
masm.CallForDeoptimization(target, 42, &before_exit, kind, &before_exit,
nullptr);
CHECK_EQ(masm.SizeOfCodeGeneratedSince(&before_exit),

View File

@ -50,7 +50,7 @@ callsFReceiver(o1);
var r2 = callsFReceiver(o1);
assertOptimized(callsFReceiver);
callsFReceiver(o2);
if (%DynamicMapChecksEnabled()) {
if (%DynamicCheckMapsEnabled()) {
// Call it again to ensure a deopt when dynamic map checks is enabled.
callsFReceiver(o2);
}
@ -77,7 +77,7 @@ assertTrue(r1 === r2);
assertTrue(r2 === r3);
if (%DynamicMapChecksEnabled()) {
if (%DynamicCheckMapsEnabled()) {
assertEquals(11, calls);
} else {
assertEquals(10, calls);

View File

@ -27,7 +27,7 @@ g1({ f : 1});
%OptimizeFunctionOnNextCall(g2);
g2({ f : 2});
g1({});
if (%DynamicMapChecksEnabled()) {
if (%DynamicCheckMapsEnabled()) {
// One more call to ensure a deopt even if dynamic map checks is enabled.
g1({});
}