v8
V8 is Google’s open source high-performance JavaScript and WebAssembly engine, written in C++.
Loading...
Searching...
No Matches
maglev-ir.h
Go to the documentation of this file.
1// Copyright 2021 the V8 project authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5#ifndef V8_MAGLEV_MAGLEV_IR_H_
6#define V8_MAGLEV_MAGLEV_IR_H_
7
8#include <optional>
9
10#include "src/base/bit-field.h"
11#include "src/base/bits.h"
12#include "src/base/bounds.h"
14#include "src/base/enum-set.h"
15#include "src/base/logging.h"
16#include "src/base/macros.h"
20#include "src/codegen/label.h"
22#include "src/codegen/reglist.h"
24#include "src/common/globals.h"
31// TODO(dmercadier): move the Turboshaft utils functions to shared code (in
32// particular, any_of, which is the reason we're including this Turboshaft
33// header)
44#include "src/objects/smi.h"
46#include "src/roots/roots.h"
48#include "src/utils/utils.h"
49#include "src/zone/zone.h"
50
51namespace v8 {
52namespace internal {
53
54enum Condition : int;
55
56namespace maglev {
57
58class BasicBlock;
59class ProcessingState;
60class MaglevAssembler;
61class MaglevCodeGenState;
62class MaglevCompilationUnit;
63class MaglevGraphLabeller;
64class MaglevVregAllocationState;
65class CompactInterpreterFrameState;
66class MergePointInterpreterFrameState;
67class ExceptionHandlerInfo;
68
69// Nodes are either
70// 1. side-effecting or value-holding SSA nodes in the body of basic blocks, or
71// 2. Control nodes that store the control flow at the end of basic blocks, and
72// form a separate node hierarchy to non-control nodes.
73//
74// The macro lists below must match the node class hierarchy.
75
76#define GENERIC_OPERATIONS_NODE_LIST(V) \
77 V(GenericAdd) \
78 V(GenericSubtract) \
79 V(GenericMultiply) \
80 V(GenericDivide) \
81 V(GenericModulus) \
82 V(GenericExponentiate) \
83 V(GenericBitwiseAnd) \
84 V(GenericBitwiseOr) \
85 V(GenericBitwiseXor) \
86 V(GenericShiftLeft) \
87 V(GenericShiftRight) \
88 V(GenericShiftRightLogical) \
89 V(GenericBitwiseNot) \
90 V(GenericNegate) \
91 V(GenericIncrement) \
92 V(GenericDecrement) \
93 V(GenericEqual) \
94 V(GenericStrictEqual) \
95 V(GenericLessThan) \
96 V(GenericLessThanOrEqual) \
97 V(GenericGreaterThan) \
98 V(GenericGreaterThanOrEqual)
99
100#define INT32_OPERATIONS_NODE_LIST(V) \
101 V(Int32AbsWithOverflow) \
102 V(Int32AddWithOverflow) \
103 V(Int32SubtractWithOverflow) \
104 V(Int32MultiplyWithOverflow) \
105 V(Int32DivideWithOverflow) \
106 V(Int32ModulusWithOverflow) \
107 V(Int32BitwiseAnd) \
108 V(Int32BitwiseOr) \
109 V(Int32BitwiseXor) \
110 V(Int32ShiftLeft) \
111 V(Int32ShiftRight) \
112 V(Int32ShiftRightLogical) \
113 V(Int32BitwiseNot) \
114 V(Int32NegateWithOverflow) \
115 V(Int32IncrementWithOverflow) \
116 V(Int32DecrementWithOverflow) \
117 V(Int32Compare) \
118 V(Int32ToBoolean)
119
120#define FLOAT64_OPERATIONS_NODE_LIST(V) \
121 V(Float64Abs) \
122 V(Float64Add) \
123 V(Float64Subtract) \
124 V(Float64Multiply) \
125 V(Float64Divide) \
126 V(Float64Exponentiate) \
127 V(Float64Modulus) \
128 V(Float64Negate) \
129 V(Float64Round) \
130 V(Float64Compare) \
131 V(Float64ToBoolean) \
132 V(Float64Ieee754Unary)
133
134#define SMI_OPERATIONS_NODE_LIST(V) \
135 V(CheckedSmiIncrement) \
136 V(CheckedSmiDecrement)
137
138#define CONSTANT_VALUE_NODE_LIST(V) \
139 V(Constant) \
140 V(ExternalConstant) \
141 V(Float64Constant) \
142 V(Int32Constant) \
143 V(Uint32Constant) \
144 V(RootConstant) \
145 V(SmiConstant) \
146 V(TaggedIndexConstant) \
147 V(TrustedConstant)
148
149#define INLINE_BUILTIN_NODE_LIST(V) \
150 V(BuiltinStringFromCharCode) \
151 V(BuiltinStringPrototypeCharCodeOrCodePointAt)
152
153#define TURBOLEV_VALUE_NODE_LIST(V) \
154 V(CreateFastArrayElements) \
155 V(MapPrototypeGet) \
156 V(MapPrototypeGetInt32Key) \
157 V(SetPrototypeHas)
158
159#define TURBOLEV_NON_VALUE_NODE_LIST(V) V(TransitionAndStoreArrayElement)
160
161#define VALUE_NODE_LIST(V) \
162 V(Identity) \
163 V(AllocationBlock) \
164 V(ArgumentsElements) \
165 V(ArgumentsLength) \
166 V(RestLength) \
167 V(Call) \
168 V(CallBuiltin) \
169 V(CallCPPBuiltin) \
170 V(CallForwardVarargs) \
171 V(CallRuntime) \
172 V(CallWithArrayLike) \
173 V(CallWithSpread) \
174 V(CallKnownApiFunction) \
175 V(CallKnownJSFunction) \
176 V(CallSelf) \
177 V(Construct) \
178 V(CheckConstructResult) \
179 V(CheckDerivedConstructResult) \
180 V(ConstructWithSpread) \
181 V(ConvertReceiver) \
182 V(ConvertHoleToUndefined) \
183 V(CreateArrayLiteral) \
184 V(CreateShallowArrayLiteral) \
185 V(CreateObjectLiteral) \
186 V(CreateShallowObjectLiteral) \
187 V(CreateFunctionContext) \
188 V(CreateClosure) \
189 V(FastCreateClosure) \
190 V(CreateRegExpLiteral) \
191 V(DeleteProperty) \
192 V(EnsureWritableFastElements) \
193 V(ExtendPropertiesBackingStore) \
194 V(InlinedAllocation) \
195 V(ForInPrepare) \
196 V(ForInNext) \
197 V(GeneratorRestoreRegister) \
198 V(GetIterator) \
199 V(GetSecondReturnedValue) \
200 V(GetTemplateObject) \
201 V(HasInPrototypeChain) \
202 V(InitialValue) \
203 V(LoadTaggedField) \
204 V(LoadTaggedFieldForProperty) \
205 V(LoadTaggedFieldForContextSlot) \
206 V(LoadTaggedFieldForScriptContextSlot) \
207 V(LoadHeapInt32) \
208 V(LoadDoubleField) \
209 V(LoadFloat64) \
210 V(LoadInt32) \
211 V(LoadTaggedFieldByFieldIndex) \
212 V(LoadFixedArrayElement) \
213 V(LoadFixedDoubleArrayElement) \
214 V(LoadHoleyFixedDoubleArrayElement) \
215 V(LoadHoleyFixedDoubleArrayElementCheckedNotHole) \
216 V(LoadSignedIntDataViewElement) \
217 V(LoadDoubleDataViewElement) \
218 V(LoadTypedArrayLength) \
219 V(LoadSignedIntTypedArrayElement) \
220 V(LoadUnsignedIntTypedArrayElement) \
221 V(LoadDoubleTypedArrayElement) \
222 V(LoadEnumCacheLength) \
223 V(LoadGlobal) \
224 V(LoadNamedGeneric) \
225 V(LoadNamedFromSuperGeneric) \
226 V(MaybeGrowFastElements) \
227 V(MigrateMapIfNeeded) \
228 V(SetNamedGeneric) \
229 V(DefineNamedOwnGeneric) \
230 V(StoreInArrayLiteralGeneric) \
231 V(StoreGlobal) \
232 V(GetKeyedGeneric) \
233 V(SetKeyedGeneric) \
234 V(DefineKeyedOwnGeneric) \
235 V(Phi) \
236 V(RegisterInput) \
237 V(CheckedSmiSizedInt32) \
238 V(CheckedSmiTagInt32) \
239 V(CheckedSmiTagUint32) \
240 V(CheckedSmiTagIntPtr) \
241 V(UnsafeSmiTagInt32) \
242 V(UnsafeSmiTagUint32) \
243 V(UnsafeSmiTagIntPtr) \
244 V(CheckedSmiUntag) \
245 V(UnsafeSmiUntag) \
246 V(CheckedInternalizedString) \
247 V(CheckedObjectToIndex) \
248 V(CheckedTruncateNumberOrOddballToInt32) \
249 V(CheckedInt32ToUint32) \
250 V(CheckedIntPtrToUint32) \
251 V(UnsafeInt32ToUint32) \
252 V(CheckedUint32ToInt32) \
253 V(CheckedIntPtrToInt32) \
254 V(ChangeInt32ToFloat64) \
255 V(ChangeUint32ToFloat64) \
256 V(ChangeIntPtrToFloat64) \
257 V(CheckedTruncateFloat64ToInt32) \
258 V(CheckedTruncateFloat64ToUint32) \
259 V(TruncateNumberOrOddballToInt32) \
260 V(TruncateUint32ToInt32) \
261 V(TruncateFloat64ToInt32) \
262 V(UnsafeTruncateUint32ToInt32) \
263 V(UnsafeTruncateFloat64ToInt32) \
264 V(Int32ToUint8Clamped) \
265 V(Uint32ToUint8Clamped) \
266 V(Float64ToUint8Clamped) \
267 V(CheckedNumberToUint8Clamped) \
268 V(Int32ToNumber) \
269 V(Uint32ToNumber) \
270 V(IntPtrToBoolean) \
271 V(IntPtrToNumber) \
272 V(Float64ToTagged) \
273 V(Float64ToHeapNumberForField) \
274 V(HoleyFloat64ToTagged) \
275 V(CheckedSmiTagFloat64) \
276 V(CheckedNumberToInt32) \
277 V(CheckedNumberOrOddballToFloat64) \
278 V(UncheckedNumberOrOddballToFloat64) \
279 V(CheckedNumberOrOddballToHoleyFloat64) \
280 V(CheckedHoleyFloat64ToFloat64) \
281 V(HoleyFloat64ToMaybeNanFloat64) \
282 V(HoleyFloat64IsHole) \
283 V(LogicalNot) \
284 V(SetPendingMessage) \
285 V(StringAt) \
286 V(StringEqual) \
287 V(StringLength) \
288 V(StringConcat) \
289 V(ConsStringMap) \
290 V(UnwrapThinString) \
291 V(UnwrapStringWrapper) \
292 V(ToBoolean) \
293 V(ToBooleanLogicalNot) \
294 V(AllocateElementsArray) \
295 V(TaggedEqual) \
296 V(TaggedNotEqual) \
297 V(TestInstanceOf) \
298 V(TestUndetectable) \
299 V(TestTypeOf) \
300 V(ToName) \
301 V(ToNumberOrNumeric) \
302 V(ToObject) \
303 V(ToString) \
304 V(TransitionElementsKind) \
305 V(NumberToString) \
306 V(UpdateJSArrayLength) \
307 V(VirtualObject) \
308 V(GetContinuationPreservedEmbedderData) \
309 CONSTANT_VALUE_NODE_LIST(V) \
310 INT32_OPERATIONS_NODE_LIST(V) \
311 FLOAT64_OPERATIONS_NODE_LIST(V) \
312 SMI_OPERATIONS_NODE_LIST(V) \
313 GENERIC_OPERATIONS_NODE_LIST(V) \
314 INLINE_BUILTIN_NODE_LIST(V) \
315 TURBOLEV_VALUE_NODE_LIST(V)
316
317#define GAP_MOVE_NODE_LIST(V) \
318 V(ConstantGapMove) \
319 V(GapMove)
320
321#define NON_VALUE_NODE_LIST(V) \
322 V(AssertInt32) \
323 V(CheckDynamicValue) \
324 V(CheckInt32IsSmi) \
325 V(CheckUint32IsSmi) \
326 V(CheckIntPtrIsSmi) \
327 V(CheckHoleyFloat64IsSmi) \
328 V(CheckHeapObject) \
329 V(CheckInt32Condition) \
330 V(CheckCacheIndicesNotCleared) \
331 V(CheckJSDataViewBounds) \
332 V(CheckTypedArrayBounds) \
333 V(CheckTypedArrayNotDetached) \
334 V(CheckMaps) \
335 V(CheckMapsWithMigrationAndDeopt) \
336 V(CheckMapsWithMigration) \
337 V(CheckMapsWithAlreadyLoadedMap) \
338 V(CheckDetectableCallable) \
339 V(CheckJSReceiverOrNullOrUndefined) \
340 V(CheckNotHole) \
341 V(CheckHoleyFloat64NotHole) \
342 V(CheckNumber) \
343 V(CheckSmi) \
344 V(CheckString) \
345 V(CheckStringOrStringWrapper) \
346 V(CheckSymbol) \
347 V(CheckValue) \
348 V(CheckValueEqualsInt32) \
349 V(CheckFloat64SameValue) \
350 V(CheckValueEqualsString) \
351 V(CheckInstanceType) \
352 V(Dead) \
353 V(DebugBreak) \
354 V(FunctionEntryStackCheck) \
355 V(GeneratorStore) \
356 V(TryOnStackReplacement) \
357 V(StoreMap) \
358 V(StoreDoubleField) \
359 V(StoreHeapInt32) \
360 V(StoreFixedArrayElementWithWriteBarrier) \
361 V(StoreFixedArrayElementNoWriteBarrier) \
362 V(StoreFixedDoubleArrayElement) \
363 V(StoreInt32) \
364 V(StoreFloat64) \
365 V(StoreIntTypedArrayElement) \
366 V(StoreDoubleTypedArrayElement) \
367 V(StoreSignedIntDataViewElement) \
368 V(StoreDoubleDataViewElement) \
369 V(StoreTaggedFieldNoWriteBarrier) \
370 V(StoreTaggedFieldWithWriteBarrier) \
371 V(StoreScriptContextSlotWithWriteBarrier) \
372 V(StoreTrustedPointerFieldWithWriteBarrier) \
373 V(HandleNoHeapWritesInterrupt) \
374 V(ReduceInterruptBudgetForLoop) \
375 V(ReduceInterruptBudgetForReturn) \
376 V(ThrowReferenceErrorIfHole) \
377 V(ThrowSuperNotCalledIfHole) \
378 V(ThrowSuperAlreadyCalledIfNotHole) \
379 V(ThrowIfNotCallable) \
380 V(ThrowIfNotSuperConstructor) \
381 V(TransitionElementsKindOrCheckMap) \
382 V(SetContinuationPreservedEmbedderData) \
383 GAP_MOVE_NODE_LIST(V) \
384 TURBOLEV_NON_VALUE_NODE_LIST(V)
385
386#define NODE_LIST(V) \
387 NON_VALUE_NODE_LIST(V) \
388 VALUE_NODE_LIST(V)
389
390#define BRANCH_CONTROL_NODE_LIST(V) \
391 V(BranchIfSmi) \
392 V(BranchIfRootConstant) \
393 V(BranchIfToBooleanTrue) \
394 V(BranchIfInt32ToBooleanTrue) \
395 V(BranchIfIntPtrToBooleanTrue) \
396 V(BranchIfFloat64ToBooleanTrue) \
397 V(BranchIfFloat64IsHole) \
398 V(BranchIfReferenceEqual) \
399 V(BranchIfInt32Compare) \
400 V(BranchIfUint32Compare) \
401 V(BranchIfFloat64Compare) \
402 V(BranchIfUndefinedOrNull) \
403 V(BranchIfUndetectable) \
404 V(BranchIfJSReceiver) \
405 V(BranchIfTypeOf)
406
407#define CONDITIONAL_CONTROL_NODE_LIST(V) \
408 V(Switch) \
409 BRANCH_CONTROL_NODE_LIST(V)
410
411#define UNCONDITIONAL_CONTROL_NODE_LIST(V) \
412 V(Jump) \
413 V(CheckpointedJump) \
414 V(JumpLoop)
415
416#define TERMINAL_CONTROL_NODE_LIST(V) \
417 V(Abort) \
418 V(Return) \
419 V(Deopt)
420
421#define CONTROL_NODE_LIST(V) \
422 TERMINAL_CONTROL_NODE_LIST(V) \
423 CONDITIONAL_CONTROL_NODE_LIST(V) \
424 UNCONDITIONAL_CONTROL_NODE_LIST(V)
425
426#define NODE_BASE_LIST(V) \
427 NODE_LIST(V) \
428 CONTROL_NODE_LIST(V)
429
430// Define the opcode enum.
431#define DEF_OPCODES(type) k##type,
432enum class Opcode : uint16_t { NODE_BASE_LIST(DEF_OPCODES) };
433#undef DEF_OPCODES
434#define PLUS_ONE(type) +1
435static constexpr int kOpcodeCount = NODE_BASE_LIST(PLUS_ONE);
436static constexpr Opcode kFirstOpcode = static_cast<Opcode>(0);
437static constexpr Opcode kLastOpcode = static_cast<Opcode>(kOpcodeCount - 1);
438#undef PLUS_ONE
439
440const char* OpcodeToString(Opcode opcode);
441inline std::ostream& operator<<(std::ostream& os, Opcode opcode) {
442 return os << OpcodeToString(opcode);
443}
444
445#define V(Name) Opcode::k##Name,
447 std::min({VALUE_NODE_LIST(V) kLastOpcode});
448static constexpr Opcode kLastValueNodeOpcode =
449 std::max({VALUE_NODE_LIST(V) kFirstOpcode});
455 std::min({GAP_MOVE_NODE_LIST(V) kLastOpcode});
457 std::max({GAP_MOVE_NODE_LIST(V) kFirstOpcode});
458
459static constexpr Opcode kFirstNodeOpcode = std::min({NODE_LIST(V) kLastOpcode});
460static constexpr Opcode kLastNodeOpcode = std::max({NODE_LIST(V) kFirstOpcode});
461
466
471
476
481
483 std::min({CONTROL_NODE_LIST(V) kLastOpcode});
485 std::max({CONTROL_NODE_LIST(V) kFirstOpcode});
486#undef V
487
488constexpr bool IsValueNode(Opcode opcode) {
489 return kFirstValueNodeOpcode <= opcode && opcode <= kLastValueNodeOpcode;
490}
491constexpr bool IsConstantNode(Opcode opcode) {
492 return kFirstConstantNodeOpcode <= opcode &&
493 opcode <= kLastConstantNodeOpcode;
494}
495constexpr bool IsCommutativeNode(Opcode opcode) {
496 switch (opcode) {
497 case Opcode::kFloat64Add:
498 case Opcode::kFloat64Multiply:
499 case Opcode::kGenericStrictEqual:
500 case Opcode::kInt32AddWithOverflow:
501 case Opcode::kInt32BitwiseAnd:
502 case Opcode::kInt32BitwiseOr:
503 case Opcode::kInt32BitwiseXor:
504 case Opcode::kInt32MultiplyWithOverflow:
505 case Opcode::kStringEqual:
506 case Opcode::kTaggedEqual:
507 case Opcode::kTaggedNotEqual:
508 return true;
509 default:
510 return false;
511 }
512}
513constexpr bool IsZeroCostNode(Opcode opcode) {
514 switch (opcode) {
515 case Opcode::kTruncateUint32ToInt32:
516 case Opcode::kUnsafeTruncateUint32ToInt32:
517 case Opcode::kIdentity:
518 return true;
519 default:
520 return false;
521 }
522}
523constexpr bool IsGapMoveNode(Opcode opcode) {
524 return kFirstGapMoveNodeOpcode <= opcode && opcode <= kLastGapMoveNodeOpcode;
525}
526constexpr bool IsControlNode(Opcode opcode) {
527 return kFirstControlNodeOpcode <= opcode && opcode <= kLastControlNodeOpcode;
528}
529constexpr bool IsBranchControlNode(Opcode opcode) {
530 return kFirstBranchControlNodeOpcode <= opcode &&
532}
533constexpr bool IsConditionalControlNode(Opcode opcode) {
534 return kFirstConditionalControlNodeOpcode <= opcode &&
536}
537constexpr bool IsUnconditionalControlNode(Opcode opcode) {
538 return kFirstUnconditionalControlNodeOpcode <= opcode &&
540}
541constexpr bool IsTerminalControlNode(Opcode opcode) {
542 return kFirstTerminalControlNodeOpcode <= opcode &&
544}
545// Simple field stores are stores which do nothing but change a field value
546// (i.e. no map transitions or calls into user code).
547constexpr bool IsSimpleFieldStore(Opcode opcode) {
548 return opcode == Opcode::kStoreTaggedFieldWithWriteBarrier ||
549 opcode == Opcode::kStoreTaggedFieldNoWriteBarrier ||
550 opcode == Opcode::kStoreDoubleField ||
551 opcode == Opcode::kStoreHeapInt32 || opcode == Opcode::kStoreFloat64 ||
552 opcode == Opcode::kStoreInt32 ||
553 opcode == Opcode::kUpdateJSArrayLength ||
554 opcode == Opcode::kStoreFixedArrayElementWithWriteBarrier ||
555 opcode == Opcode::kStoreFixedArrayElementNoWriteBarrier ||
556 opcode == Opcode::kStoreFixedDoubleArrayElement ||
557 opcode == Opcode::kStoreTrustedPointerFieldWithWriteBarrier;
558}
559constexpr bool IsElementsArrayWrite(Opcode opcode) {
560 return opcode == Opcode::kMaybeGrowFastElements ||
561 opcode == Opcode::kEnsureWritableFastElements;
562}
563constexpr bool IsTypedArrayStore(Opcode opcode) {
564 return opcode == Opcode::kStoreIntTypedArrayElement ||
565 opcode == Opcode::kStoreDoubleTypedArrayElement;
566}
567
568constexpr bool CanBeStoreToNonEscapedObject(Opcode opcode) {
569 switch (opcode) {
570 case Opcode::kStoreMap:
571 case Opcode::kStoreInt32:
572 case Opcode::kStoreTrustedPointerFieldWithWriteBarrier:
573 case Opcode::kStoreTaggedFieldWithWriteBarrier:
574 case Opcode::kStoreTaggedFieldNoWriteBarrier:
575 case Opcode::kStoreScriptContextSlotWithWriteBarrier:
576 case Opcode::kStoreFloat64:
577 return true;
578 default:
579 return false;
580 }
581}
582
583// Forward-declare NodeBase sub-hierarchies.
584class Node;
585class ControlNode;
586class ConditionalControlNode;
587class BranchControlNode;
588class UnconditionalControlNode;
589class TerminalControlNode;
590class ValueNode;
591
592enum class ValueRepresentation : uint8_t {
593 kTagged,
594 kInt32,
595 kUint32,
596 kFloat64,
598 kIntPtr
599};
600
601inline constexpr bool IsDoubleRepresentation(ValueRepresentation repr) {
602 return repr == ValueRepresentation::kFloat64 ||
604}
605
607#if defined(V8_TARGET_ARCH_RISCV64)
608 // on RISC-V int32 are always sign-extended
609 return false;
610#else
611 return (repr == ValueRepresentation::kUint32 ||
613#endif
614}
615
616// TODO(olivf): Rename Unknown to Any.
617
618/* Every object should belong to exactly one of these.*/
619#define LEAF_NODE_TYPE_LIST(V) \
620 V(Smi, (1 << 0)) \
621 V(HeapNumber, (1 << 1)) \
622 V(NullOrUndefined, (1 << 2)) \
623 V(Boolean, (1 << 3)) \
624 V(Symbol, (1 << 4)) \
625 V(ThinString, (1 << 5)) \
626 V(InternalizedString, (1 << 6)) \
627 V(NonInternalizedNonThinString, (1 << 7)) \
628 V(StringWrapper, (1 << 8)) \
629 V(JSArray, (1 << 9)) \
630 V(Callable, (1 << 10)) \
631 V(OtherJSReceiver, (1 << 11)) \
632 V(OtherHeapObject, (1 << 12))
633
634#define COMBINED_NODE_TYPE_LIST(V) \
635 /* A value which has all the above bits set */ \
636 V(Unknown, ((1 << 13) - 1)) \
637 V(Oddball, kNullOrUndefined | kBoolean) \
638 V(Number, kSmi | kHeapNumber) \
639 V(NumberOrBoolean, kNumber | kBoolean) \
640 V(NumberOrOddball, kNumber | kOddball) \
641 V(NonThinString, kInternalizedString | kNonInternalizedNonThinString) \
642 V(String, kThinString | kNonThinString) \
643 V(StringOrStringWrapper, kString | kStringWrapper) \
644 V(Name, kString | kSymbol) \
645 V(JSReceiver, kJSArray | kCallable | kStringWrapper | kOtherJSReceiver) \
646 V(JSReceiverOrNullOrUndefined, kJSReceiver | kNullOrUndefined) \
647 V(AnyHeapObject, kUnknown - kSmi)
648
649#define NODE_TYPE_LIST(V) \
650 LEAF_NODE_TYPE_LIST(V) \
651 COMBINED_NODE_TYPE_LIST(V)
652
653enum class NodeType : uint32_t {
654#define DEFINE_NODE_TYPE(Name, Value) k##Name = Value,
656#undef DEFINE_NODE_TYPE
657};
658
659inline constexpr NodeType EmptyNodeType() { return static_cast<NodeType>(0); }
660
661inline constexpr NodeType CombineType(NodeType left, NodeType right) {
662 return static_cast<NodeType>(static_cast<int>(left) &
663 static_cast<int>(right));
664}
665inline constexpr NodeType IntersectType(NodeType left, NodeType right) {
666 return static_cast<NodeType>(static_cast<int>(left) |
667 static_cast<int>(right));
668}
669inline constexpr bool NodeTypeIs(NodeType type, NodeType to_check) {
670 int right = static_cast<int>(to_check);
671 return (static_cast<int>(type) & (~right)) == 0;
672}
673
674// Assert that the Unknown type is constructed correctly.
675#define ADD_STATIC_ASSERT(Name, Value) \
676 static_assert(NodeTypeIs(NodeType::k##Name, NodeType::kUnknown));
678#undef ADD_STATIC_ASSERT
679
682 if (map.IsHeapNumberMap()) return NodeType::kHeapNumber;
683 if (map.IsStringMap()) {
684 if (map.IsInternalizedStringMap()) return NodeType::kInternalizedString;
685 if (map.IsThinStringMap()) return NodeType::kThinString;
686 return NodeType::kNonInternalizedNonThinString;
687 }
688 if (map.IsStringWrapperMap()) return NodeType::kStringWrapper;
689 if (map.IsSymbolMap()) return NodeType::kSymbol;
690 if (map.IsBooleanMap(broker)) return NodeType::kBoolean;
691 if (map.IsOddballMap()) {
692 // Oddball but not a Boolean.
693 return NodeType::kNullOrUndefined;
694 }
695 if (map.IsJSArrayMap()) return NodeType::kJSArray;
696 if (map.is_callable()) {
697 return NodeType::kCallable;
698 }
699 if (map.IsJSReceiverMap()) {
700 // JSReceiver but not any of the above.
701 return NodeType::kOtherJSReceiver;
702 }
703 return NodeType::kOtherHeapObject;
704}
705
706inline constexpr bool IsEmptyNodeType(NodeType type) {
707 // No bits are set.
708 return static_cast<int>(type) == 0;
709}
710
712 compiler::ObjectRef ref) {
713 if (ref.IsSmi()) return NodeType::kSmi;
714 NodeType type = StaticTypeForMap(ref.AsHeapObject().map(broker), broker);
715 DCHECK(!IsEmptyNodeType(type));
716 return type;
717}
718
721 switch (type) {
722 case NodeType::kSmi:
723 return false;
724 case NodeType::kHeapNumber:
725 return map.IsHeapNumberMap();
726 case NodeType::kNullOrUndefined:
727 return map.IsOddballMap() && !map.IsBooleanMap(broker);
728 case NodeType::kBoolean:
729 return map.IsBooleanMap(broker);
730 case NodeType::kSymbol:
731 return map.IsSymbolMap();
732 case NodeType::kThinString:
733 return map.IsStringMap() && map.IsThinStringMap();
734 case NodeType::kInternalizedString:
735 return map.IsStringMap() && map.IsInternalizedStringMap();
736 case NodeType::kNonInternalizedNonThinString:
737 return map.IsStringMap() && !map.IsThinStringMap() &&
738 !map.IsInternalizedStringMap();
739 case NodeType::kStringWrapper:
740 return map.IsStringWrapperMap();
741 case NodeType::kJSArray:
742 return map.IsJSArrayMap();
743 case NodeType::kCallable:
744 return map.is_callable();
745 case NodeType::kOtherJSReceiver:
746 return map.IsJSReceiverMap() && !map.IsJSArrayMap() &&
747 !map.is_callable() && !map.IsStringWrapperMap();
748 case NodeType::kOtherHeapObject:
749 return !map.IsHeapNumberMap() && !map.IsOddballMap() &&
750 !map.IsSymbolMap() && !map.IsStringMap() && !map.IsJSReceiverMap();
751 default:
752 UNREACHABLE();
753 }
754}
755
758 switch (type) {
759#define CASE(Name, _) case NodeType::k##Name:
761#undef CASE
762 return IsInstanceOfLeafNodeType(map, type, broker);
763 default:
764 // This is some a composed type.
765#define CASE(Name, _) \
766 if (NodeTypeIs(NodeType::k##Name, type)) { \
767 if (IsInstanceOfLeafNodeType(map, NodeType::k##Name, broker)) { \
768 return true; \
769 } \
770 }
772#undef CASE
773 return false;
774 }
775}
776
777inline std::ostream& operator<<(std::ostream& out, const NodeType& type) {
778 switch (type) {
779#define CASE(Name, _) \
780 case NodeType::k##Name: \
781 out << #Name; \
782 break;
784#undef CASE
785 default:
786#define CASE(Name, _) \
787 if (NodeTypeIs(NodeType::k##Name, type)) { \
788 if constexpr (NodeType::k##Name != NodeType::kUnknown) { \
789 out << #Name "|"; \
790 } \
791 }
793#undef CASE
794 }
795 return out;
796}
797
798#define DEFINE_NODE_TYPE_CHECK(Type, _) \
799 inline bool NodeTypeIs##Type(NodeType type) { \
800 return NodeTypeIs(type, NodeType::k##Type); \
801 }
803#undef DEFINE_NODE_TYPE_CHECK
804
806 return (static_cast<int>(type) &
807 static_cast<int>(NodeType::kNullOrUndefined)) != 0;
808}
809
815
816constexpr Condition ConditionFor(Operation cond);
817constexpr Condition ConditionForNaN();
818
819bool FromConstantToBool(LocalIsolate* local_isolate, ValueNode* node);
821
822inline std::ostream& operator<<(std::ostream& os,
823 const ValueRepresentation& repr) {
824 switch (repr) {
826 return os << "Tagged";
828 return os << "Int32";
830 return os << "Uint32";
832 return os << "Float64";
834 return os << "HoleyFloat64";
836 return os << "Word64";
837 }
838}
839
840inline std::ostream& operator<<(
841 std::ostream& os, const TaggedToFloat64ConversionType& conversion_type) {
842 switch (conversion_type) {
844 return os << "Number";
846 return os << "NumberOrBoolean";
848 return os << "NumberOrOddball";
849 }
850}
851
853 for (compiler::MapRef map : maps) {
854 if (!map.IsJSTypedArrayMap()) return false;
855 }
856 return true;
857}
858
860 for (compiler::MapRef map : maps) {
861 if (!map.IsJSArrayMap()) return false;
862 }
863 return true;
864}
865
867 for (compiler::MapRef map : maps) {
868 if (!map.IsJSObjectMap()) return false;
869 }
870 return true;
871}
872
874 for (compiler::MapRef map : maps) {
875 if (!map.IsStringMap()) return false;
876 }
877 return true;
878}
879
881 for (compiler::MapRef map : maps) {
882 if (map.instance_type() != HEAP_NUMBER_TYPE) return false;
883 }
884 return true;
885}
886
888 for (compiler::MapRef map : maps) {
889 if (map.instance_type() == HEAP_NUMBER_TYPE) return true;
890 }
891 return false;
892}
893
894#define DEF_FORWARD_DECLARATION(type, ...) class type;
896#undef DEF_FORWARD_DECLARATION
897
898using NodeIdT = uint32_t;
899static constexpr NodeIdT kInvalidNodeId = 0;
900static constexpr NodeIdT kFirstValidNodeId = 1;
901
902// Represents either a direct BasicBlock pointer, or an entry in a list of
903// unresolved BasicBlockRefs which will be mutated (in place) at some point into
904// direct BasicBlock pointers.
906 struct BasicBlockRefBuilder;
907
908 public:
910#ifdef DEBUG
911 state_ = kRefList;
912#endif
913 }
914 explicit BasicBlockRef(BasicBlock* block) : block_ptr_(block) {
915#ifdef DEBUG
916 state_ = kBlockPointer;
917#endif
918 }
919
920 // Refs can't be copied or moved, since they are referenced by `this` pointer
921 // in the ref list.
922 BasicBlockRef(const BasicBlockRef&) = delete;
926
927 // Construct a new ref-list mode BasicBlockRef and add it to the given ref
928 // list.
929 explicit BasicBlockRef(BasicBlockRef* ref_list_head) : BasicBlockRef() {
930 BasicBlockRef* old_next_ptr = MoveToRefList(ref_list_head);
931 USE(old_next_ptr);
932 DCHECK_NULL(old_next_ptr);
933 }
934
935 // Change this ref to a direct basic block pointer, returning the old "next"
936 // pointer of the current ref.
938 DCHECK_EQ(state_, kRefList);
939
940 BasicBlockRef* old_next_ptr = next_ref_;
942#ifdef DEBUG
943 state_ = kBlockPointer;
944#endif
945 return old_next_ptr;
946 }
947
948 // Reset this ref list to null, returning the old ref list (i.e. the old
949 // "next" pointer).
951 DCHECK_EQ(state_, kRefList);
952
953 BasicBlockRef* old_next_ptr = next_ref_;
954 next_ref_ = nullptr;
955 return old_next_ptr;
956 }
957
958 // Move this ref to the given ref list, returning the old "next" pointer of
959 // the current ref.
961 DCHECK_EQ(state_, kRefList);
962 DCHECK_EQ(ref_list_head->state_, kRefList);
963
964 BasicBlockRef* old_next_ptr = next_ref_;
965 next_ref_ = ref_list_head->next_ref_;
966 ref_list_head->next_ref_ = this;
967 return old_next_ptr;
968 }
969
970 void Bind(BasicBlock* block) {
971 DCHECK_EQ(state_, kRefList);
972
974 while (next_ref != nullptr) {
976 }
977 DCHECK_EQ(block_ptr(), block);
978 }
979
981 DCHECK_EQ(state_, kBlockPointer);
982 return block_ptr_;
983 }
984
986 DCHECK_EQ(state_, kBlockPointer);
988 }
989
991 DCHECK_EQ(state_, kRefList);
992 return next_ref_;
993 }
994
995 bool has_ref() const {
996 DCHECK_EQ(state_, kRefList);
997 return next_ref_ != nullptr;
998 }
999
1000 private:
1001 union {
1004 };
1005#ifdef DEBUG
1006 enum { kBlockPointer, kRefList } state_;
1007#endif // DEBUG
1008};
1009
1011 public:
1012 constexpr bool is_call() const {
1013 // Only returns true for non-deferred calls. Use `is_any_call` to check
1014 // deferred calls as well.
1016 }
1017 constexpr bool is_any_call() const { return is_call() || is_deferred_call(); }
1018 constexpr bool can_eager_deopt() const {
1021 }
1022 constexpr bool can_lazy_deopt() const {
1025 }
1030 constexpr bool can_deopt() const {
1031 return can_eager_deopt() || can_lazy_deopt();
1032 }
1033 constexpr bool can_throw() const {
1035 }
1036 // TODO(olivf) We should negate all of these properties which would give them
1037 // a less error-prone default state.
1038 constexpr bool can_read() const { return kCanReadBit::decode(bitfield_); }
1039 constexpr bool can_write() const { return kCanWriteBit::decode(bitfield_); }
1040 constexpr bool can_allocate() const {
1042 }
1043 // Only for ValueNodes, indicates that the instruction might return something
1044 // new every time it is executed. For example it creates an object that is
1045 // unique with regards to strict equality comparison or it reads a value that
1046 // can change in absence of an explicit write instruction.
1047 constexpr bool not_idempotent() const {
1049 }
1053 constexpr bool is_tagged() const {
1055 }
1056 constexpr bool is_conversion() const {
1058 }
1059 constexpr bool needs_register_snapshot() const {
1061 }
1062 constexpr bool is_pure() const {
1063 return (bitfield_ & kPureMask) == kPureValue;
1064 }
1065 constexpr bool is_required_when_unused() const {
1066 if (is_conversion()) {
1067 // Calls in conversions are not counted as a side-effect as far as
1068 // is_required_when_unused is concerned, since they should always be to
1069 // the Allocate builtin.
1070 return can_write() || can_throw() || can_deopt();
1071 } else {
1072 return can_write() || can_throw() || can_deopt() || is_any_call();
1073 }
1074 }
1075 constexpr bool can_participate_in_cse() const {
1076 return !can_write() && !not_idempotent();
1077 }
1078
1079 constexpr OpProperties operator|(const OpProperties& that) {
1080 return OpProperties(bitfield_ | that.bitfield_);
1081 }
1082
1083 static constexpr OpProperties Pure() { return OpProperties(kPureValue); }
1084 static constexpr OpProperties Call() {
1085 return OpProperties(kIsCallBit::encode(true));
1086 }
1099 static constexpr OpProperties CanThrow() {
1101 }
1102 static constexpr OpProperties CanRead() {
1103 return OpProperties(kCanReadBit::encode(true));
1104 }
1105 static constexpr OpProperties CanWrite() {
1106 return OpProperties(kCanWriteBit::encode(true));
1107 }
1108 static constexpr OpProperties CanAllocate() {
1110 }
1111 static constexpr OpProperties NotIdempotent() {
1113 }
1150 static constexpr OpProperties ConversionNode() {
1152 }
1153 static constexpr OpProperties CanCallUserCode() {
1154 return AnySideEffects() | LazyDeopt() | CanThrow();
1155 }
1156 // Without auditing the call target, we must assume it can cause a lazy deopt
1157 // and throw. Use this when codegen calls runtime or a builtin, unless
1158 // certain that the target either doesn't throw or cannot deopt.
1159 // TODO(jgruber): Go through all nodes marked with this property and decide
1160 // whether to keep it (or remove either the lazy-deopt or throw flag).
1162 return Call() | CanCallUserCode() | NotIdempotent();
1163 }
1164 static constexpr OpProperties JSCall() { return Call() | CanCallUserCode(); }
1165 static constexpr OpProperties AnySideEffects() {
1166 return CanRead() | CanWrite() | CanAllocate();
1167 }
1168 static constexpr OpProperties DeferredCall() {
1169 // Operations with a deferred call need a snapshot of register state,
1170 // because they need to be able to push registers to save them, and annotate
1171 // the safepoint with information about which registers are tagged.
1172 return NeedsRegisterSnapshot();
1173 }
1174
1175 constexpr explicit OpProperties(uint32_t bitfield) : bitfield_(bitfield) {}
1176 operator uint32_t() const { return bitfield_; }
1177
1181
1186
1187 private:
1200
1201 static const uint32_t kPureMask =
1203 static const uint32_t kPureValue = kCanReadBit::encode(false) |
1204 kCanWriteBit::encode(false) |
1206
1207 // NeedsRegisterSnapshot is only used for DeferredCall, and we rely on this in
1208 // `is_deferred_call` to detect deferred calls. If you need to use
1209 // NeedsRegisterSnapshot for something else that DeferredCalls, then you'll
1210 // have to update `is_any_call`.
1214
1215 const uint32_t bitfield_;
1216
1217 public:
1219
1220 constexpr bool is_deferred_call() const {
1221 // Currently, there is no kDeferredCall bit, but DeferredCall only sets a
1222 // single bit: kNeedsRegisterSnapShot. If this static assert breaks, it
1223 // means that you added additional properties to DeferredCall, and you
1224 // should update this function accordingly.
1225 static_assert(DeferredCall().bitfield_ ==
1227 return needs_register_snapshot();
1228 }
1229};
1230
1231constexpr inline OpProperties StaticPropertiesForOpcode(Opcode opcode);
1232
1234 public:
1235 ValueLocation() = default;
1236
1237 template <typename... Args>
1238 void SetUnallocated(Args&&... args) {
1239 DCHECK(operand_.IsInvalid());
1241 }
1242
1243 template <typename... Args>
1244 void SetAllocated(Args&&... args) {
1245 DCHECK(operand_.IsUnallocated());
1247 }
1248
1249 // Only to be used on inputs that inherit allocation.
1251 operand_ = location;
1252 }
1253
1254 // We use USED_AT_START to indicate that the input will be clobbered.
1255 bool Cloberred() {
1256 DCHECK(operand_.IsUnallocated());
1257 return compiler::UnallocatedOperand::cast(operand_).IsUsedAtStart();
1258 }
1259
1260 template <typename... Args>
1261 void SetConstant(Args&&... args) {
1262 DCHECK(operand_.IsUnallocated());
1264 }
1265
1270
1275
1276 bool IsAnyRegister() const { return operand_.IsAnyRegister(); }
1277 bool IsGeneralRegister() const { return operand_.IsRegister(); }
1278 bool IsDoubleRegister() const { return operand_.IsDoubleRegister(); }
1279
1282
1283 private:
1285};
1286
1288 public:
1290 // Used in ValueNode::mark_use
1292
1293 private:
1295};
1296
1297class Input : public InputLocation {
1298 public:
1299 explicit Input(ValueNode* node) : node_(node) {}
1300 ValueNode* node() const { return node_; }
1301 void set_node(ValueNode* node) { node_ = node; }
1302 void clear();
1303
1304 private:
1306};
1307
1308class VirtualObjectList;
1314 public:
1321
1329
1336
1343
1350
1354
1356 : data_(std::move(data)), parent_(parent) {}
1357
1359 : data_(data), parent_(parent) {}
1360
1361 FrameType type() const { return data_.tag(); }
1363 const DeoptFrame* parent() const { return parent_; }
1364
1365 inline const InterpretedDeoptFrame& as_interpreted() const;
1373 inline bool IsJsFrame() const;
1374
1375 inline const MaglevCompilationUnit& GetCompilationUnit() const;
1376 inline BytecodeOffset GetBytecodeOffset() const;
1377 inline SourcePosition GetSourcePosition() const;
1380 inline VirtualObjectList GetVirtualObjects() const;
1381
1382 protected:
1391
1394};
1395
1424
1425// Make sure storing/passing deopt frames by value doesn't truncate them.
1426static_assert(sizeof(InterpretedDeoptFrame) == sizeof(DeoptFrame));
1427
1430 return static_cast<const InterpretedDeoptFrame&>(*this);
1431}
1436
1462
1463// Make sure storing/passing deopt frames by value doesn't truncate them.
1464static_assert(sizeof(InlinedArgumentsDeoptFrame) == sizeof(DeoptFrame));
1465
1467 const {
1469 return static_cast<const InlinedArgumentsDeoptFrame&>(*this);
1470}
1475
1501
1502// Make sure storing/passing deopt frames by value doesn't truncate them.
1503static_assert(sizeof(ConstructInvokeStubDeoptFrame) == sizeof(DeoptFrame));
1504
1510
1515
1517 public:
1520 ValueNode* context,
1521 compiler::OptionalJSFunctionRef maybe_js_target,
1524 maybe_js_target},
1525 parent) {}
1526
1527 const Builtin& builtin_id() const { return data().builtin_id; }
1529 ValueNode*& context() { return data().context; }
1530 ValueNode* context() const { return data().context; }
1531 bool is_javascript() const { return data().maybe_js_target.has_value(); }
1533 return data().maybe_js_target.value();
1534 }
1535
1536 private:
1543};
1544
1545// Make sure storing/passing deopt frames by value doesn't truncate them.
1546static_assert(sizeof(BuiltinContinuationDeoptFrame) == sizeof(DeoptFrame));
1547
1548inline const BuiltinContinuationDeoptFrame&
1557
1558inline bool DeoptFrame::IsJsFrame() const {
1559 // This must be in sync with TRANSLATION_JS_FRAME_OPCODE_LIST in
1560 // translation-opcode.h or bad things happen.
1561 switch (data_.tag()) {
1563 return true;
1565 return as_builtin_continuation().is_javascript();
1568 return false;
1569 }
1570}
1571
1584
1599
1614
1616 const {
1617 return GetCompilationUnit().shared_function_info();
1618}
1619
1621 return GetCompilationUnit().bytecode();
1622}
1623
1625 protected:
1626 DeoptInfo(Zone* zone, const DeoptFrame top_frame,
1628
1629 public:
1631 const DeoptFrame& top_frame() const { return top_frame_; }
1635
1636 bool has_input_locations() const { return input_locations_ != nullptr; }
1641 void InitializeInputLocations(Zone* zone, size_t count);
1642
1644
1647
1648#ifdef DEBUG
1649 size_t input_location_count() { return input_location_count_; }
1650#endif // DEBUG
1651
1652 private:
1656#ifdef DEBUG
1657 size_t input_location_count_ = 0;
1658#endif // DEBUG
1661};
1662
1668
1670 public:
1674
1675 DeoptimizeReason reason() const { return reason_; }
1677
1678 template <typename Function>
1679 void ForEachInput(Function&& f);
1680 template <typename Function>
1681 void ForEachInput(Function&& f) const;
1682
1683 private:
1684 DeoptimizeReason reason_ = DeoptimizeReason::kUnknown;
1685};
1686
1687class LazyDeoptInfo : public DeoptInfo {
1688 public:
1697
1699 DCHECK(IsConsideredForResultLocation());
1700 return result_location_;
1701 }
1702 int result_size() const {
1703 DCHECK(IsConsideredForResultLocation());
1705 }
1706
1708 bool HasResultLocation() const {
1709 DCHECK(IsConsideredForResultLocation());
1710 return result_location_.is_valid();
1711 }
1712
1714 const ExceptionHandlerInfo* handler_info);
1715
1726
1729 int result_size);
1730
1731 template <typename Function>
1732 void ForEachInput(Function&& f);
1733 template <typename Function>
1734 void ForEachInput(Function&& f) const;
1735
1736 private:
1737#ifdef DEBUG
1738 bool IsConsideredForResultLocation() const {
1739 switch (top_frame().type()) {
1741 // Interpreted frames obviously need a result location.
1742 return true;
1745 return false;
1747 // Normally if the function is going to be deoptimized then the top
1748 // frame should be an interpreted one, except for LazyDeoptContinuation
1749 // builtin.
1750 switch (top_frame().as_builtin_continuation().builtin_id()) {
1751 case Builtin::kGenericLazyDeoptContinuation:
1752 case Builtin::kGetIteratorWithFeedbackLazyDeoptContinuation:
1753 case Builtin::kCallIteratorWithFeedbackLazyDeoptContinuation:
1754 return true;
1755 default:
1756 return false;
1757 }
1758 }
1759 }
1760#endif // DEBUG
1761
1764
1765 // The max code size is enforced by the various assemblers, but it's not
1766 // visible here, so static assert against the magic constant that we happen
1767 // to know is correct.
1768 static constexpr int kMaxCodeSize = 512 * MB;
1769 static constexpr unsigned int kUninitializedCallReturnPc =
1772 static_assert(kMaxCodeSize != kUninitializedCallReturnPc);
1773
1774 // Lazy deopts can have at most two result registers -- temporarily three for
1775 // ForInPrepare.
1776 static_assert(ResultSizeField::kMax >= 3);
1777
1779 uint32_t bitfield_;
1780};
1781
1783 public:
1789
1791 : catch_block_(), depth_(static_cast<int>(mode)), pc_offset_(-1) {}
1792
1794 : catch_block_(catch_block_ref), depth_(depth), pc_offset_(-1) {
1797 }
1798
1800 : catch_block_(catch_block_ref), depth_(depth), pc_offset_(-1) {}
1801
1803
1804 bool ShouldLazyDeopt() const { return depth_ == kLazyDeopt; }
1805
1807
1809
1811
1812 int depth() const {
1815 return depth_;
1816 }
1817
1818 int pc_offset() const { return pc_offset_; }
1820 DCHECK_EQ(pc_offset_, -1);
1821 DCHECK_NE(offset, -1);
1823 }
1824
1825 private:
1830
1833
1834 friend List;
1836};
1837
1838// Dummy type for the initial raw allocation.
1840
1841namespace detail {
1842// Helper for getting the static opcode of a Node subclass. This is in a
1843// "detail" namespace rather than in NodeBase because we can't template
1844// specialize outside of namespace scopes before C++17.
1845template <class T>
1847
1848#define DEF_OPCODE_OF(Name) \
1849 template <> \
1850 struct opcode_of_helper<Name> { \
1851 static constexpr Opcode value = Opcode::k##Name; \
1852 };
1854#undef DEF_OPCODE_OF
1855
1856template <typename T>
1857constexpr T* ObjectPtrBeforeAddress(void* address) {
1858 char* address_as_char_ptr = reinterpret_cast<char*>(address);
1859 char* object_ptr_as_char_ptr = address_as_char_ptr - sizeof(T);
1860 return reinterpret_cast<T*>(object_ptr_as_char_ptr);
1861}
1862
1863template <typename T>
1864constexpr const T* ObjectPtrBeforeAddress(const void* address) {
1865 const char* address_as_char_ptr = reinterpret_cast<const char*>(address);
1866 const char* object_ptr_as_char_ptr = address_as_char_ptr - sizeof(T);
1867 return reinterpret_cast<const T*>(object_ptr_as_char_ptr);
1868}
1869
1870} // namespace detail
1871
1872#define DEOPTIMIZE_REASON_FIELD \
1873 private: \
1874 using ReasonField = \
1875 NextBitField<DeoptimizeReason, base::bits::WhichPowerOfTwo<size_t>( \
1876 base::bits::RoundUpToPowerOfTwo32( \
1877 kDeoptimizeReasonCount))>; \
1878 \
1879 public: \
1880 DeoptimizeReason deoptimize_reason() const { \
1881 return ReasonField::decode(bitfield()); \
1882 }
1883
1884struct KnownNodeAspects;
1885class NodeBase : public ZoneObject {
1886 private:
1887 // Bitfield specification.
1889 static_assert(OpcodeField::is_valid(kLastOpcode));
1896 static_assert(InputCountField::kShift == 32);
1897
1898 protected:
1899 // Reserved for intermediate superclasses such as ValueNode.
1901 // Subclasses may use the remaining bitfield bits.
1902 template <class T, int size>
1904
1905 static constexpr int kMaxInputs = InputCountField::kMax;
1906
1907 public:
1908 template <class T>
1910
1911 template <class Derived, typename... Args>
1912 static Derived* New(Zone* zone, std::initializer_list<ValueNode*> inputs,
1913 Args&&... args) {
1914 static_assert(Derived::kProperties.is_conversion());
1915 Derived* node =
1916 Allocate<Derived>(zone, inputs.size(), std::forward<Args>(args)...);
1917
1918 int i = 0;
1919 for (ValueNode* input : inputs) {
1920 DCHECK_NOT_NULL(input);
1921 node->set_input(i++, input);
1922 }
1923
1924 return node;
1925 }
1926
1927 // Inputs must be initialized manually.
1928 template <class Derived, typename... Args>
1929 static Derived* New(Zone* zone, size_t input_count, Args&&... args) {
1930 Derived* node =
1931 Allocate<Derived>(zone, input_count, std::forward<Args>(args)...);
1932 return node;
1933 }
1934
1935 // Overwritten by subclasses.
1936 static constexpr OpProperties kProperties =
1938
1939 constexpr Opcode opcode() const { return OpcodeField::decode(bitfield_); }
1940 constexpr OpProperties properties() const {
1942 }
1943 void set_properties(OpProperties properties) {
1945 }
1946
1947 inline void set_input(int index, ValueNode* node);
1948
1949 template <class T>
1950 constexpr bool Is() const;
1951
1952 template <class T>
1953 constexpr T* Cast() {
1954 DCHECK(Is<T>());
1955 return static_cast<T*>(this);
1956 }
1957 template <class T>
1958 constexpr const T* Cast() const {
1959 DCHECK(Is<T>());
1960 return static_cast<const T*>(this);
1961 }
1962 template <class T>
1963 constexpr T* TryCast() {
1964 return Is<T>() ? static_cast<T*>(this) : nullptr;
1965 }
1966
1967 template <class T>
1968 constexpr const T* TryCast() const {
1969 return Is<T>() ? static_cast<const T*>(this) : nullptr;
1970 }
1971
1972 constexpr bool has_inputs() const { return input_count() > 0; }
1973 constexpr int input_count() const {
1974 static_assert(InputCountField::kMax <= kMaxInt);
1975 return static_cast<int>(InputCountField::decode(bitfield_));
1976 }
1977
1978 constexpr Input& input(int index) {
1979 DCHECK_LT(index, input_count());
1980 return *(input_base() - index);
1981 }
1982 constexpr const Input& input(int index) const {
1983 DCHECK_LT(index, input_count());
1984 return *(input_base() - index);
1985 }
1986
1987 std::optional<int32_t> TryGetInt32ConstantInput(int index);
1988
1989 // Input iterators, use like:
1990 //
1991 // for (Input& input : *node) { ... }
1992 constexpr auto begin() { return std::make_reverse_iterator(&input(-1)); }
1993 constexpr auto end() {
1994 return std::make_reverse_iterator(&input(input_count() - 1));
1995 }
1996
1997 constexpr bool has_id() const { return id_ != kInvalidNodeId; }
1998 constexpr NodeIdT id() const {
2000 return id_;
2001 }
2002 void set_id(NodeIdT id) {
2005 id_ = id;
2006 }
2007
2008 template <typename RegisterT>
2009 uint8_t num_temporaries_needed() const {
2010 if constexpr (std::is_same_v<RegisterT, Register>) {
2012 } else {
2014 }
2015 }
2016
2017 template <typename RegisterT>
2023
2024 template <typename RegisterT>
2028
2030
2031 // Some parts of Maglev require a specific iteration order of the inputs (such
2032 // as UseMarkingProcessor::MarkInputUses or
2033 // StraightForwardRegisterAllocator::AssignInputs). For such cases,
2034 // `ForAllInputsInRegallocAssignmentOrder` can be called with a callback `f`
2035 // that will be called for each input in the "correct" order.
2036 template <typename Function>
2038
2039 void Print(std::ostream& os, MaglevGraphLabeller*,
2040 bool skip_targets = false) const;
2041
2042 // For GDB: Print any Node with `print node->Print()`.
2043 void Print() const;
2044
2046 DCHECK(properties().can_eager_deopt() ||
2047 properties().is_deopt_checkpoint());
2048 DCHECK(!properties().can_lazy_deopt());
2049 return reinterpret_cast<EagerDeoptInfo*>(deopt_info_address());
2050 }
2051
2053 DCHECK(properties().can_lazy_deopt());
2054 DCHECK(!properties().can_eager_deopt());
2055 return reinterpret_cast<LazyDeoptInfo*>(deopt_info_address());
2056 }
2057
2059 DCHECK(properties().needs_register_snapshot());
2060 return *reinterpret_cast<RegisterSnapshot*>(register_snapshot_address());
2061 }
2062
2064 DCHECK(properties().can_throw());
2065 return reinterpret_cast<ExceptionHandlerInfo*>(exception_handler_address());
2066 }
2067
2069 DCHECK(properties().needs_register_snapshot());
2070 *reinterpret_cast<RegisterSnapshot*>(register_snapshot_address()) =
2071 snapshot;
2072 }
2073
2074 inline void change_input(int index, ValueNode* node);
2075
2077 DCHECK_EQ(opcode(), Opcode::kPhi);
2079 bitfield_, properties().WithNewValueRepresentation(new_repr));
2080 }
2081
2082 void set_opcode(Opcode new_opcode) {
2084 }
2085
2086 void CopyEagerDeoptInfoOf(NodeBase* other, Zone* zone) {
2087 new (eager_deopt_info())
2088 EagerDeoptInfo(zone, other->eager_deopt_info()->top_frame(),
2089 other->eager_deopt_info()->feedback_to_update());
2090 }
2091
2092 void SetEagerDeoptInfo(Zone* zone, DeoptFrame deopt_frame,
2093 compiler::FeedbackSource feedback_to_update =
2095 DCHECK(properties().can_eager_deopt() ||
2096 properties().is_deopt_checkpoint());
2097 new (eager_deopt_info())
2098 EagerDeoptInfo(zone, deopt_frame, feedback_to_update);
2099 }
2100
2101 template <typename NodeT>
2103 OverwriteWith(NodeBase::opcode_of<NodeT>, NodeT::kProperties);
2104 }
2105
2107 Opcode new_opcode,
2108 std::optional<OpProperties> maybe_new_properties = std::nullopt) {
2109 OpProperties new_properties = maybe_new_properties.has_value()
2110 ? maybe_new_properties.value()
2111 : StaticPropertiesForOpcode(new_opcode);
2112#ifdef DEBUG
2113 CheckCanOverwriteWith(new_opcode, new_properties);
2114#endif
2115 set_opcode(new_opcode);
2116 set_properties(new_properties);
2117 }
2118
2120 // OverwriteWith() checks if the node we're overwriting to has the same
2121 // input count and the same properties. Here we don't need to do that, since
2122 // overwriting with a node with property pure, we only need to check if
2123 // there is at least 1 input. Since the first input is always the one
2124 // closest to the input_base().
2125 DCHECK_GE(input_count(), 1);
2129 change_input(0, node);
2130 }
2131
2132 auto options() const { return std::tuple{}; }
2133
2136
2138
2140
2142
2143 protected:
2144 explicit NodeBase(uint64_t bitfield) : bitfield_(bitfield) {}
2145
2146 // Allow updating bits above NextBitField from subclasses
2147 constexpr uint64_t bitfield() const { return bitfield_; }
2148 void set_bitfield(uint64_t new_bitfield) {
2149#ifdef DEBUG
2150 // Make sure that all the base bitfield bits (all bits before the next
2151 // bitfield start, excluding any spare bits) are equal in the new value.
2152 const uint64_t base_bitfield_mask =
2153 ((uint64_t{1} << NextBitField<bool, 1>::kShift) - 1) &
2155 DCHECK_EQ(bitfield_ & base_bitfield_mask,
2156 new_bitfield & base_bitfield_mask);
2157#endif
2158 bitfield_ = new_bitfield;
2159 }
2160
2161 constexpr Input* input_base() {
2163 }
2164 constexpr const Input* input_base() const {
2166 }
2167 Input* last_input() { return &input(input_count() - 1); }
2168 const Input* last_input() const { return &input(input_count() - 1); }
2169
2171 return reinterpret_cast<Address>(last_input());
2172 }
2173
2174 inline void initialize_input_null(int index);
2175
2176 // For nodes that don't have data past the input, allow trimming the input
2177 // count. This is used by Phis to reduce inputs when merging in dead control
2178 // flow.
2179 void reduce_input_count(int num = 1) {
2180 DCHECK_EQ(opcode(), Opcode::kPhi);
2181 DCHECK_GE(input_count(), num);
2182 DCHECK(!properties().can_lazy_deopt());
2183 DCHECK(!properties().can_eager_deopt());
2185 }
2186
2187 // Specify that there need to be a certain number of registers free (i.e.
2188 // usable as scratch registers) on entry into this node.
2189 //
2190 // Does not include any registers requested by RequireSpecificTemporary.
2195
2200
2201 // Require that a specific register is free (and therefore clobberable) by the
2202 // entry into this node.
2206
2210
2211 private:
2212 template <class Derived, typename... Args>
2213 static Derived* Allocate(Zone* zone, size_t input_count, Args&&... args) {
2214 static_assert(
2215 !Derived::kProperties.can_eager_deopt() ||
2216 !Derived::kProperties.can_lazy_deopt(),
2217 "The current deopt info representation, at the end of inputs, requires "
2218 "that we cannot have both lazy and eager deopts on a node. If we ever "
2219 "need this, we have to update accessors to check node->properties() "
2220 "for which deopts are active.");
2221 constexpr size_t size_before_inputs =
2222 ExceptionHandlerInfoSize(Derived::kProperties) +
2223 RegisterSnapshotSize(Derived::kProperties) +
2224 EagerDeoptInfoSize(Derived::kProperties) +
2225 LazyDeoptInfoSize(Derived::kProperties);
2226
2227 static_assert(IsAligned(size_before_inputs, alignof(Input)));
2228 const size_t size_before_node =
2229 size_before_inputs + input_count * sizeof(Input);
2230
2231 DCHECK(IsAligned(size_before_inputs, alignof(Derived)));
2232 const size_t size = size_before_node + sizeof(Derived);
2233 intptr_t raw_buffer =
2234 reinterpret_cast<intptr_t>(zone->Allocate<NodeWithInlineInputs>(size));
2235#ifdef DEBUG
2236 memset(reinterpret_cast<void*>(raw_buffer), 0, size);
2237#endif
2238
2239 void* node_buffer = reinterpret_cast<void*>(raw_buffer + size_before_node);
2241 OpPropertiesField::encode(Derived::kProperties) |
2243 Derived* node =
2244 new (node_buffer) Derived(bitfield, std::forward<Args>(args)...);
2245 return node;
2246 }
2247
2248 static constexpr size_t ExceptionHandlerInfoSize(OpProperties properties) {
2250 properties.can_throw() ? sizeof(ExceptionHandlerInfo) : 0);
2251 }
2252
2253 static constexpr size_t RegisterSnapshotSize(OpProperties properties) {
2255 properties.needs_register_snapshot() ? sizeof(RegisterSnapshot) : 0);
2256 }
2257
2258 static constexpr size_t EagerDeoptInfoSize(OpProperties properties) {
2260 (properties.can_eager_deopt() || properties.is_deopt_checkpoint())
2261 ? sizeof(EagerDeoptInfo)
2262 : 0);
2263 }
2264
2265 static constexpr size_t LazyDeoptInfoSize(OpProperties properties) {
2267 properties.can_lazy_deopt() ? sizeof(LazyDeoptInfo) : 0);
2268 }
2269
2270 // Returns the position of deopt info if it exists, otherwise returns
2271 // its position as if DeoptInfo size were zero.
2273 DCHECK(!properties().can_eager_deopt() || !properties().can_lazy_deopt());
2274 size_t extra =
2276 return last_input_address() - extra;
2277 }
2278
2279 // Returns the position of register snapshot if it exists, otherwise returns
2280 // its position as if RegisterSnapshot size were zero.
2282 size_t extra = RegisterSnapshotSize(properties());
2283 return deopt_info_address() - extra;
2284 }
2285
2286 // Returns the position of exception handler info if it exists, otherwise
2287 // returns its position as if ExceptionHandlerInfo size were zero.
2289 size_t extra = ExceptionHandlerInfoSize(properties());
2290 return register_snapshot_address() - extra;
2291 }
2292
2293 void CheckCanOverwriteWith(Opcode new_opcode, OpProperties new_properties);
2294
2295 uint64_t bitfield_;
2297
2300 DCHECK_EQ(state_, State::kOwner);
2301 return store_.owner_;
2302 }
2303
2304 template <typename RegisterT>
2306 DCHECK_EQ(state_, State::kReglist);
2307 if constexpr (std::is_same_v<RegisterT, Register>) {
2308 return store_.regs_.temporaries_;
2309 } else {
2311 }
2312 }
2313
2315#ifdef DEBUG
2316 DCHECK(state_ == State::kNull || state_ == State::kOwner);
2317 state_ = State::kOwner;
2318#endif
2319 return store_.owner_ = owner;
2320 }
2321
2323#ifdef DEBUG
2324 DCHECK(state_ == State::kNull || state_ == State::kOwner);
2325 state_ = State::kReglist;
2326#endif
2329 }
2330
2331 private:
2336 union Store {
2337 Store() : owner_(nullptr) {}
2340 };
2342#ifdef DEBUG
2343 enum class State{
2344 kNull,
2345 kOwner,
2346 kReglist,
2347 };
2348 State state_ = State::kNull;
2349#endif
2350 };
2351
2353
2354 NodeBase() = delete;
2355 NodeBase(const NodeBase&) = delete;
2356 NodeBase(NodeBase&&) = delete;
2357 NodeBase& operator=(const NodeBase&) = delete;
2359};
2360
2361template <class T>
2362constexpr bool NodeBase::Is() const {
2363 return opcode() == opcode_of<T>;
2364}
2365
2366// Specialized sub-hierarchy type checks.
2367template <>
2368constexpr bool NodeBase::Is<ValueNode>() const {
2369 return IsValueNode(opcode());
2370}
2371template <>
2372constexpr bool NodeBase::Is<ControlNode>() const {
2373 return IsControlNode(opcode());
2374}
2375template <>
2376constexpr bool NodeBase::Is<BranchControlNode>() const {
2377 return IsBranchControlNode(opcode());
2378}
2379template <>
2382}
2383template <>
2386}
2387template <>
2389 return IsTerminalControlNode(opcode());
2390}
2391
2392void CheckValueInputIs(const NodeBase* node, int i,
2393 ValueRepresentation expected,
2394 MaglevGraphLabeller* graph_labeller);
2395
2396// The Node class hierarchy contains all non-control nodes.
2397class Node : public NodeBase {
2398 public:
2399 inline ValueLocation& result();
2400
2401 static constexpr bool participate_in_cse(Opcode op) {
2403 !IsConstantNode(op) && !IsControlNode(op) && !IsZeroCostNode(op) &&
2404 // The following are already precisely tracked by known_node_aspects
2405 // and tracking them with CSE would just waste time.
2406 op != Opcode::kCheckMaps;
2407 }
2408
2409 static constexpr bool needs_epoch_check(Opcode op) {
2411 }
2412
2413 protected:
2414 using NodeBase::NodeBase;
2415};
2416
2417// All non-control nodes with a result.
2418class ValueNode : public Node {
2419 private:
2421
2422 protected:
2423 using ReservedField = void;
2424
2425 public:
2427 const ValueLocation& result() const { return result_; }
2428
2429 int use_count() const {
2430 // Invalid to check use_count externally once an id is allocated.
2431 DCHECK(!has_id());
2432 return use_count_;
2433 }
2434 bool is_used() const { return use_count_ > 0; }
2435 bool unused_inputs_were_visited() const { return use_count_ == -1; }
2436 void add_use() {
2437 // Make sure a saturated use count won't overflow.
2439 use_count_++;
2440 }
2441 void remove_use() {
2442 // Make sure a saturated use count won't drop below zero.
2444 use_count_--;
2445 }
2446 // Avoid revisiting nodes when processing an unused node's inputs, by marking
2447 // it as visited.
2450 use_count_ = -1;
2451 }
2452
2454
2456
2457 bool has_hint() { return !hint_.IsInvalid(); }
2458
2459 template <typename RegisterT>
2460 RegisterT GetRegisterHint() {
2461 if (hint_.IsInvalid()) return RegisterT::no_reg();
2462 return RegisterT::from_code(
2463 compiler::UnallocatedOperand::cast(hint_).fixed_register_index());
2464 }
2465
2467 DCHECK(hint_.IsInvalid() || hint_.IsUnallocated());
2468 return hint_;
2469 }
2470
2471 bool is_loadable() const {
2472 DCHECK_EQ(state_, kSpill);
2473 return spill_.IsConstant() || spill_.IsAnyStackSlot();
2474 }
2475
2476 bool is_spilled() const {
2477 DCHECK_EQ(state_, kSpill);
2478 return spill_.IsAnyStackSlot();
2479 }
2480
2481 void SetNoSpill();
2482 void SetConstantLocation();
2483
2484 /* For constants only. */
2489 DirectHandle<Object> Reify(LocalIsolate* isolate) const;
2490
2492#ifdef DEBUG
2493 if (state_ == kLastUse) {
2494 state_ = kSpill;
2495 } else {
2496 DCHECK(!is_loadable());
2497 }
2498#endif // DEBUG
2500 DCHECK(operand.IsAnyStackSlot());
2501 spill_ = operand;
2503 }
2504
2509
2511 DCHECK_EQ(state_, kSpill);
2513 return spill_;
2514 }
2515
2526
2531
2532 bool has_valid_live_range() const { return end_id_ != 0; }
2533 LiveRange live_range() const { return {start_id(), end_id_}; }
2535
2536 // The following methods should only be used during register allocation, to
2537 // mark the _current_ state of this Node according to the register allocator.
2539
2540 bool has_no_more_uses() const { return next_use_ == kInvalidNodeId; }
2541
2542 constexpr bool use_double_register() const {
2544 }
2545
2546 constexpr bool is_tagged() const {
2547 return (properties().value_representation() ==
2549 }
2550
2551#ifdef V8_COMPRESS_POINTERS
2552 constexpr bool decompresses_tagged_result() const {
2554 }
2555
2556 void SetTaggedResultNeedsDecompress() {
2557 static_assert(PointerCompressionIsEnabled());
2558
2562 if (Is<Phi>()) {
2563 for (Input& input : *this) {
2564 // Avoid endless recursion by terminating on values already marked.
2565 if (input.node()->decompresses_tagged_result()) continue;
2566 input.node()->SetTaggedResultNeedsDecompress();
2567 }
2568 } else if (Is<Identity>()) {
2569 DCHECK_EQ(input_count(), 0);
2570 input(0).node()->SetTaggedResultNeedsDecompress();
2571 }
2572 }
2573#else
2574 constexpr bool decompresses_tagged_result() const { return false; }
2575#endif
2576
2580
2596
2604
2613
2622
2623 template <typename T>
2625
2626 int num_registers() const {
2627 if (use_double_register()) {
2629 }
2631 }
2632 bool has_register() const {
2633 if (use_double_register()) {
2635 }
2637 }
2646
2647 template <typename T>
2649 if constexpr (std::is_same<T, DoubleRegister>::value) {
2652 } else {
2655 }
2656 }
2657
2667
2668 protected:
2669 explicit ValueNode(uint64_t bitfield)
2670 : Node(bitfield),
2672 hint_(compiler::InstructionOperand()),
2673 use_count_(0)
2674#ifdef DEBUG
2675 ,
2676 state_(kLastUse)
2677#endif // DEBUG
2678 {
2680 }
2681
2682 int FirstRegisterCode() const {
2683 if (use_double_register()) {
2685 }
2687 }
2688
2689 // Rename for better pairing with `end_id`.
2690 NodeIdT start_id() const { return id(); }
2691
2695 union {
2698 };
2699 union {
2700 // Pointer to the current last use's next_use_id field. Most of the time
2701 // this will be a pointer to an Input's next_use_id_ field, but it's
2702 // initialized to this node's next_use_ to track the first use.
2705 };
2707 // TODO(leszeks): Union this into another field.
2709#ifdef DEBUG
2710 enum {kLastUse, kSpill} state_;
2711#endif // DEBUG
2712};
2713
2714inline void NodeBase::initialize_input_null(int index) {
2715 // Should already be null in debug, make sure it's null on release too.
2716 DCHECK_EQ(input(index).node(), nullptr);
2717 new (&input(index)) Input(nullptr);
2718}
2719
2720inline void NodeBase::set_input(int index, ValueNode* node) {
2721 DCHECK_NOT_NULL(node);
2722 DCHECK_EQ(input(index).node(), nullptr);
2723 node->add_use();
2724 new (&input(index)) Input(node);
2725}
2726
2727inline void NodeBase::change_input(int index, ValueNode* node) {
2728 DCHECK_NE(input(index).node(), nullptr);
2729 input(index).node()->remove_use();
2730
2731#ifdef DEBUG
2732 input(index) = Input(nullptr);
2733#endif
2734 set_input(index, node);
2735}
2736
2737template <>
2742
2743template <>
2748
2751 return Cast<ValueNode>()->result();
2752}
2753
2754// Mixin for a node with known class (and therefore known opcode and static
2755// properties), but possibly unknown numbers of inputs.
2756template <typename Base, typename Derived>
2757class NodeTMixin : public Base {
2758 public:
2759 // Shadowing for static knowledge.
2760 constexpr Opcode opcode() const { return NodeBase::opcode_of<Derived>; }
2761 constexpr const OpProperties& properties() const {
2762 return Derived::kProperties;
2763 }
2764
2765 template <typename... Args>
2766 static Derived* New(Zone* zone, std::initializer_list<ValueNode*> inputs,
2767 Args&&... args) {
2768 return NodeBase::New<Derived>(zone, inputs, std::forward<Args>...);
2769 }
2770 template <typename... Args>
2771 static Derived* New(Zone* zone, size_t input_count, Args&&... args) {
2772 return NodeBase::New<Derived>(zone, input_count, std::forward<Args>...);
2773 }
2774
2775 protected:
2776 template <typename... Args>
2777 explicit NodeTMixin(uint64_t bitfield, Args&&... args)
2778 : Base(bitfield, std::forward<Args>(args)...) {
2780 DCHECK_EQ(this->NodeBase::properties(), Derived::kProperties);
2781 }
2782};
2783
2784namespace detail {
2785// Helper class for defining input types as a std::array, but without
2786// accidental initialisation with the wrong sized initializer_list.
2787template <size_t Size>
2788class ArrayWrapper : public std::array<ValueRepresentation, Size> {
2789 public:
2790 template <typename... Args>
2791 explicit constexpr ArrayWrapper(Args&&... args)
2792 : std::array<ValueRepresentation, Size>({args...}) {
2793 static_assert(sizeof...(args) == Size);
2794 }
2795};
2797} // namespace detail
2798
2799// Mixin for a node with known class (and therefore known opcode and static
2800// properties), and known numbers of inputs.
2801template <size_t InputCount, typename Base, typename Derived>
2802class FixedInputNodeTMixin : public NodeTMixin<Base, Derived> {
2803 public:
2804 static constexpr size_t kInputCount = InputCount;
2805
2806 // Shadowing for static knowledge.
2807 constexpr bool has_inputs() const { return input_count() > 0; }
2808 constexpr uint16_t input_count() const { return kInputCount; }
2809 constexpr auto end() {
2810 return std::make_reverse_iterator(&this->input(input_count() - 1));
2811 }
2812
2813 void VerifyInputs(MaglevGraphLabeller* graph_labeller) const {
2814 if constexpr (kInputCount != 0) {
2815 static_assert(
2816 std::is_same_v<const InputTypes, decltype(Derived::kInputTypes)>);
2817 static_assert(kInputCount == Derived::kInputTypes.size());
2818 for (int i = 0; i < static_cast<int>(kInputCount); ++i) {
2819 CheckValueInputIs(this, i, Derived::kInputTypes[i], graph_labeller);
2820 }
2821 }
2822 }
2823
2824#ifdef V8_COMPRESS_POINTERS
2825 void MarkTaggedInputsAsDecompressing() const {
2826 if constexpr (kInputCount != 0) {
2827 static_assert(
2828 std::is_same_v<const InputTypes, decltype(Derived::kInputTypes)>);
2829 static_assert(kInputCount == Derived::kInputTypes.size());
2830 for (int i = 0; i < static_cast<int>(kInputCount); ++i) {
2831 if (Derived::kInputTypes[i] == ValueRepresentation::kTagged) {
2832 ValueNode* input_node = this->input(i).node();
2833 input_node->SetTaggedResultNeedsDecompress();
2834 }
2835 }
2836 }
2837 }
2838#endif
2839
2840 protected:
2843
2844 template <typename... Args>
2845 explicit FixedInputNodeTMixin(uint64_t bitfield, Args&&... args)
2846 : NodeTMixin<Base, Derived>(bitfield, std::forward<Args>(args)...) {
2847 DCHECK_EQ(this->NodeBase::input_count(), kInputCount);
2848 }
2849};
2850
2851template <class T, class = void>
2852struct IsFixedInputNode : public std::false_type {};
2853template <class T>
2854struct IsFixedInputNode<T, std::void_t<decltype(T::kInputCount)>>
2855 : public std::true_type {};
2856
2857template <class Derived>
2859
2860template <class Derived>
2862
2863template <size_t InputCount, class Derived>
2866
2867template <size_t InputCount, class Derived>
2870
2871class Identity : public FixedInputValueNodeT<1, Identity> {
2873
2874 public:
2876
2877 explicit Identity(uint64_t bitfield) : Base(bitfield) {}
2878
2880 // Identity is valid for all input types.
2881 }
2882#ifdef V8_COMPRESS_POINTERS
2883 void MarkTaggedInputsAsDecompressing() {
2884 // Do not mark inputs as decompressing here, since we don't yet know whether
2885 // this Phi needs decompression. Instead, let
2886 // Node::SetTaggedResultNeedsDecompress pass through phis.
2887 }
2888#endif
2891 void PrintParams(std::ostream&, MaglevGraphLabeller*) const {}
2892};
2893
2894template <class Derived, Operation kOperation>
2897
2898 public:
2899 // The implementation currently calls runtime.
2901 static constexpr
2903
2904 static constexpr int kOperandIndex = 0;
2907
2908 protected:
2909 explicit UnaryWithFeedbackNode(uint64_t bitfield,
2910 const compiler::FeedbackSource& feedback)
2911 : Base(bitfield), feedback_(feedback) {}
2912
2915 void PrintParams(std::ostream&, MaglevGraphLabeller*) const {}
2916
2918};
2919
2920template <class Derived, Operation kOperation>
2923
2924 public:
2925 // The implementation currently calls runtime.
2929
2930 static constexpr int kLeftIndex = 0;
2931 static constexpr int kRightIndex = 1;
2935
2936 protected:
2937 BinaryWithFeedbackNode(uint64_t bitfield,
2938 const compiler::FeedbackSource& feedback)
2939 : Base(bitfield), feedback_(feedback) {}
2940
2943 void PrintParams(std::ostream&, MaglevGraphLabeller*) const {}
2944
2946};
2947
2948#define DEF_OPERATION_WITH_FEEDBACK_NODE(Name, Super, OpName) \
2949 class Name : public Super<Name, Operation::k##OpName> { \
2950 using Base = Super<Name, Operation::k##OpName>; \
2951 \
2952 public: \
2953 Name(uint64_t bitfield, const compiler::FeedbackSource& feedback) \
2954 : Base(bitfield, feedback) {} \
2955 int MaxCallStackArgs() const { return 0; } \
2956 void SetValueLocationConstraints(); \
2957 void GenerateCode(MaglevAssembler*, const ProcessingState&); \
2958 void PrintParams(std::ostream&, MaglevGraphLabeller*) const {} \
2959 };
2960
2961#define DEF_UNARY_WITH_FEEDBACK_NODE(Name) \
2962 DEF_OPERATION_WITH_FEEDBACK_NODE(Generic##Name, UnaryWithFeedbackNode, Name)
2963#define DEF_BINARY_WITH_FEEDBACK_NODE(Name) \
2964 DEF_OPERATION_WITH_FEEDBACK_NODE(Generic##Name, BinaryWithFeedbackNode, Name)
2968#undef DEF_UNARY_WITH_FEEDBACK_NODE
2969#undef DEF_BINARY_WITH_FEEDBACK_NODE
2970#undef DEF_OPERATION_WITH_FEEDBACK_NODE
2971
2972template <class Derived, Operation kOperation>
2975
2976 public:
2977 static constexpr OpProperties kProperties =
2981
2982 static constexpr int kLeftIndex = 0;
2983 static constexpr int kRightIndex = 1;
2986
2987 protected:
2988 explicit Int32BinaryWithOverflowNode(uint64_t bitfield) : Base(bitfield) {}
2989
2990 void PrintParams(std::ostream&, MaglevGraphLabeller*) const {}
2991};
2992
2993#define DEF_OPERATION_NODE(Name, Super, OpName) \
2994 class Name : public Super<Name, Operation::k##OpName> { \
2995 using Base = Super<Name, Operation::k##OpName>; \
2996 \
2997 public: \
2998 explicit Name(uint64_t bitfield) : Base(bitfield) {} \
2999 void SetValueLocationConstraints(); \
3000 void GenerateCode(MaglevAssembler*, const ProcessingState&); \
3001 void PrintParams(std::ostream&, MaglevGraphLabeller*) const {} \
3002 };
3003
3004#define DEF_INT32_BINARY_WITH_OVERFLOW_NODE(Name) \
3005 DEF_OPERATION_NODE(Int32##Name##WithOverflow, Int32BinaryWithOverflowNode, \
3006 Name)
3012#undef DEF_INT32_BINARY_WITH_OVERFLOW_NODE
3013
3014template <class Derived, Operation kOperation>
3015class Int32BinaryNode : public FixedInputValueNodeT<2, Derived> {
3017
3018 public:
3022
3023 static constexpr int kLeftIndex = 0;
3024 static constexpr int kRightIndex = 1;
3027
3028 protected:
3029 explicit Int32BinaryNode(uint64_t bitfield) : Base(bitfield) {}
3030};
3031
3032#define DEF_INT32_BINARY_NODE(Name) \
3033 DEF_OPERATION_NODE(Int32##Name, Int32BinaryNode, Name)
3034DEF_INT32_BINARY_NODE(BitwiseAnd)
3035DEF_INT32_BINARY_NODE(BitwiseOr)
3036DEF_INT32_BINARY_NODE(BitwiseXor)
3037DEF_INT32_BINARY_NODE(ShiftLeft)
3038DEF_INT32_BINARY_NODE(ShiftRight)
3039#undef DEF_INT32_BINARY_NODE
3040
3041class Int32BitwiseNot : public FixedInputValueNodeT<1, Int32BitwiseNot> {
3043
3044 public:
3045 explicit Int32BitwiseNot(uint64_t bitfield) : Base(bitfield) {}
3046
3048 static constexpr
3050
3051 static constexpr int kValueIndex = 0;
3053
3056 void PrintParams(std::ostream&, MaglevGraphLabeller*) const {}
3057};
3058
3059template <class Derived, Operation kOperation>
3062
3063 public:
3064 static constexpr OpProperties kProperties =
3066 static constexpr
3068
3069 static constexpr int kValueIndex = 0;
3071
3072 protected:
3073 explicit Int32UnaryWithOverflowNode(uint64_t bitfield) : Base(bitfield) {}
3074};
3075
3076#define DEF_INT32_UNARY_WITH_OVERFLOW_NODE(Name) \
3077 DEF_OPERATION_NODE(Int32##Name##WithOverflow, Int32UnaryWithOverflowNode, \
3078 Name)
3079
3083#undef DEF_INT32_UNARY_WITH_OVERFLOW_NODE
3084
3086 : public FixedInputValueNodeT<2, Int32ShiftRightLogical> {
3088
3089 public:
3090 explicit Int32ShiftRightLogical(uint64_t bitfield) : Base(bitfield) {}
3091
3092 // Unlike the other Int32 nodes, logical right shift returns a Uint32.
3096
3097 static constexpr int kLeftIndex = 0;
3098 static constexpr int kRightIndex = 1;
3101
3104 void PrintParams(std::ostream&, MaglevGraphLabeller*) const {}
3105};
3106
3107class Int32Compare : public FixedInputValueNodeT<2, Int32Compare> {
3109
3110 public:
3111 explicit Int32Compare(uint64_t bitfield, Operation operation)
3112 : Base(OperationBitField::update(bitfield, operation)) {}
3113
3116
3117 static constexpr int kLeftIndex = 0;
3118 static constexpr int kRightIndex = 1;
3121
3122 constexpr Operation operation() const {
3123 return OperationBitField::decode(bitfield());
3124 }
3125
3128 void PrintParams(std::ostream&, MaglevGraphLabeller*) const;
3129
3130 auto options() const { return std::tuple{operation()}; }
3131
3132 private:
3133 using OperationBitField = NextBitField<Operation, 5>;
3134};
3135
3136class Int32ToBoolean : public FixedInputValueNodeT<1, Int32ToBoolean> {
3138
3139 public:
3140 explicit Int32ToBoolean(uint64_t bitfield, bool flip)
3141 : Base(FlipBitField::update(bitfield, flip)) {}
3142
3144
3145 Input& value() { return Node::input(0); }
3146
3147 constexpr bool flip() const { return FlipBitField::decode(bitfield()); }
3148
3151 void PrintParams(std::ostream&, MaglevGraphLabeller*) const;
3152
3153 auto options() const { return std::tuple{flip()}; }
3154
3155 private:
3156 using FlipBitField = NextBitField<bool, 1>;
3157};
3158
3159class IntPtrToBoolean : public FixedInputValueNodeT<1, IntPtrToBoolean> {
3161
3162 public:
3163 explicit IntPtrToBoolean(uint64_t bitfield, bool flip)
3164 : Base(FlipBitField::update(bitfield, flip)) {}
3165
3167
3168 Input& value() { return Node::input(0); }
3169
3170 constexpr bool flip() const { return FlipBitField::decode(bitfield()); }
3171
3174 void PrintParams(std::ostream&, MaglevGraphLabeller*) const;
3175
3176 auto options() const { return std::tuple{flip()}; }
3177
3178 private:
3179 using FlipBitField = NextBitField<bool, 1>;
3180};
3181
3183 : public FixedInputValueNodeT<1, CheckedSmiIncrement> {
3185
3186 public:
3187 explicit CheckedSmiIncrement(uint64_t bitfield) : Base(bitfield) {}
3188
3190 static constexpr
3192
3193 static constexpr int kValueIndex = 0;
3195
3198 void PrintParams(std::ostream&, MaglevGraphLabeller*) const {}
3199};
3200
3202 : public FixedInputValueNodeT<1, CheckedSmiDecrement> {
3204
3205 public:
3206 explicit CheckedSmiDecrement(uint64_t bitfield) : Base(bitfield) {}
3207
3209 static constexpr
3211
3212 static constexpr int kValueIndex = 0;
3214
3217 void PrintParams(std::ostream&, MaglevGraphLabeller*) const {}
3218};
3219
3220template <class Derived, Operation kOperation>
3221class Float64BinaryNode : public FixedInputValueNodeT<2, Derived> {
3223
3224 public:
3228
3229 static constexpr int kLeftIndex = 0;
3230 static constexpr int kRightIndex = 1;
3233
3234 protected:
3235 explicit Float64BinaryNode(uint64_t bitfield) : Base(bitfield) {}
3236
3237 void PrintParams(std::ostream&, MaglevGraphLabeller*) const {}
3238};
3239
3240#define DEF_OPERATION_NODE_WITH_CALL(Name, Super, OpName) \
3241 class Name : public Super<Name, Operation::k##OpName> { \
3242 using Base = Super<Name, Operation::k##OpName>; \
3243 \
3244 public: \
3245 explicit Name(uint64_t bitfield) : Base(bitfield) {} \
3246 int MaxCallStackArgs() const; \
3247 void SetValueLocationConstraints(); \
3248 void GenerateCode(MaglevAssembler*, const ProcessingState&); \
3249 void PrintParams(std::ostream&, MaglevGraphLabeller*) const {} \
3250 };
3251
3252template <class Derived, Operation kOperation>
3255
3256 public:
3257 static constexpr OpProperties kProperties =
3261
3262 static constexpr int kLeftIndex = 0;
3263 static constexpr int kRightIndex = 1;
3266
3267 protected:
3268 explicit Float64BinaryNodeWithCall(uint64_t bitfield) : Base(bitfield) {}
3269
3270 void PrintParams(std::ostream&, MaglevGraphLabeller*) const {}
3271};
3272
3273#define DEF_FLOAT64_BINARY_NODE(Name) \
3274 DEF_OPERATION_NODE(Float64##Name, Float64BinaryNode, Name)
3275#define DEF_FLOAT64_BINARY_NODE_WITH_CALL(Name) \
3276 DEF_OPERATION_NODE_WITH_CALL(Float64##Name, Float64BinaryNodeWithCall, Name)
3281#if defined(V8_TARGET_ARCH_ARM64) || defined(V8_TARGET_ARCH_ARM) || \
3282 defined(V8_TARGET_ARCH_RISCV64)
3283// On Arm/Arm64/Riscv64, floating point modulus is implemented with a call to a
3284// C++ function, while on x64, it's implemented natively without call.
3286#else
3288#endif
3290#undef DEF_FLOAT64_BINARY_NODE
3291#undef DEF_FLOAT64_BINARY_NODE_WITH_CALL
3292
3293#undef DEF_OPERATION_NODE
3294#undef DEF_OPERATION_NODE_WITH_CALL
3295
3296class Float64Compare : public FixedInputValueNodeT<2, Float64Compare> {
3298
3299 public:
3300 explicit Float64Compare(uint64_t bitfield, Operation operation)
3301 : Base(OperationBitField::update(bitfield, operation)) {}
3302
3305
3306 static constexpr int kLeftIndex = 0;
3307 static constexpr int kRightIndex = 1;
3310
3311 constexpr Operation operation() const {
3312 return OperationBitField::decode(bitfield());
3313 }
3314
3317 void PrintParams(std::ostream&, MaglevGraphLabeller*) const;
3318
3319 auto options() const { return std::tuple{operation()}; }
3320
3321 private:
3322 using OperationBitField = NextBitField<Operation, 5>;
3323};
3324
3325class Float64ToBoolean : public FixedInputValueNodeT<1, Float64ToBoolean> {
3327
3328 public:
3329 explicit Float64ToBoolean(uint64_t bitfield, bool flip)
3330 : Base(FlipBitField::update(bitfield, flip)) {}
3331
3334
3335 Input& value() { return Node::input(0); }
3336
3337 constexpr bool flip() const { return FlipBitField::decode(bitfield()); }
3338
3341 void PrintParams(std::ostream&, MaglevGraphLabeller*) const;
3342
3343 auto options() const { return std::tuple{flip()}; }
3344
3345 private:
3346 using FlipBitField = NextBitField<bool, 1>;
3347};
3348
3349class Float64Negate : public FixedInputValueNodeT<1, Float64Negate> {
3351
3352 public:
3353 explicit Float64Negate(uint64_t bitfield) : Base(bitfield) {}
3354
3356 static constexpr
3358
3359 Input& input() { return Node::input(0); }
3360
3363 void PrintParams(std::ostream&, MaglevGraphLabeller*) const {}
3364};
3365
3366#define IEEE_754_UNARY_LIST(V) \
3367 V(MathAcos, acos, Acos) \
3368 V(MathAcosh, acosh, Acosh) \
3369 V(MathAsin, asin, Asin) \
3370 V(MathAsinh, asinh, Asinh) \
3371 V(MathAtan, atan, Atan) \
3372 V(MathAtanh, atanh, Atanh) \
3373 V(MathCbrt, cbrt, Cbrt) \
3374 V(MathCos, cos, Cos) \
3375 V(MathCosh, cosh, Cosh) \
3376 V(MathExp, exp, Exp) \
3377 V(MathExpm1, expm1, Expm1) \
3378 V(MathLog, log, Log) \
3379 V(MathLog1p, log1p, Log1p) \
3380 V(MathLog10, log10, Log10) \
3381 V(MathLog2, log2, Log2) \
3382 V(MathSin, sin, Sin) \
3383 V(MathSinh, sinh, Sinh) \
3384 V(MathTan, tan, Tan) \
3385 V(MathTanh, tanh, Tanh)
3387 : public FixedInputValueNodeT<1, Float64Ieee754Unary> {
3389
3390 public:
3391 enum class Ieee754Function : uint8_t {
3392#define DECL_ENUM(MathName, ExtName, EnumName) k##EnumName,
3394#undef DECL_ENUM
3395 };
3397 : Base(bitfield), ieee_function_(ieee_function) {}
3398
3399 static constexpr OpProperties kProperties =
3401 static constexpr
3403
3404 Input& input() { return Node::input(0); }
3405
3406 int MaxCallStackArgs() const;
3409 void PrintParams(std::ostream&, MaglevGraphLabeller*) const;
3410
3411 auto options() const { return std::tuple{ieee_function_}; }
3412
3415
3416 private:
3418};
3419
3420class CheckInt32IsSmi : public FixedInputNodeT<1, CheckInt32IsSmi> {
3422
3423 public:
3424 explicit CheckInt32IsSmi(uint64_t bitfield) : Base(bitfield) {}
3425
3427 static constexpr
3429
3430 Input& input() { return Node::input(0); }
3431
3434 void PrintParams(std::ostream&, MaglevGraphLabeller*) const {}
3435};
3436
3437class CheckUint32IsSmi : public FixedInputNodeT<1, CheckUint32IsSmi> {
3439
3440 public:
3441 explicit CheckUint32IsSmi(uint64_t bitfield) : Base(bitfield) {}
3442
3444 static constexpr
3446
3447 Input& input() { return Node::input(0); }
3448
3451 void PrintParams(std::ostream&, MaglevGraphLabeller*) const {}
3452};
3453
3454class CheckIntPtrIsSmi : public FixedInputNodeT<1, CheckIntPtrIsSmi> {
3456
3457 public:
3458 explicit CheckIntPtrIsSmi(uint64_t bitfield) : Base(bitfield) {}
3459
3461 static constexpr
3463
3464 Input& input() { return Node::input(0); }
3465
3468 void PrintParams(std::ostream&, MaglevGraphLabeller*) const {}
3469};
3470
3472 : public FixedInputNodeT<1, CheckHoleyFloat64IsSmi> {
3474
3475 public:
3476 explicit CheckHoleyFloat64IsSmi(uint64_t bitfield) : Base(bitfield) {}
3477
3479 static constexpr
3481
3482 Input& input() { return Node::input(0); }
3483
3486 void PrintParams(std::ostream&, MaglevGraphLabeller*) const {}
3487};
3488
3489class CheckedSmiTagInt32 : public FixedInputValueNodeT<1, CheckedSmiTagInt32> {
3491
3492 public:
3493 explicit CheckedSmiTagInt32(uint64_t bitfield) : Base(bitfield) {}
3494
3495 static constexpr OpProperties kProperties =
3497 static constexpr
3499
3500 Input& input() { return Node::input(0); }
3501
3504 void PrintParams(std::ostream&, MaglevGraphLabeller*) const {}
3505};
3506
3507// This is a check disguised as a conversion node so we can use it to override
3508// untagging conversions.
3509// TODO(olivf): Support overriding bigger with smaller instruction so we can use
3510// CheckInt32IsSmi instead.
3512 : public FixedInputValueNodeT<1, CheckedSmiSizedInt32> {
3514
3515 public:
3516 explicit CheckedSmiSizedInt32(uint64_t bitfield) : Base(bitfield) {}
3517
3521 static constexpr
3523
3524 Input& input() { return Node::input(0); }
3525
3528 void PrintParams(std::ostream&, MaglevGraphLabeller*) const {}
3529};
3530
3532 : public FixedInputValueNodeT<1, CheckedSmiTagUint32> {
3534
3535 public:
3536 explicit CheckedSmiTagUint32(uint64_t bitfield) : Base(bitfield) {}
3537
3538 static constexpr OpProperties kProperties =
3540 static constexpr
3542
3543 Input& input() { return Node::input(0); }
3544
3547 void PrintParams(std::ostream&, MaglevGraphLabeller*) const {}
3548};
3549
3551 : public FixedInputValueNodeT<1, CheckedSmiTagIntPtr> {
3553
3554 public:
3555 explicit CheckedSmiTagIntPtr(uint64_t bitfield) : Base(bitfield) {}
3556
3557 static constexpr OpProperties kProperties =
3559 static constexpr
3561
3562 Input& input() { return Node::input(0); }
3563
3566 void PrintParams(std::ostream&, MaglevGraphLabeller*) const {}
3567};
3568
3569// Input must guarantee to fit in a Smi.
3570class UnsafeSmiTagInt32 : public FixedInputValueNodeT<1, UnsafeSmiTagInt32> {
3572
3573 public:
3574 explicit UnsafeSmiTagInt32(uint64_t bitfield) : Base(bitfield) {}
3575
3577 static constexpr
3579
3580 Input& input() { return Node::input(0); }
3581
3582#ifdef V8_COMPRESS_POINTERS
3583 void MarkTaggedInputsAsDecompressing() {
3584 // No tagged inputs.
3585 }
3586#endif
3587
3590 void PrintParams(std::ostream&, MaglevGraphLabeller*) const {}
3591};
3592
3593// Input must guarantee to fit in a Smi.
3594class UnsafeSmiTagUint32 : public FixedInputValueNodeT<1, UnsafeSmiTagUint32> {
3596
3597 public:
3598 explicit UnsafeSmiTagUint32(uint64_t bitfield) : Base(bitfield) {}
3599
3601 static constexpr
3603
3604 Input& input() { return Node::input(0); }
3605
3606#ifdef V8_COMPRESS_POINTERS
3607 void MarkTaggedInputsAsDecompressing() {
3608 // No tagged inputs.
3609 }
3610#endif
3611
3614 void PrintParams(std::ostream&, MaglevGraphLabeller*) const {}
3615};
3616
3617// Input must guarantee to fit in a Smi.
3618class UnsafeSmiTagIntPtr : public FixedInputValueNodeT<1, UnsafeSmiTagIntPtr> {
3620
3621 public:
3622 explicit UnsafeSmiTagIntPtr(uint64_t bitfield) : Base(bitfield) {}
3623
3625 static constexpr
3627
3628 Input& input() { return Node::input(0); }
3629
3630#ifdef V8_COMPRESS_POINTERS
3631 void MarkTaggedInputsAsDecompressing() {
3632 // No tagged inputs.
3633 }
3634#endif
3635
3638 void PrintParams(std::ostream&, MaglevGraphLabeller*) const {}
3639};
3640
3641class CheckedSmiUntag : public FixedInputValueNodeT<1, CheckedSmiUntag> {
3643
3644 public:
3645 explicit CheckedSmiUntag(uint64_t bitfield) : Base(bitfield) {}
3646
3650 static constexpr
3652
3653 Input& input() { return Node::input(0); }
3654
3655#ifdef V8_COMPRESS_POINTERS
3656 void MarkTaggedInputsAsDecompressing() {
3657 // Don't need to decompress to untag.
3658 }
3659#endif
3660
3663 void PrintParams(std::ostream&, MaglevGraphLabeller*) const {}
3664};
3665
3666class UnsafeSmiUntag : public FixedInputValueNodeT<1, UnsafeSmiUntag> {
3668
3669 public:
3670 explicit UnsafeSmiUntag(uint64_t bitfield) : Base(bitfield) {}
3671
3672 static constexpr OpProperties kProperties =
3674 static constexpr
3676
3677 Input& input() { return Node::input(0); }
3678
3679#ifdef V8_COMPRESS_POINTERS
3680 void MarkTaggedInputsAsDecompressing() {
3681 // Don't need to decompress to untag.
3682 }
3683#endif
3684
3687 void PrintParams(std::ostream&, MaglevGraphLabeller*) const {}
3688};
3689
3690class Int32Constant : public FixedInputValueNodeT<0, Int32Constant> {
3692
3693 public:
3695
3696 explicit Int32Constant(uint64_t bitfield, int32_t value)
3697 : Base(bitfield), value_(value) {}
3698
3700
3701 int32_t value() const { return value_; }
3702
3703 bool ToBoolean(LocalIsolate* local_isolate) const { return value_ != 0; }
3704
3707 void PrintParams(std::ostream&, MaglevGraphLabeller*) const;
3708
3711
3712 private:
3713 const int32_t value_;
3714};
3715
3716class Uint32Constant : public FixedInputValueNodeT<0, Uint32Constant> {
3718
3719 public:
3721
3722 explicit Uint32Constant(uint64_t bitfield, uint32_t value)
3723 : Base(bitfield), value_(value) {}
3724
3726
3727 uint32_t value() const { return value_; }
3728
3729 bool ToBoolean(LocalIsolate* local_isolate) const { return value_ != 0; }
3730
3733 void PrintParams(std::ostream&, MaglevGraphLabeller*) const;
3734
3737
3738 private:
3739 const uint32_t value_;
3740};
3741
3742class Float64Constant : public FixedInputValueNodeT<0, Float64Constant> {
3744
3745 public:
3747
3748 explicit Float64Constant(uint64_t bitfield, Float64 value)
3749 : Base(bitfield), value_(value) {}
3750
3752
3753 Float64 value() const { return value_; }
3754
3755 bool ToBoolean(LocalIsolate* local_isolate) const {
3756 return value_.get_scalar() != 0.0 && !value_.is_nan();
3757 }
3758
3761 void PrintParams(std::ostream&, MaglevGraphLabeller*) const;
3762
3765
3766 private:
3768};
3769
3771 : public FixedInputValueNodeT<1, Int32ToUint8Clamped> {
3773
3774 public:
3775 explicit Int32ToUint8Clamped(uint64_t bitfield) : Base(bitfield) {}
3776
3778 static constexpr
3780
3781 Input& input() { return Node::input(0); }
3782
3785 void PrintParams(std::ostream&, MaglevGraphLabeller*) const {}
3786};
3787
3789 : public FixedInputValueNodeT<1, Uint32ToUint8Clamped> {
3791
3792 public:
3793 explicit Uint32ToUint8Clamped(uint64_t bitfield) : Base(bitfield) {}
3794
3796 static constexpr
3798
3799 Input& input() { return Node::input(0); }
3800
3803 void PrintParams(std::ostream&, MaglevGraphLabeller*) const {}
3804};
3805
3807 : public FixedInputValueNodeT<1, Float64ToUint8Clamped> {
3809
3810 public:
3811 explicit Float64ToUint8Clamped(uint64_t bitfield) : Base(bitfield) {}
3812
3814 static constexpr
3816
3817 Input& input() { return Node::input(0); }
3818
3821 void PrintParams(std::ostream&, MaglevGraphLabeller*) const {}
3822};
3823
3825 : public FixedInputValueNodeT<1, CheckedNumberToUint8Clamped> {
3827
3828 public:
3829 explicit CheckedNumberToUint8Clamped(uint64_t bitfield) : Base(bitfield) {}
3830
3831 static constexpr OpProperties kProperties =
3833 static constexpr
3835
3836 Input& input() { return Node::input(0); }
3837
3840 void PrintParams(std::ostream&, MaglevGraphLabeller*) const {}
3841};
3842
3843class Int32ToNumber : public FixedInputValueNodeT<1, Int32ToNumber> {
3845
3846 public:
3847 explicit Int32ToNumber(uint64_t bitfield) : Base(bitfield) {}
3848
3852 static constexpr
3854
3855 Input& input() { return Node::input(0); }
3856
3857 int MaxCallStackArgs() const { return 0; }
3860 void PrintParams(std::ostream&, MaglevGraphLabeller*) const {}
3861};
3862
3863class Uint32ToNumber : public FixedInputValueNodeT<1, Uint32ToNumber> {
3865
3866 public:
3867 explicit Uint32ToNumber(uint64_t bitfield) : Base(bitfield) {}
3868
3872 static constexpr
3874
3875 Input& input() { return Node::input(0); }
3876
3877 int MaxCallStackArgs() const { return 0; }
3880 void PrintParams(std::ostream&, MaglevGraphLabeller*) const {}
3881};
3882
3883class IntPtrToNumber : public FixedInputValueNodeT<1, IntPtrToNumber> {
3885
3886 public:
3887 explicit IntPtrToNumber(uint64_t bitfield) : Base(bitfield) {}
3888
3892 static constexpr
3894
3895 Input& input() { return Node::input(0); }
3896
3897 int MaxCallStackArgs() const { return 0; }
3900 void PrintParams(std::ostream&, MaglevGraphLabeller*) const {}
3901};
3902
3903class Float64ToTagged : public FixedInputValueNodeT<1, Float64ToTagged> {
3905
3906 public:
3908 explicit Float64ToTagged(uint64_t bitfield, ConversionMode mode)
3909 : Base(ConversionModeBitField::update(bitfield, mode)) {}
3910 static constexpr
3912
3916
3917 Input& input() { return Node::input(0); }
3918
3919 int MaxCallStackArgs() const { return 0; }
3922 void PrintParams(std::ostream&, MaglevGraphLabeller*) const {}
3923
3924 auto options() const { return std::tuple{conversion_mode()}; }
3925
3927 return ConversionModeBitField::decode(bitfield());
3928 }
3929
3930 private:
3932 return ConversionModeBitField::decode(bitfield()) ==
3934 }
3935
3936 using ConversionModeBitField = NextBitField<ConversionMode, 1>;
3937};
3938
3939// Essentially the same as Float64ToTagged but the result cannot be shared as it
3940// will be used as a mutable heap number by a store.
3942 : public FixedInputValueNodeT<1, Float64ToHeapNumberForField> {
3944
3945 public:
3946 explicit Float64ToHeapNumberForField(uint64_t bitfield) : Base(bitfield) {}
3947 static constexpr
3949
3953
3954 Input& input() { return Node::input(0); }
3955
3956 int MaxCallStackArgs() const { return 0; }
3959 void PrintParams(std::ostream&, MaglevGraphLabeller*) const {}
3960};
3961
3963 : public FixedInputValueNodeT<1, HoleyFloat64ToTagged> {
3965
3966 public:
3968 explicit HoleyFloat64ToTagged(uint64_t bitfield, ConversionMode mode)
3969 : Base(ConversionModeBitField::update(bitfield, mode)) {}
3970 static constexpr
3972
3976
3977 Input& input() { return Node::input(0); }
3978
3979 int MaxCallStackArgs() const { return 0; }
3982 void PrintParams(std::ostream&, MaglevGraphLabeller*) const {}
3983
3985 set_bitfield(ConversionModeBitField::update(bitfield(), mode));
3986 }
3987
3988 auto options() const { return std::tuple{conversion_mode()}; }
3989
3991 return ConversionModeBitField::decode(bitfield());
3992 }
3993
3994 private:
3996 return ConversionModeBitField::decode(bitfield()) ==
3998 }
3999 using ConversionModeBitField = NextBitField<ConversionMode, 1>;
4000};
4001
4003 : public FixedInputValueNodeT<1, CheckedSmiTagFloat64> {
4005
4006 public:
4007 explicit CheckedSmiTagFloat64(uint64_t bitfield) : Base(bitfield) {}
4008 static constexpr
4010
4011 static constexpr OpProperties kProperties =
4013
4014 Input& input() { return Node::input(0); }
4015
4016 int MaxCallStackArgs() const { return 0; }
4019 void PrintParams(std::ostream&, MaglevGraphLabeller*) const {}
4020};
4021
4023 : public FixedInputValueNodeT<1, CheckedInt32ToUint32> {
4025
4026 public:
4027 explicit CheckedInt32ToUint32(uint64_t bitfield) : Base(bitfield) {}
4028
4032 static constexpr
4034
4035 Input& input() { return Node::input(0); }
4036
4039 void PrintParams(std::ostream&, MaglevGraphLabeller*) const {}
4040};
4041
4043 : public FixedInputValueNodeT<1, CheckedIntPtrToUint32> {
4045
4046 public:
4047 explicit CheckedIntPtrToUint32(uint64_t bitfield) : Base(bitfield) {}
4048
4052 static constexpr
4054
4055 Input& input() { return Node::input(0); }
4056
4059 void PrintParams(std::ostream&, MaglevGraphLabeller*) const {}
4060};
4061
4063 : public FixedInputValueNodeT<1, UnsafeInt32ToUint32> {
4065
4066 public:
4067 explicit UnsafeInt32ToUint32(uint64_t bitfield) : Base(bitfield) {}
4068
4069 static constexpr OpProperties kProperties =
4071 static constexpr
4073
4074 Input& input() { return Node::input(0); }
4075
4078 void PrintParams(std::ostream&, MaglevGraphLabeller*) const {}
4079};
4080
4082 : public FixedInputValueNodeT<1, CheckedUint32ToInt32> {
4084
4085 public:
4086 explicit CheckedUint32ToInt32(uint64_t bitfield) : Base(bitfield) {}
4087
4091 static constexpr
4093
4094 Input& input() { return Node::input(0); }
4095
4098 void PrintParams(std::ostream&, MaglevGraphLabeller*) const {}
4099};
4100
4102 : public FixedInputValueNodeT<1, CheckedIntPtrToInt32> {
4104
4105 public:
4106 explicit CheckedIntPtrToInt32(uint64_t bitfield) : Base(bitfield) {}
4107
4111 static constexpr
4113
4114 Input& input() { return Node::input(0); }
4115
4118 void PrintParams(std::ostream&, MaglevGraphLabeller*) const {}
4119};
4120
4122 : public FixedInputValueNodeT<1, ChangeInt32ToFloat64> {
4124
4125 public:
4126 explicit ChangeInt32ToFloat64(uint64_t bitfield) : Base(bitfield) {}
4127
4128 static constexpr OpProperties kProperties =
4130 static constexpr
4132
4133 Input& input() { return Node::input(0); }
4134
4137 void PrintParams(std::ostream&, MaglevGraphLabeller*) const {}
4138};
4139
4141 : public FixedInputValueNodeT<1, ChangeUint32ToFloat64> {
4143
4144 public:
4145 explicit ChangeUint32ToFloat64(uint64_t bitfield) : Base(bitfield) {}
4146
4147 static constexpr OpProperties kProperties =
4149 static constexpr
4151
4152 Input& input() { return Node::input(0); }
4153
4156 void PrintParams(std::ostream&, MaglevGraphLabeller*) const {}
4157};
4158
4160 : public FixedInputValueNodeT<1, ChangeIntPtrToFloat64> {
4162
4163 public:
4164 explicit ChangeIntPtrToFloat64(uint64_t bitfield) : Base(bitfield) {}
4165
4166 static constexpr OpProperties kProperties =
4168 static constexpr
4170
4171 Input& input() { return Node::input(0); }
4172
4175 void PrintParams(std::ostream&, MaglevGraphLabeller*) const {}
4176};
4177
4179 : public FixedInputValueNodeT<1, CheckedTruncateFloat64ToInt32> {
4181
4182 public:
4183 explicit CheckedTruncateFloat64ToInt32(uint64_t bitfield) : Base(bitfield) {}
4184
4188 static constexpr
4190
4191 Input& input() { return Node::input(0); }
4192
4195 void PrintParams(std::ostream&, MaglevGraphLabeller*) const {}
4196};
4197
4199 : public FixedInputValueNodeT<1, Int32AbsWithOverflow> {
4201
4202 public:
4203 static constexpr OpProperties kProperties =
4205 static constexpr
4207
4208 static constexpr int kValueIndex = 0;
4210
4211 explicit Int32AbsWithOverflow(uint64_t bitfield) : Base(bitfield) {}
4212
4215 void PrintParams(std::ostream&, MaglevGraphLabeller*) const {}
4216};
4217
4218class Float64Abs : public FixedInputValueNodeT<1, Float64Abs> {
4220
4221 public:
4222 explicit Float64Abs(uint64_t bitfield) : Base(bitfield) {}
4223
4225 static constexpr
4227
4228 Input& input() { return Node::input(0); }
4229
4232 void PrintParams(std::ostream&, MaglevGraphLabeller*) const {}
4233};
4234
4235class Float64Round : public FixedInputValueNodeT<1, Float64Round> {
4237
4238 public:
4239 enum class Kind { kFloor, kCeil, kNearest };
4240
4242 switch (kind) {
4243 case Kind::kCeil:
4244 return Builtin::kMathCeilContinuation;
4245 case Kind::kFloor:
4246 return Builtin::kMathFloorContinuation;
4247 case Kind::kNearest:
4248 return Builtin::kMathRoundContinuation;
4249 }
4250 }
4251
4252 Float64Round(uint64_t bitfield, Kind kind) : Base(bitfield), kind_(kind) {}
4253
4255 static constexpr
4257
4258 Input& input() { return Node::input(0); }
4259 Kind kind() const { return kind_; }
4260
4263 void PrintParams(std::ostream&, MaglevGraphLabeller*) const;
4264
4265 auto options() const { return std::tuple{kind_}; }
4266
4267 private:
4269};
4270
4272 : public FixedInputValueNodeT<1, CheckedTruncateFloat64ToUint32> {
4274
4275 public:
4276 explicit CheckedTruncateFloat64ToUint32(uint64_t bitfield) : Base(bitfield) {}
4277 static constexpr
4279
4283
4284 Input& input() { return Node::input(0); }
4285
4288 void PrintParams(std::ostream&, MaglevGraphLabeller*) const {}
4289};
4290
4291#define DEFINE_TRUNCATE_NODE(name, from_repr, properties) \
4292 class name : public FixedInputValueNodeT<1, name> { \
4293 using Base = FixedInputValueNodeT<1, name>; \
4294 \
4295 public: \
4296 explicit name(uint64_t bitfield) : Base(bitfield) {} \
4297 \
4298 static constexpr OpProperties kProperties = properties; \
4299 static constexpr typename Base::InputTypes kInputTypes{ \
4300 ValueRepresentation::k##from_repr}; \
4301 \
4302 Input& input() { return Node::input(0); } \
4303 \
4304 void SetValueLocationConstraints(); \
4305 void GenerateCode(MaglevAssembler*, const ProcessingState&); \
4306 void PrintParams(std::ostream&, MaglevGraphLabeller*) const {} \
4307 };
4308
4309DEFINE_TRUNCATE_NODE(TruncateUint32ToInt32, Uint32, OpProperties::Int32())
4310DEFINE_TRUNCATE_NODE(TruncateFloat64ToInt32, HoleyFloat64,
4312DEFINE_TRUNCATE_NODE(UnsafeTruncateUint32ToInt32, Uint32, OpProperties::Int32())
4313DEFINE_TRUNCATE_NODE(UnsafeTruncateFloat64ToInt32, HoleyFloat64,
4315
4316#undef DEFINE_TRUNCATE_NODE
4317
4318template <typename Derived, ValueRepresentation FloatType>
4322 : public FixedInputValueNodeT<1, Derived> {
4324 using Base::result;
4325
4326 public:
4331
4332 static constexpr OpProperties kProperties =
4336 static constexpr
4338
4339 Input& input() { return Node::input(0); }
4340
4342 return TaggedToFloat64ConversionTypeOffset::decode(Base::bitfield());
4343 }
4344
4347 ? DeoptimizeReason::kNotANumberOrBoolean
4348 : DeoptimizeReason::kNotANumberOrOddball;
4349 }
4350
4353 void PrintParams(std::ostream&, MaglevGraphLabeller*) const;
4354
4355 auto options() const { return std::tuple{conversion_type()}; }
4356
4357 private:
4359 Base::template NextBitField<TaggedToFloat64ConversionType, 2>;
4360};
4361
4364 CheckedNumberOrOddballToFloat64, ValueRepresentation::kFloat64> {
4367
4368 public:
4372};
4373
4376 CheckedNumberOrOddballToHoleyFloat64,
4377 ValueRepresentation::kHoleyFloat64> {
4380
4381 public:
4385};
4386
4388 : public FixedInputValueNodeT<1, CheckedNumberToInt32> {
4390
4391 public:
4392 explicit CheckedNumberToInt32(uint64_t bitfield) : Base(bitfield) {}
4393
4397 static constexpr
4399
4400 Input& input() { return Node::input(0); }
4401
4404 void PrintParams(std::ostream&, MaglevGraphLabeller*) const {}
4405};
4406
4408 : public FixedInputValueNodeT<1, UncheckedNumberOrOddballToFloat64> {
4410
4411 public:
4416
4417 static constexpr OpProperties kProperties =
4419 static constexpr
4421
4422 Input& input() { return Node::input(0); }
4423
4426 void PrintParams(std::ostream&, MaglevGraphLabeller*) const;
4427
4429 return TaggedToFloat64ConversionTypeOffset::decode(bitfield());
4430 }
4431
4432 auto options() const { return std::tuple{conversion_type()}; }
4433
4434 private:
4436 NextBitField<TaggedToFloat64ConversionType, 2>;
4437};
4438
4440 : public FixedInputValueNodeT<1, CheckedHoleyFloat64ToFloat64> {
4442
4443 public:
4444 explicit CheckedHoleyFloat64ToFloat64(uint64_t bitfield) : Base(bitfield) {}
4445
4449 static constexpr
4451
4452 Input& input() { return Node::input(0); }
4453
4454 int MaxCallStackArgs() const { return 0; }
4457 void PrintParams(std::ostream&, MaglevGraphLabeller*) const {}
4458};
4459
4461 : public FixedInputValueNodeT<1, HoleyFloat64ToMaybeNanFloat64> {
4463
4464 public:
4465 explicit HoleyFloat64ToMaybeNanFloat64(uint64_t bitfield) : Base(bitfield) {}
4466
4468 static constexpr
4470
4471 Input& input() { return Node::input(0); }
4472
4473 int MaxCallStackArgs() const { return 0; }
4476 void PrintParams(std::ostream&, MaglevGraphLabeller*) const {}
4477};
4478
4479class HoleyFloat64IsHole : public FixedInputValueNodeT<1, HoleyFloat64IsHole> {
4481
4482 public:
4483 explicit HoleyFloat64IsHole(uint64_t bitfield) : Base(bitfield) {}
4484
4485 static constexpr
4487
4488 Input& input() { return Node::input(0); }
4489
4492 void PrintParams(std::ostream&, MaglevGraphLabeller*) const {}
4493};
4494
4496 : public FixedInputValueNodeT<1, TruncateNumberOrOddballToInt32> {
4498
4499 public:
4504
4506 static constexpr
4508
4509 Input& input() { return Node::input(0); }
4510
4513 void PrintParams(std::ostream&, MaglevGraphLabeller*) const;
4514
4516 return TaggedToFloat64ConversionTypeOffset::decode(bitfield());
4517 }
4518
4519 auto options() const { return std::tuple{conversion_type()}; }
4520
4521 private:
4523 NextBitField<TaggedToFloat64ConversionType, 2>;
4524};
4525
4527 : public FixedInputValueNodeT<1, CheckedTruncateNumberOrOddballToInt32> {
4529
4530 public:
4535
4536 static constexpr OpProperties kProperties =
4538 static constexpr
4540
4541 Input& input() { return Node::input(0); }
4542
4545 void PrintParams(std::ostream&, MaglevGraphLabeller*) const;
4546
4548 return TaggedToFloat64ConversionTypeOffset::decode(bitfield());
4549 }
4550
4551 auto options() const { return std::tuple{conversion_type()}; }
4552
4553 private:
4555 NextBitField<TaggedToFloat64ConversionType, 2>;
4556};
4557
4558class LogicalNot : public FixedInputValueNodeT<1, LogicalNot> {
4560
4561 public:
4562 explicit LogicalNot(uint64_t bitfield) : Base(bitfield) {}
4563
4564 static constexpr
4566
4567 Input& value() { return Node::input(0); }
4568
4571 void PrintParams(std::ostream&, MaglevGraphLabeller*) const {}
4572};
4573
4574class SetPendingMessage : public FixedInputValueNodeT<1, SetPendingMessage> {
4576
4577 public:
4578 explicit SetPendingMessage(uint64_t bitfield) : Base(bitfield) {}
4579
4580 static constexpr OpProperties kProperties =
4582 static constexpr
4584
4585 Input& value() { return Node::input(0); }
4586
4589 void PrintParams(std::ostream&, MaglevGraphLabeller*) const {}
4590};
4591
4593class ToBoolean : public FixedInputValueNodeT<1, ToBoolean> {
4595
4596 public:
4597 explicit ToBoolean(uint64_t bitfield, CheckType check_type)
4598 : Base(CheckTypeBitField::update(bitfield, check_type)) {}
4599
4600 static constexpr
4602
4603 Input& value() { return Node::input(0); }
4604 CheckType check_type() const { return CheckTypeBitField::decode(bitfield()); }
4605
4608 void PrintParams(std::ostream&, MaglevGraphLabeller*) const {}
4609
4610 auto options() const { return std::tuple{check_type()}; }
4611
4612 private:
4613 using CheckTypeBitField = NextBitField<CheckType, 1>;
4614};
4615
4617 : public FixedInputValueNodeT<1, ToBooleanLogicalNot> {
4619
4620 public:
4621 explicit ToBooleanLogicalNot(uint64_t bitfield, CheckType check_type)
4622 : Base(CheckTypeBitField::update(bitfield, check_type)) {}
4623
4624 static constexpr
4626
4627 Input& value() { return Node::input(0); }
4628 CheckType check_type() const { return CheckTypeBitField::decode(bitfield()); }
4629
4632 void PrintParams(std::ostream&, MaglevGraphLabeller*) const {}
4633
4634 auto options() const { return std::tuple{check_type()}; }
4635
4636 private:
4637 using CheckTypeBitField = NextBitField<CheckType, 1>;
4638};
4639
4640class StringEqual : public FixedInputValueNodeT<2, StringEqual> {
4642
4643 public:
4644 explicit StringEqual(uint64_t bitfield) : Base(bitfield) {}
4648
4651
4652 Input& lhs() { return Node::input(0); }
4653 Input& rhs() { return Node::input(1); }
4654
4655 int MaxCallStackArgs() const { return 0; }
4658 void PrintParams(std::ostream&, MaglevGraphLabeller*) const {}
4659};
4660
4661class TaggedEqual : public FixedInputValueNodeT<2, TaggedEqual> {
4663
4664 public:
4665 explicit TaggedEqual(uint64_t bitfield) : Base(bitfield) {}
4666
4669
4670 Input& lhs() { return Node::input(0); }
4671 Input& rhs() { return Node::input(1); }
4672
4673#ifdef V8_COMPRESS_POINTERS
4674 void MarkTaggedInputsAsDecompressing() {
4675 // Don't need to decompress to compare reference equality.
4676 }
4677#endif
4678
4681 void PrintParams(std::ostream&, MaglevGraphLabeller*) const {}
4682};
4683
4684class TaggedNotEqual : public FixedInputValueNodeT<2, TaggedNotEqual> {
4686
4687 public:
4688 explicit TaggedNotEqual(uint64_t bitfield) : Base(bitfield) {}
4689
4692
4693 Input& lhs() { return Node::input(0); }
4694 Input& rhs() { return Node::input(1); }
4695
4696#ifdef V8_COMPRESS_POINTERS
4697 void MarkTaggedInputsAsDecompressing() {
4698 // Don't need to decompress to compare reference equality.
4699 }
4700#endif
4701
4704 void PrintParams(std::ostream&, MaglevGraphLabeller*) const {}
4705};
4706
4707class TestInstanceOf : public FixedInputValueNodeT<3, TestInstanceOf> {
4709
4710 public:
4711 explicit TestInstanceOf(uint64_t bitfield, compiler::FeedbackSource feedback)
4712 : Base(bitfield), feedback_(feedback) {}
4713
4714 // The implementation currently calls runtime.
4719
4720 Input& context() { return input(0); }
4721 Input& object() { return input(1); }
4722 Input& callable() { return input(2); }
4724
4725 int MaxCallStackArgs() const;
4728 void PrintParams(std::ostream&, MaglevGraphLabeller*) const {}
4729
4730 private:
4732};
4733
4734class TestUndetectable : public FixedInputValueNodeT<1, TestUndetectable> {
4736
4737 public:
4738 explicit TestUndetectable(uint64_t bitfield, CheckType check_type)
4739 : Base(CheckTypeBitField::update(bitfield, check_type)) {}
4740
4741 static constexpr
4743
4744 Input& value() { return Node::input(0); }
4745 CheckType check_type() const { return CheckTypeBitField::decode(bitfield()); }
4746
4749 void PrintParams(std::ostream&, MaglevGraphLabeller*) const {}
4750
4751 auto options() const { return std::tuple{check_type()}; }
4752
4753 private:
4754 using CheckTypeBitField = NextBitField<CheckType, 1>;
4755};
4756
4757class TestTypeOf : public FixedInputValueNodeT<1, TestTypeOf> {
4759
4760 public:
4761 explicit TestTypeOf(uint64_t bitfield,
4763 : Base(bitfield), literal_(literal) {}
4764
4765 static constexpr
4767
4768 Input& value() { return Node::input(0); }
4769
4772 void PrintParams(std::ostream&, MaglevGraphLabeller*) const;
4773
4774 auto options() const { return std::tuple{literal_}; }
4775
4777
4778 private:
4780};
4781
4782class ToName : public FixedInputValueNodeT<2, ToName> {
4784
4785 public:
4786 explicit ToName(uint64_t bitfield) : Base(bitfield) {}
4787
4788 // The implementation currently calls runtime.
4792
4793 Input& context() { return Node::input(0); }
4795
4796 int MaxCallStackArgs() const;
4799 void PrintParams(std::ostream&, MaglevGraphLabeller*) const {}
4800};
4801
4802class ToNumberOrNumeric : public FixedInputValueNodeT<1, ToNumberOrNumeric> {
4804
4805 public:
4806 explicit ToNumberOrNumeric(uint64_t bitfield, Object::Conversion mode)
4807 : Base(bitfield), mode_(mode) {}
4808
4809 static constexpr OpProperties kProperties =
4811 static constexpr
4813
4815 Object::Conversion mode() const { return mode_; }
4816
4817 int MaxCallStackArgs() const;
4820 void PrintParams(std::ostream&, MaglevGraphLabeller*) const {}
4821
4822 private:
4824};
4825
4826class DeleteProperty : public FixedInputValueNodeT<3, DeleteProperty> {
4828
4829 public:
4830 explicit DeleteProperty(uint64_t bitfield, LanguageMode mode)
4831 : Base(bitfield), mode_(mode) {}
4832
4833 // The implementation currently calls runtime.
4838
4839 Input& context() { return Node::input(0); }
4840 Input& object() { return Node::input(1); }
4841 Input& key() { return Node::input(2); }
4842
4843 LanguageMode mode() const { return mode_; }
4844
4845 int MaxCallStackArgs() const;
4848 void PrintParams(std::ostream&, MaglevGraphLabeller*) const;
4849
4850 private:
4852};
4853
4854class GeneratorStore : public NodeT<GeneratorStore> {
4856
4857 public:
4858 // We assume the context as fixed input.
4859 static constexpr int kContextIndex = 0;
4860 static constexpr int kGeneratorIndex = 1;
4861 static constexpr int kFixedInputCount = 2;
4862
4863 // This ctor is used when for variable input counts.
4864 // Inputs must be initialized manually.
4865 GeneratorStore(uint64_t bitfield, ValueNode* context, ValueNode* generator,
4866 int suspend_id, int bytecode_offset)
4867 : Base(bitfield),
4870 set_input(kContextIndex, context);
4871 set_input(kGeneratorIndex, generator);
4872 }
4873
4877
4878 int suspend_id() const { return suspend_id_; }
4879 int bytecode_offset() const { return bytecode_offset_; }
4880
4881 Input& context_input() { return input(kContextIndex); }
4883
4885 return input_count() - kFixedInputCount;
4886 }
4889 set_input(i + kFixedInputCount, node);
4890 }
4891
4892 int MaxCallStackArgs() const;
4893 void VerifyInputs(MaglevGraphLabeller* graph_labeller) const;
4894
4895#ifdef V8_COMPRESS_POINTERS
4896 void MarkTaggedInputsAsDecompressing() {
4897 // Don't need to decompress to store.
4898 }
4899#endif
4900
4903 void PrintParams(std::ostream&, MaglevGraphLabeller*) const {}
4904
4905 private:
4906 const int suspend_id_;
4908};
4909
4910class TryOnStackReplacement : public FixedInputNodeT<1, TryOnStackReplacement> {
4912
4913 public:
4914 explicit TryOnStackReplacement(uint64_t bitfield, int32_t loop_depth,
4915 FeedbackSlot feedback_slot,
4916 BytecodeOffset osr_offset,
4918 : Base(bitfield),
4919 loop_depth_(loop_depth),
4920 feedback_slot_(feedback_slot),
4921 osr_offset_(osr_offset),
4922 unit_(unit) {}
4923
4924 static constexpr OpProperties kProperties =
4928 static constexpr
4930
4931 Input& closure() { return Node::input(0); }
4932
4933 const MaglevCompilationUnit* unit() const { return unit_; }
4934
4935 int MaxCallStackArgs() const;
4938 void PrintParams(std::ostream&, MaglevGraphLabeller*) const {}
4939
4940 private:
4941 // For OSR.
4942 const int32_t loop_depth_;
4946};
4947
4948class ForInPrepare : public FixedInputValueNodeT<2, ForInPrepare> {
4950
4951 public:
4952 explicit ForInPrepare(uint64_t bitfield, compiler::FeedbackSource& feedback)
4953 : Base(bitfield), feedback_(feedback) {}
4954
4955 static constexpr OpProperties kProperties =
4959
4961
4962 Input& context() { return Node::input(0); }
4963 Input& enumerator() { return Node::input(1); }
4964
4965 int ReturnCount() const { return 2; }
4966
4967 int MaxCallStackArgs() const;
4970 void PrintParams(std::ostream&, MaglevGraphLabeller*) const {}
4971
4972 private:
4974};
4975
5005
5006class GetIterator : public FixedInputValueNodeT<2, GetIterator> {
5008
5009 public:
5010 explicit GetIterator(uint64_t bitfield, int load_slot, int call_slot,
5012 : Base(bitfield),
5015 feedback_(feedback.object()) {}
5016
5020
5021 Input& context() { return input(0); }
5022 Input& receiver() { return input(1); }
5023
5024 int load_slot() const { return load_slot_; }
5025 int call_slot() const { return call_slot_; }
5027
5028 int MaxCallStackArgs() const;
5031 void PrintParams(std::ostream&, MaglevGraphLabeller*) const {}
5032
5033 private:
5034 const int load_slot_;
5035 const int call_slot_;
5037};
5038
5040 : public FixedInputValueNodeT<0, GetSecondReturnedValue> {
5042
5043 public:
5044 // TODO(olivf): This is needed because this instruction accesses the raw
5045 // register content. We should have tuple values instead such that we can
5046 // refer to both returned values properly.
5048 explicit GetSecondReturnedValue(uint64_t bitfield) : Base(bitfield) {}
5049
5052 void PrintParams(std::ostream&, MaglevGraphLabeller*) const {}
5053};
5054
5055class ToObject : public FixedInputValueNodeT<2, ToObject> {
5057
5058 public:
5059 explicit ToObject(uint64_t bitfield, CheckType check_type)
5060 : Base(CheckTypeBitField::update(bitfield, check_type)) {}
5061
5062 // The implementation currently calls runtime.
5066
5067 Input& context() { return Node::input(0); }
5069 CheckType check_type() const { return CheckTypeBitField::decode(bitfield()); }
5070
5071 int MaxCallStackArgs() const;
5074 void PrintParams(std::ostream&, MaglevGraphLabeller*) const {}
5075
5076 private:
5077 using CheckTypeBitField = NextBitField<CheckType, 1>;
5078};
5079
5080class ToString : public FixedInputValueNodeT<2, ToString> {
5082
5083 public:
5085 explicit ToString(uint64_t bitfield, ConversionMode mode)
5086 : Base(ConversionModeBitField::update(bitfield, mode)) {}
5087
5088 // The implementation currently calls runtime.
5092
5093 Input& context() { return Node::input(0); }
5096 return ConversionModeBitField::decode(bitfield());
5097 }
5098
5099 int MaxCallStackArgs() const;
5102 void PrintParams(std::ostream&, MaglevGraphLabeller*) const {}
5103
5104 private:
5105 using ConversionModeBitField = NextBitField<ConversionMode, 1>;
5106};
5107
5108class NumberToString : public FixedInputValueNodeT<1, NumberToString> {
5110
5111 public:
5112 explicit NumberToString(uint64_t bitfield) : Base(bitfield) {}
5113
5117 static constexpr
5119
5121
5122 int MaxCallStackArgs() const { return 0; }
5125 void PrintParams(std::ostream&, MaglevGraphLabeller*) const {}
5126};
5127
5129 : public FixedInputValueNodeT<2, GeneratorRestoreRegister> {
5131
5132 public:
5133 explicit GeneratorRestoreRegister(uint64_t bitfield, int index)
5134 : Base(bitfield), index_(index) {}
5135
5139
5140 Input& array_input() { return input(0); }
5141 Input& stale_input() { return input(1); }
5142 int index() const { return index_; }
5143
5146 void PrintParams(std::ostream&, MaglevGraphLabeller*) const {}
5147
5148 private:
5149 const int index_;
5150};
5151
5152class InitialValue : public FixedInputValueNodeT<0, InitialValue> {
5154
5155 public:
5156 explicit InitialValue(uint64_t bitfield, interpreter::Register source);
5157
5159 uint32_t stack_slot() const;
5160 static uint32_t stack_slot(uint32_t register_idx);
5161
5164 void PrintParams(std::ostream&, MaglevGraphLabeller*) const;
5165
5166 auto options() const { return std::tuple{source()}; }
5167
5168 private:
5170};
5171
5172class RegisterInput : public FixedInputValueNodeT<0, RegisterInput> {
5174
5175 public:
5176 explicit RegisterInput(uint64_t bitfield, Register input)
5177 : Base(bitfield), input_(input) {}
5178
5179 Register input() const { return input_; }
5180
5182
5185 void PrintParams(std::ostream&, MaglevGraphLabeller*) const;
5186
5187 private:
5189};
5190
5191class SmiConstant : public FixedInputValueNodeT<0, SmiConstant> {
5193
5194 public:
5196
5197 explicit SmiConstant(uint64_t bitfield, Tagged<Smi> value)
5198 : Base(bitfield), value_(value) {}
5199
5200 Tagged<Smi> value() const { return value_; }
5201
5202 bool ToBoolean(LocalIsolate* local_isolate) const {
5203 return value_ != Smi::FromInt(0);
5204 }
5205
5208 void PrintParams(std::ostream&, MaglevGraphLabeller*) const;
5209
5212
5213 private:
5215};
5216
5218 : public FixedInputValueNodeT<0, TaggedIndexConstant> {
5220
5221 public:
5223
5224 explicit TaggedIndexConstant(uint64_t bitfield, Tagged<TaggedIndex> value)
5225 : Base(bitfield), value_(value) {}
5226
5228
5229 bool ToBoolean(LocalIsolate* local_isolate) const { UNREACHABLE(); }
5230
5233 void PrintParams(std::ostream&, MaglevGraphLabeller*) const;
5234
5237
5238 private:
5240};
5241
5242class ExternalConstant : public FixedInputValueNodeT<0, ExternalConstant> {
5244
5245 public:
5247
5248 explicit ExternalConstant(uint64_t bitfield,
5250 : Base(bitfield), reference_(reference) {}
5251
5252 static constexpr OpProperties kProperties =
5254
5256
5257 bool ToBoolean(LocalIsolate* local_isolate) const { UNREACHABLE(); }
5258
5261 void PrintParams(std::ostream&, MaglevGraphLabeller*) const;
5262
5265
5266 private:
5268};
5269
5270class Constant : public FixedInputValueNodeT<0, Constant> {
5272
5273 public:
5275
5276 explicit Constant(uint64_t bitfield, compiler::HeapObjectRef object)
5277 : Base(bitfield), object_(object) {}
5278
5279 bool ToBoolean(LocalIsolate* local_isolate) const {
5280 return Object::BooleanValue(*object_.object(), local_isolate);
5281 }
5282
5284 return object_.IsTheHole();
5285 }
5286
5289 void PrintParams(std::ostream&, MaglevGraphLabeller*) const;
5290
5292
5295
5297
5298 private:
5300};
5301
5302class RootConstant : public FixedInputValueNodeT<0, RootConstant> {
5304
5305 public:
5307
5308 explicit RootConstant(uint64_t bitfield, RootIndex index)
5309 : Base(bitfield), index_(index) {}
5310
5311 bool ToBoolean(LocalIsolate* local_isolate) const;
5312
5313 RootIndex index() const { return index_; }
5314
5317 void PrintParams(std::ostream&, MaglevGraphLabeller*) const;
5318
5320 Handle<Object> DoReify(LocalIsolate* isolate) const;
5321
5322 private:
5324};
5325
5326class TrustedConstant : public FixedInputValueNodeT<0, TrustedConstant> {
5328
5329 public:
5331
5332 explicit TrustedConstant(uint64_t bitfield, compiler::HeapObjectRef object,
5334 : Base(bitfield), object_(object), tag_(tag) {}
5335
5337
5338 bool ToBoolean(LocalIsolate* local_isolate) const { UNREACHABLE(); }
5339
5342 void PrintParams(std::ostream&, MaglevGraphLabeller*) const;
5343
5345 IndirectPointerTag tag() const { return tag_; }
5346
5349
5350 private:
5353};
5354
5355class CreateArrayLiteral : public FixedInputValueNodeT<0, CreateArrayLiteral> {
5357
5358 public:
5359 explicit CreateArrayLiteral(uint64_t bitfield,
5361 const compiler::FeedbackSource& feedback,
5362 int flags)
5363 : Base(bitfield),
5365 feedback_(feedback),
5366 flags_(flags) {}
5367
5370 int flags() const { return flags_; }
5371
5372 // The implementation currently calls runtime.
5373 static constexpr OpProperties kProperties =
5377
5378 int MaxCallStackArgs() const;
5381 void PrintParams(std::ostream&, MaglevGraphLabeller*) const {}
5382
5383 private:
5386 const int flags_;
5387};
5388
5390 : public FixedInputValueNodeT<0, CreateShallowArrayLiteral> {
5392
5393 public:
5394 explicit CreateShallowArrayLiteral(uint64_t bitfield,
5396 const compiler::FeedbackSource& feedback,
5397 int flags)
5398 : Base(bitfield),
5400 feedback_(feedback),
5401 flags_(flags) {}
5402
5405 int flags() const { return flags_; }
5406
5407 // The implementation currently calls runtime.
5408 static constexpr OpProperties kProperties =
5410
5411 int MaxCallStackArgs() const;
5414 void PrintParams(std::ostream&, MaglevGraphLabeller*) const {}
5415
5416 private:
5419 const int flags_;
5420};
5421
5423 : public FixedInputValueNodeT<0, CreateObjectLiteral> {
5425
5426 public:
5428 uint64_t bitfield,
5430 const compiler::FeedbackSource& feedback, int flags)
5431 : Base(bitfield),
5433 feedback_(feedback),
5434 flags_(flags) {}
5435
5440 int flags() const { return flags_; }
5441
5442 // The implementation currently calls runtime.
5443 static constexpr OpProperties kProperties =
5447
5448 int MaxCallStackArgs() const;
5451 void PrintParams(std::ostream&, MaglevGraphLabeller*) const {}
5452
5453 private:
5456 const int flags_;
5457};
5458
5460 : public FixedInputValueNodeT<0, CreateShallowObjectLiteral> {
5462
5463 public:
5465 uint64_t bitfield,
5467 const compiler::FeedbackSource& feedback, int flags)
5468 : Base(bitfield),
5470 feedback_(feedback),
5471 flags_(flags) {}
5472
5473 // TODO(victorgomes): We should not need a boilerplate descriptor in
5474 // CreateShallowObjectLiteral.
5479 int flags() const { return flags_; }
5480
5481 // The implementation currently calls runtime.
5482 static constexpr OpProperties kProperties =
5484
5485 int MaxCallStackArgs() const;
5488 void PrintParams(std::ostream&, MaglevGraphLabeller*) const {}
5489
5490 private:
5493 const int flags_;
5494};
5495
5496// VirtualObject is a ValueNode only for convenience, it should never be added
5497// to the Maglev graph.
5498class VirtualObject : public FixedInputValueNodeT<0, VirtualObject> {
5500
5501 public:
5510
5511 friend std::ostream& operator<<(std::ostream& out, Type type) {
5512 switch (type) {
5513 case kDefault:
5514 out << "object";
5515 break;
5516 case kHeapNumber:
5517 out << "number";
5518 break;
5519 case kFixedDoubleArray:
5520 out << "double[]";
5521 break;
5522 case kConsString:
5523 out << "ConsString";
5524 break;
5525 }
5526 return out;
5527 }
5528
5530 ValueNode* first() const { return data[0]; }
5531 ValueNode* second() const { return data[1]; }
5532 // Length and map are stored for constant folding but not actually part of
5533 // the virtual object as they are not needed to materialize the cons string.
5536 std::array<ValueNode*, 2> data;
5537 };
5538
5539 explicit VirtualObject(uint64_t bitfield, int id,
5541 : Base(bitfield), id_(id), type_(kConsString), cons_string_(cons_string) {
5543 }
5544
5545 explicit VirtualObject(uint64_t bitfield, compiler::MapRef map, int id,
5546 uint32_t slot_count, ValueNode** slots)
5547 : Base(bitfield),
5548 map_(map),
5549 id_(id),
5550 type_(kDefault),
5551 slots_({slot_count, slots}) {
5553 }
5554
5555 explicit VirtualObject(uint64_t bitfield, compiler::MapRef map, int id,
5556 Float64 number)
5557 : Base(bitfield),
5558 map_(map),
5559 id_(id),
5561 number_(number) {
5563 }
5564
5565 explicit VirtualObject(uint64_t bitfield, compiler::MapRef map, int id,
5566 uint32_t length,
5568 : Base(bitfield),
5569 map_(map),
5570 id_(id),
5572 double_array_({length, elements}) {
5574 }
5575
5578 void PrintParams(std::ostream&, MaglevGraphLabeller*) const;
5579
5580 constexpr bool has_static_map() const {
5581 switch (type_) {
5582 case kDefault:
5583 case kHeapNumber:
5584 case kFixedDoubleArray:
5585 return true;
5586 case kConsString:
5587 return false;
5588 }
5589 }
5590
5593 return *map_;
5594 }
5595 Type type() const { return type_; }
5596 uint32_t id() const { return id_; }
5597
5598 size_t size() const {
5599 switch (type_) {
5600 case kDefault:
5601 return (slot_count() + 1) * kTaggedSize;
5602 case kConsString:
5603 return sizeof(ConsString);
5604 case kHeapNumber:
5605 return sizeof(HeapNumber);
5606 case kFixedDoubleArray:
5608 }
5609 }
5610
5611 Float64 number() const {
5613 return number_;
5614 }
5615
5616 uint32_t double_elements_length() const {
5618 return double_array_.length;
5619 }
5620
5625
5626 ValueNode* get(uint32_t offset) const {
5627 DCHECK_NE(offset, 0); // Don't try to get the map through this getter.
5631 return slots_.data[offset / kTaggedSize];
5632 }
5633
5634 void set(uint32_t offset, ValueNode* value) {
5635 DCHECK_NE(offset, 0); // Don't try to set the map through this setter.
5637 DCHECK(!IsSnapshot());
5638 // Values set here can leak to the interpreter frame state. Conversions
5639 // should be stored in known_node_aspects/NodeInfo.
5640 DCHECK(!value->properties().is_conversion());
5644 }
5645
5648 return cons_string_.length;
5649 }
5650
5653 return cons_string_;
5654 }
5655
5656 void ClearSlots(int last_init_slot, ValueNode* clear_value) {
5658 int last_init_index = last_init_slot / kTaggedSize;
5659 for (uint32_t i = last_init_index; i < slot_count(); i++) {
5660 slots_.data[i] = clear_value;
5661 }
5662 }
5663
5667 }
5668
5669 bool compatible_for_merge(const VirtualObject* other) const {
5670 if (type_ != other->type_) return false;
5671 if (allocation_ != other->allocation_) return false;
5672 // Currently, the graph builder will never change the VO map.
5673 if (has_static_map()) {
5674 if (map() != other->map()) return false;
5675 }
5676 switch (other->type_) {
5677 case kHeapNumber:
5678 case kFixedDoubleArray:
5679 case kConsString:
5680 return true;
5681 case kDefault:
5682 return slot_count() == other->slot_count();
5683 }
5684 }
5685
5686 // VOs are snapshotted at branch points and when they are leaked to
5687 // DeoptInfos. This is because the snapshots need to preserve the original
5688 // values at the time of branching or deoptimization. While a VO is not yet
5689 // snapshotted, it can be modified freely.
5690 bool IsSnapshot() const { return snapshotted_; }
5691 void Snapshot() { snapshotted_ = true; }
5692
5693 template <typename Function>
5695 switch (type_) {
5696 case kDefault:
5697 for (uint32_t i = 0; i < slot_count(); i++) {
5699 }
5700 break;
5701 case kConsString:
5702 for (ValueNode*& val : cons_string_.data) {
5703 callback(val);
5704 }
5705 break;
5706 case kHeapNumber:
5707 break;
5708 case kFixedDoubleArray:
5709 break;
5710 }
5711 }
5712
5713 template <typename Function>
5714 inline void ForEachInput(Function&& callback) const {
5715 switch (type_) {
5716 case kDefault:
5717 for (uint32_t i = 0; i < slot_count(); i++) {
5719 }
5720 break;
5721 case kConsString:
5722 for (ValueNode* val : cons_string_.data) {
5723 callback(val);
5724 }
5725 break;
5726 case kHeapNumber:
5727 break;
5728 case kFixedDoubleArray:
5729 break;
5730 }
5731 }
5732
5733 // A runtime input is an input to the virtual object that has runtime
5734 // footprint, aka, a location.
5735 template <typename Function>
5736 inline void ForEachNestedRuntimeInput(VirtualObjectList virtual_objects,
5737 Function&& f);
5738 template <typename Function>
5739 inline void ForEachNestedRuntimeInput(VirtualObjectList virtual_objects,
5740 Function&& f) const;
5741
5742 template <typename Function>
5743 inline std::optional<VirtualObject*> Merge(const VirtualObject* other,
5744 uint32_t new_object_id, Zone* zone,
5745 Function MergeValue) const {
5746 VirtualObject* result = Clone(new_object_id, zone, /* empty_clone */ true);
5748 switch (type_) {
5749 // These objects are immutable and thus should never need merging.
5750 case kHeapNumber:
5751 case kFixedDoubleArray:
5752 case kConsString:
5753 UNREACHABLE();
5754 case kDefault: {
5755 for (uint32_t i = 0; i < slot_count(); i++) {
5756 if (auto success =
5757 MergeValue(get_by_index(i), other->get_by_index(i))) {
5758 result->set_by_index(i, *success);
5759 } else {
5760 return {};
5761 }
5762 }
5763 break;
5764 }
5765 }
5766 return result;
5767 }
5768
5769 VirtualObject* Clone(uint32_t new_object_id, Zone* zone,
5770 bool empty_clone = false) const {
5772 switch (type_) {
5773 case kHeapNumber:
5774 case kFixedDoubleArray:
5775 case kConsString:
5776 UNREACHABLE();
5777 case kDefault: {
5778 ValueNode** slots = zone->AllocateArray<ValueNode*>(slot_count());
5779 result = NodeBase::New<VirtualObject>(zone, 0, map(), new_object_id,
5780 slot_count(), slots);
5781 break;
5782 }
5783 }
5784 if (empty_clone) return result;
5785
5786 // Copy content
5787 switch (type_) {
5788 case kHeapNumber:
5789 case kFixedDoubleArray:
5790 case kConsString:
5791 UNREACHABLE();
5792 case kDefault: {
5793 for (uint32_t i = 0; i < slot_count(); i++) {
5794 result->set_by_index(i, get_by_index(i));
5795 }
5796 break;
5797 }
5798 }
5800 return result;
5801 }
5802
5803 uint32_t slot_count() const {
5805 return slots_.count;
5806 }
5807
5808 private:
5809 ValueNode* get_by_index(uint32_t i) const {
5811 return slots_.data[i];
5812 }
5813
5814 void set_by_index(uint32_t i, ValueNode* value) {
5816 // Values set here can leak to the interpreter. Conversions should be stored
5817 // in known_node_aspects/NodeInfo.
5818 DCHECK(!value->properties().is_conversion());
5819 slots_.data[i] = value;
5820 }
5821
5827 uint32_t count; // Does not count the map.
5828 ValueNode** data; // Does not contain the map.
5829 };
5830
5831 compiler::OptionalMapRef map_;
5832 const int id_;
5833 Type type_; // We need to cache the type. We cannot do map comparison in some
5834 // parts of the pipeline, because we would need to dereference a
5835 // handle.
5836 bool snapshotted_ = false; // Object should not be modified anymore.
5837 union {
5842 };
5843 mutable InlinedAllocation* allocation_ = nullptr;
5844
5847};
5848
5850 public:
5851 VirtualObjectList() : head_(nullptr) {}
5852
5853 class Iterator final {
5854 public:
5855 explicit Iterator(VirtualObject* entry) : entry_(entry) {}
5856
5858 entry_ = entry_->next_;
5859 return *this;
5860 }
5861 bool operator==(const Iterator& other) const {
5862 return entry_ == other.entry_;
5863 }
5864 bool operator!=(const Iterator& other) const {
5865 return entry_ != other.entry_;
5866 }
5869
5870 private:
5872 };
5873
5874 bool operator==(const VirtualObjectList& other) const {
5875 return head_ == other.head_;
5876 }
5877
5878 void Add(VirtualObject* object) {
5879 DCHECK_NOT_NULL(object);
5880 DCHECK_NULL(object->next_);
5881 object->next_ = head_;
5882 head_ = object;
5883 }
5884
5885 bool is_empty() const { return head_ == nullptr; }
5886
5888 VirtualObject* result = nullptr;
5889 for (VirtualObject* vo : *this) {
5890 if (vo->allocation() == allocation) {
5891 result = vo;
5892 break;
5893 }
5894 }
5895 return result;
5896 }
5897
5898 void Print(std::ostream& os, const char* prefix,
5899 MaglevGraphLabeller* labeller) const;
5900
5901 // It iterates both list in reverse other of ids until a common point.
5902 template <typename Function>
5904 const VirtualObjectList& list2,
5905 Function&& f) {
5906 VirtualObject* vo1 = list1.head_;
5907 VirtualObject* vo2 = list2.head_;
5908 while (vo1 != nullptr && vo2 != nullptr && vo1 != vo2) {
5909 DCHECK_NE(vo1->id(), vo2->id());
5910 if (vo1->id() > vo2->id()) {
5911 f(vo1, list1);
5912 vo1 = vo1->next_;
5913 } else {
5914 f(vo2, list2);
5915 vo2 = vo2->next_;
5916 }
5917 }
5918 if (vo1 == vo2) return vo1;
5919 return nullptr;
5920 }
5921
5922 void Snapshot() const {
5923 for (VirtualObject* vo : *this) {
5924 if (vo->IsSnapshot()) {
5925 // Stop processing once a snapshotted object is found, as all remaining
5926 // objects must be snapshotted.
5927 break;
5928 }
5929 vo->Snapshot();
5930 }
5932 }
5933
5934 bool IsSnapshot() const {
5935 for (VirtualObject* vo : *this) {
5936 if (!vo->IsSnapshot()) return false;
5937 }
5938 return true;
5939 }
5940
5941 Iterator begin() const { return Iterator(head_); }
5942 Iterator end() const { return Iterator(nullptr); }
5943
5944 private:
5946};
5947
5949 kUnknown,
5950 kElided,
5951 kEscaped,
5952};
5953
5954class InlinedAllocation : public FixedInputValueNodeT<1, InlinedAllocation> {
5956
5957 public:
5959
5960 explicit InlinedAllocation(uint64_t bitfield, VirtualObject* object)
5961 : Base(bitfield),
5962 object_(object),
5964
5965 Input& allocation_block_input() { return input(0); }
5967
5969 static constexpr
5971
5974 void PrintParams(std::ostream&, MaglevGraphLabeller*) const;
5975
5976 void VerifyInputs(MaglevGraphLabeller* graph_labeller) const;
5977
5978 size_t size() const { return object_->size(); }
5979
5980 VirtualObject* object() const { return object_; }
5981
5982 int offset() const {
5983 DCHECK_NE(offset_, -1);
5984 return offset_;
5985 }
5987
5989
5990 void AddNonEscapingUses(int n = 1) {
5993 }
5994 bool IsEscaping() const {
5996 return use_count_ > non_escaping_use_count_;
5997 }
6002
6007 void SetEscaped() {
6008 // We allow transitions from elided to escaped.
6011 }
6023
6025 DCHECK_EQ(this, object->allocation());
6026 object_ = object;
6027 }
6028
6029#ifdef DEBUG
6030 void set_is_returned_value_from_inline_call() {
6031 is_returned_value_from_inline_call_ = true;
6032 }
6033
6034 bool is_returned_value_from_inline_call() const {
6035 return is_returned_value_from_inline_call_;
6036 }
6037#endif // DEBUG
6038
6039 private:
6043 int offset_ = -1; // Set by AllocationBlock.
6044
6045#ifdef DEBUG
6046 bool is_returned_value_from_inline_call_ = false;
6047#endif // DEBUG
6048
6051
6052 friend List;
6054};
6055
6056template <typename Function>
6058 VirtualObjectList virtual_objects, Function&& f) {
6059 ForEachInput([&](ValueNode*& value) {
6060 if (value->Is<Identity>()) {
6061 value = value->input(0).node();
6062 }
6063 if (IsConstantNode(value->opcode())) {
6064 // No location assigned to constants.
6065 return;
6066 }
6067 // Special nodes.
6068 switch (value->opcode()) {
6069 case Opcode::kArgumentsElements:
6070 case Opcode::kArgumentsLength:
6071 case Opcode::kRestLength:
6072 // No location assigned to these opcodes.
6073 break;
6074 case Opcode::kVirtualObject:
6075 UNREACHABLE();
6076 case Opcode::kInlinedAllocation: {
6077 InlinedAllocation* alloc = value->Cast<InlinedAllocation>();
6078 VirtualObject* inner_vobject = virtual_objects.FindAllocatedWith(alloc);
6079 // Check if it has escaped.
6080 if (inner_vobject &&
6081 (!alloc->HasBeenAnalysed() || alloc->HasBeenElided())) {
6082 inner_vobject->ForEachNestedRuntimeInput(virtual_objects, f);
6083 } else {
6084 f(value);
6085 }
6086 break;
6087 }
6088 default:
6089 f(value);
6090 break;
6091 }
6092 });
6093}
6094
6095template <typename Function>
6097 VirtualObjectList virtual_objects, Function&& f) const {
6098 ForEachInput([&](ValueNode* value) {
6099 if (value->Is<Identity>()) {
6100 value = value->input(0).node();
6101 }
6102 if (IsConstantNode(value->opcode())) {
6103 // No location assigned to constants.
6104 return;
6105 }
6106 // Special nodes.
6107 switch (value->opcode()) {
6108 case Opcode::kArgumentsElements:
6109 case Opcode::kArgumentsLength:
6110 case Opcode::kRestLength:
6111 // No location assigned to these opcodes.
6112 break;
6113 case Opcode::kVirtualObject:
6114 UNREACHABLE();
6115 case Opcode::kInlinedAllocation: {
6116 InlinedAllocation* alloc = value->Cast<InlinedAllocation>();
6117 VirtualObject* inner_vobject = virtual_objects.FindAllocatedWith(alloc);
6118 // Check if it has escaped.
6119 if (inner_vobject &&
6120 (!alloc->HasBeenAnalysed() || alloc->HasBeenElided())) {
6121 inner_vobject->ForEachNestedRuntimeInput(virtual_objects, f);
6122 } else {
6123 f(value);
6124 }
6125 break;
6126 }
6127 default:
6128 f(value);
6129 break;
6130 }
6131 });
6132}
6133
6176
6177class ArgumentsLength : public FixedInputValueNodeT<0, ArgumentsLength> {
6179
6180 public:
6181 explicit ArgumentsLength(uint64_t bitfield) : Base(bitfield) {}
6182
6184
6187 void PrintParams(std::ostream&, MaglevGraphLabeller*) const {}
6188};
6189
6190class RestLength : public FixedInputValueNodeT<0, RestLength> {
6192
6193 public:
6194 explicit RestLength(uint64_t bitfield, int formal_parameter_count)
6196
6199 void PrintParams(std::ostream&, MaglevGraphLabeller*) const {}
6200
6202
6203 auto options() const { return std::tuple{formal_parameter_count_}; }
6204
6205 private:
6207};
6208
6209class ArgumentsElements : public FixedInputValueNodeT<1, ArgumentsElements> {
6211
6212 public:
6213 explicit ArgumentsElements(uint64_t bitfield, CreateArgumentsType type,
6215 : Base(bitfield),
6216 type_(type),
6218
6222
6223 static constexpr
6225
6226 Input& arguments_count_input() { return input(0); }
6227
6228 int MaxCallStackArgs() const { return 0; }
6231 void PrintParams(std::ostream&, MaglevGraphLabeller*) const {}
6232
6233 CreateArgumentsType type() const { return type_; }
6235
6236 private:
6239};
6240
6241// TODO(victorgomes): This node is currently not eliminated by the escape
6242// analysis.
6244 : public FixedInputValueNodeT<1, AllocateElementsArray> {
6246
6247 public:
6248 explicit AllocateElementsArray(uint64_t bitfield,
6250 : Base(bitfield), allocation_type_(allocation_type) {}
6251
6252 static constexpr OpProperties kProperties =
6255
6256 Input& length_input() { return input(0); }
6257
6258 static constexpr
6260
6261 int MaxCallStackArgs() const { return 0; }
6264 void PrintParams(std::ostream&, MaglevGraphLabeller*) const {}
6265
6267
6268 private:
6270};
6271
6273 : public FixedInputValueNodeT<1, CreateFunctionContext> {
6275
6276 public:
6277 explicit CreateFunctionContext(uint64_t bitfield,
6280 : Base(bitfield),
6284
6286 uint32_t slot_count() const { return slot_count_; }
6288
6289 Input& context() { return input(0); }
6290
6291 // The implementation currently calls runtime.
6292 static constexpr OpProperties kProperties =
6295 static constexpr
6297
6298 int MaxCallStackArgs() const;
6301 void PrintParams(std::ostream&, MaglevGraphLabeller*) const;
6302
6303 private:
6305 const uint32_t slot_count_;
6307};
6308
6343
6345 : public FixedInputValueNodeT<0, CreateRegExpLiteral> {
6347
6348 public:
6350 const compiler::FeedbackSource& feedback,
6351 int flags)
6352 : Base(bitfield), pattern_(pattern), feedback_(feedback), flags_(flags) {}
6353
6356 int flags() const { return flags_; }
6357
6358 // The implementation currently calls runtime.
6359 static constexpr OpProperties kProperties =
6362
6363 int MaxCallStackArgs() const;
6366 void PrintParams(std::ostream&, MaglevGraphLabeller*) const {}
6367
6368 private:
6371 const int flags_;
6372};
6373
6412
6413#define ASSERT_CONDITION(V) \
6414 V(Equal) \
6415 V(NotEqual) \
6416 V(LessThan) \
6417 V(LessThanEqual) \
6418 V(GreaterThan) \
6419 V(GreaterThanEqual) \
6420 V(UnsignedLessThan) \
6421 V(UnsignedLessThanEqual) \
6422 V(UnsignedGreaterThan) \
6423 V(UnsignedGreaterThanEqual)
6424
6426#define D(Name) k##Name,
6428#undef D
6429};
6430static constexpr int kNumAssertConditions =
6431#define D(Name) +1
6433#undef D
6434
6435inline std::ostream& operator<<(std::ostream& os, const AssertCondition cond) {
6436 switch (cond) {
6437#define CASE(Name) \
6438 case AssertCondition::k##Name: \
6439 os << #Name; \
6440 break;
6442#undef CASE
6443 }
6444 return os;
6445}
6446
6447class AssertInt32 : public FixedInputNodeT<2, AssertInt32> {
6449
6450 public:
6451 explicit AssertInt32(uint64_t bitfield, AssertCondition condition,
6453 : Base(bitfield), condition_(condition), reason_(reason) {}
6454
6457
6458 Input& left_input() { return input(0); }
6459 Input& right_input() { return input(1); }
6460
6463 void PrintParams(std::ostream&, MaglevGraphLabeller*) const;
6464
6465 auto options() const { return std::tuple{condition_, reason_}; }
6466
6468 AbortReason reason() const { return reason_; }
6469
6470 private:
6473};
6474
6475class CheckMaps : public FixedInputNodeT<1, CheckMaps> {
6477
6478 public:
6479 explicit CheckMaps(uint64_t bitfield, const compiler::ZoneRefSet<Map>& maps,
6481 : Base(CheckTypeBitField::update(bitfield, check_type)), maps_(maps) {}
6482 explicit CheckMaps(uint64_t bitfield,
6484 CheckType check_type, Zone* zone)
6485 : Base(CheckTypeBitField::update(bitfield, check_type)),
6486 maps_(maps.begin(), maps.end(), zone) {}
6487
6488 static constexpr OpProperties kProperties =
6490 static constexpr
6492
6493 const compiler::ZoneRefSet<Map>& maps() const { return maps_; }
6494 CheckType check_type() const { return CheckTypeBitField::decode(bitfield()); }
6495
6496 static constexpr int kReceiverIndex = 0;
6498
6501 void PrintParams(std::ostream&, MaglevGraphLabeller*) const;
6502
6503 auto options() const { return std::tuple{maps_, check_type()}; }
6504
6505 private:
6506 using CheckTypeBitField = NextBitField<CheckType, 1>;
6508};
6509
6511 : public FixedInputNodeT<1, CheckMapsWithMigrationAndDeopt> {
6513
6514 public:
6515 explicit CheckMapsWithMigrationAndDeopt(uint64_t bitfield,
6516 const compiler::ZoneRefSet<Map>& maps,
6518 : Base(CheckTypeBitField::update(bitfield, check_type)), maps_(maps) {}
6520 uint64_t bitfield, base::Vector<const compiler::MapRef> maps,
6521 CheckType check_type, Zone* zone)
6522 : Base(CheckTypeBitField::update(bitfield, check_type)),
6523 maps_(maps.begin(), maps.end(), zone) {}
6524
6525 static constexpr OpProperties kProperties =
6529
6530 static constexpr
6532
6533 const compiler::ZoneRefSet<Map>& maps() const { return maps_; }
6534 CheckType check_type() const { return CheckTypeBitField::decode(bitfield()); }
6535
6536 static constexpr int kReceiverIndex = 0;
6538
6539 int MaxCallStackArgs() const;
6542 void PrintParams(std::ostream&, MaglevGraphLabeller*) const;
6543
6544 auto options() const { return std::tuple{maps_, check_type()}; }
6545
6546 private:
6547 using CheckTypeBitField = NextBitField<CheckType, 1>;
6549};
6550
6552 : public FixedInputNodeT<2, CheckMapsWithAlreadyLoadedMap> {
6554
6555 public:
6556 explicit CheckMapsWithAlreadyLoadedMap(uint64_t bitfield,
6557 const compiler::ZoneRefSet<Map>& maps)
6558 : Base(bitfield), maps_(maps) {}
6560 uint64_t bitfield, base::Vector<const compiler::MapRef> maps, Zone* zone)
6561 : Base(bitfield), maps_(maps.begin(), maps.end(), zone) {}
6562
6563 static constexpr OpProperties kProperties =
6567
6568 const compiler::ZoneRefSet<Map>& maps() const { return maps_; }
6569
6570 Input& object_input() { return input(0); }
6571 Input& map_input() { return input(1); }
6572
6575 void PrintParams(std::ostream&, MaglevGraphLabeller*) const;
6576
6577 auto options() const { return std::tuple{maps_}; }
6578
6579 private:
6581};
6582
6583class CheckValue : public FixedInputNodeT<1, CheckValue> {
6585
6586 public:
6587 explicit CheckValue(uint64_t bitfield, const compiler::HeapObjectRef value,
6588 DeoptimizeReason reason)
6589 : Base(bitfield | ReasonField::encode(reason)), value_(value) {}
6590
6592 static constexpr
6594
6596
6597 static constexpr int kTargetIndex = 0;
6598 Input& target_input() { return input(kTargetIndex); }
6599
6600#ifdef V8_COMPRESS_POINTERS
6601 void MarkTaggedInputsAsDecompressing() {
6602 // Don't need to decompress to compare reference equality.
6603 }
6604#endif
6605
6608 void PrintParams(std::ostream&, MaglevGraphLabeller*) const;
6609
6610 auto options() const { return std::tuple{value_, deoptimize_reason()}; }
6611
6613
6614 private:
6616};
6617
6618class CheckValueEqualsInt32 : public FixedInputNodeT<1, CheckValueEqualsInt32> {
6620
6621 public:
6622 explicit CheckValueEqualsInt32(uint64_t bitfield, int32_t value,
6623 DeoptimizeReason reason)
6624 : Base(bitfield | ReasonField::encode(reason)), value_(value) {}
6625
6627 static constexpr
6629
6630 int32_t value() const { return value_; }
6631
6632 static constexpr int kTargetIndex = 0;
6633 Input& target_input() { return input(kTargetIndex); }
6634
6637 void PrintParams(std::ostream&, MaglevGraphLabeller*) const;
6638
6639 auto options() const { return std::tuple{value_, deoptimize_reason()}; }
6640
6642
6643 private:
6644 const int32_t value_;
6645};
6646
6647class CheckFloat64SameValue : public FixedInputNodeT<1, CheckFloat64SameValue> {
6649
6650 public:
6651 explicit CheckFloat64SameValue(uint64_t bitfield, Float64 value,
6652 DeoptimizeReason reason)
6653 : Base(bitfield | ReasonField::encode(reason)), value_(value) {}
6654
6656 static constexpr
6658
6659 Float64 value() const { return value_; }
6660
6661 static constexpr int kTargetIndex = 0;
6662 Input& target_input() { return input(kTargetIndex); }
6663
6666 void PrintParams(std::ostream&, MaglevGraphLabeller*) const;
6667
6668 auto options() const { return std::tuple{value_, deoptimize_reason()}; }
6669
6671
6672 private:
6674};
6675
6677 : public FixedInputNodeT<1, CheckValueEqualsString> {
6679
6680 public:
6681 explicit CheckValueEqualsString(uint64_t bitfield,
6683 DeoptimizeReason reason)
6684 : Base(bitfield | ReasonField::encode(reason)), value_(value) {}
6685
6686 // Can allocate if strings are flattened for comparison.
6690 static constexpr
6692
6694
6695 static constexpr int kTargetIndex = 0;
6696 Input& target_input() { return input(kTargetIndex); }
6697
6698 int MaxCallStackArgs() const { return 0; }
6701 void PrintParams(std::ostream&, MaglevGraphLabeller*) const;
6702
6703 auto options() const { return std::tuple{value_, deoptimize_reason()}; }
6704
6706
6707 private:
6709};
6710
6711class CheckDynamicValue : public FixedInputNodeT<2, CheckDynamicValue> {
6713
6714 public:
6715 explicit CheckDynamicValue(uint64_t bitfield, DeoptimizeReason reason)
6716 : Base(bitfield | ReasonField::encode(reason)) {}
6717
6721
6722 static constexpr int kFirstIndex = 0;
6723 static constexpr int kSecondIndex = 1;
6724 Input& first_input() { return input(kFirstIndex); }
6725 Input& second_input() { return input(kSecondIndex); }
6726
6727#ifdef V8_COMPRESS_POINTERS
6728 void MarkTaggedInputsAsDecompressing() {
6729 // Don't need to decompress to compare reference equality.
6730 }
6731#endif
6732
6735 void PrintParams(std::ostream&, MaglevGraphLabeller*) const;
6736
6737 auto options() const { return std::tuple{deoptimize_reason()}; }
6738
6740};
6741
6742class CheckSmi : public FixedInputNodeT<1, CheckSmi> {
6744
6745 public:
6746 explicit CheckSmi(uint64_t bitfield) : Base(bitfield) {}
6747
6749 static constexpr
6751
6752 static constexpr int kReceiverIndex = 0;
6754
6755 using Node::set_input;
6756
6757#ifdef V8_COMPRESS_POINTERS
6758 void MarkTaggedInputsAsDecompressing() {
6759 // Don't need to decompress to check Smi bits.
6760 }
6761#endif
6762
6765 void PrintParams(std::ostream&, MaglevGraphLabeller*) const {}
6766};
6767
6768class CheckNumber : public FixedInputNodeT<1, CheckNumber> {
6770
6771 public:
6772 explicit CheckNumber(uint64_t bitfield, Object::Conversion mode)
6773 : Base(bitfield), mode_(mode) {}
6774
6776 static constexpr
6778
6779 static constexpr int kReceiverIndex = 0;
6781 Object::Conversion mode() const { return mode_; }
6782
6785 void PrintParams(std::ostream&, MaglevGraphLabeller*) const {}
6786
6787 auto options() const { return std::tuple{mode_}; }
6788
6789 private:
6791};
6792
6793class CheckHeapObject : public FixedInputNodeT<1, CheckHeapObject> {
6795
6796 public:
6797 explicit CheckHeapObject(uint64_t bitfield) : Base(bitfield) {}
6798
6800 static constexpr
6802
6803 static constexpr int kReceiverIndex = 0;
6805
6806#ifdef V8_COMPRESS_POINTERS
6807 void MarkTaggedInputsAsDecompressing() {
6808 // Don't need to decompress to check Smi bits.
6809 }
6810#endif
6811
6814 void PrintParams(std::ostream&, MaglevGraphLabeller*) const {}
6815};
6816
6817class CheckSymbol : public FixedInputNodeT<1, CheckSymbol> {
6819
6820 public:
6821 explicit CheckSymbol(uint64_t bitfield, CheckType check_type)
6822 : Base(CheckTypeBitField::update(bitfield, check_type)) {}
6823
6825 static constexpr
6827
6828 static constexpr int kReceiverIndex = 0;
6830 CheckType check_type() const { return CheckTypeBitField::decode(bitfield()); }
6831
6834 void PrintParams(std::ostream&, MaglevGraphLabeller*) const {}
6835
6836 auto options() const { return std::tuple{check_type()}; }
6837
6838 private:
6839 using CheckTypeBitField = NextBitField<CheckType, 1>;
6840};
6841
6842class CheckInstanceType : public FixedInputNodeT<1, CheckInstanceType> {
6844
6845 public:
6854
6856 static constexpr
6858
6859 static constexpr int kReceiverIndex = 0;
6861
6862 CheckType check_type() const { return CheckTypeBitField::decode(bitfield()); }
6863
6866 void PrintParams(std::ostream&, MaglevGraphLabeller*) const;
6867
6868 auto options() const {
6870 }
6871
6874
6875 private:
6876 using CheckTypeBitField = NextBitField<CheckType, 1>;
6879};
6880
6881class CheckString : public FixedInputNodeT<1, CheckString> {
6883
6884 public:
6885 explicit CheckString(uint64_t bitfield, CheckType check_type)
6886 : Base(CheckTypeBitField::update(bitfield, check_type)) {}
6887
6889 static constexpr
6891
6892 static constexpr int kReceiverIndex = 0;
6894 CheckType check_type() const { return CheckTypeBitField::decode(bitfield()); }
6895
6898 void PrintParams(std::ostream&, MaglevGraphLabeller*) const {}
6899
6900 auto options() const { return std::tuple{check_type()}; }
6901
6902 private:
6903 using CheckTypeBitField = NextBitField<CheckType, 1>;
6904};
6905
6907 : public FixedInputNodeT<1, CheckStringOrStringWrapper> {
6909
6910 public:
6912 : Base(CheckTypeBitField::update(bitfield, check_type)) {}
6913
6915 static constexpr
6917
6918 static constexpr int kReceiverIndex = 0;
6920 CheckType check_type() const { return CheckTypeBitField::decode(bitfield()); }
6921
6924 void PrintParams(std::ostream&, MaglevGraphLabeller*) const {}
6925
6926 auto options() const { return std::tuple{check_type()}; }
6927
6928 private:
6929 using CheckTypeBitField = NextBitField<CheckType, 1>;
6930};
6931
6933 : public FixedInputNodeT<1, CheckDetectableCallable> {
6935
6936 public:
6937 explicit CheckDetectableCallable(uint64_t bitfield, CheckType check_type)
6938 : Base(CheckTypeBitField::update(bitfield, check_type)) {}
6939
6941 static constexpr
6943
6944 static constexpr int kReceiverIndex = 0;
6946 CheckType check_type() const { return CheckTypeBitField::decode(bitfield()); }
6947
6950 void PrintParams(std::ostream& out, MaglevGraphLabeller*) const {}
6951
6952 auto options() const { return std::tuple{check_type()}; }
6953
6954 private:
6955 using CheckTypeBitField = NextBitField<CheckType, 1>;
6956};
6957
6959 : public FixedInputNodeT<1, CheckMapsWithMigration> {
6961
6962 public:
6963 explicit CheckMapsWithMigration(uint64_t bitfield,
6964 const compiler::ZoneRefSet<Map>& maps,
6966 : Base(CheckTypeBitField::update(bitfield, check_type)), maps_(maps) {}
6967
6968 static constexpr OpProperties kProperties =
6972 static constexpr
6974
6975 const compiler::ZoneRefSet<Map>& maps() const { return maps_; }
6976
6977 static constexpr int kReceiverIndex = 0;
6979 CheckType check_type() const { return CheckTypeBitField::decode(bitfield()); }
6980
6981 int MaxCallStackArgs() const;
6984 void PrintParams(std::ostream&, MaglevGraphLabeller*) const;
6985
6986 void ClearUnstableNodeAspects(KnownNodeAspects& known_node_aspects);
6987
6988 private:
6989 using CheckTypeBitField = NextBitField<CheckType, 1>;
6991};
6992
6993class MigrateMapIfNeeded : public FixedInputValueNodeT<2, MigrateMapIfNeeded> {
6995
6996 public:
6997 explicit MigrateMapIfNeeded(uint64_t bitfield) : Base(bitfield) {}
6998
6999 static constexpr OpProperties kProperties =
7003
7006
7007 static constexpr int kMapIndex = 0;
7008 static constexpr int kObjectIndex = 1;
7009
7010 Input& object_input() { return input(kObjectIndex); }
7011 Input& map_input() { return input(kMapIndex); }
7012
7013 int MaxCallStackArgs() const;
7016 void PrintParams(std::ostream&, MaglevGraphLabeller*) const {}
7017
7018 void ClearUnstableNodeAspects(KnownNodeAspects& known_node_aspects);
7019};
7020
7022 : public FixedInputNodeT<2, CheckCacheIndicesNotCleared> {
7024
7025 public:
7026 explicit CheckCacheIndicesNotCleared(uint64_t bitfield) : Base(bitfield) {}
7027 static constexpr OpProperties kProperties =
7031
7032 static constexpr int kEnumIndices = 0;
7033 Input& indices_input() { return input(kEnumIndices); }
7034 static constexpr int kCacheLength = 1;
7035 Input& length_input() { return input(kCacheLength); }
7036
7039 void PrintParams(std::ostream&, MaglevGraphLabeller*) const {}
7040};
7041
7042class CheckJSDataViewBounds : public FixedInputNodeT<2, CheckJSDataViewBounds> {
7044
7045 public:
7046 explicit CheckJSDataViewBounds(uint64_t bitfield,
7048 : Base(bitfield), element_type_(element_type) {}
7049
7053
7054 static constexpr int kReceiverIndex = 0;
7055 static constexpr int kIndexIndex = 1;
7057 Input& index_input() { return input(kIndexIndex); }
7058
7059 int MaxCallStackArgs() const;
7062 void PrintParams(std::ostream&, MaglevGraphLabeller*) const {}
7063
7064 auto options() const { return std::tuple{element_type_}; }
7065
7067
7068 private:
7070};
7071
7073 : public FixedInputValueNodeT<1, LoadTypedArrayLength> {
7075
7076 public:
7078 : Base(bitfield), elements_kind_(elements_kind) {}
7079 static constexpr OpProperties kProperties =
7081 static constexpr
7083
7084 static constexpr int kReceiverIndex = 0;
7086
7089 void PrintParams(std::ostream&, MaglevGraphLabeller*) const {}
7090
7091 auto options() const { return std::tuple{elements_kind_}; }
7092
7094
7095 private:
7097};
7098
7100 : public FixedInputNodeT<1, CheckTypedArrayNotDetached> {
7102
7103 public:
7104 explicit CheckTypedArrayNotDetached(uint64_t bitfield) : Base(bitfield) {}
7105 static constexpr OpProperties kProperties =
7107 static constexpr
7109
7110 static constexpr int kObjectIndex = 0;
7111 Input& object_input() { return input(kObjectIndex); }
7112
7115 void PrintParams(std::ostream&, MaglevGraphLabeller*) const {}
7116};
7117
7118class CheckTypedArrayBounds : public FixedInputNodeT<2, CheckTypedArrayBounds> {
7120
7121 public:
7122 explicit CheckTypedArrayBounds(uint64_t bitfield) : Base(bitfield) {}
7126
7127 static constexpr int kIndexIndex = 0;
7128 static constexpr int kLengthIndex = 1;
7129 Input& index_input() { return input(kIndexIndex); }
7130 Input& length_input() { return input(kLengthIndex); }
7131
7134 void PrintParams(std::ostream&, MaglevGraphLabeller*) const {}
7135};
7136
7137class CheckInt32Condition : public FixedInputNodeT<2, CheckInt32Condition> {
7139
7140 public:
7141 explicit CheckInt32Condition(uint64_t bitfield, AssertCondition condition,
7142 DeoptimizeReason reason)
7143 : Base(bitfield | ConditionField::encode(condition) |
7144 ReasonField::encode(reason)) {}
7145
7149
7150 static constexpr int kLeftIndex = 0;
7151 static constexpr int kRightIndex = 1;
7152 Input& left_input() { return input(kLeftIndex); }
7153 Input& right_input() { return input(kRightIndex); }
7154
7156 return ConditionField::decode(bitfield());
7157 }
7158
7161 void PrintParams(std::ostream&, MaglevGraphLabeller*) const;
7162
7163 auto options() const { return std::tuple{condition(), deoptimize_reason()}; }
7164
7166
7167 private:
7169 ReasonField::Next<AssertCondition, base::bits::WhichPowerOfTwo<size_t>(
7172};
7173
7174class DebugBreak : public FixedInputNodeT<0, DebugBreak> {
7176
7177 public:
7178 explicit DebugBreak(uint64_t bitfield) : Base(bitfield) {}
7179
7181
7184 void PrintParams(std::ostream&, MaglevGraphLabeller*) const {}
7185};
7186
7187class Dead : public NodeT<Dead> {
7189
7190 public:
7193 void PrintParams(std::ostream&, MaglevGraphLabeller*) const {}
7196
7197 private:
7198 explicit Dead(uint64_t bitfield) : Base(bitfield) {}
7199};
7200
7202 : public FixedInputNodeT<0, FunctionEntryStackCheck> {
7204
7205 public:
7206 explicit FunctionEntryStackCheck(uint64_t bitfield) : Base(bitfield) {}
7207
7208 // Although FunctionEntryStackCheck calls a builtin, we don't mark it as Call
7209 // here. The register allocator should not spill any live registers, since the
7210 // builtin already handles it. The only possible live register is
7211 // kJavaScriptCallNewTargetRegister.
7212 static constexpr OpProperties kProperties =
7215
7216 int MaxCallStackArgs() const;
7219 void PrintParams(std::ostream&, MaglevGraphLabeller*) const {}
7220};
7221
7223 : public FixedInputValueNodeT<1, CheckedInternalizedString> {
7225
7226 public:
7228 : Base(CheckTypeBitField::update(bitfield, check_type)) {
7229 CHECK_EQ(properties().value_representation(), ValueRepresentation::kTagged);
7230 }
7231
7232 static constexpr OpProperties kProperties =
7234 static constexpr
7236
7237 static constexpr int kObjectIndex = 0;
7239 CheckType check_type() const { return CheckTypeBitField::decode(bitfield()); }
7240
7243 void PrintParams(std::ostream&, MaglevGraphLabeller*) const {}
7244
7245 auto options() const { return std::tuple{check_type()}; }
7246
7247 private:
7248 using CheckTypeBitField = NextBitField<CheckType, 1>;
7249};
7250
7252 : public FixedInputValueNodeT<1, CheckedObjectToIndex> {
7254
7255 public:
7256 explicit CheckedObjectToIndex(uint64_t bitfield, CheckType check_type)
7257 : Base(CheckTypeBitField::update(bitfield, check_type)) {}
7258
7259 static constexpr OpProperties kProperties =
7262 static constexpr
7264
7265 static constexpr int kObjectIndex = 0;
7267 CheckType check_type() const { return CheckTypeBitField::decode(bitfield()); }
7268
7269 int MaxCallStackArgs() const;
7272 void PrintParams(std::ostream&, MaglevGraphLabeller*) const {}
7273
7274 auto options() const { return std::tuple{check_type()}; }
7275
7276 private:
7277 using CheckTypeBitField = NextBitField<CheckType, 1>;
7278};
7279
7280class GetTemplateObject : public FixedInputValueNodeT<1, GetTemplateObject> {
7282
7283 public:
7286 const compiler::FeedbackSource& feedback)
7287 : Base(bitfield),
7289 feedback_(feedback) {}
7290
7291 // The implementation currently calls runtime.
7292 static constexpr OpProperties kProperties =
7294 static constexpr
7296
7297 Input& description() { return input(0); }
7298
7303
7304 int MaxCallStackArgs() const;
7307 void PrintParams(std::ostream&, MaglevGraphLabeller*) const {}
7308
7309 private:
7312};
7313
7315 : public FixedInputValueNodeT<1, HasInPrototypeChain> {
7317
7318 public:
7319 explicit HasInPrototypeChain(uint64_t bitfield,
7320 compiler::HeapObjectRef prototype)
7321 : Base(bitfield), prototype_(prototype) {}
7322
7323 // The implementation can enter user code in the deferred call (due to
7324 // proxied getPrototypeOf).
7325 static constexpr OpProperties kProperties =
7327 static constexpr
7329
7330 Input& object() { return input(0); }
7331
7333
7334 int MaxCallStackArgs() const;
7337 void PrintParams(std::ostream&, MaglevGraphLabeller*) const;
7338
7339 private:
7341};
7342
7344 : public FixedInputValueNodeT<1, BuiltinStringFromCharCode> {
7346
7347 public:
7348 explicit BuiltinStringFromCharCode(uint64_t bitfield) : Base(bitfield) {}
7349
7350 static constexpr OpProperties kProperties =
7352 static constexpr
7354
7355 Input& code_input() { return input(0); }
7356
7357 int MaxCallStackArgs() const;
7360 void PrintParams(std::ostream&, MaglevGraphLabeller*) const {}
7361};
7362
7364 : public FixedInputValueNodeT<2,
7365 BuiltinStringPrototypeCharCodeOrCodePointAt> {
7366 using Base =
7368
7369 public:
7374
7376 Mode mode)
7377 : Base(bitfield), mode_(mode) {}
7378
7379 static constexpr OpProperties kProperties =
7384
7385 static constexpr int kStringIndex = 0;
7386 static constexpr int kIndexIndex = 1;
7387 Input& string_input() { return input(kStringIndex); }
7388 Input& index_input() { return input(kIndexIndex); }
7389
7390 int MaxCallStackArgs() const;
7393 void PrintParams(std::ostream&, MaglevGraphLabeller*) const;
7394
7395 auto options() const { return std::tuple{mode_}; }
7396
7397 Mode mode() const { return mode_; }
7398
7399 private:
7401};
7402
7403class MapPrototypeGet : public FixedInputValueNodeT<2, MapPrototypeGet> {
7405
7406 public:
7407 explicit MapPrototypeGet(uint64_t bitfield) : Base(bitfield) {}
7408
7409 static constexpr OpProperties kProperties =
7414
7415 Input& table_input() { return input(0); }
7416 Input& key_input() { return input(1); }
7417
7418 int MaxCallStackArgs() const {
7419 // Only implemented in Turbolev.
7420 UNREACHABLE();
7421 }
7422
7425 void PrintParams(std::ostream&, MaglevGraphLabeller*) const {}
7426};
7427
7429 : public FixedInputValueNodeT<2, MapPrototypeGetInt32Key> {
7431
7432 public:
7433 explicit MapPrototypeGetInt32Key(uint64_t bitfield) : Base(bitfield) {}
7434
7440
7441 Input& table_input() { return input(0); }
7442 Input& key_input() { return input(1); }
7443
7446 void PrintParams(std::ostream&, MaglevGraphLabeller*) const {}
7447};
7448
7449class SetPrototypeHas : public FixedInputValueNodeT<2, SetPrototypeHas> {
7451
7452 public:
7453 explicit SetPrototypeHas(uint64_t bitfield) : Base(bitfield) {}
7454
7455 // CanAllocate is needed, since finding strings in hash tables does an
7456 // equality comparison which flattens strings.
7457 static constexpr OpProperties kProperties =
7462
7463 Input& table_input() { return input(0); }
7464 Input& key_input() { return input(1); }
7465
7466 int MaxCallStackArgs() const {
7467 // Only implemented in Turbolev.
7468 UNREACHABLE();
7469 }
7470
7473 void PrintParams(std::ostream&, MaglevGraphLabeller*) const {}
7474};
7475
7477 : public FixedInputValueNodeT<1, CreateFastArrayElements> {
7479
7480 public:
7481 explicit CreateFastArrayElements(uint64_t bitfield,
7483 : Base(bitfield), allocation_type_(allocation_type) {}
7484
7486
7487 static constexpr OpProperties kProperties =
7489
7490 static constexpr
7492
7493 Input& length_input() { return input(0); }
7494
7497 void PrintParams(std::ostream&, MaglevGraphLabeller*) const {}
7498
7499 private:
7501};
7502
7504 : public FixedInputValueNodeT<3, TransitionAndStoreArrayElement> {
7506
7507 public:
7508 explicit TransitionAndStoreArrayElement(uint64_t bitfield,
7511 : Base(bitfield), fast_map_(fast_map), double_map_(double_map) {}
7512
7513 static constexpr OpProperties kProperties =
7518
7519 Input& array_input() { return input(0); }
7520 Input& index_input() { return input(1); }
7521 Input& value_input() { return input(2); }
7522
7525
7526 int MaxCallStackArgs() const {
7527 // Only implemented in Turbolev.
7528 UNREACHABLE();
7529 }
7532
7533 void PrintParams(std::ostream&, MaglevGraphLabeller*) const {}
7534
7535 private:
7538};
7539
7541 public:
7550
7556 const ZoneVector<compiler::MapRef>& maps, compiler::ObjectRef constant) {
7558 constant);
7559 }
7561 const ZoneVector<compiler::MapRef>& maps, Float64 constant) {
7562 return PolymorphicAccessInfo(kConstantDouble, maps, constant);
7563 }
7565 const ZoneVector<compiler::MapRef>& maps, Representation representation,
7566 compiler::OptionalJSObjectRef holder, FieldIndex field_index) {
7567 return PolymorphicAccessInfo(kDataLoad, maps, representation, holder,
7568 field_index);
7569 }
7579
7580 Kind kind() const { return kind_; }
7581
7582 const ZoneVector<compiler::MapRef>& maps() const { return maps_; }
7583
7586 return constant_.object();
7587 }
7588
7589 double constant_double() const {
7591 return constant_double_.get_scalar();
7592 }
7593
7596 return constant_.AsCell().object();
7597 }
7598
7599 compiler::OptionalJSObjectRef holder() const {
7601 return data_load_.holder_;
7602 }
7603
7606 return data_load_.field_index_;
7607 }
7608
7610
7611 bool operator==(const PolymorphicAccessInfo& other) const {
7612 if (kind_ != other.kind_ || !(representation_ == other.representation_)) {
7613 return false;
7614 }
7615 if (maps_.size() != other.maps_.size()) {
7616 return false;
7617 }
7618 for (size_t i = 0; i < maps_.size(); ++i) {
7619 if (maps_[i] != other.maps_[i]) {
7620 return false;
7621 }
7622 }
7623 switch (kind_) {
7624 case kNotFound:
7625 case kStringLength:
7626 return true;
7627 case kModuleExport:
7628 case kConstant:
7629 return constant_.equals(other.constant_);
7630 case kConstantDouble:
7631 return constant_double_ == other.constant_double_;
7632 case kDataLoad:
7633 return data_load_.holder_.equals(other.data_load_.holder_) &&
7634 data_load_.field_index_ == other.data_load_.field_index_;
7635 }
7636 }
7637
7638 size_t hash_value() const {
7639 size_t hash = base::hash_value(kind_);
7641 for (auto map : maps()) {
7642 hash = base::hash_combine(hash, map.hash_value());
7643 }
7644 switch (kind_) {
7645 case kNotFound:
7646 case kStringLength:
7647 break;
7648 case kModuleExport:
7649 case kConstant:
7650 hash = base::hash_combine(hash, constant_.hash_value());
7651 break;
7652 case kConstantDouble:
7654 break;
7655 case kDataLoad:
7656 hash = base::hash_combine(
7657 hash, base::hash_value(data_load_.holder_.hash_value()));
7658 hash = base::hash_combine(
7659 hash, base::hash_value(data_load_.field_index_.index()));
7660 break;
7661 }
7662 return hash;
7663 }
7664
7665 private:
7667 const ZoneVector<compiler::MapRef>& maps,
7668 Representation representation)
7669 : kind_(kind), maps_(maps), representation_(representation) {
7671 }
7672
7674 Representation representation,
7675 compiler::ObjectRef constant)
7676 : kind_(kind),
7677 maps_(maps),
7678 representation_(representation),
7679 constant_(constant) {
7681 }
7682
7684 Float64 constant)
7685 : kind_(kind),
7686 maps_(maps),
7688 constant_double_(constant) {
7690 }
7691
7693 Representation representation,
7694 compiler::OptionalJSObjectRef holder,
7696 : kind_(kind),
7697 maps_(maps),
7698 representation_(representation),
7701 }
7702
7704 // TODO(victorgomes): Create a PolymorphicMapChecks and avoid the maps here.
7707 union {
7708 const compiler::ObjectRef constant_;
7710 struct {
7711 const compiler::OptionalJSObjectRef holder_;
7714 };
7715};
7716
7717template <typename Derived = LoadTaggedField>
7720 using Base::result;
7721
7722 public:
7723 explicit AbstractLoadTaggedField(uint64_t bitfield, const int offset)
7724 : Base(bitfield), offset_(offset) {}
7725
7727 static constexpr
7729
7730 int offset() const { return offset_; }
7731
7732 using Base::input;
7733 static constexpr int kObjectIndex = 0;
7734 Input& object_input() { return input(kObjectIndex); }
7735
7738 void PrintParams(std::ostream&, MaglevGraphLabeller*) const;
7739
7740 auto options() const { return std::tuple{offset()}; }
7741
7742 using Base::decompresses_tagged_result;
7743
7744 private:
7745 const int offset_;
7746};
7747
7748class LoadTaggedField : public AbstractLoadTaggedField<LoadTaggedField> {
7750
7751 public:
7752 explicit LoadTaggedField(uint64_t bitfield, const int offset)
7753 : Base(bitfield, offset) {}
7754};
7755
7757 : public AbstractLoadTaggedField<LoadTaggedFieldForProperty> {
7759
7760 public:
7761 explicit LoadTaggedFieldForProperty(uint64_t bitfield, const int offset,
7762 compiler::NameRef name)
7763 : Base(bitfield, offset), name_(name) {}
7765
7766 auto options() const { return std::tuple{offset(), name_}; }
7767
7768 private:
7770};
7771
7773 : public AbstractLoadTaggedField<LoadTaggedFieldForContextSlot> {
7775
7776 public:
7777 explicit LoadTaggedFieldForContextSlot(uint64_t bitfield, const int offset)
7778 : Base(bitfield, offset) {}
7779};
7780
7782 : public FixedInputValueNodeT<1, LoadTaggedFieldForScriptContextSlot> {
7784
7785 public:
7786 explicit LoadTaggedFieldForScriptContextSlot(uint64_t bitfield,
7787 const int index)
7788 : Base(bitfield), index_(index) {}
7789
7793 static constexpr
7795
7797 int index() const { return index_; }
7798
7799 using Base::input;
7800 static constexpr int kContextIndex = 0;
7801 Input& context() { return input(kContextIndex); }
7802
7803 int MaxCallStackArgs() const { return 0; }
7806 void PrintParams(std::ostream&, MaglevGraphLabeller*) const;
7807
7808 auto options() const { return std::tuple{index()}; }
7809
7810 using Base::decompresses_tagged_result;
7811
7812 private:
7813 const int index_;
7814};
7815
7816class LoadDoubleField : public FixedInputValueNodeT<1, LoadDoubleField> {
7818
7819 public:
7820 explicit LoadDoubleField(uint64_t bitfield, int offset)
7821 : Base(bitfield), offset_(offset) {}
7822
7823 static constexpr OpProperties kProperties =
7825 static constexpr
7827
7828 int offset() const { return offset_; }
7829
7830 static constexpr int kObjectIndex = 0;
7831 Input& object_input() { return input(kObjectIndex); }
7832
7835 void PrintParams(std::ostream&, MaglevGraphLabeller*) const;
7836
7837 auto options() const { return std::tuple{offset()}; }
7838
7839 private:
7840 const int offset_;
7841};
7842
7843class LoadFloat64 : public FixedInputValueNodeT<1, LoadFloat64> {
7845
7846 public:
7847 explicit LoadFloat64(uint64_t bitfield, int offset)
7848 : Base(bitfield), offset_(offset) {}
7849
7850 static constexpr OpProperties kProperties =
7852 static constexpr
7854
7855 int offset() const { return offset_; }
7856
7857 static constexpr int kObjectIndex = 0;
7858 Input& object_input() { return input(kObjectIndex); }
7859
7862 void PrintParams(std::ostream&, MaglevGraphLabeller*) const;
7863
7864 auto options() const { return std::tuple{offset()}; }
7865
7866 private:
7867 const int offset_;
7868};
7869
7870class LoadHeapInt32 : public FixedInputValueNodeT<1, LoadHeapInt32> {
7872
7873 public:
7874 explicit LoadHeapInt32(uint64_t bitfield, int offset)
7875 : Base(bitfield), offset_(offset) {}
7876
7877 static constexpr OpProperties kProperties =
7879 static constexpr
7881
7882 int offset() const { return offset_; }
7883
7884 static constexpr int kObjectIndex = 0;
7885 Input& object_input() { return input(kObjectIndex); }
7886
7889 void PrintParams(std::ostream&, MaglevGraphLabeller*) const;
7890
7891 auto options() const { return std::tuple{offset()}; }
7892
7893 private:
7894 const int offset_;
7895};
7896
7897class LoadInt32 : public FixedInputValueNodeT<1, LoadInt32> {
7899
7900 public:
7901 explicit LoadInt32(uint64_t bitfield, int offset)
7902 : Base(bitfield), offset_(offset) {}
7903
7904 static constexpr OpProperties kProperties =
7906 static constexpr
7908
7909 int offset() const { return offset_; }
7910
7911 static constexpr int kObjectIndex = 0;
7912 Input& object_input() { return input(kObjectIndex); }
7913
7916 void PrintParams(std::ostream&, MaglevGraphLabeller*) const;
7917
7918 auto options() const { return std::tuple{offset()}; }
7919
7920 private:
7921 const int offset_;
7922};
7923
7925 : public FixedInputValueNodeT<2, LoadTaggedFieldByFieldIndex> {
7927
7928 public:
7929 explicit LoadTaggedFieldByFieldIndex(uint64_t bitfield) : Base(bitfield) {}
7930
7936
7937 static constexpr int kObjectIndex = 0;
7938 static constexpr int kIndexIndex = 1;
7939 Input& object_input() { return input(kObjectIndex); }
7940 Input& index_input() { return input(kIndexIndex); }
7941
7942#ifdef V8_COMPRESS_POINTERS
7943 void MarkTaggedInputsAsDecompressing() {
7944 // Only need to decompress the object, the index should be a Smi.
7945 object_input().node()->SetTaggedResultNeedsDecompress();
7946 }
7947#endif
7948
7949 int MaxCallStackArgs() const { return 0; }
7952 void PrintParams(std::ostream&, MaglevGraphLabeller*) const {}
7953};
7954
7956 : public FixedInputValueNodeT<2, LoadFixedArrayElement> {
7958
7959 public:
7960 explicit LoadFixedArrayElement(uint64_t bitfield) : Base(bitfield) {}
7961
7965
7966 static constexpr int kElementsIndex = 0;
7967 static constexpr int kIndexIndex = 1;
7969 Input& index_input() { return input(kIndexIndex); }
7970
7973 void PrintParams(std::ostream&, MaglevGraphLabeller*) const;
7974};
7975
7977 : public FixedInputValueNodeT<2, EnsureWritableFastElements> {
7979
7980 public:
7981 explicit EnsureWritableFastElements(uint64_t bitfield) : Base(bitfield) {}
7982
7988
7989 static constexpr int kElementsIndex = 0;
7990 static constexpr int kObjectIndex = 1;
7992 Input& object_input() { return input(kObjectIndex); }
7993
7994 int MaxCallStackArgs() const { return 0; }
7997 void PrintParams(std::ostream&, MaglevGraphLabeller*) const {}
7998};
7999
8001 : public FixedInputValueNodeT<2, ExtendPropertiesBackingStore> {
8003
8004 public:
8005 explicit ExtendPropertiesBackingStore(uint64_t bitfield, int old_length)
8006 : Base(bitfield), old_length_(old_length) {}
8007
8008 static constexpr OpProperties kProperties =
8012
8015
8016 static constexpr int kPropertyArrayIndex = 0;
8017 static constexpr int kObjectIndex = 1;
8019 Input& object_input() { return input(kObjectIndex); }
8020
8021 int MaxCallStackArgs() const { return 0; }
8024 void PrintParams(std::ostream&, MaglevGraphLabeller*) const;
8025
8026 int old_length() const { return old_length_; }
8027
8028 private:
8029 const int old_length_;
8030};
8031
8033 : public FixedInputValueNodeT<4, MaybeGrowFastElements> {
8035
8036 public:
8038 : Base(bitfield), elements_kind_(elements_kind) {}
8039
8040 static constexpr OpProperties kProperties =
8046
8047 static constexpr int kElementsIndex = 0;
8048 static constexpr int kObjectIndex = 1;
8049 static constexpr int kIndexIndex = 2;
8050 static constexpr int kElementsLengthIndex = 3;
8052 Input& object_input() { return input(kObjectIndex); }
8053 Input& index_input() { return input(kIndexIndex); }
8055
8057
8058 int MaxCallStackArgs() const { return 0; }
8061 void PrintParams(std::ostream&, MaglevGraphLabeller*) const {}
8062
8063 auto options() const { return std::tuple{elements_kind()}; }
8064
8065 private:
8067};
8068
8070 : public FixedInputNodeT<3, StoreFixedArrayElementWithWriteBarrier> {
8072
8073 public:
8074 explicit StoreFixedArrayElementWithWriteBarrier(uint64_t bitfield)
8075 : Base(bitfield) {}
8076
8077 static constexpr OpProperties kProperties =
8082
8083 static constexpr int kElementsIndex = 0;
8084 static constexpr int kIndexIndex = 1;
8085 static constexpr int kValueIndex = 2;
8087 Input& index_input() { return input(kIndexIndex); }
8088 Input& value_input() { return input(kValueIndex); }
8089
8090 int MaxCallStackArgs() const { return 0; }
8093 void PrintParams(std::ostream&, MaglevGraphLabeller*) const {}
8094};
8095
8096// StoreFixedArrayElementNoWriteBarrier never does a Deferred Call. However,
8097// PhiRepresentationSelector can cause some StoreFixedArrayElementNoWriteBarrier
8098// to become StoreFixedArrayElementWithWriteBarrier, which can do Deferred
8099// Calls, and thus need the register snapshot. We thus set the DeferredCall
8100// property in StoreFixedArrayElementNoWriteBarrier so that it's allocated with
8101// enough space for the register snapshot.
8103 : public FixedInputNodeT<3, StoreFixedArrayElementNoWriteBarrier> {
8105
8106 public:
8107 explicit StoreFixedArrayElementNoWriteBarrier(uint64_t bitfield)
8108 : Base(bitfield) {}
8109
8110 static constexpr OpProperties kProperties =
8115
8116 static constexpr int kElementsIndex = 0;
8117 static constexpr int kIndexIndex = 1;
8118 static constexpr int kValueIndex = 2;
8120 Input& index_input() { return input(kIndexIndex); }
8121 Input& value_input() { return input(kValueIndex); }
8122
8123 int MaxCallStackArgs() const {
8124 // StoreFixedArrayElementNoWriteBarrier never really does any call.
8125 return 0;
8126 }
8129 void PrintParams(std::ostream&, MaglevGraphLabeller*) const {}
8130};
8131
8133 : public FixedInputValueNodeT<2, LoadFixedDoubleArrayElement> {
8135
8136 public:
8137 explicit LoadFixedDoubleArrayElement(uint64_t bitfield) : Base(bitfield) {}
8138
8139 static constexpr OpProperties kProperties =
8143
8144 static constexpr int kElementsIndex = 0;
8145 static constexpr int kIndexIndex = 1;
8147 Input& index_input() { return input(kIndexIndex); }
8148
8151 void PrintParams(std::ostream&, MaglevGraphLabeller*) const {}
8152};
8153
8155 : public FixedInputValueNodeT<2, LoadHoleyFixedDoubleArrayElement> {
8157
8158 public:
8159 explicit LoadHoleyFixedDoubleArrayElement(uint64_t bitfield)
8160 : Base(bitfield) {}
8161
8162 static constexpr OpProperties kProperties =
8166
8167 static constexpr int kElementsIndex = 0;
8168 static constexpr int kIndexIndex = 1;
8170 Input& index_input() { return input(kIndexIndex); }
8171
8174 void PrintParams(std::ostream&, MaglevGraphLabeller*) const {}
8175};
8176
8178 : public FixedInputValueNodeT<
8179 2, LoadHoleyFixedDoubleArrayElementCheckedNotHole> {
8180 using Base =
8182
8183 public:
8185 : Base(bitfield) {}
8186
8192
8193 static constexpr int kElementsIndex = 0;
8194 static constexpr int kIndexIndex = 1;
8196 Input& index_input() { return input(kIndexIndex); }
8197
8200 void PrintParams(std::ostream&, MaglevGraphLabeller*) const {}
8201};
8202
8204 : public FixedInputNodeT<3, StoreFixedDoubleArrayElement> {
8206
8207 public:
8208 explicit StoreFixedDoubleArrayElement(uint64_t bitfield) : Base(bitfield) {}
8209
8214
8215 static constexpr int kElementsIndex = 0;
8216 static constexpr int kIndexIndex = 1;
8217 static constexpr int kValueIndex = 2;
8219 Input& index_input() { return input(kIndexIndex); }
8220 Input& value_input() { return input(kValueIndex); }
8221
8224 void PrintParams(std::ostream&, MaglevGraphLabeller*) const {}
8225};
8226
8228 : public FixedInputValueNodeT<3, LoadSignedIntDataViewElement> {
8230
8231 public:
8232 explicit LoadSignedIntDataViewElement(uint64_t bitfield,
8233 ExternalArrayType type)
8234 : Base(bitfield), type_(type) {
8238 }
8239
8240 static constexpr OpProperties kProperties =
8245
8246 static constexpr int kObjectIndex = 0;
8247 static constexpr int kIndexIndex = 1;
8248 static constexpr int kIsLittleEndianIndex = 2;
8249 Input& object_input() { return input(kObjectIndex); }
8250 Input& index_input() { return input(kIndexIndex); }
8252
8256
8259 void PrintParams(std::ostream&, MaglevGraphLabeller*) const {}
8260
8261 auto options() const { return std::tuple{type_}; }
8262
8263 ExternalArrayType type() const { return type_; }
8264
8265 private:
8267};
8268
8270 : public FixedInputValueNodeT<3, LoadDoubleDataViewElement> {
8272 static constexpr ExternalArrayType type_ =
8274
8275 public:
8276 explicit LoadDoubleDataViewElement(uint64_t bitfield, ExternalArrayType type)
8277 : Base(bitfield) {
8278 DCHECK_EQ(type, type_);
8279 }
8280
8281 static constexpr OpProperties kProperties =
8286
8287 static constexpr int kObjectIndex = 0;
8288 static constexpr int kIndexIndex = 1;
8289 static constexpr int kIsLittleEndianIndex = 2;
8290 Input& object_input() { return input(kObjectIndex); }
8291 Input& index_input() { return input(kIndexIndex); }
8293
8297
8300 void PrintParams(std::ostream&, MaglevGraphLabeller*) const {}
8301
8302 auto options() const { return std::tuple{type_}; }
8303};
8304
8305#define LOAD_TYPED_ARRAY(name, properties, ...) \
8306 class name : public FixedInputValueNodeT<2, name> { \
8307 using Base = FixedInputValueNodeT<2, name>; \
8308 \
8309 public: \
8310 explicit name(uint64_t bitfield, ElementsKind elements_kind) \
8311 : Base(bitfield), elements_kind_(elements_kind) { \
8312 DCHECK(elements_kind == \
8313 v8::internal::compiler::turboshaft::any_of(__VA_ARGS__)); \
8314 } \
8315 \
8316 static constexpr OpProperties kProperties = \
8317 OpProperties::CanRead() | properties; \
8318 static constexpr typename Base::InputTypes kInputTypes{ \
8319 ValueRepresentation::kTagged, ValueRepresentation::kUint32}; \
8320 \
8321 static constexpr int kObjectIndex = 0; \
8322 static constexpr int kIndexIndex = 1; \
8323 Input& object_input() { return input(kObjectIndex); } \
8324 Input& index_input() { return input(kIndexIndex); } \
8325 \
8326 void SetValueLocationConstraints(); \
8327 void GenerateCode(MaglevAssembler*, const ProcessingState&); \
8328 void PrintParams(std::ostream&, MaglevGraphLabeller*) const {} \
8329 \
8330 auto options() const { return std::tuple{elements_kind_}; } \
8331 \
8332 ElementsKind elements_kind() const { return elements_kind_; } \
8333 \
8334 private: \
8335 ElementsKind elements_kind_; \
8336 };
8337
8338LOAD_TYPED_ARRAY(LoadSignedIntTypedArrayElement, OpProperties::Int32(),
8340
8341LOAD_TYPED_ARRAY(LoadUnsignedIntTypedArrayElement, OpProperties::Uint32(),
8343 UINT16_ELEMENTS, UINT32_ELEMENTS)
8344
8345LOAD_TYPED_ARRAY(LoadDoubleTypedArrayElement, OpProperties::Float64(),
8346 FLOAT32_ELEMENTS, FLOAT64_ELEMENTS)
8347
8348#undef LOAD_TYPED_ARRAY
8349
8350#define STORE_TYPED_ARRAY(name, properties, type, ...) \
8351 class name : public FixedInputNodeT<3, name> { \
8352 using Base = FixedInputNodeT<3, name>; \
8353 \
8354 public: \
8355 explicit name(uint64_t bitfield, ElementsKind elements_kind) \
8356 : Base(bitfield), elements_kind_(elements_kind) { \
8357 DCHECK(elements_kind == \
8358 v8::internal::compiler::turboshaft::any_of(__VA_ARGS__)); \
8359 } \
8360 \
8361 static constexpr OpProperties kProperties = properties; \
8362 static constexpr typename Base::InputTypes kInputTypes{ \
8363 ValueRepresentation::kTagged, ValueRepresentation::kUint32, type}; \
8364 \
8365 static constexpr int kObjectIndex = 0; \
8366 static constexpr int kIndexIndex = 1; \
8367 static constexpr int kValueIndex = 2; \
8368 Input& object_input() { return input(kObjectIndex); } \
8369 Input& index_input() { return input(kIndexIndex); } \
8370 Input& value_input() { return input(kValueIndex); } \
8371 \
8372 void SetValueLocationConstraints(); \
8373 void GenerateCode(MaglevAssembler*, const ProcessingState&); \
8374 void PrintParams(std::ostream&, MaglevGraphLabeller*) const {} \
8375 \
8376 ElementsKind elements_kind() const { return elements_kind_; } \
8377 \
8378 private: \
8379 ElementsKind elements_kind_; \
8380 };
8381
8382STORE_TYPED_ARRAY(StoreIntTypedArrayElement, OpProperties::CanWrite(),
8385 UINT16_ELEMENTS, UINT16_ELEMENTS, UINT32_ELEMENTS)
8386STORE_TYPED_ARRAY(StoreDoubleTypedArrayElement, OpProperties::CanWrite(),
8387 ValueRepresentation::kHoleyFloat64, FLOAT32_ELEMENTS,
8388 FLOAT64_ELEMENTS)
8389#undef STORE_TYPED_ARRAY
8390
8391class StoreSignedIntDataViewElement
8392 : public FixedInputNodeT<4, StoreSignedIntDataViewElement> {
8394
8395 public:
8396 explicit StoreSignedIntDataViewElement(uint64_t bitfield,
8397 ExternalArrayType type)
8398 : Base(bitfield), type_(type) {
8399 DCHECK(type == ExternalArrayType::kExternalInt8Array ||
8400 type == ExternalArrayType::kExternalInt16Array ||
8401 type == ExternalArrayType::kExternalInt32Array);
8402 }
8403
8404 static constexpr OpProperties kProperties = OpProperties::CanWrite();
8405 static constexpr typename Base::InputTypes kInputTypes{
8406 ValueRepresentation::kTagged, ValueRepresentation::kInt32,
8407 ValueRepresentation::kInt32, ValueRepresentation::kTagged};
8408
8409 static constexpr int kObjectIndex = 0;
8410 static constexpr int kIndexIndex = 1;
8411 static constexpr int kValueIndex = 2;
8412 static constexpr int kIsLittleEndianIndex = 3;
8413 Input& object_input() { return input(kObjectIndex); }
8414 Input& index_input() { return input(kIndexIndex); }
8415 Input& value_input() { return input(kValueIndex); }
8416 Input& is_little_endian_input() { return input(kIsLittleEndianIndex); }
8417
8418 bool is_little_endian_constant() {
8419 return IsConstantNode(is_little_endian_input().node()->opcode());
8420 }
8421
8422 void SetValueLocationConstraints();
8423 void GenerateCode(MaglevAssembler*, const ProcessingState&);
8424 void PrintParams(std::ostream&, MaglevGraphLabeller*) const {}
8425
8426 ExternalArrayType type() const { return type_; }
8427
8428 private:
8430};
8431
8433 : public FixedInputNodeT<4, StoreDoubleDataViewElement> {
8435
8436 public:
8437 explicit StoreDoubleDataViewElement(uint64_t bitfield, ExternalArrayType type)
8438 : Base(bitfield) {
8440 }
8441
8446
8447 static constexpr int kObjectIndex = 0;
8448 static constexpr int kIndexIndex = 1;
8449 static constexpr int kValueIndex = 2;
8450 static constexpr int kIsLittleEndianIndex = 3;
8451 Input& object_input() { return input(kObjectIndex); }
8452 Input& index_input() { return input(kIndexIndex); }
8453 Input& value_input() { return input(kValueIndex); }
8455
8459
8462 void PrintParams(std::ostream&, MaglevGraphLabeller*) const {}
8463};
8464
8465class StoreDoubleField : public FixedInputNodeT<2, StoreDoubleField> {
8467
8468 public:
8469 explicit StoreDoubleField(uint64_t bitfield, int offset)
8470 : Base(bitfield), offset_(offset) {}
8471
8475
8476 int offset() const { return offset_; }
8477
8478 static constexpr int kObjectIndex = 0;
8479 static constexpr int kValueIndex = 1;
8480 Input& object_input() { return input(kObjectIndex); }
8481 Input& value_input() { return input(kValueIndex); }
8482
8485 void PrintParams(std::ostream&, MaglevGraphLabeller*) const;
8486
8487 private:
8488 const int offset_;
8489};
8490
8491class StoreHeapInt32 : public FixedInputNodeT<2, StoreHeapInt32> {
8493
8494 public:
8495 explicit StoreHeapInt32(uint64_t bitfield, int offset)
8496 : Base(bitfield), offset_(offset) {}
8497
8501
8502 int offset() const { return offset_; }
8503
8504 static constexpr int kObjectIndex = 0;
8505 static constexpr int kValueIndex = 1;
8506 Input& object_input() { return input(kObjectIndex); }
8507 Input& value_input() { return input(kValueIndex); }
8508
8511 void PrintParams(std::ostream&, MaglevGraphLabeller*) const;
8512
8513 private:
8514 const int offset_;
8515};
8516
8517class StoreInt32 : public FixedInputNodeT<2, StoreInt32> {
8519
8520 public:
8521 explicit StoreInt32(uint64_t bitfield, int offset)
8522 : Base(bitfield), offset_(offset) {}
8523
8527
8528 int offset() const { return offset_; }
8529
8530 static constexpr int kObjectIndex = 0;
8531 static constexpr int kValueIndex = 1;
8532 Input& object_input() { return input(kObjectIndex); }
8533 Input& value_input() { return input(kValueIndex); }
8534
8537 void PrintParams(std::ostream&, MaglevGraphLabeller*) const;
8538
8539 private:
8540 const int offset_;
8541};
8542
8543class StoreFloat64 : public FixedInputNodeT<2, StoreFloat64> {
8545
8546 public:
8547 explicit StoreFloat64(uint64_t bitfield, int offset)
8548 : Base(bitfield), offset_(offset) {}
8549
8553
8554 int offset() const { return offset_; }
8555
8556 static constexpr int kObjectIndex = 0;
8557 static constexpr int kValueIndex = 1;
8558 Input& object_input() { return input(kObjectIndex); }
8559 Input& value_input() { return input(kValueIndex); }
8560
8563 void PrintParams(std::ostream&, MaglevGraphLabeller*) const;
8564
8565 private:
8566 const int offset_;
8567};
8568
8569enum class StoreTaggedMode : uint8_t {
8570 kDefault,
8573};
8578
8580 : public FixedInputNodeT<2, StoreTaggedFieldNoWriteBarrier> {
8582
8583 public:
8584 explicit StoreTaggedFieldNoWriteBarrier(uint64_t bitfield, int offset,
8585 StoreTaggedMode store_mode)
8586 : Base(bitfield | InitializingOrTransitioningField::encode(
8587 IsInitializingOrTransitioning(store_mode))),
8588 offset_(offset) {}
8589
8590 // StoreTaggedFieldNoWriteBarrier never does a Deferred Call. However,
8591 // PhiRepresentationSelector can cause some StoreTaggedFieldNoWriteBarrier to
8592 // become StoreTaggedFieldWithWriteBarrier, which can do Deferred Calls, and
8593 // thus need the register snapshot. We thus set the DeferredCall property in
8594 // StoreTaggedFieldNoWriteBarrier so that it's allocated with enough space for
8595 // the register snapshot.
8596 static constexpr OpProperties kProperties =
8600
8601 int offset() const { return offset_; }
8603 return InitializingOrTransitioningField::decode(bitfield());
8604 }
8605
8606 static constexpr int kObjectIndex = 0;
8607 static constexpr int kValueIndex = 1;
8608 Input& object_input() { return input(kObjectIndex); }
8609 Input& value_input() { return input(kValueIndex); }
8610
8611#ifdef V8_COMPRESS_POINTERS
8612 void MarkTaggedInputsAsDecompressing() {
8613 object_input().node()->SetTaggedResultNeedsDecompress();
8614 // Don't need to decompress value to store it.
8615 }
8616#endif
8617
8618 int MaxCallStackArgs() const {
8619 // StoreTaggedFieldNoWriteBarrier never really does any call.
8620 return 0;
8621 }
8624 void PrintParams(std::ostream&, MaglevGraphLabeller*) const;
8625
8626 void VerifyInputs(MaglevGraphLabeller* graph_labeller) const;
8627
8628 private:
8629 using InitializingOrTransitioningField = NextBitField<bool, 1>;
8630
8631 const int offset_;
8632};
8633
8634class StoreMap : public FixedInputNodeT<1, StoreMap> {
8636
8637 public:
8638 enum class Kind {
8642 };
8643 explicit StoreMap(uint64_t bitfield, compiler::MapRef map, Kind kind)
8644 : Base(bitfield | KindField::encode(kind)), map_(map) {}
8645
8646 static constexpr OpProperties kProperties =
8648 static constexpr
8650
8651 static constexpr int kObjectIndex = 0;
8652 Input& object_input() { return input(kObjectIndex); }
8653
8654 compiler::MapRef map() const { return map_; }
8655 Kind kind() const { return KindField::decode(bitfield()); }
8656
8657 int MaxCallStackArgs() const;
8660 void PrintParams(std::ostream&, MaglevGraphLabeller*) const;
8661
8663
8664 private:
8665 using KindField = NextBitField<Kind, 3>;
8667};
8668std::ostream& operator<<(std::ostream& os, StoreMap::Kind);
8669
8671 : public FixedInputNodeT<2, StoreTaggedFieldWithWriteBarrier> {
8673
8674 public:
8675 explicit StoreTaggedFieldWithWriteBarrier(uint64_t bitfield, int offset,
8676 StoreTaggedMode store_mode)
8677 : Base(bitfield | InitializingOrTransitioningField::encode(
8678 IsInitializingOrTransitioning(store_mode))),
8679 offset_(offset) {}
8680
8681 static constexpr OpProperties kProperties =
8685
8686 int offset() const { return offset_; }
8688 return InitializingOrTransitioningField::decode(bitfield());
8689 }
8690
8691 static constexpr int kObjectIndex = 0;
8692 static constexpr int kValueIndex = 1;
8693 Input& object_input() { return input(kObjectIndex); }
8694 Input& value_input() { return input(kValueIndex); }
8695
8696#ifdef V8_COMPRESS_POINTERS
8697 void MarkTaggedInputsAsDecompressing() {
8698 object_input().node()->SetTaggedResultNeedsDecompress();
8699 // Don't need to decompress value to store it.
8700 }
8701#endif
8702
8703 int MaxCallStackArgs() const;
8706 void PrintParams(std::ostream&, MaglevGraphLabeller*) const;
8707
8708 private:
8709 using InitializingOrTransitioningField = NextBitField<bool, 1>;
8710
8711 const int offset_;
8712};
8713
8715 : public FixedInputNodeT<2, StoreScriptContextSlotWithWriteBarrier> {
8717
8718 public:
8719 explicit StoreScriptContextSlotWithWriteBarrier(uint64_t bitfield, int index)
8720 : Base(bitfield), index_(index) {}
8721
8727
8728 int offset() const { return Context::OffsetOfElementAt(index()); }
8729 int index() const { return index_; }
8730
8731 static constexpr int kContextIndex = 0;
8732 static constexpr int kNewValueIndex = 1;
8733 Input& context_input() { return input(kContextIndex); }
8735
8736#ifdef V8_COMPRESS_POINTERS
8737 void MarkTaggedInputsAsDecompressing() {
8738 context_input().node()->SetTaggedResultNeedsDecompress();
8739 new_value_input().node()->SetTaggedResultNeedsDecompress();
8740 }
8741#endif
8742
8743 int MaxCallStackArgs() const;
8746 void PrintParams(std::ostream&, MaglevGraphLabeller*) const;
8747
8748 private:
8749 const int index_;
8750};
8751
8753 : public FixedInputNodeT<2, StoreTrustedPointerFieldWithWriteBarrier> {
8755
8756 public:
8758 int offset,
8760 StoreTaggedMode store_mode)
8761 : Base(bitfield | InitializingOrTransitioningField::encode(
8762 IsInitializingOrTransitioning(store_mode))),
8763 offset_(offset),
8764 tag_(tag) {}
8765
8766 static constexpr OpProperties kProperties =
8770
8771 int offset() const { return offset_; }
8772 IndirectPointerTag tag() const { return tag_; }
8774 return InitializingOrTransitioningField::decode(bitfield());
8775 }
8776
8777 static constexpr int kObjectIndex = 0;
8778 static constexpr int kValueIndex = 1;
8779 Input& object_input() { return input(kObjectIndex); }
8780 Input& value_input() { return input(kValueIndex); }
8781
8782#ifdef V8_COMPRESS_POINTERS
8783 void MarkTaggedInputsAsDecompressing() {
8784 object_input().node()->SetTaggedResultNeedsDecompress();
8785 // value is never compressed.
8786 }
8787#endif
8788
8789 int MaxCallStackArgs() const;
8792 void PrintParams(std::ostream&, MaglevGraphLabeller*) const;
8793
8794 private:
8795 using InitializingOrTransitioningField = NextBitField<bool, 1>;
8796
8797 const int offset_;
8799};
8800
8801class LoadGlobal : public FixedInputValueNodeT<1, LoadGlobal> {
8803
8804 public:
8805 explicit LoadGlobal(uint64_t bitfield, compiler::NameRef name,
8806 const compiler::FeedbackSource& feedback,
8808 : Base(bitfield),
8809 name_(name),
8810 feedback_(feedback),
8812
8813 // The implementation currently calls runtime.
8815 static constexpr
8817
8818 compiler::NameRef name() const { return name_; }
8821
8822 Input& context() { return input(0); }
8823
8824 int MaxCallStackArgs() const;
8827 void PrintParams(std::ostream&, MaglevGraphLabeller*) const;
8828
8829 private:
8833};
8834
8835class StoreGlobal : public FixedInputValueNodeT<2, StoreGlobal> {
8837
8838 public:
8839 explicit StoreGlobal(uint64_t bitfield, compiler::NameRef name,
8840 const compiler::FeedbackSource& feedback)
8841 : Base(bitfield), name_(name), feedback_(feedback) {}
8842
8843 // The implementation currently calls runtime.
8847
8848 compiler::NameRef name() const { return name_; }
8850
8851 Input& context() { return input(0); }
8852 Input& value() { return input(1); }
8853
8854 int MaxCallStackArgs() const;
8857 void PrintParams(std::ostream&, MaglevGraphLabeller*) const;
8858
8859 private:
8862};
8863
8865 : public FixedInputValueNodeT<3, UpdateJSArrayLength> {
8867
8868 public:
8869 explicit UpdateJSArrayLength(uint64_t bitfield) : Base(bitfield) {}
8870
8875
8876 // TODO(pthier): Use a more natural order once we can define the result
8877 // register to be equal to any input register.
8878 // The current order avoids any extra moves in the common case where index is
8879 // less than length
8880 static constexpr int kLengthIndex = 0;
8881 static constexpr int kObjectIndex = 1;
8882 static constexpr int kIndexIndex = 2;
8883 Input& length_input() { return input(kLengthIndex); }
8884 Input& object_input() { return input(kObjectIndex); }
8885 Input& index_input() { return input(kIndexIndex); }
8886
8889 void PrintParams(std::ostream&, MaglevGraphLabeller*) const {}
8890};
8891
8892class LoadNamedGeneric : public FixedInputValueNodeT<2, LoadNamedGeneric> {
8894
8895 public:
8896 explicit LoadNamedGeneric(uint64_t bitfield, compiler::NameRef name,
8897 const compiler::FeedbackSource& feedback)
8898 : Base(bitfield), name_(name), feedback_(feedback) {}
8899
8900 // The implementation currently calls runtime.
8904
8905 compiler::NameRef name() const { return name_; }
8907
8908 static constexpr int kContextIndex = 0;
8909 static constexpr int kObjectIndex = 1;
8910 Input& context() { return input(kContextIndex); }
8911 Input& object_input() { return input(kObjectIndex); }
8912
8913 int MaxCallStackArgs() const;
8916 void PrintParams(std::ostream&, MaglevGraphLabeller*) const;
8917
8918 private:
8921};
8922
8924 : public FixedInputValueNodeT<3, LoadNamedFromSuperGeneric> {
8926
8927 public:
8928 explicit LoadNamedFromSuperGeneric(uint64_t bitfield, compiler::NameRef name,
8929 const compiler::FeedbackSource& feedback)
8930 : Base(bitfield), name_(name), feedback_(feedback) {}
8931
8932 // The implementation currently calls runtime.
8937
8938 compiler::NameRef name() const { return name_; }
8940
8941 static constexpr int kContextIndex = 0;
8942 static constexpr int kReceiverIndex = 1;
8943 static constexpr int kLookupStartObjectIndex = 2;
8944 Input& context() { return input(kContextIndex); }
8945 Input& receiver() { return input(kReceiverIndex); }
8947
8948 int MaxCallStackArgs() const;
8951 void PrintParams(std::ostream&, MaglevGraphLabeller*) const;
8952
8953 private:
8956};
8957
8958class SetNamedGeneric : public FixedInputValueNodeT<3, SetNamedGeneric> {
8960
8961 public:
8962 explicit SetNamedGeneric(uint64_t bitfield, compiler::NameRef name,
8963 const compiler::FeedbackSource& feedback)
8964 : Base(bitfield), name_(name), feedback_(feedback) {}
8965
8966 // The implementation currently calls runtime.
8971
8972 compiler::NameRef name() const { return name_; }
8974
8975 static constexpr int kContextIndex = 0;
8976 static constexpr int kObjectIndex = 1;
8977 static constexpr int kValueIndex = 2;
8978 Input& context() { return input(kContextIndex); }
8979 Input& object_input() { return input(kObjectIndex); }
8980 Input& value_input() { return input(kValueIndex); }
8981
8982 int MaxCallStackArgs() const;
8985 void PrintParams(std::ostream&, MaglevGraphLabeller*) const;
8986
8987 private:
8990};
8991
8993 : public FixedInputValueNodeT<1, LoadEnumCacheLength> {
8995
8996 public:
8997 explicit LoadEnumCacheLength(uint64_t bitfield) : Base(bitfield) {}
8998
8999 static constexpr OpProperties kProperties =
9001 static constexpr
9003
9004 static constexpr int kMapInput = 0;
9005 Input& map_input() { return input(kMapInput); }
9006
9009 void PrintParams(std::ostream&, MaglevGraphLabeller*) const {}
9010};
9011
9012class StringAt : public FixedInputValueNodeT<2, StringAt> {
9014
9015 public:
9016 explicit StringAt(uint64_t bitfield) : Base(bitfield) {}
9017
9023
9024 static constexpr int kStringIndex = 0;
9025 static constexpr int kIndexIndex = 1;
9026 Input& string_input() { return input(kStringIndex); }
9027 Input& index_input() { return input(kIndexIndex); }
9028
9029 int MaxCallStackArgs() const;
9032 void PrintParams(std::ostream&, MaglevGraphLabeller*) const {}
9033};
9034
9035class StringLength : public FixedInputValueNodeT<1, StringLength> {
9037
9038 public:
9039 explicit StringLength(uint64_t bitfield) : Base(bitfield) {}
9040
9041 static constexpr OpProperties kProperties =
9043 static constexpr
9045
9046 static constexpr int kObjectIndex = 0;
9047 Input& object_input() { return input(kObjectIndex); }
9048
9049 int MaxCallStackArgs() const;
9052 void PrintParams(std::ostream&, MaglevGraphLabeller*) const {}
9053};
9054
9055class StringConcat : public FixedInputValueNodeT<2, StringConcat> {
9057
9058 public:
9059 explicit StringConcat(uint64_t bitfield) : Base(bitfield) {}
9060
9061 static constexpr OpProperties kProperties =
9066
9067 Input& lhs() { return Node::input(0); }
9068 Input& rhs() { return Node::input(1); }
9069
9070 int MaxCallStackArgs() const { return 0; }
9073 void PrintParams(std::ostream&, MaglevGraphLabeller*) const {}
9074};
9075
9076/*
9077 * This instruction takes two string map inputs and returns the result map that
9078 * is required for a cons string of these two inputs types (i.e.,
9079 * Const(One|Two)ByteStringMap).
9080 *
9081 * TODO(olivf): Remove this instruction and instead select the result map using
9082 * normal branches. This needs allocation folding support across the resulting
9083 * sub-graph.
9084 *
9085 */
9086class ConsStringMap : public FixedInputValueNodeT<2, ConsStringMap> {
9088
9089 public:
9090 explicit ConsStringMap(uint64_t bitfield) : Base(bitfield) {}
9091
9093
9096
9097 Input& lhs() { return Node::input(0); }
9098 Input& rhs() { return Node::input(1); }
9099
9100#ifdef V8_STATIC_ROOTS
9101 void MarkTaggedInputsAsDecompressing() const {
9102 // Not needed as we just check some bits on the map ptr.
9103 }
9104#endif
9105
9106 int MaxCallStackArgs() const { return 0; }
9109 void PrintParams(std::ostream&, MaglevGraphLabeller*) const {}
9110};
9111
9113 : public FixedInputValueNodeT<1, UnwrapStringWrapper> {
9115
9116 public:
9117 explicit UnwrapStringWrapper(uint64_t bitfield) : Base(bitfield) {}
9118
9120
9121 static constexpr
9123
9125
9126 int MaxCallStackArgs() const { return 0; }
9129 void PrintParams(std::ostream&, MaglevGraphLabeller*) const {}
9130};
9131
9132class UnwrapThinString : public FixedInputValueNodeT<1, UnwrapThinString> {
9134
9135 public:
9136 explicit UnwrapThinString(uint64_t bitfield) : Base(bitfield) {}
9137
9139
9140 static constexpr
9142
9144
9145 int MaxCallStackArgs() const { return 0; }
9148 void PrintParams(std::ostream&, MaglevGraphLabeller*) const {}
9149};
9150
9152 : public FixedInputValueNodeT<3, DefineNamedOwnGeneric> {
9154
9155 public:
9156 explicit DefineNamedOwnGeneric(uint64_t bitfield, compiler::NameRef name,
9157 const compiler::FeedbackSource& feedback)
9158 : Base(bitfield), name_(name), feedback_(feedback) {}
9159
9160 // The implementation currently calls runtime.
9165
9166 compiler::NameRef name() const { return name_; }
9168
9169 static constexpr int kContextIndex = 0;
9170 static constexpr int kObjectIndex = 1;
9171 static constexpr int kValueIndex = 2;
9172 Input& context() { return input(kContextIndex); }
9173 Input& object_input() { return input(kObjectIndex); }
9174 Input& value_input() { return input(kValueIndex); }
9175
9176 int MaxCallStackArgs() const;
9179 void PrintParams(std::ostream&, MaglevGraphLabeller*) const;
9180
9181 private:
9184};
9185
9187 : public FixedInputValueNodeT<4, StoreInArrayLiteralGeneric> {
9189
9190 public:
9191 explicit StoreInArrayLiteralGeneric(uint64_t bitfield,
9192 const compiler::FeedbackSource& feedback)
9193 : Base(bitfield), feedback_(feedback) {}
9194
9195 // The implementation currently calls runtime.
9200
9202
9203 static constexpr int kContextIndex = 0;
9204 static constexpr int kObjectIndex = 1;
9205 static constexpr int kNameIndex = 2;
9206 static constexpr int kValueIndex = 3;
9207 Input& context() { return input(kContextIndex); }
9208 Input& object_input() { return input(kObjectIndex); }
9209 Input& name_input() { return input(kNameIndex); }
9210 Input& value_input() { return input(kValueIndex); }
9211
9212 int MaxCallStackArgs() const;
9215 void PrintParams(std::ostream&, MaglevGraphLabeller*) const {}
9216
9217 private:
9219};
9220
9221class GetKeyedGeneric : public FixedInputValueNodeT<3, GetKeyedGeneric> {
9223
9224 public:
9225 explicit GetKeyedGeneric(uint64_t bitfield,
9226 const compiler::FeedbackSource& feedback)
9227 : Base(bitfield), feedback_(feedback) {}
9228
9229 // The implementation currently calls runtime.
9234
9236
9237 static constexpr int kContextIndex = 0;
9238 static constexpr int kObjectIndex = 1;
9239 static constexpr int kKeyIndex = 2;
9240 Input& context() { return input(kContextIndex); }
9241 Input& object_input() { return input(kObjectIndex); }
9242 Input& key_input() { return input(kKeyIndex); }
9243
9244 int MaxCallStackArgs() const;
9247 void PrintParams(std::ostream&, MaglevGraphLabeller*) const {}
9248
9249 private:
9251};
9252
9253class SetKeyedGeneric : public FixedInputValueNodeT<4, SetKeyedGeneric> {
9255
9256 public:
9257 explicit SetKeyedGeneric(uint64_t bitfield,
9258 const compiler::FeedbackSource& feedback)
9259 : Base(bitfield), feedback_(feedback) {}
9260
9261 // The implementation currently calls runtime.
9266
9268
9269 static constexpr int kContextIndex = 0;
9270 static constexpr int kObjectIndex = 1;
9271 static constexpr int kKeyIndex = 2;
9272 static constexpr int kValueIndex = 3;
9273 Input& context() { return input(kContextIndex); }
9274 Input& object_input() { return input(kObjectIndex); }
9275 Input& key_input() { return input(kKeyIndex); }
9276 Input& value_input() { return input(kValueIndex); }
9277
9278 int MaxCallStackArgs() const;
9281 void PrintParams(std::ostream&, MaglevGraphLabeller*) const {}
9282
9283 private:
9285};
9286
9288 : public FixedInputValueNodeT<5, DefineKeyedOwnGeneric> {
9290
9291 public:
9292 explicit DefineKeyedOwnGeneric(uint64_t bitfield,
9293 const compiler::FeedbackSource& feedback)
9294 : Base(bitfield), feedback_(feedback) {}
9295
9296 // The implementation currently calls runtime.
9302
9304
9305 static constexpr int kContextIndex = 0;
9306 static constexpr int kObjectIndex = 1;
9307 static constexpr int kKeyIndex = 2;
9308 static constexpr int kValueIndex = 3;
9309 static constexpr int kFlagsIndex = 4;
9310 Input& context() { return input(kContextIndex); }
9311 Input& object_input() { return input(kObjectIndex); }
9312 Input& key_input() { return input(kKeyIndex); }
9313 Input& value_input() { return input(kValueIndex); }
9314 Input& flags_input() { return input(kFlagsIndex); }
9315
9316 int MaxCallStackArgs() const;
9319 void PrintParams(std::ostream&, MaglevGraphLabeller*) const {}
9320
9321 private:
9323};
9324
9325class GapMove : public FixedInputNodeT<0, GapMove> {
9327
9328 public:
9329 GapMove(uint64_t bitfield, compiler::AllocatedOperand source,
9331 : Base(bitfield), source_(source), target_(target) {}
9332
9335
9338 void PrintParams(std::ostream&, MaglevGraphLabeller*) const;
9339
9340 private:
9343};
9344
9345class ConstantGapMove : public FixedInputNodeT<0, ConstantGapMove> {
9347
9348 public:
9349 ConstantGapMove(uint64_t bitfield, ValueNode* node,
9351 : Base(bitfield), node_(node), target_(target) {}
9352
9354 ValueNode* node() const { return node_; }
9355
9358 void PrintParams(std::ostream&, MaglevGraphLabeller*) const;
9359
9360 private:
9364};
9365
9367
9368// ValueRepresentation doesn't distinguish between Int32 and TruncatedInt32:
9369// both are Int32. For Phi untagging however, it's interesting to have a
9370// difference between the 2, as a TruncatedInt32 would allow untagging to
9371// Float64, whereas an Int32 use wouldn't (because it would require a deopting
9372// Float64->Int32 conversion, whereas the truncating version of this conversion
9373// cannot deopt). We thus use a UseRepresentation to record use hints for Phis.
9374enum class UseRepresentation : uint8_t {
9375 kTagged,
9376 kInt32,
9378 kUint32,
9379 kFloat64,
9381};
9382
9383inline std::ostream& operator<<(std::ostream& os,
9384 const UseRepresentation& repr) {
9385 switch (repr) {
9387 return os << "Tagged";
9389 return os << "Int32";
9391 return os << "TruncatedInt32";
9393 return os << "Uint32";
9395 return os << "Float64";
9397 return os << "HoleyFloat64";
9398 }
9399}
9400
9403
9404// TODO(verwaest): It may make more sense to buffer phis in merged_states until
9405// we set up the interpreter frame state for code generation. At that point we
9406// can generate correctly-sized phis.
9407class Phi : public ValueNodeT<Phi> {
9409
9410 public:
9412
9413 // TODO(jgruber): More intuitive constructors, if possible.
9423
9424 Input& backedge_input() { return input(input_count() - 1); }
9425
9428 return merge_state_;
9429 }
9430
9433 using Node::set_input;
9434
9435 bool is_exception_phi() const { return input_count() == 0; }
9436 bool is_loop_phi() const;
9437
9438 bool is_backedge_offset(int i) const {
9439 return is_loop_phi() && i == input_count() - 1;
9440 }
9441
9442 void VerifyInputs(MaglevGraphLabeller* graph_labeller) const;
9443
9444#ifdef V8_COMPRESS_POINTERS
9445 void MarkTaggedInputsAsDecompressing() {
9446 // Do not mark inputs as decompressing here, since we don't yet know whether
9447 // this Phi needs decompression. Instead, let
9448 // Node::SetTaggedResultNeedsDecompress pass through phis.
9449 }
9450#endif
9451
9454 void PrintParams(std::ostream&, MaglevGraphLabeller*) const;
9455
9457
9461
9463
9468
9484
9486 DCHECK(!has_key());
9487 type_ = IntersectType(type_, type);
9488 }
9489 void set_type(NodeType type) {
9490 DCHECK(!has_key());
9491 type_ = type;
9492 }
9493 NodeType type() const {
9494 DCHECK(!has_key());
9495 return type_;
9496 }
9497
9499 Key key() const {
9500 DCHECK(has_key());
9501 return key_;
9502 }
9504 set_bitfield(bitfield() | HasKeyFlag::encode(true));
9505 key_ = key;
9506 }
9507
9508 // True if the {key_} field has been initialized.
9509 bool has_key() const { return HasKeyFlag::decode(bitfield()); }
9510
9511 // Remembers if a use is unsafely untagged. If that happens we must ensure to
9512 // stay within the smi range, even when untagging.
9515 return Requires31BitValueFlag::decode(bitfield());
9516 }
9518 set_bitfield(bitfield() | Requires31BitValueFlag::encode(true));
9519 }
9520
9521 // Check if a phi has cleared the loop.
9522 bool is_unmerged_loop_phi() const;
9523
9524 private:
9525 Phi** next() { return &next_; }
9526
9527 using HasKeyFlag = NextBitField<bool, 1>;
9528 using Requires31BitValueFlag = HasKeyFlag::Next<bool, 1>;
9529 using LoopPhiAfterLoopFlag = Requires31BitValueFlag::Next<bool, 1>;
9530
9532
9535
9536 Phi* next_ = nullptr;
9538
9539 union {
9540 struct {
9541 // The type of this Phi based on its predecessors' types.
9543 // {type_} for loop Phis should always be Unknown until their backedge has
9544 // been bound (because we don't know what will be the type of the
9545 // backedge). However, once the backedge is bound, we might be able to
9546 // refine it. {post_loop_type_} is thus used to keep track of loop Phi
9547 // types: for loop Phis, we update {post_loop_type_} when we merge
9548 // predecessors, but keep {type_} as Unknown. Once the backedge is bound,
9549 // we set {type_} as {post_loop_type_}.
9551 };
9552 // After graph building, {type_} and {post_loop_type_} are not used anymore,
9553 // so we reuse this memory to store the SnapshotTable Key for this Phi for
9554 // phi untagging.
9556 };
9557
9559};
9560
9561class Call : public ValueNodeT<Call> {
9563
9564 public:
9565 enum class TargetType { kJSFunction, kAny };
9566 // We assume function and context as fixed inputs.
9567 static constexpr int kFunctionIndex = 0;
9568 static constexpr int kContextIndex = 1;
9569 static constexpr int kFixedInputCount = 2;
9570
9571 // We need enough inputs to have these fixed inputs plus the maximum arguments
9572 // to a function call.
9573 static_assert(kMaxInputs >= kFixedInputCount + Code::kMaxArguments);
9574
9575 // This ctor is used when for variable input counts.
9576 // Inputs must be initialized manually.
9578 ValueNode* function, ValueNode* context)
9579 : Base(bitfield), receiver_mode_(mode), target_type_(target_type) {
9580 set_input(kFunctionIndex, function);
9581 set_input(kContextIndex, context);
9582 }
9583
9585
9586 Input& function() { return input(kFunctionIndex); }
9587 const Input& function() const { return input(kFunctionIndex); }
9588 Input& context() { return input(kContextIndex); }
9589 const Input& context() const { return input(kContextIndex); }
9590 int num_args() const { return input_count() - kFixedInputCount; }
9591 Input& arg(int i) { return input(i + kFixedInputCount); }
9592 void set_arg(int i, ValueNode* node) {
9593 set_input(i + kFixedInputCount, node);
9594 }
9595 auto args() {
9597 std::make_reverse_iterator(&arg(-1)),
9598 std::make_reverse_iterator(&arg(num_args() - 1)));
9599 }
9600
9601 void VerifyInputs(MaglevGraphLabeller* graph_labeller) const;
9602#ifdef V8_COMPRESS_POINTERS
9603 void MarkTaggedInputsAsDecompressing();
9604#endif
9605 int MaxCallStackArgs() const;
9608 void PrintParams(std::ostream&, MaglevGraphLabeller*) const;
9609
9612
9613 private:
9616};
9617
9618class Construct : public ValueNodeT<Construct> {
9620
9621 public:
9622 // We assume function and context as fixed inputs.
9623 static constexpr int kFunctionIndex = 0;
9624 static constexpr int kNewTargetIndex = 1;
9625 static constexpr int kContextIndex = 2;
9626 static constexpr int kFixedInputCount = 3;
9627
9628 // We need enough inputs to have these fixed inputs plus the maximum arguments
9629 // to a function call.
9630 static_assert(kMaxInputs >= kFixedInputCount + Code::kMaxArguments);
9631
9632 // This ctor is used when for variable input counts.
9633 // Inputs must be initialized manually.
9634 Construct(uint64_t bitfield, const compiler::FeedbackSource& feedback,
9635 ValueNode* function, ValueNode* new_target, ValueNode* context)
9636 : Base(bitfield), feedback_(feedback) {
9637 set_input(kFunctionIndex, function);
9638 set_input(kNewTargetIndex, new_target);
9639 set_input(kContextIndex, context);
9640 }
9641
9643
9644 Input& function() { return input(kFunctionIndex); }
9645 const Input& function() const { return input(kFunctionIndex); }
9646 Input& new_target() { return input(kNewTargetIndex); }
9647 const Input& new_target() const { return input(kNewTargetIndex); }
9648 Input& context() { return input(kContextIndex); }
9649 const Input& context() const { return input(kContextIndex); }
9650 int num_args() const { return input_count() - kFixedInputCount; }
9651 Input& arg(int i) { return input(i + kFixedInputCount); }
9652 void set_arg(int i, ValueNode* node) {
9653 set_input(i + kFixedInputCount, node);
9654 }
9655 auto args() {
9657 std::make_reverse_iterator(&arg(-1)),
9658 std::make_reverse_iterator(&arg(num_args() - 1)));
9659 }
9660
9662
9663 void VerifyInputs(MaglevGraphLabeller* graph_labeller) const;
9664#ifdef V8_COMPRESS_POINTERS
9665 void MarkTaggedInputsAsDecompressing();
9666#endif
9667 int MaxCallStackArgs() const;
9670 void PrintParams(std::ostream&, MaglevGraphLabeller*) const {}
9671
9672 private:
9674};
9675
9676class CallBuiltin : public ValueNodeT<CallBuiltin> {
9678
9679 public:
9681
9682 // This ctor is used when for variable input counts.
9683 // Inputs must be initialized manually.
9684 CallBuiltin(uint64_t bitfield, Builtin builtin)
9685 : Base(bitfield), builtin_(builtin) {
9686 DCHECK(
9687 !Builtins::CallInterfaceDescriptorFor(builtin).HasContextParameter());
9688 }
9689
9690 // This ctor is used when for variable input counts.
9691 // Inputs must be initialized manually.
9692 CallBuiltin(uint64_t bitfield, Builtin builtin, ValueNode* context)
9693 : Base(bitfield), builtin_(builtin) {
9694 DCHECK(Builtins::CallInterfaceDescriptorFor(builtin).HasContextParameter());
9695 // We use the last valid input for the context.
9696 set_input(input_count() - 1, context);
9697 }
9698
9699 // This is an overestimation, since some builtins might not call JS code.
9701
9702 bool has_feedback() const { return feedback_.has_value(); }
9705 return feedback_.value();
9706 }
9709 return slot_type_;
9710 }
9716
9717 Builtin builtin() const { return builtin_; }
9719 DCHECK(
9720 Builtins::CallInterfaceDescriptorFor(builtin()).HasContextParameter());
9721 return input(input_count() - 1);
9722 }
9723
9726 bool has_context = descriptor.HasContextParameter();
9727 int extra_input_count = has_context ? 1 : 0;
9728 return input_count() - extra_input_count;
9729 }
9730
9733 if (has_feedback()) {
9734 int slot_index = InputCountWithoutContext();
9735 int vector_index = slot_index + 1;
9736
9737 // There are three possibilities:
9738 // 1. Feedback slot and vector are in register.
9739 // 2. Feedback slot is in register and vector is on stack.
9740 // 3. Feedback slot and vector are on stack.
9741 if (vector_index < descriptor.GetRegisterParameterCount()) {
9742 return descriptor.GetRegisterParameterCount() - 2;
9743 } else if (vector_index == descriptor.GetRegisterParameterCount()) {
9744 return descriptor.GetRegisterParameterCount() - 1;
9745 } else {
9746 return descriptor.GetRegisterParameterCount();
9747 }
9748 }
9749 return descriptor.GetRegisterParameterCount();
9750 }
9751
9752 auto stack_args() {
9754 std::make_reverse_iterator(&input(InputsInRegisterCount() - 1)),
9755 std::make_reverse_iterator(&input(InputCountWithoutContext() - 1)));
9756 }
9757
9758 void set_arg(int i, ValueNode* node) { set_input(i, node); }
9759
9763
9764 void VerifyInputs(MaglevGraphLabeller* graph_labeller) const;
9765#ifdef V8_COMPRESS_POINTERS
9766 void MarkTaggedInputsAsDecompressing();
9767#endif
9768 int MaxCallStackArgs() const;
9771 void PrintParams(std::ostream&, MaglevGraphLabeller*) const;
9772
9773 private:
9774 template <typename... Args>
9775 void PushArguments(MaglevAssembler* masm, Args... extra_args);
9778
9780 std::optional<compiler::FeedbackSource> feedback_;
9782};
9783
9784class CallCPPBuiltin : public ValueNodeT<CallCPPBuiltin> {
9786 // Only 1 return value with arguments on the stack is supported.
9787 static constexpr Builtin kCEntry_Builtin =
9788 Builtin::kCEntry_Return1_ArgvOnStack_BuiltinExit;
9789
9790 public:
9791 static constexpr int kTargetIndex = 0;
9792 static constexpr int kNewTargetIndex = 1;
9793 static constexpr int kContextIndex = 2;
9794 static constexpr int kFixedInputCount = 3;
9795
9796 CallCPPBuiltin(uint64_t bitfield, Builtin builtin, ValueNode* target,
9797 ValueNode* new_target, ValueNode* context)
9798 : Base(bitfield), builtin_(builtin) {
9799 DCHECK(Builtins::CallInterfaceDescriptorFor(builtin).HasContextParameter());
9800 DCHECK_EQ(Builtins::CallInterfaceDescriptorFor(builtin).GetReturnCount(),
9801 1);
9802 set_input(kTargetIndex, target);
9803 set_input(kNewTargetIndex, new_target);
9804 set_input(kContextIndex, context);
9805 }
9806
9807 // This is an overestimation, since some builtins might not call JS code.
9809
9810 Builtin builtin() const { return builtin_; }
9811
9812 Input& target() { return input(kTargetIndex); }
9813 const Input& target() const { return input(kTargetIndex); }
9814 Input& new_target() { return input(kNewTargetIndex); }
9815 const Input& new_target() const { return input(kNewTargetIndex); }
9816 Input& context() { return input(kContextIndex); }
9817 const Input& context() const { return input(kContextIndex); }
9818
9819 int num_args() const { return input_count() - kFixedInputCount; }
9820 Input& arg(int i) { return input(i + kFixedInputCount); }
9821 void set_arg(int i, ValueNode* node) {
9822 set_input(i + kFixedInputCount, node);
9823 }
9824
9825 auto args() {
9827 std::make_reverse_iterator(&arg(-1)),
9828 std::make_reverse_iterator(&arg(num_args() - 1)));
9829 }
9830
9831 void VerifyInputs(MaglevGraphLabeller* graph_labeller) const;
9832#ifdef V8_COMPRESS_POINTERS
9833 void MarkTaggedInputsAsDecompressing();
9834#endif
9835 int MaxCallStackArgs() const;
9838 void PrintParams(std::ostream&, MaglevGraphLabeller*) const;
9839
9840 private:
9842};
9843
9844class CallForwardVarargs : public ValueNodeT<CallForwardVarargs> {
9846
9847 public:
9848 static constexpr int kFunctionIndex = 0;
9849 static constexpr int kContextIndex = 1;
9850 static constexpr int kFixedInputCount = 2;
9851
9852 // We need enough inputs to have these fixed inputs plus the maximum arguments
9853 // to a function call.
9854 static_assert(kMaxInputs >= kFixedInputCount + Code::kMaxArguments);
9855
9856 // This ctor is used when for variable input counts.
9857 // Inputs must be initialized manually.
9858 CallForwardVarargs(uint64_t bitfield, ValueNode* function, ValueNode* context,
9861 set_input(kFunctionIndex, function);
9862 set_input(kContextIndex, context);
9863 }
9864
9866
9867 Input& function() { return input(kFunctionIndex); }
9868 const Input& function() const { return input(kFunctionIndex); }
9869 Input& context() { return input(kContextIndex); }
9870 const Input& context() const { return input(kContextIndex); }
9871 int num_args() const { return input_count() - kFixedInputCount; }
9872 Input& arg(int i) { return input(i + kFixedInputCount); }
9873 void set_arg(int i, ValueNode* node) {
9874 set_input(i + kFixedInputCount, node);
9875 }
9876 auto args() {
9878 std::make_reverse_iterator(&arg(-1)),
9879 std::make_reverse_iterator(&arg(num_args() - 1)));
9880 }
9881
9882 void VerifyInputs(MaglevGraphLabeller* graph_labeller) const;
9883#ifdef V8_COMPRESS_POINTERS
9884 void MarkTaggedInputsAsDecompressing();
9885#endif
9886 int MaxCallStackArgs() const;
9889 void PrintParams(std::ostream&, MaglevGraphLabeller*) const;
9890
9891 int start_index() const { return start_index_; }
9893
9894 private:
9897};
9898
9899class CallRuntime : public ValueNodeT<CallRuntime> {
9901
9902 public:
9903 // We assume the context as fixed input.
9904 static constexpr int kContextIndex = 0;
9905 static constexpr int kFixedInputCount = 1;
9906
9907 // This ctor is used when for variable input counts.
9908 // Inputs must be initialized manually.
9910 ValueNode* context)
9911 : Base(bitfield), function_id_(function_id) {
9912 set_input(kContextIndex, context);
9913 }
9914
9916
9918
9919 Input& context() { return input(kContextIndex); }
9920 const Input& context() const { return input(kContextIndex); }
9921 int num_args() const { return input_count() - kFixedInputCount; }
9922 Input& arg(int i) { return input(i + kFixedInputCount); }
9923 void set_arg(int i, ValueNode* node) {
9924 set_input(i + kFixedInputCount, node);
9925 }
9926 auto args() {
9928 std::make_reverse_iterator(&arg(-1)),
9929 std::make_reverse_iterator(&arg(num_args() - 1)));
9930 }
9931
9932 int ReturnCount() const {
9933 return Runtime::FunctionForId(function_id())->result_size;
9934 }
9935
9936 void VerifyInputs(MaglevGraphLabeller* graph_labeller) const;
9937#ifdef V8_COMPRESS_POINTERS
9938 void MarkTaggedInputsAsDecompressing();
9939#endif
9940 int MaxCallStackArgs() const;
9943 void PrintParams(std::ostream&, MaglevGraphLabeller*) const;
9944
9945 private:
9947};
9948
9949class CallWithSpread : public ValueNodeT<CallWithSpread> {
9951
9952 public:
9953 // We assume function and context as fixed inputs.
9954 static constexpr int kFunctionIndex = 0;
9955 static constexpr int kContextIndex = 1;
9956 static constexpr int kFixedInputCount = 2;
9957
9958 // This ctor is used when for variable input counts.
9959 // Inputs must be initialized manually.
9960 CallWithSpread(uint64_t bitfield, ValueNode* function, ValueNode* context)
9961 : Base(bitfield) {
9962 set_input(kFunctionIndex, function);
9963 set_input(kContextIndex, context);
9964 }
9965
9967
9968 Input& function() { return input(kFunctionIndex); }
9969 const Input& function() const { return input(kFunctionIndex); }
9970 Input& context() { return input(kContextIndex); }
9971 const Input& context() const { return input(kContextIndex); }
9972 int num_args() const { return input_count() - kFixedInputCount; }
9974 DCHECK_GT(num_args(), 0);
9975 return num_args() - 1;
9976 }
9977 Input& arg(int i) { return input(i + kFixedInputCount); }
9978 void set_arg(int i, ValueNode* node) {
9979 set_input(i + kFixedInputCount, node);
9980 }
9983 std::make_reverse_iterator(&arg(-1)),
9984 std::make_reverse_iterator(&arg(num_args_no_spread() - 1)));
9985 }
9987 // Spread is the last argument/input.
9988 return input(input_count() - 1);
9989 }
9990 Input& receiver() { return arg(0); }
9991
9992 void VerifyInputs(MaglevGraphLabeller* graph_labeller) const;
9993#ifdef V8_COMPRESS_POINTERS
9994 void MarkTaggedInputsAsDecompressing();
9995#endif
9996 int MaxCallStackArgs() const;
9999 void PrintParams(std::ostream&, MaglevGraphLabeller*) const {}
10000};
10001
10002class CallWithArrayLike : public FixedInputValueNodeT<4, CallWithArrayLike> {
10004
10005 public:
10006 // We assume function and context as fixed inputs.
10007 static constexpr int kFunctionIndex = 0;
10008 static constexpr int kReceiverIndex = 1;
10009 static constexpr int kArgumentsListIndex = 2;
10010 static constexpr int kContextIndex = 3;
10011
10012 // This ctor is used when for variable input counts.
10013 // Inputs must be initialized manually.
10014 explicit CallWithArrayLike(uint64_t bitfield) : Base(bitfield) {}
10015
10020
10021 Input& function() { return input(kFunctionIndex); }
10022 Input& receiver() { return input(kReceiverIndex); }
10024 Input& context() { return input(kContextIndex); }
10025
10026 void VerifyInputs(MaglevGraphLabeller* graph_labeller) const;
10027#ifdef V8_COMPRESS_POINTERS
10028 void MarkTaggedInputsAsDecompressing();
10029#endif
10030 int MaxCallStackArgs() const;
10033 void PrintParams(std::ostream&, MaglevGraphLabeller*) const {}
10034};
10035
10036class CallSelf : public ValueNodeT<CallSelf> {
10038
10039 public:
10040 static constexpr int kClosureIndex = 0;
10041 static constexpr int kContextIndex = 1;
10042 static constexpr int kReceiverIndex = 2;
10043 static constexpr int kNewTargetIndex = 3;
10044 static constexpr int kFixedInputCount = 4;
10045
10046 // We need enough inputs to have these fixed inputs plus the maximum arguments
10047 // to a function call.
10048 static_assert(kMaxInputs >= kFixedInputCount + Code::kMaxArguments);
10049
10050 // This ctor is used when for variable input counts.
10051 // Inputs must be initialized manually.
10052 CallSelf(uint64_t bitfield, int expected_parameter_count, ValueNode* closure,
10054 : Base(bitfield), expected_parameter_count_(expected_parameter_count) {
10055 set_input(kClosureIndex, closure);
10056 set_input(kContextIndex, context);
10057 set_input(kReceiverIndex, receiver);
10058 set_input(kNewTargetIndex, new_target);
10059 }
10060
10062
10063 Input& closure() { return input(kClosureIndex); }
10064 const Input& closure() const { return input(kClosureIndex); }
10065 Input& context() { return input(kContextIndex); }
10066 const Input& context() const { return input(kContextIndex); }
10067 Input& receiver() { return input(kReceiverIndex); }
10068 const Input& receiver() const { return input(kReceiverIndex); }
10069 Input& new_target() { return input(kNewTargetIndex); }
10070 const Input& new_target() const { return input(kNewTargetIndex); }
10071 int num_args() const { return input_count() - kFixedInputCount; }
10072 Input& arg(int i) { return input(i + kFixedInputCount); }
10073 void set_arg(int i, ValueNode* node) {
10074 set_input(i + kFixedInputCount, node);
10075 }
10076 auto args() {
10078 std::make_reverse_iterator(&arg(-1)),
10079 std::make_reverse_iterator(&arg(num_args() - 1)));
10080 }
10081
10082 void VerifyInputs(MaglevGraphLabeller* graph_labeller) const;
10083#ifdef V8_COMPRESS_POINTERS
10084 void MarkTaggedInputsAsDecompressing();
10085#endif
10086 int MaxCallStackArgs() const;
10089 void PrintParams(std::ostream&, MaglevGraphLabeller*) const;
10090
10091 private:
10093};
10094
10095class CallKnownJSFunction : public ValueNodeT<CallKnownJSFunction> {
10097
10098 public:
10099 static constexpr int kClosureIndex = 0;
10100 static constexpr int kContextIndex = 1;
10101 static constexpr int kReceiverIndex = 2;
10102 static constexpr int kNewTargetIndex = 3;
10103 static constexpr int kFixedInputCount = 4;
10104
10105 // We need enough inputs to have these fixed inputs plus the maximum arguments
10106 // to a function call.
10107 static_assert(kMaxInputs >= kFixedInputCount + Code::kMaxArguments);
10108
10109 // This ctor is used when for variable input counts.
10110 // Inputs must be initialized manually.
10111 inline CallKnownJSFunction(
10112 uint64_t bitfield,
10113#ifdef V8_ENABLE_LEAPTIERING
10114 JSDispatchHandle dispatch_handle,
10115#endif
10118
10120
10121 Input& closure() { return input(kClosureIndex); }
10122 const Input& closure() const { return input(kClosureIndex); }
10123 Input& context() { return input(kContextIndex); }
10124 const Input& context() const { return input(kContextIndex); }
10125 Input& receiver() { return input(kReceiverIndex); }
10126 const Input& receiver() const { return input(kReceiverIndex); }
10127 Input& new_target() { return input(kNewTargetIndex); }
10128 const Input& new_target() const { return input(kNewTargetIndex); }
10129 int num_args() const { return input_count() - kFixedInputCount; }
10130 Input& arg(int i) { return input(i + kFixedInputCount); }
10131 void set_arg(int i, ValueNode* node) {
10132 set_input(i + kFixedInputCount, node);
10133 }
10134 auto args() {
10136 std::make_reverse_iterator(&arg(-1)),
10137 std::make_reverse_iterator(&arg(num_args() - 1)));
10138 }
10139
10143
10144 void VerifyInputs(MaglevGraphLabeller* graph_labeller) const;
10145#ifdef V8_COMPRESS_POINTERS
10146 void MarkTaggedInputsAsDecompressing();
10147#endif
10148 int MaxCallStackArgs() const;
10151 void PrintParams(std::ostream&, MaglevGraphLabeller*) const;
10152
10154
10155 private:
10156#ifdef V8_ENABLE_LEAPTIERING
10157 JSDispatchHandle dispatch_handle_;
10158#endif
10160 // Cache the expected parameter count so that we can access it in
10161 // MaxCallStackArgs without needing to unpark the local isolate.
10163};
10164
10165class CallKnownApiFunction : public ValueNodeT<CallKnownApiFunction> {
10167
10168 public:
10169 enum Mode {
10170 // Use Builtin::kCallApiCallbackOptimizedNoProfiling.
10172 // Inline API call sequence into the generated code.
10174 // Use Builtin::kCallApiCallbackOptimized.
10176 };
10177
10178 static constexpr int kContextIndex = 0;
10179 static constexpr int kReceiverIndex = 1;
10180 static constexpr int kFixedInputCount = 2;
10181
10182 // We need enough inputs to have these fixed inputs plus the maximum arguments
10183 // to a function call.
10184 static_assert(kMaxInputs >= kFixedInputCount + Code::kMaxArguments);
10185
10186 // This ctor is used when for variable input counts.
10187 // Inputs must be initialized manually.
10188 CallKnownApiFunction(uint64_t bitfield, Mode mode,
10190 ValueNode* context, ValueNode* receiver)
10191 : Base(bitfield | ModeField::encode(mode)),
10193 set_input(kContextIndex, context);
10194 set_input(kReceiverIndex, receiver);
10195 }
10196
10197 // TODO(ishell): introduce JSApiCall() which will take C++ ABI into account
10198 // when deciding which registers to splill.
10200
10201 // Input& closure() { return input(kClosureIndex); }
10202 // const Input& closure() const { return input(kClosureIndex); }
10203 Input& context() { return input(kContextIndex); }
10204 const Input& context() const { return input(kContextIndex); }
10205 Input& receiver() { return input(kReceiverIndex); }
10206 const Input& receiver() const { return input(kReceiverIndex); }
10207 int num_args() const { return input_count() - kFixedInputCount; }
10208 Input& arg(int i) { return input(i + kFixedInputCount); }
10209 void set_arg(int i, ValueNode* node) {
10210 set_input(i + kFixedInputCount, node);
10211 }
10212 auto args() {
10214 std::make_reverse_iterator(&arg(-1)),
10215 std::make_reverse_iterator(&arg(num_args() - 1)));
10216 }
10217
10218 Mode mode() const { return ModeField::decode(bitfield()); }
10219
10223
10224 bool inline_builtin() const { return mode() == kNoProfilingInlined; }
10225
10226 void VerifyInputs(MaglevGraphLabeller* graph_labeller) const;
10227#ifdef V8_COMPRESS_POINTERS
10228 void MarkTaggedInputsAsDecompressing();
10229#endif
10230 int MaxCallStackArgs() const;
10233 void PrintParams(std::ostream&, MaglevGraphLabeller*) const;
10234
10235 private:
10236 using ModeField = NextBitField<Mode, 2>;
10237
10239 const ProcessingState& state);
10240
10242 const compiler::OptionalJSObjectRef api_holder_;
10243};
10244
10245class ConstructWithSpread : public ValueNodeT<ConstructWithSpread> {
10247
10248 public:
10249 // We assume function and context as fixed inputs.
10250 static constexpr int kFunctionIndex = 0;
10251 static constexpr int kNewTargetIndex = 1;
10252 static constexpr int kContextIndex = 2;
10253 static constexpr int kFixedInputCount = 3;
10254
10255 // This ctor is used when for variable input counts.
10256 // Inputs must be initialized manually.
10258 ValueNode* function, ValueNode* new_target,
10259 ValueNode* context)
10260 : Base(bitfield), feedback_(feedback) {
10261 set_input(kFunctionIndex, function);
10262 set_input(kNewTargetIndex, new_target);
10263 set_input(kContextIndex, context);
10264 }
10265
10267
10268 Input& function() { return input(kFunctionIndex); }
10269 const Input& function() const { return input(kFunctionIndex); }
10270 Input& new_target() { return input(kNewTargetIndex); }
10271 const Input& new_target() const { return input(kNewTargetIndex); }
10272 Input& context() { return input(kContextIndex); }
10273 const Input& context() const { return input(kContextIndex); }
10274 int num_args() const { return input_count() - kFixedInputCount; }
10276 DCHECK_GT(num_args(), 0);
10277 return num_args() - 1;
10278 }
10279 Input& arg(int i) { return input(i + kFixedInputCount); }
10280 void set_arg(int i, ValueNode* node) {
10281 set_input(i + kFixedInputCount, node);
10282 }
10284 // Spread is the last argument/input.
10285 return input(input_count() - 1);
10286 }
10289 std::make_reverse_iterator(&arg(-1)),
10290 std::make_reverse_iterator(&arg(num_args_no_spread() - 1)));
10291 }
10293
10294 void VerifyInputs(MaglevGraphLabeller* graph_labeller) const;
10295#ifdef V8_COMPRESS_POINTERS
10296 void MarkTaggedInputsAsDecompressing();
10297#endif
10298 int MaxCallStackArgs() const;
10301 void PrintParams(std::ostream&, MaglevGraphLabeller*) const {}
10302
10303 private:
10305};
10306
10307class ConvertReceiver : public FixedInputValueNodeT<1, ConvertReceiver> {
10309
10310 public:
10311 explicit ConvertReceiver(uint64_t bitfield,
10314 : Base(bitfield), native_context_(native_context), mode_(mode) {}
10315
10316 Input& receiver_input() { return input(0); }
10317
10318 // The implementation currently calls runtime.
10322 static constexpr
10324
10325 int MaxCallStackArgs() const;
10328 void PrintParams(std::ostream&, MaglevGraphLabeller*) const {}
10329
10330 auto options() const { return std::tuple{native_context_, mode_}; }
10331
10333 ConvertReceiverMode mode() const { return mode_; }
10334
10335 private:
10338};
10339
10341 : public FixedInputValueNodeT<2, CheckConstructResult> {
10343
10344 public:
10345 explicit CheckConstructResult(uint64_t bitfield) : Base(bitfield) {}
10346
10347 Input& construct_result_input() { return input(0); }
10348 Input& implicit_receiver_input() { return input(1); }
10349
10352
10353 int MaxCallStackArgs() const;
10356 void PrintParams(std::ostream&, MaglevGraphLabeller*) const {}
10357};
10358
10360 : public FixedInputValueNodeT<1, CheckDerivedConstructResult> {
10362
10363 public:
10364 explicit CheckDerivedConstructResult(uint64_t bitfield) : Base(bitfield) {}
10365
10366 Input& construct_result_input() { return input(0); }
10367
10371 static constexpr
10373
10375
10376 int MaxCallStackArgs() const;
10379 void PrintParams(std::ostream&, MaglevGraphLabeller*) const {}
10380};
10381
10383 : public FixedInputNodeT<1, CheckJSReceiverOrNullOrUndefined> {
10385
10386 public:
10387 explicit CheckJSReceiverOrNullOrUndefined(uint64_t bitfield,
10389 : Base(CheckTypeBitField::update(bitfield, check_type)) {}
10390
10392 static constexpr
10394
10395 Input& object_input() { return input(0); }
10396 CheckType check_type() const { return CheckTypeBitField::decode(bitfield()); }
10397
10400 void PrintParams(std::ostream&, MaglevGraphLabeller*) const {}
10401
10402 auto options() const { return std::tuple{check_type()}; }
10403
10404 private:
10405 using CheckTypeBitField = NextBitField<CheckType, 1>;
10406};
10407
10408class CheckNotHole : public FixedInputNodeT<1, CheckNotHole> {
10410
10411 public:
10412 explicit CheckNotHole(uint64_t bitfield) : Base(bitfield) {}
10413
10415 static constexpr
10417
10418 Input& object_input() { return input(0); }
10419
10422 void PrintParams(std::ostream&, MaglevGraphLabeller*) const {}
10423};
10424
10426 : public FixedInputNodeT<1, CheckHoleyFloat64NotHole> {
10428
10429 public:
10430 explicit CheckHoleyFloat64NotHole(uint64_t bitfield) : Base(bitfield) {}
10431
10433 static constexpr
10435
10436 Input& float64_input() { return input(0); }
10437
10440 void PrintParams(std::ostream&, MaglevGraphLabeller*) const {}
10441};
10442
10444 : public FixedInputValueNodeT<1, ConvertHoleToUndefined> {
10446
10447 public:
10448 explicit ConvertHoleToUndefined(uint64_t bitfield) : Base(bitfield) {}
10449
10450 static constexpr
10452
10453 Input& object_input() { return input(0); }
10454
10457 void PrintParams(std::ostream&, MaglevGraphLabeller*) const {}
10458};
10459
10461 : public FixedInputNodeT<0, HandleNoHeapWritesInterrupt> {
10463
10464 public:
10465 explicit HandleNoHeapWritesInterrupt(uint64_t bitfield) : Base(bitfield) {}
10466
10470
10473 void PrintParams(std::ostream&, MaglevGraphLabeller*) const {}
10474 int MaxCallStackArgs() const { return 0; }
10475};
10476
10478 : public FixedInputNodeT<1, ReduceInterruptBudgetForLoop> {
10480
10481 public:
10482 explicit ReduceInterruptBudgetForLoop(uint64_t bitfield, int amount)
10483 : Base(bitfield), amount_(amount) {
10484 DCHECK_GT(amount, 0);
10485 }
10486
10487 static constexpr
10489
10490 static constexpr OpProperties kProperties =
10493
10494 int amount() const { return amount_; }
10495
10496 Input& feedback_cell() { return input(0); }
10497
10498 int MaxCallStackArgs() const;
10501 void PrintParams(std::ostream&, MaglevGraphLabeller*) const;
10502
10503 private:
10504 const int amount_;
10505};
10506
10508 : public FixedInputNodeT<1, ReduceInterruptBudgetForReturn> {
10510
10511 public:
10512 explicit ReduceInterruptBudgetForReturn(uint64_t bitfield, int amount)
10513 : Base(bitfield), amount_(amount) {
10514 DCHECK_GT(amount, 0);
10515 }
10516
10517 static constexpr
10519
10520 static constexpr OpProperties kProperties =
10522
10523 int amount() const { return amount_; }
10524
10525 Input& feedback_cell() { return input(0); }
10526
10527 int MaxCallStackArgs() const;
10530 void PrintParams(std::ostream&, MaglevGraphLabeller*) const;
10531
10532 private:
10533 const int amount_;
10534};
10535
10537 : public FixedInputNodeT<1, ThrowReferenceErrorIfHole> {
10539
10540 public:
10541 explicit ThrowReferenceErrorIfHole(uint64_t bitfield,
10542 const compiler::NameRef name)
10543 : Base(bitfield), name_(name) {}
10544
10545 static constexpr OpProperties kProperties =
10547 static constexpr
10549
10550 compiler::NameRef name() const { return name_; }
10551
10552 Input& value() { return Node::input(0); }
10553
10554 int MaxCallStackArgs() const;
10557 void PrintParams(std::ostream&, MaglevGraphLabeller*) const {}
10558
10559 auto options() const { return std::tuple{name_}; }
10560
10561 private:
10563};
10564
10566 : public FixedInputNodeT<1, ThrowSuperNotCalledIfHole> {
10568
10569 public:
10570 explicit ThrowSuperNotCalledIfHole(uint64_t bitfield) : Base(bitfield) {}
10571
10572 static constexpr OpProperties kProperties =
10574 static constexpr
10576
10577 Input& value() { return Node::input(0); }
10578
10579 int MaxCallStackArgs() const;
10582 void PrintParams(std::ostream&, MaglevGraphLabeller*) const {}
10583};
10584
10586 : public FixedInputNodeT<1, ThrowSuperAlreadyCalledIfNotHole> {
10588
10589 public:
10590 explicit ThrowSuperAlreadyCalledIfNotHole(uint64_t bitfield)
10591 : Base(bitfield) {}
10592
10593 static constexpr OpProperties kProperties =
10595 static constexpr
10597
10598 Input& value() { return Node::input(0); }
10599
10600 int MaxCallStackArgs() const;
10603 void PrintParams(std::ostream&, MaglevGraphLabeller*) const {}
10604};
10605
10606class ThrowIfNotCallable : public FixedInputNodeT<1, ThrowIfNotCallable> {
10608
10609 public:
10610 explicit ThrowIfNotCallable(uint64_t bitfield) : Base(bitfield) {}
10611
10612 static constexpr OpProperties kProperties =
10614 static constexpr
10616
10617 Input& value() { return Node::input(0); }
10618
10619 int MaxCallStackArgs() const;
10622 void PrintParams(std::ostream&, MaglevGraphLabeller*) const {}
10623};
10624
10626 : public FixedInputNodeT<2, ThrowIfNotSuperConstructor> {
10628
10629 public:
10630 explicit ThrowIfNotSuperConstructor(uint64_t bitfield) : Base(bitfield) {}
10631
10632 static constexpr OpProperties kProperties =
10636
10638 Input& function() { return Node::input(1); }
10639
10640 int MaxCallStackArgs() const;
10643 void PrintParams(std::ostream&, MaglevGraphLabeller*) const {}
10644};
10645
10647 : public FixedInputValueNodeT<2, TransitionElementsKind> {
10649
10650 public:
10657
10658 // TODO(leszeks): Special case the case where all transitions are fast.
10659 static constexpr OpProperties kProperties =
10663
10664 Input& object_input() { return input(0); }
10665 Input& map_input() { return input(1); }
10666
10667 int MaxCallStackArgs() const;
10670 void PrintParams(std::ostream&, MaglevGraphLabeller*) const {}
10671
10676 return transition_target_;
10677 }
10678
10679 private:
10682};
10683
10685 : public FixedInputNodeT<2, TransitionElementsKindOrCheckMap> {
10687
10688 public:
10695
10696 // TODO(leszeks): Special case the case where all transitions are fast.
10702
10704 Input& map_input() { return Node::input(1); }
10705
10706 int MaxCallStackArgs() const;
10709 void PrintParams(std::ostream&, MaglevGraphLabeller*) const;
10710
10715 return transition_target_;
10716 }
10717
10718 private:
10721};
10722
10724 : public FixedInputValueNodeT<0, GetContinuationPreservedEmbedderData> {
10726
10727 public:
10728 explicit GetContinuationPreservedEmbedderData(uint64_t bitfield)
10729 : Base(bitfield) {}
10730
10733 void PrintParams(std::ostream&, MaglevGraphLabeller*) const {}
10734
10735 static constexpr OpProperties kProperties =
10737};
10738
10740 : public FixedInputNodeT<1, SetContinuationPreservedEmbedderData> {
10742
10743 public:
10744 explicit SetContinuationPreservedEmbedderData(uint64_t bitfield)
10745 : Base(bitfield) {}
10746
10747 static constexpr
10749
10750 Input& data_input() { return input(0); }
10751
10754 void PrintParams(std::ostream&, MaglevGraphLabeller*) const {}
10755
10757};
10758
10759class ControlNode : public NodeBase {
10760 public:
10761 // A "hole" in control flow is a control node that unconditionally interrupts
10762 // linear control flow (either by jumping or by exiting).
10763 //
10764 // A "post-dominating" hole is a hole that is guaranteed to be be reached in
10765 // control flow after this node (i.e. it is a hole that is a post-dominator
10766 // of this node).
10771 DCHECK_IMPLIES(node != nullptr, node->Is<UnconditionalControlNode>() ||
10772 node->Is<TerminalControlNode>() ||
10773 node->Is<Switch>());
10775 }
10776
10777 protected:
10778 using NodeBase::NodeBase;
10779
10780 private:
10782};
10783
10785 public:
10786 BasicBlock* target() const { return target_.block_ptr(); }
10787 int predecessor_id() const { return predecessor_id_; }
10789
10791
10792 protected:
10794 BasicBlockRef* target_refs)
10795 : ControlNode(bitfield), target_(target_refs) {}
10797 : ControlNode(bitfield), target_(target) {}
10798
10799 private:
10802};
10803
10804template <class Derived>
10806 : public FixedInputNodeTMixin<0, UnconditionalControlNode, Derived> {
10808
10809 protected:
10811 BasicBlockRef* target_refs)
10813 bitfield, target_refs) {}
10816 target) {}
10817};
10818
10820 public:
10822};
10823
10825 public:
10827 BasicBlockRef* if_false_refs)
10829 if_true_(if_true_refs),
10830 if_false_(if_false_refs) {}
10831
10832 BasicBlock* if_true() const { return if_true_.block_ptr(); }
10834
10837
10838 private:
10841};
10842
10844 protected:
10846};
10847
10848template <size_t InputCount, class Derived>
10850 : public FixedInputNodeTMixin<InputCount, TerminalControlNode, Derived> {
10852
10853 protected:
10855 : FixedInputNodeTMixin<InputCount, TerminalControlNode, Derived>(
10856 bitfield) {}
10857};
10858
10859template <size_t InputCount, class Derived>
10861 : public FixedInputNodeTMixin<InputCount, BranchControlNode, Derived> {
10863
10864 protected:
10865 explicit BranchControlNodeT(uint64_t bitfield, BasicBlockRef* if_true_refs,
10866 BasicBlockRef* if_false_refs)
10867 : FixedInputNodeTMixin<InputCount, BranchControlNode, Derived>(
10868 bitfield, if_true_refs, if_false_refs) {}
10869};
10870
10871class Jump : public UnconditionalControlNodeT<Jump> {
10873
10874 public:
10875 Jump(uint64_t bitfield, BasicBlockRef* target_refs)
10876 : Base(bitfield, target_refs) {}
10877
10880 void PrintParams(std::ostream&, MaglevGraphLabeller*) const {}
10881};
10882
10883// TODO(olivf): Unify implementation with Jump.
10884class CheckpointedJump : public UnconditionalControlNodeT<CheckpointedJump> {
10886
10887 public:
10889 : Base(bitfield, target_refs) {}
10890
10891 static constexpr OpProperties kProperties =
10893
10896 void PrintParams(std::ostream&, MaglevGraphLabeller*) const {}
10897};
10898
10899class JumpLoop : public UnconditionalControlNodeT<JumpLoop> {
10901
10902 public:
10903 explicit JumpLoop(uint64_t bitfield, BasicBlock* target)
10904 : Base(bitfield, target) {}
10905
10906 explicit JumpLoop(uint64_t bitfield, BasicBlockRef* ref)
10907 : Base(bitfield, ref) {}
10908
10911 void PrintParams(std::ostream&, MaglevGraphLabeller*) const {}
10912
10915 used_node_locations_ = locations;
10916 }
10917
10918 private:
10920};
10921
10922class Abort : public TerminalControlNodeT<0, Abort> {
10924
10925 public:
10930
10932
10933 AbortReason reason() const { return reason_; }
10934
10935 int MaxCallStackArgs() const;
10938 void PrintParams(std::ostream&, MaglevGraphLabeller*) const;
10939
10940 private:
10942};
10943
10944class Return : public TerminalControlNodeT<1, Return> {
10946
10947 public:
10948 explicit Return(uint64_t bitfield) : Base(bitfield) {
10950 }
10951
10952 static constexpr
10954
10955 Input& value_input() { return input(0); }
10956
10959 void PrintParams(std::ostream&, MaglevGraphLabeller*) const {}
10960};
10961
10962class Deopt : public TerminalControlNodeT<0, Deopt> {
10964
10965 public:
10966 explicit Deopt(uint64_t bitfield, DeoptimizeReason reason)
10967 : Base(bitfield | ReasonField::encode(reason)) {
10969 }
10970
10972
10975 void PrintParams(std::ostream&, MaglevGraphLabeller*) const;
10976
10978};
10979
10980class Switch : public FixedInputNodeTMixin<1, ConditionalControlNode, Switch> {
10982
10983 public:
10984 explicit Switch(uint64_t bitfield, int value_base, BasicBlockRef* targets,
10985 int size)
10986 : Base(bitfield),
10988 targets_(targets),
10989 size_(size),
10990 fallthrough_() {}
10991
10992 explicit Switch(uint64_t bitfield, int value_base, BasicBlockRef* targets,
10993 int size, BasicBlockRef* fallthrough)
10994 : Base(bitfield),
10996 targets_(targets),
10997 size_(size),
10999
11000 static constexpr
11002
11003 int value_base() const { return value_base_; }
11004 BasicBlockRef* targets() const { return targets_; }
11005 int size() const { return size_; }
11006
11007 bool has_fallthrough() const { return fallthrough_.has_value(); }
11010 return fallthrough_.value().block_ptr();
11011 }
11012
11015 fallthrough_.value().set_block_ptr(fallthrough);
11016 }
11017
11018 Input& value() { return input(0); }
11019
11022 void PrintParams(std::ostream&, MaglevGraphLabeller*) const {}
11023
11024 private:
11025 const int value_base_;
11027 const int size_;
11028 std::optional<BasicBlockRef> fallthrough_;
11029};
11030
11031class BranchIfSmi : public BranchControlNodeT<1, BranchIfSmi> {
11033
11034 public:
11035 explicit BranchIfSmi(uint64_t bitfield, BasicBlockRef* if_true_refs,
11036 BasicBlockRef* if_false_refs)
11037 : Base(bitfield, if_true_refs, if_false_refs) {}
11038
11039 static constexpr
11041
11042 Input& condition_input() { return input(0); }
11043
11044#ifdef V8_COMPRESS_POINTERS
11045 void MarkTaggedInputsAsDecompressing() {
11046 // Don't need to decompress values to reference compare.
11047 }
11048#endif
11049
11052 void PrintParams(std::ostream&, MaglevGraphLabeller*) const {}
11053};
11054
11056 : public BranchControlNodeT<1, BranchIfRootConstant> {
11058
11059 public:
11061 BasicBlockRef* if_true_refs,
11062 BasicBlockRef* if_false_refs)
11063 : Base(bitfield, if_true_refs, if_false_refs), root_index_(root_index) {}
11064
11065 static constexpr
11067
11069 Input& condition_input() { return input(0); }
11070
11071#ifdef V8_COMPRESS_POINTERS
11072 void MarkTaggedInputsAsDecompressing() {
11073 // Don't need to decompress values to reference compare.
11074 }
11075#endif
11076
11079 void PrintParams(std::ostream&, MaglevGraphLabeller*) const;
11080
11081 private:
11083};
11084
11086 : public BranchControlNodeT<1, BranchIfUndefinedOrNull> {
11088
11089 public:
11091 BasicBlockRef* if_true_refs,
11092 BasicBlockRef* if_false_refs)
11093 : Base(bitfield, if_true_refs, if_false_refs) {}
11094
11095 static constexpr
11097
11098 Input& condition_input() { return input(0); }
11099
11100#ifdef V8_COMPRESS_POINTERS
11101 void MarkTaggedInputsAsDecompressing() {
11102 // Don't need to decompress values to reference compare.
11103 }
11104#endif
11105
11108 void PrintParams(std::ostream&, MaglevGraphLabeller*) const {}
11109};
11110
11112 : public BranchControlNodeT<1, BranchIfUndetectable> {
11114
11115 public:
11117 BasicBlockRef* if_true_refs,
11118 BasicBlockRef* if_false_refs)
11119 : Base(CheckTypeBitField::update(bitfield, check_type), if_true_refs,
11120 if_false_refs) {}
11121
11122 static constexpr
11124
11125 Input& condition_input() { return input(0); }
11127
11130 void PrintParams(std::ostream&, MaglevGraphLabeller*) const {}
11131
11132 private:
11134};
11135
11136class BranchIfJSReceiver : public BranchControlNodeT<1, BranchIfJSReceiver> {
11138
11139 public:
11140 explicit BranchIfJSReceiver(uint64_t bitfield, BasicBlockRef* if_true_refs,
11141 BasicBlockRef* if_false_refs)
11142 : Base(bitfield, if_true_refs, if_false_refs) {}
11143
11144 static constexpr
11146
11147 Input& condition_input() { return input(0); }
11148
11151 void PrintParams(std::ostream&, MaglevGraphLabeller*) const {}
11152};
11153
11155 : public BranchControlNodeT<1, BranchIfToBooleanTrue> {
11157
11158 public:
11160 BasicBlockRef* if_true_refs,
11161 BasicBlockRef* if_false_refs)
11162 : Base(CheckTypeBitField::update(bitfield, check_type), if_true_refs,
11163 if_false_refs) {}
11164
11165 static constexpr
11167
11168 Input& condition_input() { return input(0); }
11170
11173 void PrintParams(std::ostream&, MaglevGraphLabeller*) const {}
11174
11175 private:
11177};
11178
11180 : public BranchControlNodeT<1, BranchIfInt32ToBooleanTrue> {
11182
11183 public:
11185 BasicBlockRef* if_true_refs,
11186 BasicBlockRef* if_false_refs)
11187 : Base(bitfield, if_true_refs, if_false_refs) {}
11188
11189 static constexpr
11191
11192 Input& condition_input() { return input(0); }
11193
11196 void PrintParams(std::ostream&, MaglevGraphLabeller*) const {}
11197};
11198
11200 : public BranchControlNodeT<1, BranchIfIntPtrToBooleanTrue> {
11202
11203 public:
11205 BasicBlockRef* if_true_refs,
11206 BasicBlockRef* if_false_refs)
11207 : Base(bitfield, if_true_refs, if_false_refs) {}
11208
11209 static constexpr
11211
11212 Input& condition_input() { return input(0); }
11213
11216 void PrintParams(std::ostream&, MaglevGraphLabeller*) const {}
11217};
11218
11220 : public BranchControlNodeT<1, BranchIfFloat64ToBooleanTrue> {
11222
11223 public:
11225 BasicBlockRef* if_true_refs,
11226 BasicBlockRef* if_false_refs)
11227 : Base(bitfield, if_true_refs, if_false_refs) {}
11228
11229 static constexpr
11231
11232 Input& condition_input() { return input(0); }
11233
11236 void PrintParams(std::ostream&, MaglevGraphLabeller*) const {}
11237};
11238
11240 : public BranchControlNodeT<1, BranchIfFloat64IsHole> {
11242
11243 public:
11244 explicit BranchIfFloat64IsHole(uint64_t bitfield, BasicBlockRef* if_true_refs,
11245 BasicBlockRef* if_false_refs)
11246 : Base(bitfield, if_true_refs, if_false_refs) {}
11247
11248 static constexpr
11250
11251 Input& condition_input() { return input(0); }
11252
11255 void PrintParams(std::ostream&, MaglevGraphLabeller*) const {}
11256};
11257
11259 : public BranchControlNodeT<2, BranchIfInt32Compare> {
11261
11262 public:
11263 static constexpr int kLeftIndex = 0;
11264 static constexpr int kRightIndex = 1;
11267
11269 BasicBlockRef* if_true_refs,
11270 BasicBlockRef* if_false_refs)
11271 : Base(bitfield, if_true_refs, if_false_refs), operation_(operation) {}
11272
11275
11278 void PrintParams(std::ostream&, MaglevGraphLabeller*) const;
11279
11280 Operation operation() const { return operation_; }
11281
11282 private:
11284};
11285
11287 : public BranchControlNodeT<2, BranchIfUint32Compare> {
11289
11290 public:
11291 static constexpr int kLeftIndex = 0;
11292 static constexpr int kRightIndex = 1;
11295
11297 BasicBlockRef* if_true_refs,
11298 BasicBlockRef* if_false_refs)
11299 : Base(bitfield, if_true_refs, if_false_refs), operation_(operation) {}
11300
11303
11306 void PrintParams(std::ostream&, MaglevGraphLabeller*) const;
11307
11308 Operation operation() const { return operation_; }
11309
11310 private:
11312};
11313
11315 : public BranchControlNodeT<2, BranchIfFloat64Compare> {
11317
11318 public:
11319 static constexpr int kLeftIndex = 0;
11320 static constexpr int kRightIndex = 1;
11323
11325 BasicBlockRef* if_true_refs,
11326 BasicBlockRef* if_false_refs)
11327 : Base(bitfield, if_true_refs, if_false_refs), operation_(operation) {}
11328
11331
11334 void PrintParams(std::ostream&, MaglevGraphLabeller*) const;
11335
11336 Operation operation() const { return operation_; }
11337
11338 private:
11340};
11341
11343 : public BranchControlNodeT<2, BranchIfReferenceEqual> {
11345
11346 public:
11347 static constexpr int kLeftIndex = 0;
11348 static constexpr int kRightIndex = 1;
11351
11353 BasicBlockRef* if_true_refs,
11354 BasicBlockRef* if_false_refs)
11355 : Base(bitfield, if_true_refs, if_false_refs) {}
11356
11359
11360#ifdef V8_COMPRESS_POINTERS
11361 void MarkTaggedInputsAsDecompressing() {
11362 // Don't need to decompress values to reference compare.
11363 }
11364#endif
11365
11368 void PrintParams(std::ostream&, MaglevGraphLabeller*) const {}
11369};
11370
11371class BranchIfTypeOf : public BranchControlNodeT<1, BranchIfTypeOf> {
11373
11374 public:
11375 static constexpr int kValueIndex = 0;
11377
11378 explicit BranchIfTypeOf(uint64_t bitfield,
11380 BasicBlockRef* if_true_refs,
11381 BasicBlockRef* if_false_refs)
11382 : Base(bitfield, if_true_refs, if_false_refs), literal_(literal) {}
11383
11384 static constexpr
11386
11389 void PrintParams(std::ostream&, MaglevGraphLabeller*) const;
11390
11391 private:
11393};
11394
11396 switch (opcode) {
11397#define CASE(op) \
11398 case Opcode::k##op: \
11399 return op::kProperties;
11401#undef CASE
11402 }
11403}
11404
11405template <typename Function>
11407 auto iterate_inputs = [&](InputAllocationPolicy category) {
11408 for (Input& input : *this) {
11409 switch (compiler::UnallocatedOperand::cast(input.operand())
11410 .extended_policy()) {
11413 f(category, &input);
11414 break;
11415
11417 if (category == InputAllocationPolicy::kAny) f(category, &input);
11418 break;
11419
11423 f(category, &input);
11424 break;
11425
11430 UNREACHABLE();
11431 }
11432 }
11433 };
11434
11437 iterate_inputs(InputAllocationPolicy::kAny);
11438}
11439
11441 LocalIsolate* isolate, ValueNode* node);
11442
11443} // namespace maglev
11444} // namespace internal
11445} // namespace v8
11446
11447#endif // V8_MAGLEV_MAGLEV_IR_H_
#define DEF_FORWARD_DECLARATION(type)
Definition ast.h:140
#define T
#define SBXCHECK_LT(lhs, rhs)
Definition check.h:66
#define SLOW_DCHECK(condition)
Definition checks.h:21
static constexpr U kMax
Definition bit-field.h:44
static constexpr int kLastUsedBit
Definition bit-field.h:42
static constexpr T decode(U value)
Definition bit-field.h:66
static constexpr bool is_valid(T value)
Definition bit-field.h:50
static constexpr U encode(T value)
Definition bit-field.h:55
static V8_NODISCARD constexpr U update(U previous, T value)
Definition bit-field.h:61
static constexpr U kMask
Definition bit-field.h:41
static constexpr int kShift
Definition bit-field.h:39
constexpr const auto & get() const
static BytecodeOffset GetContinuationBytecodeOffset(Builtin builtin)
Definition builtins.cc:97
static CallInterfaceDescriptor CallInterfaceDescriptorFor(Builtin builtin)
Definition builtins.cc:189
static constexpr BytecodeOffset None()
Definition utils.h:675
static const int kMaxArguments
Definition code.h:463
static V8_INLINE constexpr int OffsetOfElementAt(int index)
Definition contexts.h:512
static constexpr MachineRepresentation PointerRepresentation()
static V8_EXPORT_PRIVATE bool BooleanValue(Tagged< Object > obj, IsolateT *isolate)
constexpr RegisterT first() const
constexpr void set(RegisterT reg)
constexpr bool has(RegisterT reg) const
constexpr void clear(RegisterT reg)
constexpr unsigned Count() const
constexpr int8_t code() const
static constexpr Representation Smi()
static constexpr Representation Tagged()
static V8_EXPORT_PRIVATE const Function * FunctionForId(FunctionId id)
Definition runtime.cc:350
static constexpr Tagged< Smi > FromInt(int value)
Definition smi.h:38
T * AllocateArray(size_t length)
Definition zone.h:127
void * Allocate(size_t size)
Definition zone.h:61
V8_EXPORT_PRIVATE MapRef map(JSHeapBroker *broker) const
static LocationOperand * cast(InstructionOperand *op)
DoubleRegister GetDoubleRegister() const
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
void GenerateCode(MaglevAssembler *, const ProcessingState &)
const AbortReason reason_
static constexpr OpProperties kProperties
Abort(uint64_t bitfield, AbortReason reason)
AbortReason reason() const
AbstractLoadTaggedField(uint64_t bitfield, const int offset)
Definition maglev-ir.h:7723
void GenerateCode(MaglevAssembler *, const ProcessingState &)
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
static constexpr Base::InputTypes kInputTypes
Definition maglev-ir.h:7728
static constexpr OpProperties kProperties
Definition maglev-ir.h:7726
AllocateElementsArray(uint64_t bitfield, AllocationType allocation_type)
Definition maglev-ir.h:6248
void GenerateCode(MaglevAssembler *, const ProcessingState &)
static constexpr Base::InputTypes kInputTypes
Definition maglev-ir.h:6259
static constexpr OpProperties kProperties
Definition maglev-ir.h:6252
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
Definition maglev-ir.h:6264
InlinedAllocation::List allocation_list_
Definition maglev-ir.h:6174
InlinedAllocation::List & allocation_list()
Definition maglev-ir.h:6154
AllocationType allocation_type() const
Definition maglev-ir.h:6150
void GenerateCode(MaglevAssembler *, const ProcessingState &)
void Add(InlinedAllocation *alloc)
Definition maglev-ir.h:6156
AllocationBlock(uint64_t bitfield, AllocationType allocation_type)
Definition maglev-ir.h:6138
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
static constexpr OpProperties kProperties
Definition maglev-ir.h:6141
static constexpr Base::InputTypes kInputTypes
Definition maglev-ir.h:6224
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
Definition maglev-ir.h:6231
static constexpr OpProperties kProperties
Definition maglev-ir.h:6219
void GenerateCode(MaglevAssembler *, const ProcessingState &)
ArgumentsElements(uint64_t bitfield, CreateArgumentsType type, int formal_parameter_count)
Definition maglev-ir.h:6213
CreateArgumentsType type() const
Definition maglev-ir.h:6233
static constexpr OpProperties kProperties
Definition maglev-ir.h:6183
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
Definition maglev-ir.h:6187
void GenerateCode(MaglevAssembler *, const ProcessingState &)
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
AssertCondition condition() const
Definition maglev-ir.h:6467
AssertInt32(uint64_t bitfield, AssertCondition condition, AbortReason reason)
Definition maglev-ir.h:6451
static constexpr Base::InputTypes kInputTypes
Definition maglev-ir.h:6455
void GenerateCode(MaglevAssembler *, const ProcessingState &)
BasicBlockRef * next_ref() const
Definition maglev-ir.h:990
BasicBlockRef & operator=(const BasicBlockRef &)=delete
BasicBlockRef & operator=(BasicBlockRef &&)=delete
BasicBlock * block_ptr() const
Definition maglev-ir.h:980
void Bind(BasicBlock *block)
Definition maglev-ir.h:970
void set_block_ptr(BasicBlock *block)
Definition maglev-ir.h:985
BasicBlockRef(const BasicBlockRef &)=delete
BasicBlockRef * MoveToRefList(BasicBlockRef *ref_list_head)
Definition maglev-ir.h:960
BasicBlockRef(BasicBlockRef &&)=delete
BasicBlockRef(BasicBlockRef *ref_list_head)
Definition maglev-ir.h:929
BasicBlockRef * SetToBlockAndReturnNext(BasicBlock *block)
Definition maglev-ir.h:937
void GenerateCode(MaglevAssembler *, const ProcessingState &)
static constexpr Base::InputTypes kInputTypes
Definition maglev-ir.h:2927
static constexpr OpProperties kProperties
Definition maglev-ir.h:2926
BinaryWithFeedbackNode(uint64_t bitfield, const compiler::FeedbackSource &feedback)
Definition maglev-ir.h:2937
compiler::FeedbackSource feedback() const
Definition maglev-ir.h:2934
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
Definition maglev-ir.h:2943
const compiler::FeedbackSource feedback_
Definition maglev-ir.h:2945
BranchControlNodeT(uint64_t bitfield, BasicBlockRef *if_true_refs, BasicBlockRef *if_false_refs)
void set_if_true(BasicBlock *block)
void set_if_false(BasicBlock *block)
BranchControlNode(uint64_t bitfield, BasicBlockRef *if_true_refs, BasicBlockRef *if_false_refs)
static constexpr Base::InputTypes kInputTypes
void GenerateCode(MaglevAssembler *, const ProcessingState &)
BranchIfFloat64Compare(uint64_t bitfield, Operation operation, BasicBlockRef *if_true_refs, BasicBlockRef *if_false_refs)
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
BranchIfFloat64IsHole(uint64_t bitfield, BasicBlockRef *if_true_refs, BasicBlockRef *if_false_refs)
static constexpr Base::InputTypes kInputTypes
void GenerateCode(MaglevAssembler *, const ProcessingState &)
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
static constexpr Base::InputTypes kInputTypes
BranchIfFloat64ToBooleanTrue(uint64_t bitfield, BasicBlockRef *if_true_refs, BasicBlockRef *if_false_refs)
void GenerateCode(MaglevAssembler *, const ProcessingState &)
static constexpr Base::InputTypes kInputTypes
BranchIfInt32Compare(uint64_t bitfield, Operation operation, BasicBlockRef *if_true_refs, BasicBlockRef *if_false_refs)
void GenerateCode(MaglevAssembler *, const ProcessingState &)
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
BranchIfInt32ToBooleanTrue(uint64_t bitfield, BasicBlockRef *if_true_refs, BasicBlockRef *if_false_refs)
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
static constexpr Base::InputTypes kInputTypes
void GenerateCode(MaglevAssembler *, const ProcessingState &)
static constexpr Base::InputTypes kInputTypes
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
void GenerateCode(MaglevAssembler *, const ProcessingState &)
BranchIfIntPtrToBooleanTrue(uint64_t bitfield, BasicBlockRef *if_true_refs, BasicBlockRef *if_false_refs)
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
void GenerateCode(MaglevAssembler *, const ProcessingState &)
BranchIfJSReceiver(uint64_t bitfield, BasicBlockRef *if_true_refs, BasicBlockRef *if_false_refs)
static constexpr Base::InputTypes kInputTypes
static constexpr Base::InputTypes kInputTypes
BranchIfReferenceEqual(uint64_t bitfield, BasicBlockRef *if_true_refs, BasicBlockRef *if_false_refs)
void GenerateCode(MaglevAssembler *, const ProcessingState &)
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
void GenerateCode(MaglevAssembler *, const ProcessingState &)
static constexpr Base::InputTypes kInputTypes
BranchIfRootConstant(uint64_t bitfield, RootIndex root_index, BasicBlockRef *if_true_refs, BasicBlockRef *if_false_refs)
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
static constexpr Base::InputTypes kInputTypes
void GenerateCode(MaglevAssembler *, const ProcessingState &)
BranchIfSmi(uint64_t bitfield, BasicBlockRef *if_true_refs, BasicBlockRef *if_false_refs)
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
BranchIfToBooleanTrue(uint64_t bitfield, CheckType check_type, BasicBlockRef *if_true_refs, BasicBlockRef *if_false_refs)
void GenerateCode(MaglevAssembler *, const ProcessingState &)
static constexpr Base::InputTypes kInputTypes
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
BranchIfTypeOf(uint64_t bitfield, interpreter::TestTypeOfFlags::LiteralFlag literal, BasicBlockRef *if_true_refs, BasicBlockRef *if_false_refs)
interpreter::TestTypeOfFlags::LiteralFlag literal_
void GenerateCode(MaglevAssembler *, const ProcessingState &)
static constexpr Base::InputTypes kInputTypes
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
static constexpr Base::InputTypes kInputTypes
void GenerateCode(MaglevAssembler *, const ProcessingState &)
BranchIfUint32Compare(uint64_t bitfield, Operation operation, BasicBlockRef *if_true_refs, BasicBlockRef *if_false_refs)
BranchIfUndefinedOrNull(uint64_t bitfield, BasicBlockRef *if_true_refs, BasicBlockRef *if_false_refs)
static constexpr Base::InputTypes kInputTypes
void GenerateCode(MaglevAssembler *, const ProcessingState &)
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
static constexpr Base::InputTypes kInputTypes
void GenerateCode(MaglevAssembler *, const ProcessingState &)
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
BranchIfUndetectable(uint64_t bitfield, CheckType check_type, BasicBlockRef *if_true_refs, BasicBlockRef *if_false_refs)
BuiltinContinuationDeoptFrame(Builtin builtin_id, base::Vector< ValueNode * > parameters, ValueNode *context, compiler::OptionalJSFunctionRef maybe_js_target, DeoptFrame *parent)
Definition maglev-ir.h:1518
compiler::JSFunctionRef javascript_target() const
Definition maglev-ir.h:1532
base::Vector< ValueNode * > parameters() const
Definition maglev-ir.h:1528
const BuiltinContinuationFrameData & data() const
Definition maglev-ir.h:1540
static constexpr Base::InputTypes kInputTypes
Definition maglev-ir.h:7353
static constexpr OpProperties kProperties
Definition maglev-ir.h:7350
void GenerateCode(MaglevAssembler *, const ProcessingState &)
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
Definition maglev-ir.h:7360
BuiltinStringPrototypeCharCodeOrCodePointAt(uint64_t bitfield, Mode mode)
Definition maglev-ir.h:7375
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
void GenerateCode(MaglevAssembler *, const ProcessingState &)
void PushFeedbackAndArguments(MaglevAssembler *)
compiler::FeedbackSource feedback() const
Definition maglev-ir.h:9703
CallBuiltin(uint64_t bitfield, Builtin builtin, ValueNode *context)
Definition maglev-ir.h:9692
FeedbackSlotType slot_type() const
Definition maglev-ir.h:9707
void set_arg(int i, ValueNode *node)
Definition maglev-ir.h:9758
void PassFeedbackSlotInRegister(MaglevAssembler *)
void set_feedback(compiler::FeedbackSource const &feedback, FeedbackSlotType slot_type)
Definition maglev-ir.h:9711
CallBuiltin(uint64_t bitfield, Builtin builtin)
Definition maglev-ir.h:9684
void PushArguments(MaglevAssembler *masm, Args... extra_args)
std::optional< compiler::FeedbackSource > feedback_
Definition maglev-ir.h:9780
static constexpr OpProperties kProperties
Definition maglev-ir.h:9700
void VerifyInputs(MaglevGraphLabeller *graph_labeller) const
Definition maglev-ir.cc:728
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
void GenerateCode(MaglevAssembler *, const ProcessingState &)
static constexpr OpProperties kProperties
Definition maglev-ir.h:9808
const Input & new_target() const
Definition maglev-ir.h:9815
void set_arg(int i, ValueNode *node)
Definition maglev-ir.h:9821
void VerifyInputs(MaglevGraphLabeller *graph_labeller) const
Definition maglev-ir.cc:779
CallCPPBuiltin(uint64_t bitfield, Builtin builtin, ValueNode *target, ValueNode *new_target, ValueNode *context)
Definition maglev-ir.h:9796
static constexpr int kContextIndex
Definition maglev-ir.h:9793
void GenerateCode(MaglevAssembler *, const ProcessingState &)
static constexpr int kFixedInputCount
Definition maglev-ir.h:9794
static constexpr int kTargetIndex
Definition maglev-ir.h:9791
static constexpr int kNewTargetIndex
Definition maglev-ir.h:9792
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
static constexpr Builtin kCEntry_Builtin
Definition maglev-ir.h:9787
void VerifyInputs(MaglevGraphLabeller *graph_labeller) const
Definition maglev-ir.cc:611
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
void GenerateCode(MaglevAssembler *, const ProcessingState &)
void set_arg(int i, ValueNode *node)
Definition maglev-ir.h:9873
Call::TargetType target_type() const
Definition maglev-ir.h:9892
CallForwardVarargs(uint64_t bitfield, ValueNode *function, ValueNode *context, int start_index, Call::TargetType target_type)
Definition maglev-ir.h:9858
static constexpr OpProperties kProperties
Definition maglev-ir.h:9865
void set_arg(int i, ValueNode *node)
static constexpr OpProperties kProperties
const compiler::OptionalJSObjectRef api_holder_
compiler::FunctionTemplateInfoRef function_template_info() const
void GenerateCallApiCallbackOptimizedInline(MaglevAssembler *masm, const ProcessingState &state)
const compiler::FunctionTemplateInfoRef function_template_info_
CallKnownApiFunction(uint64_t bitfield, Mode mode, compiler::FunctionTemplateInfoRef function_template_info, ValueNode *context, ValueNode *receiver)
void VerifyInputs(MaglevGraphLabeller *graph_labeller) const
Definition maglev-ir.cc:684
void GenerateCode(MaglevAssembler *, const ProcessingState &)
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
compiler::SharedFunctionInfoRef shared_function_info() const
void set_arg(int i, ValueNode *node)
CallKnownJSFunction(uint64_t bitfield, compiler::SharedFunctionInfoRef shared_function_info, ValueNode *closure, ValueNode *context, ValueNode *receiver, ValueNode *new_target)
void VerifyInputs(MaglevGraphLabeller *graph_labeller) const
Definition maglev-ir.cc:669
static constexpr OpProperties kProperties
const compiler::SharedFunctionInfoRef shared_function_info_
void GenerateCode(MaglevAssembler *, const ProcessingState &)
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
static constexpr int kFixedInputCount
Definition maglev-ir.h:9905
const Input & context() const
Definition maglev-ir.h:9920
Runtime::FunctionId function_id() const
Definition maglev-ir.h:9917
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
static constexpr int kContextIndex
Definition maglev-ir.h:9904
Runtime::FunctionId function_id_
Definition maglev-ir.h:9946
void GenerateCode(MaglevAssembler *, const ProcessingState &)
CallRuntime(uint64_t bitfield, Runtime::FunctionId function_id, ValueNode *context)
Definition maglev-ir.h:9909
void set_arg(int i, ValueNode *node)
Definition maglev-ir.h:9923
static constexpr OpProperties kProperties
Definition maglev-ir.h:9915
void VerifyInputs(MaglevGraphLabeller *graph_labeller) const
Definition maglev-ir.cc:793
static constexpr int kContextIndex
static constexpr int kReceiverIndex
const Input & context() const
static constexpr int kClosureIndex
void GenerateCode(MaglevAssembler *, const ProcessingState &)
static constexpr OpProperties kProperties
void set_arg(int i, ValueNode *node)
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
const Input & new_target() const
static constexpr int kFixedInputCount
const Input & closure() const
static constexpr int kNewTargetIndex
const Input & receiver() const
void VerifyInputs(MaglevGraphLabeller *graph_labeller) const
Definition maglev-ir.cc:655
CallSelf(uint64_t bitfield, int expected_parameter_count, ValueNode *closure, ValueNode *context, ValueNode *receiver, ValueNode *new_target)
void VerifyInputs(MaglevGraphLabeller *graph_labeller) const
Definition maglev-ir.cc:626
void GenerateCode(MaglevAssembler *, const ProcessingState &)
static constexpr OpProperties kProperties
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
static constexpr Base::InputTypes kInputTypes
void set_arg(int i, ValueNode *node)
Definition maglev-ir.h:9978
void GenerateCode(MaglevAssembler *, const ProcessingState &)
static constexpr OpProperties kProperties
Definition maglev-ir.h:9966
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
Definition maglev-ir.h:9999
static constexpr int kContextIndex
Definition maglev-ir.h:9955
CallWithSpread(uint64_t bitfield, ValueNode *function, ValueNode *context)
Definition maglev-ir.h:9960
static constexpr int kFixedInputCount
Definition maglev-ir.h:9956
static constexpr int kFunctionIndex
Definition maglev-ir.h:9954
void VerifyInputs(MaglevGraphLabeller *graph_labeller) const
Definition maglev-ir.cc:641
ConvertReceiverMode receiver_mode() const
Definition maglev-ir.h:9610
void set_arg(int i, ValueNode *node)
Definition maglev-ir.h:9592
static constexpr OpProperties kProperties
Definition maglev-ir.h:9584
static constexpr int kFixedInputCount
Definition maglev-ir.h:9569
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
void VerifyInputs(MaglevGraphLabeller *graph_labeller) const
Definition maglev-ir.cc:597
ConvertReceiverMode receiver_mode_
Definition maglev-ir.h:9614
static constexpr int kFunctionIndex
Definition maglev-ir.h:9567
Call(uint64_t bitfield, ConvertReceiverMode mode, TargetType target_type, ValueNode *function, ValueNode *context)
Definition maglev-ir.h:9577
void GenerateCode(MaglevAssembler *, const ProcessingState &)
TargetType target_type() const
Definition maglev-ir.h:9611
const Input & context() const
Definition maglev-ir.h:9589
static constexpr int kContextIndex
Definition maglev-ir.h:9568
const Input & function() const
Definition maglev-ir.h:9587
static constexpr OpProperties kProperties
Definition maglev-ir.h:4128
void GenerateCode(MaglevAssembler *, const ProcessingState &)
static constexpr Base::InputTypes kInputTypes
Definition maglev-ir.h:4131
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
Definition maglev-ir.h:4137
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
Definition maglev-ir.h:4175
static constexpr Base::InputTypes kInputTypes
Definition maglev-ir.h:4169
static constexpr OpProperties kProperties
Definition maglev-ir.h:4166
void GenerateCode(MaglevAssembler *, const ProcessingState &)
static constexpr OpProperties kProperties
Definition maglev-ir.h:4147
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
Definition maglev-ir.h:4156
static constexpr Base::InputTypes kInputTypes
Definition maglev-ir.h:4150
void GenerateCode(MaglevAssembler *, const ProcessingState &)
void GenerateCode(MaglevAssembler *, const ProcessingState &)
static constexpr Base::InputTypes kInputTypes
Definition maglev-ir.h:7029
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
Definition maglev-ir.h:7039
static constexpr OpProperties kProperties
Definition maglev-ir.h:7027
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
void GenerateCode(MaglevAssembler *, const ProcessingState &)
static constexpr Base::InputTypes kInputTypes
void GenerateCode(MaglevAssembler *, const ProcessingState &)
static constexpr Base::InputTypes kInputTypes
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
static constexpr Base::InputTypes kInputTypes
Definition maglev-ir.h:6942
void GenerateCode(MaglevAssembler *, const ProcessingState &)
NextBitField< CheckType, 1 > CheckTypeBitField
Definition maglev-ir.h:6955
CheckDetectableCallable(uint64_t bitfield, CheckType check_type)
Definition maglev-ir.h:6937
void PrintParams(std::ostream &out, MaglevGraphLabeller *) const
Definition maglev-ir.h:6950
static constexpr OpProperties kProperties
Definition maglev-ir.h:6940
static constexpr OpProperties kProperties
Definition maglev-ir.h:6718
CheckDynamicValue(uint64_t bitfield, DeoptimizeReason reason)
Definition maglev-ir.h:6715
static constexpr Base::InputTypes kInputTypes
Definition maglev-ir.h:6719
void GenerateCode(MaglevAssembler *, const ProcessingState &)
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
static constexpr Base::InputTypes kInputTypes
Definition maglev-ir.h:6657
static constexpr OpProperties kProperties
Definition maglev-ir.h:6655
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
void GenerateCode(MaglevAssembler *, const ProcessingState &)
CheckFloat64SameValue(uint64_t bitfield, Float64 value, DeoptimizeReason reason)
Definition maglev-ir.h:6651
void GenerateCode(MaglevAssembler *, const ProcessingState &)
static constexpr int kReceiverIndex
Definition maglev-ir.h:6803
static constexpr OpProperties kProperties
Definition maglev-ir.h:6799
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
Definition maglev-ir.h:6814
static constexpr Base::InputTypes kInputTypes
Definition maglev-ir.h:6801
static constexpr OpProperties kProperties
Definition maglev-ir.h:3478
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
Definition maglev-ir.h:3486
static constexpr Base::InputTypes kInputTypes
Definition maglev-ir.h:3480
void GenerateCode(MaglevAssembler *, const ProcessingState &)
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
static constexpr Base::InputTypes kInputTypes
static constexpr OpProperties kProperties
void GenerateCode(MaglevAssembler *, const ProcessingState &)
NextBitField< CheckType, 1 > CheckTypeBitField
Definition maglev-ir.h:6876
InstanceType first_instance_type() const
Definition maglev-ir.h:6872
static constexpr OpProperties kProperties
Definition maglev-ir.h:6855
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
CheckInstanceType(uint64_t bitfield, CheckType check_type, const InstanceType first_instance_type, const InstanceType last_instance_type)
Definition maglev-ir.h:6846
static constexpr Base::InputTypes kInputTypes
Definition maglev-ir.h:6857
InstanceType last_instance_type() const
Definition maglev-ir.h:6873
void GenerateCode(MaglevAssembler *, const ProcessingState &)
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
void GenerateCode(MaglevAssembler *, const ProcessingState &)
static constexpr Base::InputTypes kInputTypes
Definition maglev-ir.h:7147
CheckInt32Condition(uint64_t bitfield, AssertCondition condition, DeoptimizeReason reason)
Definition maglev-ir.h:7141
static constexpr OpProperties kProperties
Definition maglev-ir.h:7146
ReasonField::Next< AssertCondition, base::bits::WhichPowerOfTwo< size_t >( base::bits::RoundUpToPowerOfTwo32( kNumAssertConditions))> ConditionField
Definition maglev-ir.h:7168
void GenerateCode(MaglevAssembler *, const ProcessingState &)
static constexpr OpProperties kProperties
Definition maglev-ir.h:3426
static constexpr Base::InputTypes kInputTypes
Definition maglev-ir.h:3428
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
Definition maglev-ir.h:3434
static constexpr Base::InputTypes kInputTypes
Definition maglev-ir.h:3462
void GenerateCode(MaglevAssembler *, const ProcessingState &)
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
Definition maglev-ir.h:3468
static constexpr OpProperties kProperties
Definition maglev-ir.h:3460
static constexpr Base::InputTypes kInputTypes
Definition maglev-ir.h:7051
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
Definition maglev-ir.h:7062
CheckJSDataViewBounds(uint64_t bitfield, ExternalArrayType element_type)
Definition maglev-ir.h:7046
ExternalArrayType element_type() const
Definition maglev-ir.h:7066
void GenerateCode(MaglevAssembler *, const ProcessingState &)
static constexpr OpProperties kProperties
Definition maglev-ir.h:7050
static constexpr Base::InputTypes kInputTypes
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
void GenerateCode(MaglevAssembler *, const ProcessingState &)
CheckJSReceiverOrNullOrUndefined(uint64_t bitfield, CheckType check_type)
const compiler::ZoneRefSet< Map > maps_
Definition maglev-ir.h:6580
const compiler::ZoneRefSet< Map > & maps() const
Definition maglev-ir.h:6568
void GenerateCode(MaglevAssembler *, const ProcessingState &)
CheckMapsWithAlreadyLoadedMap(uint64_t bitfield, base::Vector< const compiler::MapRef > maps, Zone *zone)
Definition maglev-ir.h:6559
CheckMapsWithAlreadyLoadedMap(uint64_t bitfield, const compiler::ZoneRefSet< Map > &maps)
Definition maglev-ir.h:6556
static constexpr Base::InputTypes kInputTypes
Definition maglev-ir.h:6565
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
void GenerateCode(MaglevAssembler *, const ProcessingState &)
CheckMapsWithMigrationAndDeopt(uint64_t bitfield, base::Vector< const compiler::MapRef > maps, CheckType check_type, Zone *zone)
Definition maglev-ir.h:6519
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
const compiler::ZoneRefSet< Map > maps_
Definition maglev-ir.h:6548
const compiler::ZoneRefSet< Map > & maps() const
Definition maglev-ir.h:6533
CheckMapsWithMigrationAndDeopt(uint64_t bitfield, const compiler::ZoneRefSet< Map > &maps, CheckType check_type)
Definition maglev-ir.h:6515
static constexpr Base::InputTypes kInputTypes
Definition maglev-ir.h:6531
void GenerateCode(MaglevAssembler *, const ProcessingState &)
CheckMapsWithMigration(uint64_t bitfield, const compiler::ZoneRefSet< Map > &maps, CheckType check_type)
Definition maglev-ir.h:6963
static constexpr OpProperties kProperties
Definition maglev-ir.h:6968
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
void ClearUnstableNodeAspects(KnownNodeAspects &known_node_aspects)
const compiler::ZoneRefSet< Map > maps_
Definition maglev-ir.h:6990
const compiler::ZoneRefSet< Map > & maps() const
Definition maglev-ir.h:6975
static constexpr Base::InputTypes kInputTypes
Definition maglev-ir.h:6973
NextBitField< CheckType, 1 > CheckTypeBitField
Definition maglev-ir.h:6989
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
static constexpr OpProperties kProperties
Definition maglev-ir.h:6488
CheckMaps(uint64_t bitfield, base::Vector< const compiler::MapRef > maps, CheckType check_type, Zone *zone)
Definition maglev-ir.h:6482
const compiler::ZoneRefSet< Map > maps_
Definition maglev-ir.h:6507
const compiler::ZoneRefSet< Map > & maps() const
Definition maglev-ir.h:6493
void GenerateCode(MaglevAssembler *, const ProcessingState &)
NextBitField< CheckType, 1 > CheckTypeBitField
Definition maglev-ir.h:6506
static constexpr Base::InputTypes kInputTypes
Definition maglev-ir.h:6491
static constexpr int kReceiverIndex
Definition maglev-ir.h:6496
CheckMaps(uint64_t bitfield, const compiler::ZoneRefSet< Map > &maps, CheckType check_type)
Definition maglev-ir.h:6479
void GenerateCode(MaglevAssembler *, const ProcessingState &)
static constexpr Base::InputTypes kInputTypes
static constexpr OpProperties kProperties
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
Object::Conversion mode() const
Definition maglev-ir.h:6781
static constexpr Base::InputTypes kInputTypes
Definition maglev-ir.h:6777
void GenerateCode(MaglevAssembler *, const ProcessingState &)
CheckNumber(uint64_t bitfield, Object::Conversion mode)
Definition maglev-ir.h:6772
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
Definition maglev-ir.h:6785
static constexpr OpProperties kProperties
Definition maglev-ir.h:6775
const Object::Conversion mode_
Definition maglev-ir.h:6790
static constexpr int kReceiverIndex
Definition maglev-ir.h:6779
void GenerateCode(MaglevAssembler *, const ProcessingState &)
static constexpr OpProperties kProperties
Definition maglev-ir.h:6748
static constexpr int kReceiverIndex
Definition maglev-ir.h:6752
static constexpr Base::InputTypes kInputTypes
Definition maglev-ir.h:6750
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
Definition maglev-ir.h:6765
CheckSmi(uint64_t bitfield)
Definition maglev-ir.h:6746
NextBitField< CheckType, 1 > CheckTypeBitField
Definition maglev-ir.h:6929
static constexpr Base::InputTypes kInputTypes
Definition maglev-ir.h:6916
static constexpr OpProperties kProperties
Definition maglev-ir.h:6914
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
Definition maglev-ir.h:6924
void GenerateCode(MaglevAssembler *, const ProcessingState &)
CheckStringOrStringWrapper(uint64_t bitfield, CheckType check_type)
Definition maglev-ir.h:6911
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
Definition maglev-ir.h:6898
static constexpr OpProperties kProperties
Definition maglev-ir.h:6888
void GenerateCode(MaglevAssembler *, const ProcessingState &)
NextBitField< CheckType, 1 > CheckTypeBitField
Definition maglev-ir.h:6903
static constexpr int kReceiverIndex
Definition maglev-ir.h:6892
static constexpr Base::InputTypes kInputTypes
Definition maglev-ir.h:6890
CheckString(uint64_t bitfield, CheckType check_type)
Definition maglev-ir.h:6885
static constexpr OpProperties kProperties
Definition maglev-ir.h:6824
CheckSymbol(uint64_t bitfield, CheckType check_type)
Definition maglev-ir.h:6821
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
Definition maglev-ir.h:6834
void GenerateCode(MaglevAssembler *, const ProcessingState &)
static constexpr Base::InputTypes kInputTypes
Definition maglev-ir.h:6826
NextBitField< CheckType, 1 > CheckTypeBitField
Definition maglev-ir.h:6839
static constexpr int kReceiverIndex
Definition maglev-ir.h:6828
static constexpr Base::InputTypes kInputTypes
Definition maglev-ir.h:7124
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
Definition maglev-ir.h:7134
static constexpr OpProperties kProperties
Definition maglev-ir.h:7123
void GenerateCode(MaglevAssembler *, const ProcessingState &)
static constexpr OpProperties kProperties
Definition maglev-ir.h:7105
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
Definition maglev-ir.h:7115
void GenerateCode(MaglevAssembler *, const ProcessingState &)
static constexpr Base::InputTypes kInputTypes
Definition maglev-ir.h:7108
static constexpr Base::InputTypes kInputTypes
Definition maglev-ir.h:3445
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
Definition maglev-ir.h:3451
static constexpr OpProperties kProperties
Definition maglev-ir.h:3443
void GenerateCode(MaglevAssembler *, const ProcessingState &)
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
CheckValueEqualsInt32(uint64_t bitfield, int32_t value, DeoptimizeReason reason)
Definition maglev-ir.h:6622
static constexpr OpProperties kProperties
Definition maglev-ir.h:6626
static constexpr Base::InputTypes kInputTypes
Definition maglev-ir.h:6628
void GenerateCode(MaglevAssembler *, const ProcessingState &)
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
CheckValueEqualsString(uint64_t bitfield, compiler::InternalizedStringRef value, DeoptimizeReason reason)
Definition maglev-ir.h:6681
const compiler::InternalizedStringRef value_
Definition maglev-ir.h:6708
static constexpr OpProperties kProperties
Definition maglev-ir.h:6687
compiler::InternalizedStringRef value() const
Definition maglev-ir.h:6693
static constexpr Base::InputTypes kInputTypes
Definition maglev-ir.h:6691
void GenerateCode(MaglevAssembler *, const ProcessingState &)
const compiler::HeapObjectRef value_
Definition maglev-ir.h:6615
compiler::HeapObjectRef value() const
Definition maglev-ir.h:6595
void GenerateCode(MaglevAssembler *, const ProcessingState &)
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
static constexpr Base::InputTypes kInputTypes
Definition maglev-ir.h:6593
CheckValue(uint64_t bitfield, const compiler::HeapObjectRef value, DeoptimizeReason reason)
Definition maglev-ir.h:6587
static constexpr OpProperties kProperties
Definition maglev-ir.h:6591
static constexpr int kTargetIndex
Definition maglev-ir.h:6597
void GenerateCode(MaglevAssembler *, const ProcessingState &)
static constexpr Base::InputTypes kInputTypes
Definition maglev-ir.h:4450
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
Definition maglev-ir.h:4457
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
Definition maglev-ir.h:4039
void GenerateCode(MaglevAssembler *, const ProcessingState &)
static constexpr OpProperties kProperties
Definition maglev-ir.h:4029
static constexpr Base::InputTypes kInputTypes
Definition maglev-ir.h:4033
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
Definition maglev-ir.h:4118
static constexpr Base::InputTypes kInputTypes
Definition maglev-ir.h:4112
static constexpr OpProperties kProperties
Definition maglev-ir.h:4108
void GenerateCode(MaglevAssembler *, const ProcessingState &)
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
Definition maglev-ir.h:4059
static constexpr Base::InputTypes kInputTypes
Definition maglev-ir.h:4053
static constexpr OpProperties kProperties
Definition maglev-ir.h:4049
void GenerateCode(MaglevAssembler *, const ProcessingState &)
void GenerateCode(MaglevAssembler *, const ProcessingState &)
NextBitField< CheckType, 1 > CheckTypeBitField
Definition maglev-ir.h:7248
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
Definition maglev-ir.h:7243
CheckedInternalizedString(uint64_t bitfield, CheckType check_type)
Definition maglev-ir.h:7227
static constexpr Base::InputTypes kInputTypes
Definition maglev-ir.h:7235
static constexpr OpProperties kProperties
Definition maglev-ir.h:7232
void GenerateCode(MaglevAssembler *, const ProcessingState &)
CheckedNumberOrOddballToFloat64OrHoleyFloat64(uint64_t bitfield, TaggedToFloat64ConversionType conversion_type)
Definition maglev-ir.h:4327
Base::template NextBitField< TaggedToFloat64ConversionType, 2 > TaggedToFloat64ConversionTypeOffset
Definition maglev-ir.h:4358
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
CheckedNumberOrOddballToFloat64(uint64_t bitfield, TaggedToFloat64ConversionType conversion_type)
Definition maglev-ir.h:4369
CheckedNumberOrOddballToHoleyFloat64(uint64_t bitfield, TaggedToFloat64ConversionType conversion_type)
Definition maglev-ir.h:4382
static constexpr Base::InputTypes kInputTypes
Definition maglev-ir.h:4398
static constexpr OpProperties kProperties
Definition maglev-ir.h:4394
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
Definition maglev-ir.h:4404
void GenerateCode(MaglevAssembler *, const ProcessingState &)
static constexpr OpProperties kProperties
Definition maglev-ir.h:3831
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
Definition maglev-ir.h:3840
void GenerateCode(MaglevAssembler *, const ProcessingState &)
static constexpr Base::InputTypes kInputTypes
Definition maglev-ir.h:3834
void GenerateCode(MaglevAssembler *, const ProcessingState &)
static constexpr Base::InputTypes kInputTypes
Definition maglev-ir.h:7263
static constexpr OpProperties kProperties
Definition maglev-ir.h:7259
NextBitField< CheckType, 1 > CheckTypeBitField
Definition maglev-ir.h:7277
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
Definition maglev-ir.h:7272
CheckedObjectToIndex(uint64_t bitfield, CheckType check_type)
Definition maglev-ir.h:7256
void GenerateCode(MaglevAssembler *, const ProcessingState &)
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
Definition maglev-ir.h:3217
static constexpr OpProperties kProperties
Definition maglev-ir.h:3208
static constexpr Base::InputTypes kInputTypes
Definition maglev-ir.h:3210
static constexpr Base::InputTypes kInputTypes
Definition maglev-ir.h:3191
void GenerateCode(MaglevAssembler *, const ProcessingState &)
static constexpr OpProperties kProperties
Definition maglev-ir.h:3189
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
Definition maglev-ir.h:3198
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
Definition maglev-ir.h:3528
void GenerateCode(MaglevAssembler *, const ProcessingState &)
static constexpr OpProperties kProperties
Definition maglev-ir.h:3518
static constexpr Base::InputTypes kInputTypes
Definition maglev-ir.h:3522
void GenerateCode(MaglevAssembler *, const ProcessingState &)
static constexpr Base::InputTypes kInputTypes
Definition maglev-ir.h:4009
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
Definition maglev-ir.h:4019
static constexpr OpProperties kProperties
Definition maglev-ir.h:4011
static constexpr OpProperties kProperties
Definition maglev-ir.h:3495
void GenerateCode(MaglevAssembler *, const ProcessingState &)
static constexpr Base::InputTypes kInputTypes
Definition maglev-ir.h:3498
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
Definition maglev-ir.h:3504
void GenerateCode(MaglevAssembler *, const ProcessingState &)
static constexpr OpProperties kProperties
Definition maglev-ir.h:3557
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
Definition maglev-ir.h:3566
static constexpr Base::InputTypes kInputTypes
Definition maglev-ir.h:3560
static constexpr OpProperties kProperties
Definition maglev-ir.h:3538
static constexpr Base::InputTypes kInputTypes
Definition maglev-ir.h:3541
void GenerateCode(MaglevAssembler *, const ProcessingState &)
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
Definition maglev-ir.h:3547
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
Definition maglev-ir.h:3663
static constexpr OpProperties kProperties
Definition maglev-ir.h:3647
void GenerateCode(MaglevAssembler *, const ProcessingState &)
static constexpr Base::InputTypes kInputTypes
Definition maglev-ir.h:3651
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
Definition maglev-ir.h:4195
void GenerateCode(MaglevAssembler *, const ProcessingState &)
static constexpr Base::InputTypes kInputTypes
Definition maglev-ir.h:4189
void GenerateCode(MaglevAssembler *, const ProcessingState &)
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
Definition maglev-ir.h:4288
static constexpr Base::InputTypes kInputTypes
Definition maglev-ir.h:4278
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
TaggedToFloat64ConversionType conversion_type() const
Definition maglev-ir.h:4547
NextBitField< TaggedToFloat64ConversionType, 2 > TaggedToFloat64ConversionTypeOffset
Definition maglev-ir.h:4554
CheckedTruncateNumberOrOddballToInt32(uint64_t bitfield, TaggedToFloat64ConversionType conversion_type)
Definition maglev-ir.h:4531
void GenerateCode(MaglevAssembler *, const ProcessingState &)
void GenerateCode(MaglevAssembler *, const ProcessingState &)
static constexpr Base::InputTypes kInputTypes
Definition maglev-ir.h:4092
static constexpr OpProperties kProperties
Definition maglev-ir.h:4088
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
Definition maglev-ir.h:4098
static constexpr OpProperties kProperties
CheckpointedJump(uint64_t bitfield, BasicBlockRef *target_refs)
void GenerateCode(MaglevAssembler *, const ProcessingState &)
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
void GenerateCode(MaglevAssembler *, const ProcessingState &)
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
Definition maglev-ir.h:9109
static constexpr Base::InputTypes kInputTypes
Definition maglev-ir.h:9094
static constexpr OpProperties kProperties
Definition maglev-ir.h:9092
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
void GenerateCode(MaglevAssembler *, const ProcessingState &)
ConstantGapMove(uint64_t bitfield, ValueNode *node, compiler::AllocatedOperand target)
Definition maglev-ir.h:9349
compiler::InstructionOperand source_
Definition maglev-ir.h:9362
compiler::AllocatedOperand target() const
Definition maglev-ir.h:9353
compiler::AllocatedOperand target_
Definition maglev-ir.h:9363
bool IsTheHole(compiler::JSHeapBroker *broker) const
Definition maglev-ir.h:5283
void DoLoadToRegister(MaglevAssembler *, OutputRegister)
void GenerateCode(MaglevAssembler *, const ProcessingState &)
bool ToBoolean(LocalIsolate *local_isolate) const
Definition maglev-ir.h:5279
compiler::HeapObjectRef object()
Definition maglev-ir.h:5291
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
const compiler::HeapObjectRef object_
Definition maglev-ir.h:5299
Constant(uint64_t bitfield, compiler::HeapObjectRef object)
Definition maglev-ir.h:5276
compiler::HeapObjectRef ref() const
Definition maglev-ir.h:5296
DirectHandle< Object > DoReify(LocalIsolate *isolate) const
Definition maglev-ir.cc:897
const ConstructInvokeStubFrameData & data() const
Definition maglev-ir.h:1497
ConstructInvokeStubDeoptFrame(const MaglevCompilationUnit &unit, SourcePosition source_position, ValueNode *receiver, ValueNode *context, DeoptFrame *parent)
Definition maglev-ir.h:1478
const MaglevCompilationUnit & unit() const
Definition maglev-ir.h:1486
compiler::FeedbackSource feedback() const
const compiler::FeedbackSource feedback_
void VerifyInputs(MaglevGraphLabeller *graph_labeller) const
Definition maglev-ir.cc:713
void set_arg(int i, ValueNode *node)
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
void GenerateCode(MaglevAssembler *, const ProcessingState &)
static constexpr OpProperties kProperties
ConstructWithSpread(uint64_t bitfield, compiler::FeedbackSource feedback, ValueNode *function, ValueNode *new_target, ValueNode *context)
void set_arg(int i, ValueNode *node)
Definition maglev-ir.h:9652
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
Definition maglev-ir.h:9670
Construct(uint64_t bitfield, const compiler::FeedbackSource &feedback, ValueNode *function, ValueNode *new_target, ValueNode *context)
Definition maglev-ir.h:9634
const compiler::FeedbackSource feedback_
Definition maglev-ir.h:9673
static constexpr int kContextIndex
Definition maglev-ir.h:9625
static constexpr int kNewTargetIndex
Definition maglev-ir.h:9624
const Input & function() const
Definition maglev-ir.h:9645
void VerifyInputs(MaglevGraphLabeller *graph_labeller) const
Definition maglev-ir.cc:699
static constexpr OpProperties kProperties
Definition maglev-ir.h:9642
static constexpr int kFixedInputCount
Definition maglev-ir.h:9626
compiler::FeedbackSource feedback() const
Definition maglev-ir.h:9661
static constexpr int kFunctionIndex
Definition maglev-ir.h:9623
void GenerateCode(MaglevAssembler *, const ProcessingState &)
const Input & context() const
Definition maglev-ir.h:9649
const Input & new_target() const
Definition maglev-ir.h:9647
ControlNode * next_post_dominating_hole() const
void set_next_post_dominating_hole(ControlNode *node)
void GenerateCode(MaglevAssembler *, const ProcessingState &)
static constexpr Base::InputTypes kInputTypes
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
const compiler::NativeContextRef native_context_
static constexpr Base::InputTypes kInputTypes
compiler::NativeContextRef native_context() const
void GenerateCode(MaglevAssembler *, const ProcessingState &)
ConvertReceiver(uint64_t bitfield, compiler::NativeContextRef native_context, ConvertReceiverMode mode)
static constexpr OpProperties kProperties
ConvertReceiverMode mode() const
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
Definition maglev-ir.h:5381
const compiler::FeedbackSource feedback_
Definition maglev-ir.h:5385
static constexpr OpProperties kProperties
Definition maglev-ir.h:5373
const compiler::HeapObjectRef constant_elements_
Definition maglev-ir.h:5384
CreateArrayLiteral(uint64_t bitfield, compiler::HeapObjectRef constant_elements, const compiler::FeedbackSource &feedback, int flags)
Definition maglev-ir.h:5359
compiler::HeapObjectRef constant_elements()
Definition maglev-ir.h:5368
void GenerateCode(MaglevAssembler *, const ProcessingState &)
compiler::FeedbackSource feedback() const
Definition maglev-ir.h:5369
void GenerateCode(MaglevAssembler *, const ProcessingState &)
const compiler::SharedFunctionInfoRef shared_function_info_
Definition maglev-ir.h:6408
static constexpr Base::InputTypes kInputTypes
Definition maglev-ir.h:6400
CreateClosure(uint64_t bitfield, compiler::SharedFunctionInfoRef shared_function_info, compiler::FeedbackCellRef feedback_cell, bool pretenured)
Definition maglev-ir.h:6378
static constexpr OpProperties kProperties
Definition maglev-ir.h:6396
const compiler::FeedbackCellRef feedback_cell_
Definition maglev-ir.h:6409
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
compiler::FeedbackCellRef feedback_cell() const
Definition maglev-ir.h:6390
compiler::SharedFunctionInfoRef shared_function_info() const
Definition maglev-ir.h:6387
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
Definition maglev-ir.h:7497
static constexpr OpProperties kProperties
Definition maglev-ir.h:7487
static constexpr Base::InputTypes kInputTypes
Definition maglev-ir.h:7491
void GenerateCode(MaglevAssembler *, const ProcessingState &)
CreateFastArrayElements(uint64_t bitfield, AllocationType allocation_type)
Definition maglev-ir.h:7481
static constexpr OpProperties kProperties
Definition maglev-ir.h:6292
compiler::ScopeInfoRef scope_info() const
Definition maglev-ir.h:6285
static constexpr Base::InputTypes kInputTypes
Definition maglev-ir.h:6296
const compiler::ScopeInfoRef scope_info_
Definition maglev-ir.h:6304
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
void GenerateCode(MaglevAssembler *, const ProcessingState &)
CreateFunctionContext(uint64_t bitfield, compiler::ScopeInfoRef scope_info, uint32_t slot_count, ScopeType scope_type)
Definition maglev-ir.h:6277
const compiler::FeedbackSource feedback_
Definition maglev-ir.h:5455
compiler::FeedbackSource feedback() const
Definition maglev-ir.h:5439
void GenerateCode(MaglevAssembler *, const ProcessingState &)
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
Definition maglev-ir.h:5451
compiler::ObjectBoilerplateDescriptionRef boilerplate_descriptor()
Definition maglev-ir.h:5436
CreateObjectLiteral(uint64_t bitfield, compiler::ObjectBoilerplateDescriptionRef boilerplate_descriptor, const compiler::FeedbackSource &feedback, int flags)
Definition maglev-ir.h:5427
static constexpr OpProperties kProperties
Definition maglev-ir.h:5443
const compiler::ObjectBoilerplateDescriptionRef boilerplate_descriptor_
Definition maglev-ir.h:5454
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
Definition maglev-ir.h:6366
static constexpr OpProperties kProperties
Definition maglev-ir.h:6359
CreateRegExpLiteral(uint64_t bitfield, compiler::StringRef pattern, const compiler::FeedbackSource &feedback, int flags)
Definition maglev-ir.h:6349
const compiler::FeedbackSource feedback_
Definition maglev-ir.h:6370
compiler::FeedbackSource feedback() const
Definition maglev-ir.h:6355
void GenerateCode(MaglevAssembler *, const ProcessingState &)
static constexpr OpProperties kProperties
Definition maglev-ir.h:5408
CreateShallowArrayLiteral(uint64_t bitfield, compiler::HeapObjectRef constant_elements, const compiler::FeedbackSource &feedback, int flags)
Definition maglev-ir.h:5394
compiler::FeedbackSource feedback() const
Definition maglev-ir.h:5404
void GenerateCode(MaglevAssembler *, const ProcessingState &)
const compiler::FeedbackSource feedback_
Definition maglev-ir.h:5418
const compiler::HeapObjectRef constant_elements_
Definition maglev-ir.h:5417
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
Definition maglev-ir.h:5414
compiler::ObjectBoilerplateDescriptionRef boilerplate_descriptor()
Definition maglev-ir.h:5475
static constexpr OpProperties kProperties
Definition maglev-ir.h:5482
CreateShallowObjectLiteral(uint64_t bitfield, compiler::ObjectBoilerplateDescriptionRef boilerplate_descriptor, const compiler::FeedbackSource &feedback, int flags)
Definition maglev-ir.h:5464
const compiler::ObjectBoilerplateDescriptionRef boilerplate_descriptor_
Definition maglev-ir.h:5491
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
Definition maglev-ir.h:5488
const compiler::FeedbackSource feedback_
Definition maglev-ir.h:5492
compiler::FeedbackSource feedback() const
Definition maglev-ir.h:5478
void GenerateCode(MaglevAssembler *, const ProcessingState &)
void VerifyInputs(MaglevGraphLabeller *) const
Definition maglev-ir.h:7194
Dead(uint64_t bitfield)
Definition maglev-ir.h:7198
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
Definition maglev-ir.h:7193
void GenerateCode(MaglevAssembler *, const ProcessingState &)
Definition maglev-ir.h:7192
void GenerateCode(MaglevAssembler *, const ProcessingState &)
DebugBreak(uint64_t bitfield)
Definition maglev-ir.h:7178
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
Definition maglev-ir.h:7184
static constexpr OpProperties kProperties
Definition maglev-ir.h:7180
static constexpr OpProperties kProperties
Definition maglev-ir.h:9297
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
Definition maglev-ir.h:9319
DefineKeyedOwnGeneric(uint64_t bitfield, const compiler::FeedbackSource &feedback)
Definition maglev-ir.h:9292
compiler::FeedbackSource feedback() const
Definition maglev-ir.h:9303
const compiler::FeedbackSource feedback_
Definition maglev-ir.h:9322
static constexpr Base::InputTypes kInputTypes
Definition maglev-ir.h:9298
void GenerateCode(MaglevAssembler *, const ProcessingState &)
const compiler::FeedbackSource feedback_
Definition maglev-ir.h:9183
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
static constexpr Base::InputTypes kInputTypes
Definition maglev-ir.h:9162
static constexpr OpProperties kProperties
Definition maglev-ir.h:9161
compiler::FeedbackSource feedback() const
Definition maglev-ir.h:9167
void GenerateCode(MaglevAssembler *, const ProcessingState &)
DefineNamedOwnGeneric(uint64_t bitfield, compiler::NameRef name, const compiler::FeedbackSource &feedback)
Definition maglev-ir.h:9156
DeleteProperty(uint64_t bitfield, LanguageMode mode)
Definition maglev-ir.h:4830
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
static constexpr Base::InputTypes kInputTypes
Definition maglev-ir.h:4835
void GenerateCode(MaglevAssembler *, const ProcessingState &)
static constexpr OpProperties kProperties
Definition maglev-ir.h:4834
SourcePosition GetSourcePosition() const
Definition maglev-ir.h:1600
const InlinedArgumentsDeoptFrame & as_inlined_arguments() const
Definition maglev-ir.h:1466
const ConstructInvokeStubDeoptFrame & as_construct_stub() const
Definition maglev-ir.h:1505
compiler::SharedFunctionInfoRef GetSharedFunctionInfo() const
Definition maglev-ir.h:1615
DeoptFrame(InterpretedFrameData &&data, DeoptFrame *parent)
Definition maglev-ir.h:1383
const DeoptFrame * parent() const
Definition maglev-ir.h:1363
DeoptFrame(const FrameData &data, DeoptFrame *parent)
Definition maglev-ir.h:1358
DeoptFrame(FrameData &&data, DeoptFrame *parent)
Definition maglev-ir.h:1355
DeoptFrame(InlinedArgumentsFrameData &&data, DeoptFrame *parent)
Definition maglev-ir.h:1385
const InterpretedDeoptFrame & as_interpreted() const
Definition maglev-ir.h:1428
const MaglevCompilationUnit & GetCompilationUnit() const
Definition maglev-ir.h:1572
compiler::BytecodeArrayRef GetBytecodeArray() const
Definition maglev-ir.h:1620
DeoptFrame(ConstructInvokeStubFrameData &&data, DeoptFrame *parent)
Definition maglev-ir.h:1387
const BuiltinContinuationDeoptFrame & as_builtin_continuation() const
Definition maglev-ir.h:1549
BytecodeOffset GetBytecodeOffset() const
Definition maglev-ir.h:1585
DeoptFrame(BuiltinContinuationFrameData &&data, DeoptFrame *parent)
Definition maglev-ir.h:1389
const DeoptFrame & top_frame() const
Definition maglev-ir.h:1631
const compiler::FeedbackSource & feedback_to_update() const
Definition maglev-ir.h:1632
void set_translation_index(int index)
Definition maglev-ir.h:1646
void InitializeInputLocations(Zone *zone, size_t count)
Definition maglev-ir.cc:340
DeoptInfo(Zone *zone, const DeoptFrame top_frame, compiler::FeedbackSource feedback_to_update)
Definition maglev-ir.cc:383
const compiler::FeedbackSource feedback_to_update_
Definition maglev-ir.h:1654
InputLocation * input_locations() const
Definition maglev-ir.h:1637
void GenerateCode(MaglevAssembler *, const ProcessingState &)
Deopt(uint64_t bitfield, DeoptimizeReason reason)
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
static constexpr OpProperties kProperties
EagerDeoptInfo(Zone *zone, const DeoptFrame top_frame, compiler::FeedbackSource feedback_to_update)
Definition maglev-ir.h:1671
DeoptimizeReason reason() const
Definition maglev-ir.h:1675
void set_reason(DeoptimizeReason reason)
Definition maglev-ir.h:1676
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
Definition maglev-ir.h:7997
void GenerateCode(MaglevAssembler *, const ProcessingState &)
static constexpr Base::InputTypes kInputTypes
Definition maglev-ir.h:7986
static constexpr OpProperties kProperties
Definition maglev-ir.h:7983
ExceptionHandlerInfo(BasicBlockRef *catch_block_ref, int depth)
Definition maglev-ir.h:1793
ExceptionHandlerInfo(BasicBlock *catch_block_ref, int depth)
Definition maglev-ir.h:1799
ExceptionHandlerInfo(Mode mode=kNoExceptionHandler)
Definition maglev-ir.h:1790
void GenerateCode(MaglevAssembler *, const ProcessingState &)
static constexpr Base::InputTypes kInputTypes
Definition maglev-ir.h:8013
ExtendPropertiesBackingStore(uint64_t bitfield, int old_length)
Definition maglev-ir.h:8005
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
void DoLoadToRegister(MaglevAssembler *, OutputRegister)
ExternalReference reference() const
Definition maglev-ir.h:5255
const ExternalReference reference_
Definition maglev-ir.h:5267
void GenerateCode(MaglevAssembler *, const ProcessingState &)
ExternalConstant(uint64_t bitfield, const ExternalReference &reference)
Definition maglev-ir.h:5248
bool ToBoolean(LocalIsolate *local_isolate) const
Definition maglev-ir.h:5257
DirectHandle< Object > DoReify(LocalIsolate *isolate) const
Definition maglev-ir.cc:872
static constexpr OpProperties kProperties
Definition maglev-ir.h:5252
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
const compiler::SharedFunctionInfoRef shared_function_info_
Definition maglev-ir.h:6340
FastCreateClosure(uint64_t bitfield, compiler::SharedFunctionInfoRef shared_function_info, compiler::FeedbackCellRef feedback_cell)
Definition maglev-ir.h:6313
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
void GenerateCode(MaglevAssembler *, const ProcessingState &)
compiler::SharedFunctionInfoRef shared_function_info() const
Definition maglev-ir.h:6320
static constexpr OpProperties kProperties
Definition maglev-ir.h:6328
compiler::FeedbackCellRef feedback_cell() const
Definition maglev-ir.h:6323
static constexpr Base::InputTypes kInputTypes
Definition maglev-ir.h:6332
const compiler::FeedbackCellRef feedback_cell_
Definition maglev-ir.h:6341
detail::YouNeedToDefineAnInputTypesArrayInYourDerivedClass kInputTypes
Definition maglev-ir.h:2842
void VerifyInputs(MaglevGraphLabeller *graph_labeller) const
Definition maglev-ir.h:2813
FixedInputNodeTMixin(uint64_t bitfield, Args &&... args)
Definition maglev-ir.h:2845
detail::ArrayWrapper< kInputCount > InputTypes
Definition maglev-ir.h:2841
constexpr uint16_t input_count() const
Definition maglev-ir.h:2808
void GenerateCode(MaglevAssembler *, const ProcessingState &)
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
Definition maglev-ir.h:4232
static constexpr OpProperties kProperties
Definition maglev-ir.h:4224
Float64Abs(uint64_t bitfield)
Definition maglev-ir.h:4222
static constexpr Base::InputTypes kInputTypes
Definition maglev-ir.h:4226
static constexpr OpProperties kProperties
Definition maglev-ir.h:3257
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
Definition maglev-ir.h:3270
static constexpr Base::InputTypes kInputTypes
Definition maglev-ir.h:3259
static constexpr OpProperties kProperties
Definition maglev-ir.h:3225
static constexpr Base::InputTypes kInputTypes
Definition maglev-ir.h:3226
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
Definition maglev-ir.h:3237
Float64Compare(uint64_t bitfield, Operation operation)
Definition maglev-ir.h:3300
void GenerateCode(MaglevAssembler *, const ProcessingState &)
constexpr Operation operation() const
Definition maglev-ir.h:3311
NextBitField< Operation, 5 > OperationBitField
Definition maglev-ir.h:3322
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
static constexpr Base::InputTypes kInputTypes
Definition maglev-ir.h:3303
static constexpr OpProperties kProperties
Definition maglev-ir.h:3751
bool ToBoolean(LocalIsolate *local_isolate) const
Definition maglev-ir.h:3755
Float64Constant(uint64_t bitfield, Float64 value)
Definition maglev-ir.h:3748
DirectHandle< Object > DoReify(LocalIsolate *isolate) const
Definition maglev-ir.cc:892
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
void DoLoadToRegister(MaglevAssembler *, OutputRegister)
void GenerateCode(MaglevAssembler *, const ProcessingState &)
ExternalReference ieee_function_ref() const
Definition maglev-ir.cc:502
static constexpr Base::InputTypes kInputTypes
Definition maglev-ir.h:3402
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
Ieee754Function ieee_function() const
Definition maglev-ir.h:3413
void GenerateCode(MaglevAssembler *, const ProcessingState &)
Float64Ieee754Unary(uint64_t bitfield, Ieee754Function ieee_function)
Definition maglev-ir.h:3396
static constexpr OpProperties kProperties
Definition maglev-ir.h:3399
static constexpr Base::InputTypes kInputTypes
Definition maglev-ir.h:3357
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
Definition maglev-ir.h:3363
void GenerateCode(MaglevAssembler *, const ProcessingState &)
static constexpr OpProperties kProperties
Definition maglev-ir.h:3355
Float64Round(uint64_t bitfield, Kind kind)
Definition maglev-ir.h:4252
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
static constexpr Base::InputTypes kInputTypes
Definition maglev-ir.h:4256
static constexpr OpProperties kProperties
Definition maglev-ir.h:4254
static Builtin continuation(Kind kind)
Definition maglev-ir.h:4241
void GenerateCode(MaglevAssembler *, const ProcessingState &)
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
NextBitField< bool, 1 > FlipBitField
Definition maglev-ir.h:3346
void GenerateCode(MaglevAssembler *, const ProcessingState &)
Float64ToBoolean(uint64_t bitfield, bool flip)
Definition maglev-ir.h:3329
static constexpr Base::InputTypes kInputTypes
Definition maglev-ir.h:3332
static constexpr Base::InputTypes kInputTypes
Definition maglev-ir.h:3948
void GenerateCode(MaglevAssembler *, const ProcessingState &)
static constexpr OpProperties kProperties
Definition maglev-ir.h:3950
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
Definition maglev-ir.h:3959
static constexpr Base::InputTypes kInputTypes
Definition maglev-ir.h:3911
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
Definition maglev-ir.h:3922
Float64ToTagged(uint64_t bitfield, ConversionMode mode)
Definition maglev-ir.h:3908
ConversionMode conversion_mode() const
Definition maglev-ir.h:3926
NextBitField< ConversionMode, 1 > ConversionModeBitField
Definition maglev-ir.h:3936
static constexpr OpProperties kProperties
Definition maglev-ir.h:3913
void GenerateCode(MaglevAssembler *, const ProcessingState &)
static constexpr OpProperties kProperties
Definition maglev-ir.h:3813
void GenerateCode(MaglevAssembler *, const ProcessingState &)
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
Definition maglev-ir.h:3821
static constexpr Base::InputTypes kInputTypes
Definition maglev-ir.h:3815
void GenerateCode(MaglevAssembler *, const ProcessingState &)
compiler::FeedbackSource feedback() const
Definition maglev-ir.h:4989
ForInNext(uint64_t bitfield, compiler::FeedbackSource &feedback)
Definition maglev-ir.h:4980
const compiler::FeedbackSource feedback_
Definition maglev-ir.h:5003
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
Definition maglev-ir.h:5000
static constexpr OpProperties kProperties
Definition maglev-ir.h:4983
static constexpr Base::InputTypes kInputTypes
Definition maglev-ir.h:4984
static constexpr Base::InputTypes kInputTypes
Definition maglev-ir.h:4957
compiler::FeedbackSource feedback() const
Definition maglev-ir.h:4960
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
Definition maglev-ir.h:4970
void GenerateCode(MaglevAssembler *, const ProcessingState &)
static constexpr OpProperties kProperties
Definition maglev-ir.h:4955
const compiler::FeedbackSource feedback_
Definition maglev-ir.h:4973
ForInPrepare(uint64_t bitfield, compiler::FeedbackSource &feedback)
Definition maglev-ir.h:4952
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
Definition maglev-ir.h:7219
static constexpr OpProperties kProperties
Definition maglev-ir.h:7212
void GenerateCode(MaglevAssembler *, const ProcessingState &)
compiler::AllocatedOperand source_
Definition maglev-ir.h:9341
compiler::AllocatedOperand target() const
Definition maglev-ir.h:9334
compiler::AllocatedOperand target_
Definition maglev-ir.h:9342
GapMove(uint64_t bitfield, compiler::AllocatedOperand source, compiler::AllocatedOperand target)
Definition maglev-ir.h:9329
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
void GenerateCode(MaglevAssembler *, const ProcessingState &)
compiler::AllocatedOperand source() const
Definition maglev-ir.h:9333
static constexpr Base::InputTypes kInputTypes
Definition maglev-ir.h:5137
void GenerateCode(MaglevAssembler *, const ProcessingState &)
GeneratorRestoreRegister(uint64_t bitfield, int index)
Definition maglev-ir.h:5133
static constexpr OpProperties kProperties
Definition maglev-ir.h:5136
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
Definition maglev-ir.h:5146
static constexpr int kGeneratorIndex
Definition maglev-ir.h:4860
static constexpr int kFixedInputCount
Definition maglev-ir.h:4861
static constexpr OpProperties kProperties
Definition maglev-ir.h:4874
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
Definition maglev-ir.h:4903
void GenerateCode(MaglevAssembler *, const ProcessingState &)
GeneratorStore(uint64_t bitfield, ValueNode *context, ValueNode *generator, int suspend_id, int bytecode_offset)
Definition maglev-ir.h:4865
void set_parameters_and_registers(int i, ValueNode *node)
Definition maglev-ir.h:4888
void VerifyInputs(MaglevGraphLabeller *graph_labeller) const
Definition maglev-ir.cc:570
static constexpr int kContextIndex
Definition maglev-ir.h:4859
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
void GenerateCode(MaglevAssembler *, const ProcessingState &)
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
Definition maglev-ir.h:5031
IndirectHandle< FeedbackVector > feedback() const
Definition maglev-ir.h:5026
static constexpr Base::InputTypes kInputTypes
Definition maglev-ir.h:5018
void GenerateCode(MaglevAssembler *, const ProcessingState &)
static constexpr OpProperties kProperties
Definition maglev-ir.h:5017
GetIterator(uint64_t bitfield, int load_slot, int call_slot, compiler::FeedbackVectorRef feedback)
Definition maglev-ir.h:5010
const IndirectHandle< FeedbackVector > feedback_
Definition maglev-ir.h:5036
static constexpr Base::InputTypes kInputTypes
Definition maglev-ir.h:9231
void GenerateCode(MaglevAssembler *, const ProcessingState &)
static constexpr OpProperties kProperties
Definition maglev-ir.h:9230
const compiler::FeedbackSource feedback_
Definition maglev-ir.h:9250
GetKeyedGeneric(uint64_t bitfield, const compiler::FeedbackSource &feedback)
Definition maglev-ir.h:9225
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
Definition maglev-ir.h:9247
compiler::FeedbackSource feedback() const
Definition maglev-ir.h:9235
void GenerateCode(MaglevAssembler *, const ProcessingState &)
static constexpr OpProperties kProperties
Definition maglev-ir.h:5047
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
Definition maglev-ir.h:5052
compiler::SharedFunctionInfoRef shared_function_info_
Definition maglev-ir.h:7310
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
Definition maglev-ir.h:7307
static constexpr OpProperties kProperties
Definition maglev-ir.h:7292
const compiler::FeedbackSource feedback_
Definition maglev-ir.h:7311
GetTemplateObject(uint64_t bitfield, compiler::SharedFunctionInfoRef shared_function_info, const compiler::FeedbackSource &feedback)
Definition maglev-ir.h:7284
compiler::FeedbackSource feedback() const
Definition maglev-ir.h:7302
compiler::SharedFunctionInfoRef shared_function_info()
Definition maglev-ir.h:7299
void GenerateCode(MaglevAssembler *, const ProcessingState &)
static constexpr Base::InputTypes kInputTypes
Definition maglev-ir.h:7295
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
void GenerateCode(MaglevAssembler *, const ProcessingState &)
static constexpr Base::InputTypes kInputTypes
Definition maglev-ir.h:7328
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
void GenerateCode(MaglevAssembler *, const ProcessingState &)
HasInPrototypeChain(uint64_t bitfield, compiler::HeapObjectRef prototype)
Definition maglev-ir.h:7319
compiler::HeapObjectRef prototype()
Definition maglev-ir.h:7332
static constexpr OpProperties kProperties
Definition maglev-ir.h:7325
static constexpr Base::InputTypes kInputTypes
Definition maglev-ir.h:4486
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
Definition maglev-ir.h:4492
void GenerateCode(MaglevAssembler *, const ProcessingState &)
void GenerateCode(MaglevAssembler *, const ProcessingState &)
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
Definition maglev-ir.h:4476
static constexpr Base::InputTypes kInputTypes
Definition maglev-ir.h:4469
static constexpr OpProperties kProperties
Definition maglev-ir.h:3973
static constexpr Base::InputTypes kInputTypes
Definition maglev-ir.h:3971
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
Definition maglev-ir.h:3982
NextBitField< ConversionMode, 1 > ConversionModeBitField
Definition maglev-ir.h:3999
void GenerateCode(MaglevAssembler *, const ProcessingState &)
HoleyFloat64ToTagged(uint64_t bitfield, ConversionMode mode)
Definition maglev-ir.h:3968
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
Definition maglev-ir.h:2891
Identity(uint64_t bitfield)
Definition maglev-ir.h:2877
void GenerateCode(MaglevAssembler *, const ProcessingState &)
Definition maglev-ir.h:2890
static constexpr OpProperties kProperties
Definition maglev-ir.h:2875
void VerifyInputs(MaglevGraphLabeller *) const
Definition maglev-ir.h:2879
interpreter::Register source() const
Definition maglev-ir.h:5158
const interpreter::Register source_
Definition maglev-ir.h:5169
static uint32_t stack_slot(uint32_t register_idx)
void GenerateCode(MaglevAssembler *, const ProcessingState &)
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
InitialValue(uint64_t bitfield, interpreter::Register source)
Definition maglev-ir.cc:167
static constexpr OpProperties kProperties
Definition maglev-ir.h:5968
EscapeAnalysisResult escape_analysis_result_
Definition maglev-ir.h:6041
void VerifyInputs(MaglevGraphLabeller *graph_labeller) const
Definition maglev-ir.cc:819
void UpdateObject(VirtualObject *object)
Definition maglev-ir.h:6024
void GenerateCode(MaglevAssembler *, const ProcessingState &)
InlinedAllocation(uint64_t bitfield, VirtualObject *object)
Definition maglev-ir.h:5960
static constexpr Base::InputTypes kInputTypes
Definition maglev-ir.h:5970
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
InlinedArgumentsDeoptFrame(const MaglevCompilationUnit &unit, BytecodeOffset bytecode_position, ValueNode *closure, base::Vector< ValueNode * > arguments, DeoptFrame *parent)
Definition maglev-ir.h:1439
base::Vector< ValueNode * > arguments() const
Definition maglev-ir.h:1452
const MaglevCompilationUnit & unit() const
Definition maglev-ir.h:1448
const InlinedArgumentsFrameData & data() const
Definition maglev-ir.h:1458
void set_node(ValueNode *node)
Definition maglev-ir.h:1301
ValueNode * node() const
Definition maglev-ir.h:1300
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
Definition maglev-ir.h:4215
void GenerateCode(MaglevAssembler *, const ProcessingState &)
static constexpr OpProperties kProperties
Definition maglev-ir.h:4203
static constexpr Base::InputTypes kInputTypes
Definition maglev-ir.h:4206
static constexpr OpProperties kProperties
Definition maglev-ir.h:3019
static constexpr Base::InputTypes kInputTypes
Definition maglev-ir.h:3020
static constexpr Base::InputTypes kInputTypes
Definition maglev-ir.h:2979
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
Definition maglev-ir.h:2990
static constexpr OpProperties kProperties
Definition maglev-ir.h:2977
static constexpr Base::InputTypes kInputTypes
Definition maglev-ir.h:3049
void GenerateCode(MaglevAssembler *, const ProcessingState &)
static constexpr OpProperties kProperties
Definition maglev-ir.h:3047
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
Definition maglev-ir.h:3056
static constexpr int kLeftIndex
Definition maglev-ir.h:3117
constexpr Operation operation() const
Definition maglev-ir.h:3122
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
Int32Compare(uint64_t bitfield, Operation operation)
Definition maglev-ir.h:3111
NextBitField< Operation, 5 > OperationBitField
Definition maglev-ir.h:3133
static constexpr Base::InputTypes kInputTypes
Definition maglev-ir.h:3114
void GenerateCode(MaglevAssembler *, const ProcessingState &)
static constexpr int kRightIndex
Definition maglev-ir.h:3118
void GenerateCode(MaglevAssembler *, const ProcessingState &)
bool ToBoolean(LocalIsolate *local_isolate) const
Definition maglev-ir.h:3703
static constexpr OpProperties kProperties
Definition maglev-ir.h:3699
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
DirectHandle< Object > DoReify(LocalIsolate *isolate) const
Definition maglev-ir.cc:884
void DoLoadToRegister(MaglevAssembler *, OutputRegister)
Int32Constant(uint64_t bitfield, int32_t value)
Definition maglev-ir.h:3696
void GenerateCode(MaglevAssembler *, const ProcessingState &)
static constexpr Base::InputTypes kInputTypes
Definition maglev-ir.h:3094
static constexpr OpProperties kProperties
Definition maglev-ir.h:3093
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
Definition maglev-ir.h:3104
NextBitField< bool, 1 > FlipBitField
Definition maglev-ir.h:3156
static constexpr Base::InputTypes kInputTypes
Definition maglev-ir.h:3143
void GenerateCode(MaglevAssembler *, const ProcessingState &)
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
Int32ToBoolean(uint64_t bitfield, bool flip)
Definition maglev-ir.h:3140
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
Definition maglev-ir.h:3860
void GenerateCode(MaglevAssembler *, const ProcessingState &)
static constexpr Base::InputTypes kInputTypes
Definition maglev-ir.h:3853
static constexpr OpProperties kProperties
Definition maglev-ir.h:3849
static constexpr OpProperties kProperties
Definition maglev-ir.h:3777
void GenerateCode(MaglevAssembler *, const ProcessingState &)
static constexpr Base::InputTypes kInputTypes
Definition maglev-ir.h:3779
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
Definition maglev-ir.h:3785
static constexpr OpProperties kProperties
Definition maglev-ir.h:3064
static constexpr Base::InputTypes kInputTypes
Definition maglev-ir.h:3067
void GenerateCode(MaglevAssembler *, const ProcessingState &)
static constexpr Base::InputTypes kInputTypes
Definition maglev-ir.h:3166
NextBitField< bool, 1 > FlipBitField
Definition maglev-ir.h:3179
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
IntPtrToBoolean(uint64_t bitfield, bool flip)
Definition maglev-ir.h:3163
static constexpr OpProperties kProperties
Definition maglev-ir.h:3889
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
Definition maglev-ir.h:3900
void GenerateCode(MaglevAssembler *, const ProcessingState &)
static constexpr Base::InputTypes kInputTypes
Definition maglev-ir.h:3893
const MaglevCompilationUnit & unit() const
Definition maglev-ir.h:1406
int ComputeReturnOffset(interpreter::Register result_location, int result_size) const
Definition maglev-ir.cc:412
InterpretedDeoptFrame(const MaglevCompilationUnit &unit, const CompactInterpreterFrameState *frame_state, ValueNode *closure, BytecodeOffset bytecode_position, SourcePosition source_position, DeoptFrame *parent)
Definition maglev-ir.h:1398
const CompactInterpreterFrameState * frame_state() const
Definition maglev-ir.h:1407
const InterpretedFrameData & data() const
Definition maglev-ir.h:1420
void GenerateCode(MaglevAssembler *, const ProcessingState &)
JumpLoop(uint64_t bitfield, BasicBlock *target)
base::Vector< Input > used_node_locations_
void set_used_nodes(base::Vector< Input > locations)
base::Vector< Input > used_nodes()
JumpLoop(uint64_t bitfield, BasicBlockRef *ref)
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
void GenerateCode(MaglevAssembler *, const ProcessingState &)
Jump(uint64_t bitfield, BasicBlockRef *target_refs)
interpreter::Register result_location_
Definition maglev-ir.h:1778
interpreter::Register result_location() const
Definition maglev-ir.h:1698
static bool InReturnValues(interpreter::Register reg, interpreter::Register result_location, int result_size)
Definition maglev-ir.cc:402
static constexpr unsigned int kUninitializedCallReturnPc
Definition maglev-ir.h:1769
bool IsResultRegister(interpreter::Register reg) const
Definition maglev-ir.cc:387
static constexpr int kMaxCodeSize
Definition maglev-ir.h:1768
LazyDeoptInfo(Zone *zone, const DeoptFrame top_frame, interpreter::Register result_location, int result_size, compiler::FeedbackSource feedback_to_update)
Definition maglev-ir.h:1689
const InterpretedDeoptFrame & GetFrameForExceptionHandler(const ExceptionHandlerInfo *handler_info)
Definition maglev-ir.cc:435
static constexpr Base::InputTypes kInputTypes
Definition maglev-ir.h:8283
LoadDoubleDataViewElement(uint64_t bitfield, ExternalArrayType type)
Definition maglev-ir.h:8276
static constexpr ExternalArrayType type_
Definition maglev-ir.h:8272
void GenerateCode(MaglevAssembler *, const ProcessingState &)
static constexpr OpProperties kProperties
Definition maglev-ir.h:8281
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
Definition maglev-ir.h:8300
static constexpr Base::InputTypes kInputTypes
Definition maglev-ir.h:7826
void GenerateCode(MaglevAssembler *, const ProcessingState &)
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
LoadDoubleField(uint64_t bitfield, int offset)
Definition maglev-ir.h:7820
static constexpr OpProperties kProperties
Definition maglev-ir.h:7823
void GenerateCode(MaglevAssembler *, const ProcessingState &)
static constexpr Base::InputTypes kInputTypes
Definition maglev-ir.h:9002
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
Definition maglev-ir.h:9009
static constexpr OpProperties kProperties
Definition maglev-ir.h:8999
void GenerateCode(MaglevAssembler *, const ProcessingState &)
static constexpr Base::InputTypes kInputTypes
Definition maglev-ir.h:7963
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
static constexpr OpProperties kProperties
Definition maglev-ir.h:7962
static constexpr Base::InputTypes kInputTypes
Definition maglev-ir.h:8141
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
Definition maglev-ir.h:8151
static constexpr OpProperties kProperties
Definition maglev-ir.h:8139
void GenerateCode(MaglevAssembler *, const ProcessingState &)
LoadFloat64(uint64_t bitfield, int offset)
Definition maglev-ir.h:7847
static constexpr Base::InputTypes kInputTypes
Definition maglev-ir.h:7853
static constexpr int kObjectIndex
Definition maglev-ir.h:7857
void GenerateCode(MaglevAssembler *, const ProcessingState &)
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
static constexpr OpProperties kProperties
Definition maglev-ir.h:7850
void GenerateCode(MaglevAssembler *, const ProcessingState &)
const compiler::NameRef name_
Definition maglev-ir.h:8830
const compiler::FeedbackSource feedback_
Definition maglev-ir.h:8831
LoadGlobal(uint64_t bitfield, compiler::NameRef name, const compiler::FeedbackSource &feedback, TypeofMode typeof_mode)
Definition maglev-ir.h:8805
static constexpr Base::InputTypes kInputTypes
Definition maglev-ir.h:8816
compiler::FeedbackSource feedback() const
Definition maglev-ir.h:8819
static constexpr OpProperties kProperties
Definition maglev-ir.h:8814
TypeofMode typeof_mode() const
Definition maglev-ir.h:8820
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
compiler::NameRef name() const
Definition maglev-ir.h:8818
void GenerateCode(MaglevAssembler *, const ProcessingState &)
static constexpr int kObjectIndex
Definition maglev-ir.h:7884
LoadHeapInt32(uint64_t bitfield, int offset)
Definition maglev-ir.h:7874
static constexpr Base::InputTypes kInputTypes
Definition maglev-ir.h:7880
static constexpr OpProperties kProperties
Definition maglev-ir.h:7877
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
void GenerateCode(MaglevAssembler *, const ProcessingState &)
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
Definition maglev-ir.h:8200
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
Definition maglev-ir.h:8174
static constexpr Base::InputTypes kInputTypes
Definition maglev-ir.h:8164
void GenerateCode(MaglevAssembler *, const ProcessingState &)
static constexpr OpProperties kProperties
Definition maglev-ir.h:7904
void GenerateCode(MaglevAssembler *, const ProcessingState &)
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
static constexpr int kObjectIndex
Definition maglev-ir.h:7911
LoadInt32(uint64_t bitfield, int offset)
Definition maglev-ir.h:7901
static constexpr Base::InputTypes kInputTypes
Definition maglev-ir.h:7907
compiler::FeedbackSource feedback() const
Definition maglev-ir.h:8939
LoadNamedFromSuperGeneric(uint64_t bitfield, compiler::NameRef name, const compiler::FeedbackSource &feedback)
Definition maglev-ir.h:8928
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
void GenerateCode(MaglevAssembler *, const ProcessingState &)
const compiler::FeedbackSource feedback_
Definition maglev-ir.h:8955
static constexpr Base::InputTypes kInputTypes
Definition maglev-ir.h:8934
static constexpr OpProperties kProperties
Definition maglev-ir.h:8933
void GenerateCode(MaglevAssembler *, const ProcessingState &)
compiler::NameRef name() const
Definition maglev-ir.h:8905
const compiler::FeedbackSource feedback_
Definition maglev-ir.h:8920
static constexpr Base::InputTypes kInputTypes
Definition maglev-ir.h:8902
static constexpr OpProperties kProperties
Definition maglev-ir.h:8901
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
compiler::FeedbackSource feedback() const
Definition maglev-ir.h:8906
LoadNamedGeneric(uint64_t bitfield, compiler::NameRef name, const compiler::FeedbackSource &feedback)
Definition maglev-ir.h:8896
LoadSignedIntDataViewElement(uint64_t bitfield, ExternalArrayType type)
Definition maglev-ir.h:8232
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
Definition maglev-ir.h:8259
void GenerateCode(MaglevAssembler *, const ProcessingState &)
static constexpr Base::InputTypes kInputTypes
Definition maglev-ir.h:8242
static constexpr OpProperties kProperties
Definition maglev-ir.h:7931
static constexpr Base::InputTypes kInputTypes
Definition maglev-ir.h:7934
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
Definition maglev-ir.h:7952
void GenerateCode(MaglevAssembler *, const ProcessingState &)
LoadTaggedFieldForContextSlot(uint64_t bitfield, const int offset)
Definition maglev-ir.h:7777
LoadTaggedFieldForProperty(uint64_t bitfield, const int offset, compiler::NameRef name)
Definition maglev-ir.h:7761
LoadTaggedFieldForScriptContextSlot(uint64_t bitfield, const int index)
Definition maglev-ir.h:7786
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
void GenerateCode(MaglevAssembler *, const ProcessingState &)
LoadTaggedField(uint64_t bitfield, const int offset)
Definition maglev-ir.h:7752
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
Definition maglev-ir.h:7089
static constexpr OpProperties kProperties
Definition maglev-ir.h:7079
void GenerateCode(MaglevAssembler *, const ProcessingState &)
LoadTypedArrayLength(uint64_t bitfield, ElementsKind elements_kind)
Definition maglev-ir.h:7077
static constexpr Base::InputTypes kInputTypes
Definition maglev-ir.h:7082
void GenerateCode(MaglevAssembler *, const ProcessingState &)
LogicalNot(uint64_t bitfield)
Definition maglev-ir.h:4562
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
Definition maglev-ir.h:4571
static constexpr Base::InputTypes kInputTypes
Definition maglev-ir.h:4565
static constexpr OpProperties kProperties
Definition maglev-ir.h:7435
static constexpr Base::InputTypes kInputTypes
Definition maglev-ir.h:7438
void GenerateCode(MaglevAssembler *, const ProcessingState &)
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
Definition maglev-ir.h:7446
static constexpr OpProperties kProperties
Definition maglev-ir.h:7409
static constexpr Base::InputTypes kInputTypes
Definition maglev-ir.h:7412
void GenerateCode(MaglevAssembler *, const ProcessingState &)
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
Definition maglev-ir.h:7425
MaybeGrowFastElements(uint64_t bitfield, ElementsKind elements_kind)
Definition maglev-ir.h:8037
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
Definition maglev-ir.h:8061
static constexpr Base::InputTypes kInputTypes
Definition maglev-ir.h:8043
static constexpr OpProperties kProperties
Definition maglev-ir.h:8040
void GenerateCode(MaglevAssembler *, const ProcessingState &)
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
Definition maglev-ir.h:7016
static constexpr Base::InputTypes kInputTypes
Definition maglev-ir.h:7004
static constexpr OpProperties kProperties
Definition maglev-ir.h:6999
void ClearUnstableNodeAspects(KnownNodeAspects &known_node_aspects)
void GenerateCode(MaglevAssembler *, const ProcessingState &)
constexpr const Input * input_base() const
Definition maglev-ir.h:2164
void set_properties(OpProperties properties)
Definition maglev-ir.h:1943
EagerDeoptInfo * eager_deopt_info()
Definition maglev-ir.h:2045
Address exception_handler_address() const
Definition maglev-ir.h:2288
void set_temporaries_needed(uint8_t value)
Definition maglev-ir.h:2191
static constexpr OpProperties kProperties
Definition maglev-ir.h:1936
void set_owner(BasicBlock *block)
Definition maglev-ir.h:2137
void RequireSpecificTemporary(Register reg)
Definition maglev-ir.h:2203
constexpr const T * Cast() const
Definition maglev-ir.h:1958
void OverwriteWithIdentityTo(ValueNode *node)
Definition maglev-ir.h:2119
constexpr uint64_t bitfield() const
Definition maglev-ir.h:2147
void change_representation(ValueRepresentation new_repr)
Definition maglev-ir.h:2076
InputCountField::Next< bool, 1 > ReservedField
Definition maglev-ir.h:1900
constexpr bool Is() const
Definition maglev-ir.h:2362
constexpr const Input & input(int index) const
Definition maglev-ir.h:1982
static constexpr size_t RegisterSnapshotSize(OpProperties properties)
Definition maglev-ir.h:2253
constexpr const T * TryCast() const
Definition maglev-ir.h:1968
NodeBase(const NodeBase &)=delete
void set_input(int index, ValueNode *node)
Definition maglev-ir.h:2720
static constexpr int kMaxInputs
Definition maglev-ir.h:1905
Address last_input_address() const
Definition maglev-ir.h:2170
static constexpr Opcode opcode_of
Definition maglev-ir.h:1909
ExceptionHandlerInfo * exception_handler_info()
Definition maglev-ir.h:2063
constexpr bool has_inputs() const
Definition maglev-ir.h:1972
OwnerOrTemporaries owner_or_temporaries_
Definition maglev-ir.h:2352
RegListBase< RegisterT > & temporaries()
Definition maglev-ir.h:2018
void assign_temporaries(RegListBase< RegisterT > list)
Definition maglev-ir.h:2025
static constexpr size_t LazyDeoptInfoSize(OpProperties properties)
Definition maglev-ir.h:2265
void reduce_input_count(int num=1)
Definition maglev-ir.h:2179
static Derived * Allocate(Zone *zone, size_t input_count, Args &&... args)
Definition maglev-ir.h:2213
static constexpr size_t EagerDeoptInfoSize(OpProperties properties)
Definition maglev-ir.h:2258
constexpr Input * input_base()
Definition maglev-ir.h:2161
void ForAllInputsInRegallocAssignmentOrder(Function &&f)
void CopyEagerDeoptInfoOf(NodeBase *other, Zone *zone)
Definition maglev-ir.h:2086
constexpr NodeIdT id() const
Definition maglev-ir.h:1998
BasicBlock * owner() const
Definition maglev-ir.h:2139
void ClearUnstableNodeAspects(KnownNodeAspects &)
NodeBase(uint64_t bitfield)
Definition maglev-ir.h:2144
void SetEagerDeoptInfo(Zone *zone, DeoptFrame deopt_frame, compiler::FeedbackSource feedback_to_update=compiler::FeedbackSource())
Definition maglev-ir.h:2092
void change_input(int index, ValueNode *node)
Definition maglev-ir.h:2727
static constexpr size_t ExceptionHandlerInfoSize(OpProperties properties)
Definition maglev-ir.h:2248
const Input * last_input() const
Definition maglev-ir.h:2168
Address deopt_info_address() const
Definition maglev-ir.h:2272
static Derived * New(Zone *zone, std::initializer_list< ValueNode * > inputs, Args &&... args)
Definition maglev-ir.h:1912
Address register_snapshot_address() const
Definition maglev-ir.h:2281
void ClearElementsProperties(KnownNodeAspects &)
static Derived * New(Zone *zone, size_t input_count, Args &&... args)
Definition maglev-ir.h:1929
DoubleRegList & double_temporaries()
Definition maglev-ir.h:2022
void CheckCanOverwriteWith(Opcode new_opcode, OpProperties new_properties)
constexpr Input & input(int index)
Definition maglev-ir.h:1978
void set_bitfield(uint64_t new_bitfield)
Definition maglev-ir.h:2148
constexpr int input_count() const
Definition maglev-ir.h:1973
void set_opcode(Opcode new_opcode)
Definition maglev-ir.h:2082
uint8_t num_temporaries_needed() const
Definition maglev-ir.h:2009
NodeBase(NodeBase &&)=delete
NodeBase & operator=(const NodeBase &)=delete
void set_double_temporaries_needed(uint8_t value)
Definition maglev-ir.h:2196
void RequireSpecificDoubleTemporary(DoubleRegister reg)
Definition maglev-ir.h:2207
const RegisterSnapshot & register_snapshot() const
Definition maglev-ir.h:2058
constexpr bool has_id() const
Definition maglev-ir.h:1997
void set_register_snapshot(RegisterSnapshot snapshot)
Definition maglev-ir.h:2068
void initialize_input_null(int index)
Definition maglev-ir.h:2714
std::optional< int32_t > TryGetInt32ConstantInput(int index)
constexpr Opcode opcode() const
Definition maglev-ir.h:1939
LazyDeoptInfo * lazy_deopt_info()
Definition maglev-ir.h:2052
void OverwriteWith(Opcode new_opcode, std::optional< OpProperties > maybe_new_properties=std::nullopt)
Definition maglev-ir.h:2106
NodeBase & operator=(NodeBase &&)=delete
constexpr OpProperties properties() const
Definition maglev-ir.h:1940
NodeTMixin(uint64_t bitfield, Args &&... args)
Definition maglev-ir.h:2777
constexpr const OpProperties & properties() const
Definition maglev-ir.h:2761
static Derived * New(Zone *zone, std::initializer_list< ValueNode * > inputs, Args &&... args)
Definition maglev-ir.h:2766
constexpr Opcode opcode() const
Definition maglev-ir.h:2760
static Derived * New(Zone *zone, size_t input_count, Args &&... args)
Definition maglev-ir.h:2771
ValueLocation & result()
Definition maglev-ir.h:2749
static constexpr bool needs_epoch_check(Opcode op)
Definition maglev-ir.h:2409
static constexpr bool participate_in_cse(Opcode op)
Definition maglev-ir.h:2401
static constexpr Base::InputTypes kInputTypes
Definition maglev-ir.h:5118
void GenerateCode(MaglevAssembler *, const ProcessingState &)
static constexpr OpProperties kProperties
Definition maglev-ir.h:5114
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
Definition maglev-ir.h:5125
static const uint32_t kPureMask
Definition maglev-ir.h:1201
static constexpr OpProperties TaggedValue()
Definition maglev-ir.h:1114
constexpr bool can_allocate() const
Definition maglev-ir.h:1040
static constexpr OpProperties ConversionNode()
Definition maglev-ir.h:1150
constexpr bool needs_register_snapshot() const
Definition maglev-ir.h:1059
constexpr bool is_required_when_unused() const
Definition maglev-ir.h:1065
constexpr bool can_read() const
Definition maglev-ir.h:1038
static constexpr OpProperties CanCallUserCode()
Definition maglev-ir.h:1153
constexpr OpProperties(uint32_t bitfield)
Definition maglev-ir.h:1175
static constexpr OpProperties CanThrow()
Definition maglev-ir.h:1099
static constexpr OpProperties IntPtr()
Definition maglev-ir.h:1138
constexpr bool can_throw() const
Definition maglev-ir.h:1033
static constexpr OpProperties Int32()
Definition maglev-ir.h:1122
static constexpr OpProperties CanRead()
Definition maglev-ir.h:1102
static constexpr OpProperties DeferredCall()
Definition maglev-ir.h:1168
static constexpr OpProperties CanAllocate()
Definition maglev-ir.h:1108
constexpr bool is_deopt_checkpoint() const
Definition maglev-ir.h:1026
constexpr bool can_eager_deopt() const
Definition maglev-ir.h:1018
static constexpr OpProperties AnySideEffects()
Definition maglev-ir.h:1165
constexpr OpProperties operator|(const OpProperties &that)
Definition maglev-ir.h:1079
OpProperties WithNewValueRepresentation(ValueRepresentation new_repr) const
Definition maglev-ir.h:1178
constexpr bool can_lazy_deopt() const
Definition maglev-ir.h:1022
static constexpr OpProperties Call()
Definition maglev-ir.h:1084
static constexpr OpProperties JSCall()
Definition maglev-ir.h:1164
static constexpr OpProperties Uint32()
Definition maglev-ir.h:1126
OpProperties WithoutDeopt() const
Definition maglev-ir.h:1182
static constexpr OpProperties LazyDeopt()
Definition maglev-ir.h:1091
static constexpr OpProperties Pure()
Definition maglev-ir.h:1083
constexpr bool is_any_call() const
Definition maglev-ir.h:1017
constexpr ValueRepresentation value_representation() const
Definition maglev-ir.h:1050
constexpr bool is_conversion() const
Definition maglev-ir.h:1056
constexpr bool is_call() const
Definition maglev-ir.h:1012
static constexpr OpProperties DeoptCheckpoint()
Definition maglev-ir.h:1095
static constexpr OpProperties NeedsRegisterSnapshot()
Definition maglev-ir.h:1211
static constexpr OpProperties ForValueRepresentation(ValueRepresentation repr)
Definition maglev-ir.h:1146
constexpr bool is_deferred_call() const
Definition maglev-ir.h:1220
constexpr bool is_pure() const
Definition maglev-ir.h:1062
static constexpr OpProperties CanWrite()
Definition maglev-ir.h:1105
constexpr bool is_tagged() const
Definition maglev-ir.h:1053
static constexpr OpProperties ExternalReference()
Definition maglev-ir.h:1118
static constexpr OpProperties Float64()
Definition maglev-ir.h:1130
constexpr bool not_idempotent() const
Definition maglev-ir.h:1047
static constexpr OpProperties GenericRuntimeOrBuiltinCall()
Definition maglev-ir.h:1161
static const uint32_t kPureValue
Definition maglev-ir.h:1203
constexpr bool can_write() const
Definition maglev-ir.h:1039
static constexpr OpProperties EagerDeopt()
Definition maglev-ir.h:1087
static constexpr OpProperties NotIdempotent()
Definition maglev-ir.h:1111
static constexpr OpProperties HoleyFloat64()
Definition maglev-ir.h:1134
constexpr bool can_participate_in_cse() const
Definition maglev-ir.h:1075
static constexpr OpProperties TrustedPointer()
Definition maglev-ir.h:1142
constexpr bool can_deopt() const
Definition maglev-ir.h:1030
UseRepresentationSet get_same_loop_uses_repr_hints()
Definition maglev-ir.h:9465
NodeType type() const
Definition maglev-ir.h:9493
const interpreter::Register owner_
Definition maglev-ir.h:9531
Requires31BitValueFlag::Next< bool, 1 > LoopPhiAfterLoopFlag
Definition maglev-ir.h:9529
void merge_type(NodeType type)
Definition maglev-ir.h:9485
bool uses_require_31_bit_value() const
Definition maglev-ir.h:9514
void GenerateCode(MaglevAssembler *, const ProcessingState &)
NextBitField< bool, 1 > HasKeyFlag
Definition maglev-ir.h:9527
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
void VerifyInputs(MaglevGraphLabeller *graph_labeller) const
Definition maglev-ir.cc:576
BasicBlock * predecessor_at(int i)
Definition maglev-ir.cc:59
bool is_backedge_offset(int i) const
Definition maglev-ir.h:9438
Phi(uint64_t bitfield, MergePointInterpreterFrameState *merge_state, interpreter::Register owner)
Definition maglev-ir.h:9414
void set_post_loop_type(NodeType type)
Definition maglev-ir.h:9473
MergePointInterpreterFrameState *const merge_state_
Definition maglev-ir.h:9537
UseRepresentationSet same_loop_uses_repr_hint_
Definition maglev-ir.h:9534
void merge_post_loop_type(NodeType type)
Definition maglev-ir.h:9469
UseRepresentationSet uses_repr_hint_
Definition maglev-ir.h:9533
bool is_exception_phi() const
Definition maglev-ir.h:9435
void set_type(NodeType type)
Definition maglev-ir.h:9489
const MergePointInterpreterFrameState * merge_state() const
Definition maglev-ir.h:9427
UseRepresentationSet get_uses_repr_hints()
Definition maglev-ir.h:9464
bool is_unmerged_loop_phi() const
Definition maglev-ir.cc:128
interpreter::Register owner() const
Definition maglev-ir.h:9426
void RecordUseReprHint(UseRepresentation repr)
Definition maglev-ir.h:9458
HasKeyFlag::Next< bool, 1 > Requires31BitValueFlag
Definition maglev-ir.h:9528
static PolymorphicAccessInfo Constant(const ZoneVector< compiler::MapRef > &maps, compiler::ObjectRef constant)
Definition maglev-ir.h:7555
static PolymorphicAccessInfo ConstantDouble(const ZoneVector< compiler::MapRef > &maps, Float64 constant)
Definition maglev-ir.h:7560
struct v8::internal::maglev::PolymorphicAccessInfo::@148::@150 data_load_
compiler::OptionalJSObjectRef holder() const
Definition maglev-ir.h:7599
static PolymorphicAccessInfo ModuleExport(const ZoneVector< compiler::MapRef > &maps, compiler::CellRef cell)
Definition maglev-ir.h:7570
Representation field_representation() const
Definition maglev-ir.h:7609
const compiler::OptionalJSObjectRef holder_
Definition maglev-ir.h:7711
DirectHandle< Cell > cell() const
Definition maglev-ir.h:7594
PolymorphicAccessInfo(Kind kind, const ZoneVector< compiler::MapRef > &maps, Representation representation, compiler::ObjectRef constant)
Definition maglev-ir.h:7673
const ZoneVector< compiler::MapRef > & maps() const
Definition maglev-ir.h:7582
static PolymorphicAccessInfo StringLength(const ZoneVector< compiler::MapRef > &maps)
Definition maglev-ir.h:7575
PolymorphicAccessInfo(Kind kind, const ZoneVector< compiler::MapRef > &maps, Representation representation)
Definition maglev-ir.h:7666
DirectHandle< Object > constant() const
Definition maglev-ir.h:7584
static PolymorphicAccessInfo NotFound(const ZoneVector< compiler::MapRef > &maps)
Definition maglev-ir.h:7551
const ZoneVector< compiler::MapRef > maps_
Definition maglev-ir.h:7705
PolymorphicAccessInfo(Kind kind, const ZoneVector< compiler::MapRef > &maps, Float64 constant)
Definition maglev-ir.h:7683
bool operator==(const PolymorphicAccessInfo &other) const
Definition maglev-ir.h:7611
PolymorphicAccessInfo(Kind kind, const ZoneVector< compiler::MapRef > &maps, Representation representation, compiler::OptionalJSObjectRef holder, FieldIndex field_index)
Definition maglev-ir.h:7692
static PolymorphicAccessInfo DataLoad(const ZoneVector< compiler::MapRef > &maps, Representation representation, compiler::OptionalJSObjectRef holder, FieldIndex field_index)
Definition maglev-ir.h:7564
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
static constexpr Base::InputTypes kInputTypes
ReduceInterruptBudgetForLoop(uint64_t bitfield, int amount)
void GenerateCode(MaglevAssembler *, const ProcessingState &)
ReduceInterruptBudgetForReturn(uint64_t bitfield, int amount)
static constexpr Base::InputTypes kInputTypes
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
void GenerateCode(MaglevAssembler *, const ProcessingState &)
static constexpr OpProperties kProperties
Definition maglev-ir.h:5181
void GenerateCode(MaglevAssembler *, const ProcessingState &)
RegisterInput(uint64_t bitfield, Register input)
Definition maglev-ir.h:5176
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
RestLength(uint64_t bitfield, int formal_parameter_count)
Definition maglev-ir.h:6194
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
Definition maglev-ir.h:6199
void GenerateCode(MaglevAssembler *, const ProcessingState &)
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
Return(uint64_t bitfield)
static constexpr Base::InputTypes kInputTypes
void GenerateCode(MaglevAssembler *, const ProcessingState &)
RootConstant(uint64_t bitfield, RootIndex index)
Definition maglev-ir.h:5308
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
bool ToBoolean(LocalIsolate *local_isolate) const
Definition maglev-ir.cc:352
void GenerateCode(MaglevAssembler *, const ProcessingState &)
Handle< Object > DoReify(LocalIsolate *isolate) const
Definition maglev-ir.cc:905
void DoLoadToRegister(MaglevAssembler *, OutputRegister)
void GenerateCode(MaglevAssembler *, const ProcessingState &)
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
const compiler::FeedbackSource feedback_
Definition maglev-ir.h:9284
static constexpr Base::InputTypes kInputTypes
Definition maglev-ir.h:9263
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
Definition maglev-ir.h:9281
SetKeyedGeneric(uint64_t bitfield, const compiler::FeedbackSource &feedback)
Definition maglev-ir.h:9257
void GenerateCode(MaglevAssembler *, const ProcessingState &)
compiler::FeedbackSource feedback() const
Definition maglev-ir.h:9267
static constexpr OpProperties kProperties
Definition maglev-ir.h:9262
const compiler::FeedbackSource feedback_
Definition maglev-ir.h:8989
static constexpr Base::InputTypes kInputTypes
Definition maglev-ir.h:8968
void GenerateCode(MaglevAssembler *, const ProcessingState &)
const compiler::NameRef name_
Definition maglev-ir.h:8988
compiler::FeedbackSource feedback() const
Definition maglev-ir.h:8973
SetNamedGeneric(uint64_t bitfield, compiler::NameRef name, const compiler::FeedbackSource &feedback)
Definition maglev-ir.h:8962
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
static constexpr OpProperties kProperties
Definition maglev-ir.h:8967
compiler::NameRef name() const
Definition maglev-ir.h:8972
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
Definition maglev-ir.h:4589
void GenerateCode(MaglevAssembler *, const ProcessingState &)
static constexpr OpProperties kProperties
Definition maglev-ir.h:4580
static constexpr Base::InputTypes kInputTypes
Definition maglev-ir.h:4583
static constexpr OpProperties kProperties
Definition maglev-ir.h:7457
void GenerateCode(MaglevAssembler *, const ProcessingState &)
static constexpr Base::InputTypes kInputTypes
Definition maglev-ir.h:7460
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
Definition maglev-ir.h:7473
void DoLoadToRegister(MaglevAssembler *, OutputRegister)
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
bool ToBoolean(LocalIsolate *local_isolate) const
Definition maglev-ir.h:5202
void GenerateCode(MaglevAssembler *, const ProcessingState &)
Tagged< Smi > value() const
Definition maglev-ir.h:5200
SmiConstant(uint64_t bitfield, Tagged< Smi > value)
Definition maglev-ir.h:5197
DirectHandle< Object > DoReify(LocalIsolate *isolate) const
Definition maglev-ir.cc:876
static constexpr OpProperties kProperties
Definition maglev-ir.h:8442
StoreDoubleDataViewElement(uint64_t bitfield, ExternalArrayType type)
Definition maglev-ir.h:8437
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
Definition maglev-ir.h:8462
void GenerateCode(MaglevAssembler *, const ProcessingState &)
static constexpr Base::InputTypes kInputTypes
Definition maglev-ir.h:8443
StoreDoubleField(uint64_t bitfield, int offset)
Definition maglev-ir.h:8469
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
static constexpr Base::InputTypes kInputTypes
Definition maglev-ir.h:8473
static constexpr OpProperties kProperties
Definition maglev-ir.h:8472
void GenerateCode(MaglevAssembler *, const ProcessingState &)
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
Definition maglev-ir.h:8129
void GenerateCode(MaglevAssembler *, const ProcessingState &)
void GenerateCode(MaglevAssembler *, const ProcessingState &)
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
Definition maglev-ir.h:8093
static constexpr Base::InputTypes kInputTypes
Definition maglev-ir.h:8211
void GenerateCode(MaglevAssembler *, const ProcessingState &)
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
Definition maglev-ir.h:8224
static constexpr Base::InputTypes kInputTypes
Definition maglev-ir.h:8551
void GenerateCode(MaglevAssembler *, const ProcessingState &)
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
StoreFloat64(uint64_t bitfield, int offset)
Definition maglev-ir.h:8547
static constexpr OpProperties kProperties
Definition maglev-ir.h:8550
static constexpr int kValueIndex
Definition maglev-ir.h:8557
static constexpr int kObjectIndex
Definition maglev-ir.h:8556
StoreGlobal(uint64_t bitfield, compiler::NameRef name, const compiler::FeedbackSource &feedback)
Definition maglev-ir.h:8839
const compiler::NameRef name_
Definition maglev-ir.h:8860
void GenerateCode(MaglevAssembler *, const ProcessingState &)
compiler::FeedbackSource feedback() const
Definition maglev-ir.h:8849
static constexpr Base::InputTypes kInputTypes
Definition maglev-ir.h:8845
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
static constexpr OpProperties kProperties
Definition maglev-ir.h:8844
compiler::NameRef name() const
Definition maglev-ir.h:8848
const compiler::FeedbackSource feedback_
Definition maglev-ir.h:8861
static constexpr int kObjectIndex
Definition maglev-ir.h:8504
StoreHeapInt32(uint64_t bitfield, int offset)
Definition maglev-ir.h:8495
static constexpr Base::InputTypes kInputTypes
Definition maglev-ir.h:8499
static constexpr OpProperties kProperties
Definition maglev-ir.h:8498
void GenerateCode(MaglevAssembler *, const ProcessingState &)
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
static constexpr Base::InputTypes kInputTypes
Definition maglev-ir.h:9197
void GenerateCode(MaglevAssembler *, const ProcessingState &)
static constexpr OpProperties kProperties
Definition maglev-ir.h:9196
const compiler::FeedbackSource feedback_
Definition maglev-ir.h:9218
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
Definition maglev-ir.h:9215
StoreInArrayLiteralGeneric(uint64_t bitfield, const compiler::FeedbackSource &feedback)
Definition maglev-ir.h:9191
compiler::FeedbackSource feedback() const
Definition maglev-ir.h:9201
static constexpr OpProperties kProperties
Definition maglev-ir.h:8524
static constexpr int kObjectIndex
Definition maglev-ir.h:8530
static constexpr int kValueIndex
Definition maglev-ir.h:8531
static constexpr Base::InputTypes kInputTypes
Definition maglev-ir.h:8525
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
StoreInt32(uint64_t bitfield, int offset)
Definition maglev-ir.h:8521
void GenerateCode(MaglevAssembler *, const ProcessingState &)
const compiler::MapRef map_
Definition maglev-ir.h:8666
static constexpr OpProperties kProperties
Definition maglev-ir.h:8646
void GenerateCode(MaglevAssembler *, const ProcessingState &)
NextBitField< Kind, 3 > KindField
Definition maglev-ir.h:8665
StoreMap(uint64_t bitfield, compiler::MapRef map, Kind kind)
Definition maglev-ir.h:8643
static constexpr int kObjectIndex
Definition maglev-ir.h:8651
compiler::MapRef map() const
Definition maglev-ir.h:8654
static constexpr Base::InputTypes kInputTypes
Definition maglev-ir.h:8649
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
void ClearUnstableNodeAspects(KnownNodeAspects &)
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
void GenerateCode(MaglevAssembler *, const ProcessingState &)
StoreScriptContextSlotWithWriteBarrier(uint64_t bitfield, int index)
Definition maglev-ir.h:8719
void VerifyInputs(MaglevGraphLabeller *graph_labeller) const
Definition maglev-ir.cc:807
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
static constexpr Base::InputTypes kInputTypes
Definition maglev-ir.h:8598
void GenerateCode(MaglevAssembler *, const ProcessingState &)
StoreTaggedFieldNoWriteBarrier(uint64_t bitfield, int offset, StoreTaggedMode store_mode)
Definition maglev-ir.h:8584
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
void GenerateCode(MaglevAssembler *, const ProcessingState &)
static constexpr Base::InputTypes kInputTypes
Definition maglev-ir.h:8683
StoreTaggedFieldWithWriteBarrier(uint64_t bitfield, int offset, StoreTaggedMode store_mode)
Definition maglev-ir.h:8675
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
void GenerateCode(MaglevAssembler *, const ProcessingState &)
StoreTrustedPointerFieldWithWriteBarrier(uint64_t bitfield, int offset, IndirectPointerTag tag, StoreTaggedMode store_mode)
Definition maglev-ir.h:8757
static constexpr OpProperties kProperties
Definition maglev-ir.h:9018
static constexpr int kStringIndex
Definition maglev-ir.h:9024
static constexpr Base::InputTypes kInputTypes
Definition maglev-ir.h:9021
StringAt(uint64_t bitfield)
Definition maglev-ir.h:9016
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
Definition maglev-ir.h:9032
void GenerateCode(MaglevAssembler *, const ProcessingState &)
static constexpr int kIndexIndex
Definition maglev-ir.h:9025
static constexpr OpProperties kProperties
Definition maglev-ir.h:9061
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
Definition maglev-ir.h:9073
static constexpr Base::InputTypes kInputTypes
Definition maglev-ir.h:9064
void GenerateCode(MaglevAssembler *, const ProcessingState &)
static constexpr Base::InputTypes kInputTypes
Definition maglev-ir.h:4649
void GenerateCode(MaglevAssembler *, const ProcessingState &)
static constexpr OpProperties kProperties
Definition maglev-ir.h:4645
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
Definition maglev-ir.h:4658
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
Definition maglev-ir.h:9052
static constexpr OpProperties kProperties
Definition maglev-ir.h:9041
void GenerateCode(MaglevAssembler *, const ProcessingState &)
static constexpr Base::InputTypes kInputTypes
Definition maglev-ir.h:9044
static constexpr int kObjectIndex
Definition maglev-ir.h:9046
void GenerateCode(MaglevAssembler *, const ProcessingState &)
void set_fallthrough(BasicBlock *fallthrough)
Switch(uint64_t bitfield, int value_base, BasicBlockRef *targets, int size, BasicBlockRef *fallthrough)
Switch(uint64_t bitfield, int value_base, BasicBlockRef *targets, int size)
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
static constexpr Base::InputTypes kInputTypes
BasicBlock * fallthrough() const
BasicBlockRef * targets() const
std::optional< BasicBlockRef > fallthrough_
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
Definition maglev-ir.h:4681
static constexpr Base::InputTypes kInputTypes
Definition maglev-ir.h:4667
void GenerateCode(MaglevAssembler *, const ProcessingState &)
bool ToBoolean(LocalIsolate *local_isolate) const
Definition maglev-ir.h:5229
DirectHandle< Object > DoReify(LocalIsolate *isolate) const
Definition maglev-ir.cc:880
void DoLoadToRegister(MaglevAssembler *, OutputRegister)
void GenerateCode(MaglevAssembler *, const ProcessingState &)
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
TaggedIndexConstant(uint64_t bitfield, Tagged< TaggedIndex > value)
Definition maglev-ir.h:5224
Tagged< TaggedIndex > value() const
Definition maglev-ir.h:5227
const Tagged< TaggedIndex > value_
Definition maglev-ir.h:5239
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
Definition maglev-ir.h:4704
static constexpr Base::InputTypes kInputTypes
Definition maglev-ir.h:4690
void GenerateCode(MaglevAssembler *, const ProcessingState &)
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
Definition maglev-ir.h:4728
TestInstanceOf(uint64_t bitfield, compiler::FeedbackSource feedback)
Definition maglev-ir.h:4711
static constexpr OpProperties kProperties
Definition maglev-ir.h:4715
compiler::FeedbackSource feedback() const
Definition maglev-ir.h:4723
const compiler::FeedbackSource feedback_
Definition maglev-ir.h:4731
void GenerateCode(MaglevAssembler *, const ProcessingState &)
static constexpr Base::InputTypes kInputTypes
Definition maglev-ir.h:4716
void GenerateCode(MaglevAssembler *, const ProcessingState &)
static constexpr Base::InputTypes kInputTypes
Definition maglev-ir.h:4766
interpreter::TestTypeOfFlags::LiteralFlag literal_
Definition maglev-ir.h:4779
TestTypeOf(uint64_t bitfield, interpreter::TestTypeOfFlags::LiteralFlag literal)
Definition maglev-ir.h:4761
interpreter::TestTypeOfFlags::LiteralFlag literal() const
Definition maglev-ir.h:4776
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
void GenerateCode(MaglevAssembler *, const ProcessingState &)
TestUndetectable(uint64_t bitfield, CheckType check_type)
Definition maglev-ir.h:4738
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
Definition maglev-ir.h:4749
static constexpr Base::InputTypes kInputTypes
Definition maglev-ir.h:4742
NextBitField< CheckType, 1 > CheckTypeBitField
Definition maglev-ir.h:4754
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
void GenerateCode(MaglevAssembler *, const ProcessingState &)
static constexpr OpProperties kProperties
static constexpr Base::InputTypes kInputTypes
void GenerateCode(MaglevAssembler *, const ProcessingState &)
static constexpr OpProperties kProperties
static constexpr Base::InputTypes kInputTypes
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
static constexpr OpProperties kProperties
ThrowReferenceErrorIfHole(uint64_t bitfield, const compiler::NameRef name)
void GenerateCode(MaglevAssembler *, const ProcessingState &)
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
static constexpr Base::InputTypes kInputTypes
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
void GenerateCode(MaglevAssembler *, const ProcessingState &)
static constexpr Base::InputTypes kInputTypes
void GenerateCode(MaglevAssembler *, const ProcessingState &)
static constexpr OpProperties kProperties
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
static constexpr Base::InputTypes kInputTypes
ToBooleanLogicalNot(uint64_t bitfield, CheckType check_type)
Definition maglev-ir.h:4621
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
Definition maglev-ir.h:4632
static constexpr Base::InputTypes kInputTypes
Definition maglev-ir.h:4625
void GenerateCode(MaglevAssembler *, const ProcessingState &)
NextBitField< CheckType, 1 > CheckTypeBitField
Definition maglev-ir.h:4637
NextBitField< CheckType, 1 > CheckTypeBitField
Definition maglev-ir.h:4613
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
Definition maglev-ir.h:4608
ToBoolean(uint64_t bitfield, CheckType check_type)
Definition maglev-ir.h:4597
static constexpr Base::InputTypes kInputTypes
Definition maglev-ir.h:4601
void GenerateCode(MaglevAssembler *, const ProcessingState &)
void GenerateCode(MaglevAssembler *, const ProcessingState &)
ToName(uint64_t bitfield)
Definition maglev-ir.h:4786
static constexpr OpProperties kProperties
Definition maglev-ir.h:4789
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
Definition maglev-ir.h:4799
static constexpr Base::InputTypes kInputTypes
Definition maglev-ir.h:4790
static constexpr OpProperties kProperties
Definition maglev-ir.h:4809
void GenerateCode(MaglevAssembler *, const ProcessingState &)
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
Definition maglev-ir.h:4820
ToNumberOrNumeric(uint64_t bitfield, Object::Conversion mode)
Definition maglev-ir.h:4806
Object::Conversion mode() const
Definition maglev-ir.h:4815
static constexpr Base::InputTypes kInputTypes
Definition maglev-ir.h:4812
static constexpr OpProperties kProperties
Definition maglev-ir.h:5063
CheckType check_type() const
Definition maglev-ir.h:5069
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
Definition maglev-ir.h:5074
NextBitField< CheckType, 1 > CheckTypeBitField
Definition maglev-ir.h:5077
static constexpr Base::InputTypes kInputTypes
Definition maglev-ir.h:5064
void GenerateCode(MaglevAssembler *, const ProcessingState &)
ToObject(uint64_t bitfield, CheckType check_type)
Definition maglev-ir.h:5059
void GenerateCode(MaglevAssembler *, const ProcessingState &)
static constexpr Base::InputTypes kInputTypes
Definition maglev-ir.h:5090
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
Definition maglev-ir.h:5102
NextBitField< ConversionMode, 1 > ConversionModeBitField
Definition maglev-ir.h:5105
ConversionMode mode() const
Definition maglev-ir.h:5095
static constexpr OpProperties kProperties
Definition maglev-ir.h:5089
ToString(uint64_t bitfield, ConversionMode mode)
Definition maglev-ir.h:5085
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
Definition maglev-ir.h:7533
TransitionAndStoreArrayElement(uint64_t bitfield, const compiler::MapRef &fast_map, const compiler::MapRef &double_map)
Definition maglev-ir.h:7508
static constexpr Base::InputTypes kInputTypes
Definition maglev-ir.h:7515
void GenerateCode(MaglevAssembler *, const ProcessingState &)
const ZoneVector< compiler::MapRef > & transition_sources() const
TransitionElementsKindOrCheckMap(uint64_t bitfield, const ZoneVector< compiler::MapRef > &transition_sources, compiler::MapRef transition_target)
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
static constexpr Base::InputTypes kInputTypes
void GenerateCode(MaglevAssembler *, const ProcessingState &)
const compiler::MapRef transition_target() const
static constexpr Base::InputTypes kInputTypes
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
const ZoneVector< compiler::MapRef > & transition_sources() const
TransitionElementsKind(uint64_t bitfield, const ZoneVector< compiler::MapRef > &transition_sources, compiler::MapRef transition_target)
void GenerateCode(MaglevAssembler *, const ProcessingState &)
static constexpr OpProperties kProperties
ZoneVector< compiler::MapRef > transition_sources_
NextBitField< TaggedToFloat64ConversionType, 2 > TaggedToFloat64ConversionTypeOffset
Definition maglev-ir.h:4522
void GenerateCode(MaglevAssembler *, const ProcessingState &)
TaggedToFloat64ConversionType conversion_type() const
Definition maglev-ir.h:4515
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
TruncateNumberOrOddballToInt32(uint64_t bitfield, TaggedToFloat64ConversionType conversion_type)
Definition maglev-ir.h:4500
static constexpr Base::InputTypes kInputTypes
Definition maglev-ir.h:4507
IndirectPointerTag tag() const
Definition maglev-ir.h:5345
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
bool ToBoolean(LocalIsolate *local_isolate) const
Definition maglev-ir.h:5338
static constexpr OpProperties kProperties
Definition maglev-ir.h:5336
void DoLoadToRegister(MaglevAssembler *, OutputRegister)
TrustedConstant(uint64_t bitfield, compiler::HeapObjectRef object, IndirectPointerTag tag)
Definition maglev-ir.h:5332
DirectHandle< Object > DoReify(LocalIsolate *isolate) const
Definition maglev-ir.cc:901
void GenerateCode(MaglevAssembler *, const ProcessingState &)
const IndirectPointerTag tag_
Definition maglev-ir.h:5352
const compiler::HeapObjectRef object_
Definition maglev-ir.h:5351
compiler::HeapObjectRef object() const
Definition maglev-ir.h:5344
TryOnStackReplacement(uint64_t bitfield, int32_t loop_depth, FeedbackSlot feedback_slot, BytecodeOffset osr_offset, MaglevCompilationUnit *unit)
Definition maglev-ir.h:4914
static constexpr OpProperties kProperties
Definition maglev-ir.h:4924
MaglevCompilationUnit *const unit_
Definition maglev-ir.h:4945
static constexpr Base::InputTypes kInputTypes
Definition maglev-ir.h:4929
const MaglevCompilationUnit * unit() const
Definition maglev-ir.h:4933
void GenerateCode(MaglevAssembler *, const ProcessingState &)
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
Definition maglev-ir.h:4938
void DoLoadToRegister(MaglevAssembler *, OutputRegister)
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
Uint32Constant(uint64_t bitfield, uint32_t value)
Definition maglev-ir.h:3722
bool ToBoolean(LocalIsolate *local_isolate) const
Definition maglev-ir.h:3729
DirectHandle< Object > DoReify(LocalIsolate *isolate) const
Definition maglev-ir.cc:888
static constexpr OpProperties kProperties
Definition maglev-ir.h:3725
void GenerateCode(MaglevAssembler *, const ProcessingState &)
static constexpr Base::InputTypes kInputTypes
Definition maglev-ir.h:3873
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
Definition maglev-ir.h:3880
static constexpr OpProperties kProperties
Definition maglev-ir.h:3869
void GenerateCode(MaglevAssembler *, const ProcessingState &)
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
Definition maglev-ir.h:3803
static constexpr Base::InputTypes kInputTypes
Definition maglev-ir.h:3797
void GenerateCode(MaglevAssembler *, const ProcessingState &)
static constexpr OpProperties kProperties
Definition maglev-ir.h:3795
UnaryWithFeedbackNode(uint64_t bitfield, const compiler::FeedbackSource &feedback)
Definition maglev-ir.h:2909
void GenerateCode(MaglevAssembler *, const ProcessingState &)
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
Definition maglev-ir.h:2915
static constexpr Base::InputTypes kInputTypes
Definition maglev-ir.h:2902
compiler::FeedbackSource feedback() const
Definition maglev-ir.h:2906
static constexpr OpProperties kProperties
Definition maglev-ir.h:2900
const compiler::FeedbackSource feedback_
Definition maglev-ir.h:2917
UncheckedNumberOrOddballToFloat64(uint64_t bitfield, TaggedToFloat64ConversionType conversion_type)
Definition maglev-ir.h:4412
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
NextBitField< TaggedToFloat64ConversionType, 2 > TaggedToFloat64ConversionTypeOffset
Definition maglev-ir.h:4435
static constexpr Base::InputTypes kInputTypes
Definition maglev-ir.h:4420
void GenerateCode(MaglevAssembler *, const ProcessingState &)
TaggedToFloat64ConversionType conversion_type() const
Definition maglev-ir.h:4428
UnconditionalControlNodeT(uint64_t bitfield, BasicBlockRef *target_refs)
UnconditionalControlNodeT(uint64_t bitfield, BasicBlock *target)
UnconditionalControlNode(uint64_t bitfield, BasicBlock *target)
UnconditionalControlNode(uint64_t bitfield, BasicBlockRef *target_refs)
static constexpr OpProperties kProperties
Definition maglev-ir.h:4069
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
Definition maglev-ir.h:4078
static constexpr Base::InputTypes kInputTypes
Definition maglev-ir.h:4072
void GenerateCode(MaglevAssembler *, const ProcessingState &)
void GenerateCode(MaglevAssembler *, const ProcessingState &)
static constexpr OpProperties kProperties
Definition maglev-ir.h:3576
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
Definition maglev-ir.h:3590
static constexpr Base::InputTypes kInputTypes
Definition maglev-ir.h:3578
void GenerateCode(MaglevAssembler *, const ProcessingState &)
static constexpr Base::InputTypes kInputTypes
Definition maglev-ir.h:3626
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
Definition maglev-ir.h:3638
static constexpr OpProperties kProperties
Definition maglev-ir.h:3624
static constexpr Base::InputTypes kInputTypes
Definition maglev-ir.h:3602
void GenerateCode(MaglevAssembler *, const ProcessingState &)
static constexpr OpProperties kProperties
Definition maglev-ir.h:3600
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
Definition maglev-ir.h:3614
static constexpr OpProperties kProperties
Definition maglev-ir.h:3672
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
Definition maglev-ir.h:3687
void GenerateCode(MaglevAssembler *, const ProcessingState &)
static constexpr Base::InputTypes kInputTypes
Definition maglev-ir.h:3675
static constexpr Base::InputTypes kInputTypes
Definition maglev-ir.h:9122
void GenerateCode(MaglevAssembler *, const ProcessingState &)
static constexpr OpProperties kProperties
Definition maglev-ir.h:9119
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
Definition maglev-ir.h:9129
static constexpr Base::InputTypes kInputTypes
Definition maglev-ir.h:9141
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
Definition maglev-ir.h:9148
static constexpr OpProperties kProperties
Definition maglev-ir.h:9138
void GenerateCode(MaglevAssembler *, const ProcessingState &)
static constexpr Base::InputTypes kInputTypes
Definition maglev-ir.h:8872
void GenerateCode(MaglevAssembler *, const ProcessingState &)
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
Definition maglev-ir.h:8889
static constexpr OpProperties kProperties
Definition maglev-ir.h:8871
compiler::InstructionOperand operand_
Definition maglev-ir.h:1284
Register AssignedGeneralRegister() const
Definition maglev-ir.h:1266
const compiler::InstructionOperand & operand() const
Definition maglev-ir.h:1280
void SetUnallocated(Args &&... args)
Definition maglev-ir.h:1238
void InjectLocation(compiler::InstructionOperand location)
Definition maglev-ir.h:1250
const compiler::InstructionOperand & operand()
Definition maglev-ir.h:1281
void SetConstant(Args &&... args)
Definition maglev-ir.h:1261
void SetAllocated(Args &&... args)
Definition maglev-ir.h:1244
DoubleRegister AssignedDoubleRegister() const
Definition maglev-ir.h:1271
compiler::InstructionOperand hint_
Definition maglev-ir.h:2706
RegListBase< T > ClearRegisters()
bool unused_inputs_were_visited() const
Definition maglev-ir.h:2435
void record_next_use(NodeIdT id, InputLocation *input_location)
Definition maglev-ir.h:2516
compiler::InstructionOperand loadable_slot() const
Definition maglev-ir.h:2510
constexpr ValueRepresentation value_representation() const
Definition maglev-ir.h:2577
RegListBase< T > result_registers()
Definition maglev-ir.h:2648
void AddRegister(DoubleRegister reg)
Definition maglev-ir.h:2609
compiler::AllocatedOperand spill_slot() const
Definition maglev-ir.h:2505
void LoadToRegister(MaglevAssembler *, DoubleRegister)
const ValueLocation & result() const
Definition maglev-ir.h:2427
constexpr bool is_tagged() const
Definition maglev-ir.h:2546
ValueNode(uint64_t bitfield)
Definition maglev-ir.h:2669
void advance_next_use(NodeIdT use)
Definition maglev-ir.h:2538
void AddRegister(Register reg)
Definition maglev-ir.h:2605
void Spill(compiler::AllocatedOperand operand)
Definition maglev-ir.h:2491
DirectHandle< Object > Reify(LocalIsolate *isolate) const
Definition maglev-ir.cc:860
void LoadToRegister(MaglevAssembler *, Register)
compiler::InstructionOperand spill_
Definition maglev-ir.h:2704
constexpr bool decompresses_tagged_result() const
Definition maglev-ir.h:2574
void RemoveRegister(Register reg)
Definition maglev-ir.h:2614
void DoLoadToRegister(MaglevAssembler *, Register)
compiler::InstructionOperand allocation() const
Definition maglev-ir.h:2658
void SetHint(compiler::InstructionOperand hint)
Definition maglev-ir.cc:466
constexpr bool use_double_register() const
Definition maglev-ir.h:2542
constexpr MachineRepresentation GetMachineRepresentation() const
Definition maglev-ir.h:2581
bool is_in_register(DoubleRegister reg) const
Definition maglev-ir.h:2642
void DoLoadToRegister(MaglevAssembler *, DoubleRegister)
const compiler::InstructionOperand & hint() const
Definition maglev-ir.h:2466
DoubleRegList double_registers_with_result_
Definition maglev-ir.h:2697
bool is_in_register(Register reg) const
Definition maglev-ir.h:2638
void RemoveRegister(DoubleRegister reg)
Definition maglev-ir.h:2618
bool operator==(const Iterator &other) const
Definition maglev-ir.h:5861
bool operator!=(const Iterator &other) const
Definition maglev-ir.h:5864
void Add(VirtualObject *object)
Definition maglev-ir.h:5878
void Print(std::ostream &os, const char *prefix, MaglevGraphLabeller *labeller) const
Definition maglev-ir.cc:329
static VirtualObject * WalkUntilCommon(const VirtualObjectList &list1, const VirtualObjectList &list2, Function &&f)
Definition maglev-ir.h:5903
VirtualObject * FindAllocatedWith(const InlinedAllocation *allocation) const
Definition maglev-ir.h:5887
bool operator==(const VirtualObjectList &other) const
Definition maglev-ir.h:5874
friend std::ostream & operator<<(std::ostream &out, Type type)
Definition maglev-ir.h:5511
void ForEachNestedRuntimeInput(VirtualObjectList virtual_objects, Function &&f)
Definition maglev-ir.h:6057
constexpr bool has_static_map() const
Definition maglev-ir.h:5580
void set(uint32_t offset, ValueNode *value)
Definition maglev-ir.h:5634
std::optional< VirtualObject * > Merge(const VirtualObject *other, uint32_t new_object_id, Zone *zone, Function MergeValue) const
Definition maglev-ir.h:5743
void ForEachInput(Function &&callback)
Definition maglev-ir.h:5694
compiler::FixedDoubleArrayRef double_elements() const
Definition maglev-ir.h:5621
ValueNode * get(uint32_t offset) const
Definition maglev-ir.h:5626
VirtualObject * Clone(uint32_t new_object_id, Zone *zone, bool empty_clone=false) const
Definition maglev-ir.h:5769
VirtualObject(uint64_t bitfield, compiler::MapRef map, int id, uint32_t length, compiler::FixedDoubleArrayRef elements)
Definition maglev-ir.h:5565
void GenerateCode(MaglevAssembler *, const ProcessingState &)
Definition maglev-ir.h:5577
void ClearSlots(int last_init_slot, ValueNode *clear_value)
Definition maglev-ir.h:5656
VirtualObject(uint64_t bitfield, compiler::MapRef map, int id, Float64 number)
Definition maglev-ir.h:5555
void set_allocation(InlinedAllocation *allocation)
Definition maglev-ir.h:5665
void ForEachInput(Function &&callback) const
Definition maglev-ir.h:5714
uint32_t double_elements_length() const
Definition maglev-ir.h:5616
VirtualObject(uint64_t bitfield, compiler::MapRef map, int id, uint32_t slot_count, ValueNode **slots)
Definition maglev-ir.h:5545
const VirtualConsString & cons_string() const
Definition maglev-ir.h:5651
compiler::OptionalMapRef map_
Definition maglev-ir.h:5831
compiler::MapRef map() const
Definition maglev-ir.h:5591
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
VirtualObject(uint64_t bitfield, int id, const VirtualConsString &cons_string)
Definition maglev-ir.h:5539
void set_by_index(uint32_t i, ValueNode *value)
Definition maglev-ir.h:5814
bool compatible_for_merge(const VirtualObject *other) const
Definition maglev-ir.h:5669
ValueNode * get_by_index(uint32_t i) const
Definition maglev-ir.h:5809
ValueNode * string_length() const
Definition maglev-ir.h:5646
InlinedAllocation * allocation() const
Definition maglev-ir.h:5664
constexpr ArrayWrapper(Args &&... args)
Definition maglev-ir.h:2791
const ObjectRef type_
enum v8::internal::@1270::DeoptimizableCodeIterator::@67 state_
base::Vector< const DirectHandle< Object > > args
Definition execution.cc:74
JSHeapBroker * broker
int32_t offset
TNode< Object > callback
Node * node
RpoNumber block
ZoneVector< RpoNumber > & result
LiftoffRegister reg
FunctionLiteral * literal
Definition liveedit.cc:294
#define DEF_OPCODE_OF(Name)
Definition maglev-ir.h:1848
#define CONDITIONAL_CONTROL_NODE_LIST(V)
Definition maglev-ir.h:407
#define DEOPTIMIZE_REASON_FIELD
Definition maglev-ir.h:1872
#define DEF_INT32_UNARY_WITH_OVERFLOW_NODE(Name)
Definition maglev-ir.h:3076
#define NODE_TYPE_LIST(V)
Definition maglev-ir.h:649
#define STORE_TYPED_ARRAY(name, properties, type,...)
#define DEF_BINARY_WITH_FEEDBACK_NODE(Name)
Definition maglev-ir.h:2963
#define LEAF_NODE_TYPE_LIST(V)
Definition maglev-ir.h:619
#define LOAD_TYPED_ARRAY(name, properties,...)
Definition maglev-ir.h:8305
#define ADD_STATIC_ASSERT(Name, Value)
Definition maglev-ir.h:675
#define GAP_MOVE_NODE_LIST(V)
Definition maglev-ir.h:317
#define NODE_LIST(V)
Definition maglev-ir.h:386
#define DEF_UNARY_WITH_FEEDBACK_NODE(Name)
Definition maglev-ir.h:2961
#define BRANCH_CONTROL_NODE_LIST(V)
Definition maglev-ir.h:390
#define VALUE_NODE_LIST(V)
Definition maglev-ir.h:161
#define CONTROL_NODE_LIST(V)
Definition maglev-ir.h:421
#define UNCONDITIONAL_CONTROL_NODE_LIST(V)
Definition maglev-ir.h:411
#define DEF_FLOAT64_BINARY_NODE_WITH_CALL(Name)
Definition maglev-ir.h:3275
#define IEEE_754_UNARY_LIST(V)
Definition maglev-ir.h:3366
#define DEF_OPCODES(type)
Definition maglev-ir.h:431
#define DEFINE_NODE_TYPE_CHECK(Type, _)
Definition maglev-ir.h:798
#define DEF_FLOAT64_BINARY_NODE(Name)
Definition maglev-ir.h:3273
#define DEF_INT32_BINARY_WITH_OVERFLOW_NODE(Name)
Definition maglev-ir.h:3004
#define TERMINAL_CONTROL_NODE_LIST(V)
Definition maglev-ir.h:416
#define ASSERT_CONDITION(V)
Definition maglev-ir.h:6413
#define DEFINE_TRUNCATE_NODE(name, from_repr, properties)
Definition maglev-ir.h:4291
#define DEF_INT32_BINARY_NODE(Name)
Definition maglev-ir.h:3032
#define CONSTANT_VALUE_NODE_LIST(V)
Definition maglev-ir.h:138
int n
Definition mul-fft.cc:296
STL namespace.
V8_BASE_EXPORT constexpr uint32_t RoundUpToPowerOfTwo32(uint32_t value)
Definition bits.h:219
V8_INLINE size_t hash_value(unsigned int v)
Definition hashing.h:205
V8_INLINE size_t hash_combine(size_t seed, size_t hash)
Definition hashing.h:77
auto make_iterator_range(ForwardIterator begin, ForwardIterator end)
Definition iterator.h:65
constexpr T * ObjectPtrBeforeAddress(void *address)
Definition maglev-ir.h:1857
UINT32_ELEMENTS INT32_ELEMENTS
Definition maglev-ir.h:8384
static constexpr NodeIdT kInvalidNodeId
Definition maglev-ir.h:899
constexpr NodeType CombineType(NodeType left, NodeType right)
Definition maglev-ir.h:661
constexpr bool IsControlNode(Opcode opcode)
Definition maglev-ir.h:526
static constexpr Opcode kLastNodeOpcode
Definition maglev-ir.h:460
constexpr Condition ConditionForNaN()
static constexpr Opcode kLastOpcode
Definition maglev-ir.h:437
NodeType StaticTypeForConstant(compiler::JSHeapBroker *broker, compiler::ObjectRef ref)
Definition maglev-ir.h:711
static constexpr Opcode kLastGapMoveNodeOpcode
Definition maglev-ir.h:456
static constexpr Opcode kFirstUnconditionalControlNodeOpcode
Definition maglev-ir.h:474
bool HasOnlyStringMaps(base::Vector< const compiler::MapRef > maps)
Definition maglev-ir.h:873
base::EnumSet< UseRepresentation, int8_t > UseRepresentationSet
Definition maglev-ir.h:9402
static constexpr int kOpcodeCount
Definition maglev-ir.h:435
base::EnumSet< ValueRepresentation, int8_t > ValueRepresentationSet
Definition maglev-ir.h:9401
static constexpr Opcode kLastControlNodeOpcode
Definition maglev-ir.h:484
bool IsInstanceOfLeafNodeType(compiler::MapRef map, NodeType type, compiler::JSHeapBroker *broker)
Definition maglev-ir.h:719
constexpr Condition ConditionFor(Operation operation)
static constexpr Opcode kFirstNodeOpcode
Definition maglev-ir.h:459
constexpr NodeType EmptyNodeType()
Definition maglev-ir.h:659
constexpr bool IsTerminalControlNode(Opcode opcode)
Definition maglev-ir.h:541
UINT32_ELEMENTS INT8_ELEMENTS
Definition maglev-ir.h:8383
bool HasOnlyNumberMaps(base::Vector< const compiler::MapRef > maps)
Definition maglev-ir.h:880
constexpr bool NodeTypeIs(NodeType type, NodeType to_check)
Definition maglev-ir.h:669
constexpr bool IsZeroCostNode(Opcode opcode)
Definition maglev-ir.h:513
constexpr bool IsEmptyNodeType(NodeType type)
Definition maglev-ir.h:706
static constexpr Opcode kLastConstantNodeOpcode
Definition maglev-ir.h:452
bool HasOnlyJSTypedArrayMaps(base::Vector< const compiler::MapRef > maps)
Definition maglev-ir.h:852
std::ostream & operator<<(std::ostream &os, const PrintNode &printer)
static constexpr Opcode kFirstGapMoveNodeOpcode
Definition maglev-ir.h:454
constexpr OpProperties StaticPropertiesForOpcode(Opcode opcode)
static constexpr Opcode kLastTerminalControlNodeOpcode
Definition maglev-ir.h:477
constexpr NodeType IntersectType(NodeType left, NodeType right)
Definition maglev-ir.h:665
const char * OpcodeToString(Opcode opcode)
Definition maglev-ir.cc:52
bool IsInitializingOrTransitioning(StoreTaggedMode mode)
Definition maglev-ir.h:8574
constexpr bool IsConstantNode(Opcode opcode)
Definition maglev-ir.h:491
static constexpr Opcode kLastConditionalControlNodeOpcode
Definition maglev-ir.h:469
static constexpr NodeIdT kFirstValidNodeId
Definition maglev-ir.h:900
UINT32_ELEMENTS INT16_ELEMENTS
Definition maglev-ir.h:8383
void CheckValueInputIs(const NodeBase *node, int i, ValueRepresentation expected, MaglevGraphLabeller *graph_labeller)
Definition maglev-ir.cc:532
constexpr bool IsZeroExtendedRepresentation(ValueRepresentation repr)
Definition maglev-ir.h:606
constexpr bool IsValueNode(Opcode opcode)
Definition maglev-ir.h:488
NodeType StaticTypeForNode(compiler::JSHeapBroker *broker, LocalIsolate *isolate, ValueNode *node)
static constexpr int kNumAssertConditions
Definition maglev-ir.h:6430
static constexpr Opcode kLastBranchControlNodeOpcode
Definition maglev-ir.h:464
static constexpr Opcode kLastValueNodeOpcode
Definition maglev-ir.h:448
constexpr bool IsCommutativeNode(Opcode opcode)
Definition maglev-ir.h:495
static constexpr Opcode kFirstValueNodeOpcode
Definition maglev-ir.h:446
bool IsInstanceOfNodeType(compiler::MapRef map, NodeType type, compiler::JSHeapBroker *broker)
Definition maglev-ir.h:756
bool FromConstantToBool(LocalIsolate *local_isolate, ValueNode *node)
Definition maglev-ir.cc:364
static constexpr Opcode kFirstControlNodeOpcode
Definition maglev-ir.h:482
constexpr bool IsConditionalControlNode(Opcode opcode)
Definition maglev-ir.h:533
constexpr bool IsDoubleRepresentation(ValueRepresentation repr)
Definition maglev-ir.h:601
constexpr bool IsSimpleFieldStore(Opcode opcode)
Definition maglev-ir.h:547
NodeType StaticTypeForMap(compiler::MapRef map, compiler::JSHeapBroker *broker)
Definition maglev-ir.h:680
constexpr bool IsTypedArrayStore(Opcode opcode)
Definition maglev-ir.h:563
static constexpr Opcode kFirstConstantNodeOpcode
Definition maglev-ir.h:450
bool HasNumberMap(base::Vector< const compiler::MapRef > maps)
Definition maglev-ir.h:887
static constexpr Opcode kFirstOpcode
Definition maglev-ir.h:436
bool NodeTypeMayBeNullOrUndefined(NodeType type)
Definition maglev-ir.h:805
static constexpr Opcode kLastUnconditionalControlNodeOpcode
Definition maglev-ir.h:472
constexpr bool IsBranchControlNode(Opcode opcode)
Definition maglev-ir.h:529
bool HasOnlyJSArrayMaps(base::Vector< const compiler::MapRef > maps)
Definition maglev-ir.h:859
static constexpr Opcode kFirstTerminalControlNodeOpcode
Definition maglev-ir.h:479
static constexpr Opcode kFirstBranchControlNodeOpcode
Definition maglev-ir.h:462
constexpr bool IsUnconditionalControlNode(Opcode opcode)
Definition maglev-ir.h:537
constexpr bool IsGapMoveNode(Opcode opcode)
Definition maglev-ir.h:523
bool HasOnlyJSObjectMaps(base::Vector< const compiler::MapRef > maps)
Definition maglev-ir.h:866
static constexpr Opcode kFirstConditionalControlNodeOpcode
Definition maglev-ir.h:467
constexpr bool IsElementsArrayWrite(Opcode opcode)
Definition maglev-ir.h:559
RegListBase< DoubleRegister > DoubleRegList
Definition reglist-arm.h:15
constexpr int kTaggedSize
Definition globals.h:542
DwVfpRegister DoubleRegister
RegListBase< Register > RegList
Definition reglist-arm.h:14
static constexpr DoubleRegList kEmptyDoubleRegList
Definition reglist.h:40
other heap size generate builtins concurrently on separate threads in mksnapshot track concurrent recompilation artificial compilation delay in ms max number of threads that concurrent Turbofan can use(0 for unbounded)") DEFINE_BOOL( stress_concurrent_inlining
@ kExternalFloat64Array
Definition globals.h:2461
@ kExternalInt32Array
Definition globals.h:2457
@ kExternalInt8Array
Definition globals.h:2453
@ kExternalInt16Array
Definition globals.h:2455
return value
Definition map-inl.h:893
static constexpr RegList kEmptyRegList
Definition reglist.h:33
constexpr int kMaxInt
Definition globals.h:374
too high values may cause the compiler to set high thresholds for inlining to as much as possible avoid inlined allocation of objects that cannot escape trace load stores from virtual maglev objects use TurboFan fast string builder analyze liveness of environment slots and zap dead values trace TurboFan load elimination emit data about basic block usage in builtins to this enable builtin reordering when run mksnapshot flag for emit warnings when applying builtin profile data verify register allocation in TurboFan randomly schedule instructions to stress dependency tracking enable store store elimination in TurboFan rewrite far to near simulate GC compiler thread race related to allow float parameters to be passed in simulator mode JS Wasm Run additional turbo_optimize_inlined_js_wasm_wrappers enable experimental feedback collection in generic lowering enable Turboshaft s WasmLoadElimination enable Turboshaft s low level load elimination for JS enable Turboshaft s escape analysis for string concatenation use enable Turbolev features that we want to ship in the not too far future trace individual Turboshaft reduction steps trace intermediate Turboshaft reduction steps invocation count threshold for early optimization Enables optimizations which favor memory size over execution speed Enables sampling allocation profiler with X as a sample interval min size of a semi the new space consists of two semi spaces max size of the Collect garbage after Collect garbage after keeps maps alive for< n > old space garbage collections print one detailed trace line in allocation gc speed threshold for starting incremental marking via a task in percent of available threshold for starting incremental marking immediately in percent of available Use a single schedule for determining a marking schedule between JS and C objects schedules the minor GC task with kUserVisible priority max worker number of concurrent for NumberOfWorkerThreads start background threads that allocate memory concurrent_array_buffer_sweeping use parallel threads to clear weak refs in the atomic pause trace progress of the incremental marking trace object counts and memory usage * MB
Definition flags.cc:2197
constexpr bool PointerCompressionIsEnabled()
#define UNARY_OPERATION_LIST(V)
Definition operation.h:24
#define ARITHMETIC_OPERATION_LIST(V)
Definition operation.h:10
#define COMPARISON_OPERATION_LIST(V)
Definition operation.h:30
#define DCHECK_LE(v1, v2)
Definition logging.h:490
#define DCHECK_NULL(val)
Definition logging.h:491
#define CHECK(condition)
Definition logging.h:124
#define DCHECK_NOT_NULL(val)
Definition logging.h:492
#define DCHECK_IMPLIES(v1, v2)
Definition logging.h:493
#define DCHECK_NE(v1, v2)
Definition logging.h:486
#define DCHECK_GE(v1, v2)
Definition logging.h:488
#define CHECK_EQ(lhs, rhs)
#define DCHECK(condition)
Definition logging.h:482
#define DCHECK_LT(v1, v2)
Definition logging.h:489
#define DCHECK_EQ(v1, v2)
Definition logging.h:485
#define DCHECK_GT(v1, v2)
Definition logging.h:487
#define USE(...)
Definition macros.h:293
constexpr T RoundUp(T x, intptr_t m)
Definition macros.h:387
constexpr bool IsAligned(T value, U alignment)
Definition macros.h:403
const CompactInterpreterFrameState * frame_state
Definition maglev-ir.h:1324
BasicBlock * operator=(BasicBlock *owner)
Definition maglev-ir.h:2314
#define PLUS_ONE(...)
wasm::ValueType type