16#define GET_CACHED_FIELD(ptr, expr) (*(ptr)) ? *(ptr) : (*(ptr) = (expr))
18#define DEFINE_GETTER(name, Type, expr) \
19 TNode<Type> JSGraph::name() { \
20 return TNode<Type>::UncheckedCast(GET_CACHED_FIELD(&name##_, expr)); \
24 bool builtin_exit_frame) {
26 DCHECK(result_size >= 1 && result_size <= 3);
27 if (!builtin_exit_frame) {
29 if (result_size == 1) {
30 ptr = &CEntryStub1Constant_;
31 }
else if (result_size == 2) {
32 ptr = &CEntryStub2Constant_;
35 ptr = &CEntryStub3Constant_;
39 isolate(), result_size, argv_mode, builtin_exit_frame)));
41 Node** ptr = builtin_exit_frame ? &CEntryStub1WithBuiltinExitFrameConstant_
42 : &CEntryStub1Constant_;
45 isolate(), result_size, argv_mode, builtin_exit_frame)));
48 argv_mode, builtin_exit_frame));
54 CHECK(ref.IsSmi() || ref.IsHeapNumber() ||
55 ref.AsHeapObject().GetHeapObjectType(
broker).hole_type() ==
57 if (IsThinString(*ref.object())) {
70 if (ref.IsHeapNumber()) {
74 switch (ref.AsHeapObject().GetHeapObjectType(
broker).hole_type()) {
78 return TheHoleConstant();
79 case HoleType::kPropertyCellHole:
80 return PropertyCellHoleConstant();
81 case HoleType::kHashTableHole:
82 return HashTableHoleConstant();
83 case HoleType::kPromiseHole:
84 return PromiseHoleConstant();
85 case HoleType::kOptimizedOut:
86 return OptimizedOutConstant();
87 case HoleType::kStaleRegister:
88 return StaleRegisterConstant();
89 case HoleType::kUninitialized:
90 return UninitializedConstant();
91 case HoleType::kException:
92 case HoleType::kTerminationException:
93 case HoleType::kArgumentsMarker:
94 case HoleType::kSelfReferenceMarker:
95 case HoleType::kBasicBlockCountersMarker:
100 ref.AsHeapObject().GetHeapObjectType(
broker).oddball_type();
103 DCHECK(IsUndefined(*ref.object(), roots));
104 return UndefinedConstant();
107 return NullConstant();
109 if (IsTrue(*ref.object(), roots)) {
110 return TrueConstant();
112 DCHECK(IsFalse(*ref.object(), roots));
113 return FalseConstant();
132 return ZeroConstant();
134 return OneConstant();
140 if (*loc ==
nullptr) {
149 if (*loc ==
nullptr) {
157 if (*loc ==
nullptr) {
166 if (*loc ==
nullptr) {
173 DCHECK(IsTrustedObject(*value));
182#define DO_CACHED_FIELD(name, ...) \
183 if (name##_) nodes->push_back(name##_);
187#undef DO_CACHED_FIELD
192 AllocateInYoungGeneration)))
196 AllocateInOldGeneration)))
198#if V8_ENABLE_WEBASSEMBLY
201 WasmAllocateInYoungGeneration)))
205 WasmAllocateInOldGeneration)))
222 PlainPrimitiveToNumber)))
288 graph()->NewNode(common()->StateValues(0,
293 graph()->NewNode(common()->TypedStateValues(
301#undef GET_CACHED_FIELD
#define BUILTIN_CODE(isolate, name)
static Handle< Code > CEntry(Isolate *isolate, int result_size=1, ArgvMode argv_mode=ArgvMode::kStack, bool builtin_exit_frame=false, bool switch_to_central_stack=false)
void GetCachedNodes(ZoneVector< Node * > *nodes)
Node ** FindNumberConstant(double value)
Node ** FindHeapConstant(Handle< HeapObject > value)
IndirectHandle< HeapNumber > object() const
Node * ConstantMaybeHole(ObjectRef ref, JSHeapBroker *broker)
Node * Constant(ObjectRef value, JSHeapBroker *broker)
void GetCachedNodes(NodeVector *nodes)
Node * HeapConstantHole(Handle< HeapObject > value)
Node * HeapConstantNoHole(Handle< HeapObject > value)
Node * NumberConstant(double value)
Node * CEntryStubConstant(int result_size, ArgvMode argv_mode=ArgvMode::kStack, bool builtin_exit_frame=false)
Isolate * isolate() const
Node * ConstantMutableHeapNumber(HeapNumberRef ref, JSHeapBroker *broker)
Node * HeapConstantMaybeHole(Handle< HeapObject > value)
Node * ConstantNoHole(ObjectRef ref, JSHeapBroker *broker)
Node * TrustedHeapConstant(Handle< HeapObject > value)
CommonOperatorBuilder * common() const
Node * NewNode(const Operator *op, int input_count, Node *const *inputs, bool incomplete=false)
#define DEFINE_GETTER(Name, HighBit, LowBit, Func)
#define DO_CACHED_FIELD(name,...)
#define GET_CACHED_FIELD(ptr, expr)
#define CACHED_GLOBAL_LIST(V)
#define CACHED_CENTRY_LIST(V)
V8_INLINE Dest bit_cast(Source const &source)
HeapConstantHole(factory() ->the_hole_value())) DEFINE_GETTER(PropertyCellHoleConstant
NumberConstant(std::numeric_limits< double >::quiet_NaN())) DEFINE_GETTER(EmptyStateValues
ref_traits< T >::ref_type MakeRefAssumeMemoryFence(JSHeapBroker *broker, Tagged< T > object)
HeapConstantNoHole(BUILTIN_CODE(isolate(), AllocateInOldGeneration))) DEFINE_GETTER(ArrayConstructorStubConstant
bool IsAnyHole(Tagged< Object > obj, PtrComprCageBase cage_base)
constexpr uint64_t kHoleNanInt64
int ToNumber(Register reg)
kInstanceDescriptorsOffset kTransitionsOrPrototypeInfoOffset IsNull(value)||IsJSProxy(value)||IsWasmObject(value)||(IsJSObject(value) &&(HeapLayout
Tagged< To > Cast(Tagged< From > value, const v8::SourceLocation &loc=INIT_SOURCE_LOCATION_IN_DEBUG)
static const base::uc32 kEndMarker
#define CHECK_NE(lhs, rhs)
#define DCHECK(condition)
#define DCHECK_EQ(v1, v2)