5 #include "src/compiler/common-operator.h" 7 #include "src/assembler.h" 8 #include "src/base/lazy-instance.h" 9 #include "src/compiler/linkage.h" 10 #include "src/compiler/node.h" 11 #include "src/compiler/opcodes.h" 12 #include "src/compiler/operator.h" 13 #include "src/handles-inl.h" 14 #include "src/zone/zone.h" 20 std::ostream& operator<<(std::ostream& os, BranchHint hint) {
22 case BranchHint::kNone:
24 case BranchHint::kTrue:
26 case BranchHint::kFalse:
32 std::ostream& operator<<(std::ostream& os, IsSafetyCheck is_safety_check) {
33 switch (is_safety_check) {
34 case IsSafetyCheck::kCriticalSafetyCheck:
35 return os <<
"CriticalSafetyCheck";
36 case IsSafetyCheck::kSafetyCheck:
37 return os <<
"SafetyCheck";
38 case IsSafetyCheck::kNoSafetyCheck:
39 return os <<
"NoSafetyCheck";
44 std::ostream& operator<<(std::ostream& os, TrapId trap_id) {
46 #define TRAP_CASE(Name) \ 47 case TrapId::k##Name: \ 49 FOREACH_WASM_TRAPREASON(TRAP_CASE)
51 case TrapId::kInvalid:
52 return os <<
"Invalid";
57 TrapId TrapIdOf(
const Operator*
const op) {
58 DCHECK(op->opcode() == IrOpcode::kTrapIf ||
59 op->opcode() == IrOpcode::kTrapUnless);
60 return OpParameter<TrapId>(op);
63 std::ostream& operator<<(std::ostream& os, BranchOperatorInfo info) {
64 return os << info.hint <<
"|" << info.is_safety_check;
67 const BranchOperatorInfo& BranchOperatorInfoOf(
const Operator*
const op) {
68 DCHECK_EQ(IrOpcode::kBranch, op->opcode());
69 return OpParameter<BranchOperatorInfo>(op);
72 BranchHint BranchHintOf(
const Operator*
const op) {
73 return BranchOperatorInfoOf(op).hint;
76 int ValueInputCountOfReturn(Operator
const*
const op) {
77 DCHECK_EQ(IrOpcode::kReturn, op->opcode());
80 return op->ValueInputCount() - 1;
83 bool operator==(DeoptimizeParameters lhs, DeoptimizeParameters rhs) {
84 return lhs.kind() == rhs.kind() && lhs.reason() == rhs.reason() &&
85 lhs.feedback() == rhs.feedback() &&
86 lhs.is_safety_check() == rhs.is_safety_check();
89 bool operator!=(DeoptimizeParameters lhs, DeoptimizeParameters rhs) {
93 size_t hash_value(DeoptimizeParameters p) {
94 return base::hash_combine(p.kind(), p.reason(), p.feedback(),
98 std::ostream& operator<<(std::ostream& os, DeoptimizeParameters p) {
99 os << p.kind() <<
":" << p.reason() <<
":" << p.is_safety_check();
100 if (p.feedback().IsValid()) {
101 os <<
"; " << p.feedback();
106 DeoptimizeParameters
const& DeoptimizeParametersOf(Operator
const*
const op) {
107 DCHECK(op->opcode() == IrOpcode::kDeoptimize ||
108 op->opcode() == IrOpcode::kDeoptimizeIf ||
109 op->opcode() == IrOpcode::kDeoptimizeUnless);
110 return OpParameter<DeoptimizeParameters>(op);
113 IsSafetyCheck IsSafetyCheckOf(
const Operator* op) {
114 if (op->opcode() == IrOpcode::kBranch) {
115 return BranchOperatorInfoOf(op).is_safety_check;
117 return DeoptimizeParametersOf(op).is_safety_check();
120 const Operator* CommonOperatorBuilder::MarkAsSafetyCheck(
121 const Operator* op, IsSafetyCheck safety_check) {
122 if (op->opcode() == IrOpcode::kBranch) {
123 BranchOperatorInfo info = BranchOperatorInfoOf(op);
124 if (info.is_safety_check == safety_check)
return op;
125 return Branch(info.hint, safety_check);
127 DeoptimizeParameters p = DeoptimizeParametersOf(op);
128 if (p.is_safety_check() == safety_check)
return op;
129 switch (op->opcode()) {
130 case IrOpcode::kDeoptimizeIf:
131 return DeoptimizeIf(p.kind(), p.reason(), p.feedback(), safety_check);
132 case IrOpcode::kDeoptimizeUnless:
133 return DeoptimizeUnless(p.kind(), p.reason(), p.feedback(), safety_check);
139 const Operator* CommonOperatorBuilder::DelayedStringConstant(
140 const StringConstantBase* str) {
141 return new (zone()) Operator1<const StringConstantBase*>(
142 IrOpcode::kDelayedStringConstant, Operator::kPure,
143 "DelayedStringConstant", 0, 0, 0, 1, 0, 0, str);
146 bool operator==(SelectParameters
const& lhs, SelectParameters
const& rhs) {
147 return lhs.representation() == rhs.representation() &&
148 lhs.hint() == rhs.hint();
152 bool operator!=(SelectParameters
const& lhs, SelectParameters
const& rhs) {
153 return !(lhs == rhs);
157 size_t hash_value(SelectParameters
const& p) {
158 return base::hash_combine(p.representation(), p.hint());
162 std::ostream& operator<<(std::ostream& os, SelectParameters
const& p) {
163 return os << p.representation() <<
"|" << p.hint();
167 SelectParameters
const& SelectParametersOf(
const Operator*
const op) {
168 DCHECK_EQ(IrOpcode::kSelect, op->opcode());
169 return OpParameter<SelectParameters>(op);
172 CallDescriptor
const* CallDescriptorOf(
const Operator*
const op) {
173 DCHECK(op->opcode() == IrOpcode::kCall ||
174 op->opcode() == IrOpcode::kCallWithCallerSavedRegisters ||
175 op->opcode() == IrOpcode::kTailCall);
176 return OpParameter<CallDescriptor const*>(op);
179 size_t ProjectionIndexOf(
const Operator*
const op) {
180 DCHECK_EQ(IrOpcode::kProjection, op->opcode());
181 return OpParameter<size_t>(op);
185 MachineRepresentation PhiRepresentationOf(
const Operator*
const op) {
186 DCHECK_EQ(IrOpcode::kPhi, op->opcode());
187 return OpParameter<MachineRepresentation>(op);
191 int ParameterIndexOf(
const Operator*
const op) {
192 DCHECK_EQ(IrOpcode::kParameter, op->opcode());
193 return OpParameter<ParameterInfo>(op).index();
197 const ParameterInfo& ParameterInfoOf(
const Operator*
const op) {
198 DCHECK_EQ(IrOpcode::kParameter, op->opcode());
199 return OpParameter<ParameterInfo>(op);
203 bool operator==(ParameterInfo
const& lhs, ParameterInfo
const& rhs) {
204 return lhs.index() == rhs.index();
208 bool operator!=(ParameterInfo
const& lhs, ParameterInfo
const& rhs) {
209 return !(lhs == rhs);
213 size_t hash_value(ParameterInfo
const& p) {
return p.index(); }
216 std::ostream& operator<<(std::ostream& os, ParameterInfo
const&
i) {
217 if (
i.debug_name()) os <<
i.debug_name() <<
'#';
222 std::ostream& operator<<(std::ostream& os, ObjectStateInfo
const&
i) {
223 return os <<
"id:" <<
i.object_id() <<
"|size:" <<
i.size();
226 size_t hash_value(ObjectStateInfo
const& p) {
227 return base::hash_combine(p.object_id(), p.size());
230 std::ostream& operator<<(std::ostream& os, TypedObjectStateInfo
const&
i) {
231 return os <<
"id:" <<
i.object_id() <<
"|" <<
i.machine_types();
234 size_t hash_value(TypedObjectStateInfo
const& p) {
235 return base::hash_combine(p.object_id(), p.machine_types());
238 bool operator==(RelocatablePtrConstantInfo
const& lhs,
239 RelocatablePtrConstantInfo
const& rhs) {
240 return lhs.rmode() == rhs.rmode() && lhs.value() == rhs.value() &&
241 lhs.type() == rhs.type();
244 bool operator!=(RelocatablePtrConstantInfo
const& lhs,
245 RelocatablePtrConstantInfo
const& rhs) {
246 return !(lhs == rhs);
249 size_t hash_value(RelocatablePtrConstantInfo
const& p) {
250 return base::hash_combine(p.value(), int8_t{p.rmode()}, p.type());
253 std::ostream& operator<<(std::ostream& os,
254 RelocatablePtrConstantInfo
const& p) {
255 return os << p.value() <<
"|" << p.rmode() <<
"|" << p.type();
258 SparseInputMask::InputIterator::InputIterator(
259 SparseInputMask::BitMaskType bit_mask, Node* parent)
260 : bit_mask_(bit_mask), parent_(parent), real_index_(0) {
262 if (bit_mask_ != SparseInputMask::kDenseBitMask) {
263 DCHECK_EQ(base::bits::CountPopulation(bit_mask_) -
264 base::bits::CountPopulation(kEndMarker),
265 parent->InputCount());
270 void SparseInputMask::InputIterator::Advance() {
279 Node* SparseInputMask::InputIterator::GetReal()
const {
281 return parent_->InputAt(real_index_);
284 bool SparseInputMask::InputIterator::IsReal()
const {
285 return bit_mask_ == SparseInputMask::kDenseBitMask ||
286 (bit_mask_ & kEntryMask);
289 bool SparseInputMask::InputIterator::IsEnd()
const {
290 return (bit_mask_ == kEndMarker) ||
291 (bit_mask_ == SparseInputMask::kDenseBitMask &&
292 real_index_ >= parent_->InputCount());
295 int SparseInputMask::CountReal()
const {
297 return base::bits::CountPopulation(bit_mask_) -
298 base::bits::CountPopulation(kEndMarker);
301 SparseInputMask::InputIterator SparseInputMask::IterateOverInputs(Node* node) {
302 DCHECK(IsDense() || CountReal() == node->InputCount());
303 return InputIterator(bit_mask_, node);
306 bool operator==(SparseInputMask
const& lhs, SparseInputMask
const& rhs) {
307 return lhs.mask() == rhs.mask();
310 bool operator!=(SparseInputMask
const& lhs, SparseInputMask
const& rhs) {
311 return !(lhs == rhs);
314 size_t hash_value(SparseInputMask
const& p) {
315 return base::hash_value(p.mask());
318 std::ostream& operator<<(std::ostream& os, SparseInputMask
const& p) {
320 return os <<
"dense";
322 SparseInputMask::BitMaskType mask = p.mask();
323 DCHECK_NE(mask, SparseInputMask::kDenseBitMask);
327 while (mask != SparseInputMask::kEndMarker) {
328 if (mask & SparseInputMask::kEntryMask) {
339 bool operator==(TypedStateValueInfo
const& lhs,
340 TypedStateValueInfo
const& rhs) {
341 return lhs.machine_types() == rhs.machine_types() &&
342 lhs.sparse_input_mask() == rhs.sparse_input_mask();
345 bool operator!=(TypedStateValueInfo
const& lhs,
346 TypedStateValueInfo
const& rhs) {
347 return !(lhs == rhs);
350 size_t hash_value(TypedStateValueInfo
const& p) {
351 return base::hash_combine(p.machine_types(), p.sparse_input_mask());
354 std::ostream& operator<<(std::ostream& os, TypedStateValueInfo
const& p) {
355 return os << p.machine_types() <<
"|" << p.sparse_input_mask();
358 size_t hash_value(RegionObservability observability) {
359 return static_cast<size_t>(observability);
362 std::ostream& operator<<(std::ostream& os, RegionObservability observability) {
363 switch (observability) {
364 case RegionObservability::kObservable:
365 return os <<
"observable";
366 case RegionObservability::kNotObservable:
367 return os <<
"not-observable";
372 RegionObservability RegionObservabilityOf(Operator
const* op) {
373 DCHECK_EQ(IrOpcode::kBeginRegion, op->opcode());
374 return OpParameter<RegionObservability>(op);
377 Type TypeGuardTypeOf(Operator
const* op) {
378 DCHECK_EQ(IrOpcode::kTypeGuard, op->opcode());
379 return OpParameter<Type>(op);
382 std::ostream& operator<<(std::ostream& os,
383 const ZoneVector<MachineType>* types) {
386 for (MachineType elem : *types) {
396 int OsrValueIndexOf(Operator
const* op) {
397 DCHECK_EQ(IrOpcode::kOsrValue, op->opcode());
398 return OpParameter<int>(op);
401 SparseInputMask SparseInputMaskOf(Operator
const* op) {
402 DCHECK(op->opcode() == IrOpcode::kStateValues ||
403 op->opcode() == IrOpcode::kTypedStateValues);
405 if (op->opcode() == IrOpcode::kTypedStateValues) {
406 return OpParameter<TypedStateValueInfo>(op).sparse_input_mask();
408 return OpParameter<SparseInputMask>(op);
411 ZoneVector<MachineType>
const* MachineTypesOf(Operator
const* op) {
412 DCHECK(op->opcode() == IrOpcode::kTypedObjectState ||
413 op->opcode() == IrOpcode::kTypedStateValues);
415 if (op->opcode() == IrOpcode::kTypedStateValues) {
416 return OpParameter<TypedStateValueInfo>(op).machine_types();
418 return OpParameter<TypedObjectStateInfo>(op).machine_types();
421 V8_EXPORT_PRIVATE
bool operator==(IfValueParameters
const& l,
422 IfValueParameters
const& r) {
423 return l.value() == r.value() && r.comparison_order() == r.comparison_order();
426 size_t hash_value(IfValueParameters
const& p) {
427 return base::hash_combine(p.value(), p.comparison_order());
430 V8_EXPORT_PRIVATE std::ostream& operator<<(std::ostream& out,
431 IfValueParameters
const& p) {
432 out << p.value() <<
" (order " << p.comparison_order() <<
")";
436 IfValueParameters
const& IfValueParametersOf(
const Operator* op) {
437 DCHECK(op->opcode() == IrOpcode::kIfValue);
438 return OpParameter<IfValueParameters>(op);
441 #define COMMON_CACHED_OP_LIST(V) \ 442 V(Dead, Operator::kFoldable, 0, 0, 0, 1, 1, 1) \ 443 V(Unreachable, Operator::kFoldable, 0, 1, 1, 1, 1, 0) \ 444 V(IfTrue, Operator::kKontrol, 0, 0, 1, 0, 0, 1) \ 445 V(IfFalse, Operator::kKontrol, 0, 0, 1, 0, 0, 1) \ 446 V(IfSuccess, Operator::kKontrol, 0, 0, 1, 0, 0, 1) \ 447 V(IfException, Operator::kKontrol, 0, 1, 1, 1, 1, 1) \ 448 V(IfDefault, Operator::kKontrol, 0, 0, 1, 0, 0, 1) \ 449 V(Throw, Operator::kKontrol, 0, 1, 1, 0, 0, 1) \ 450 V(Terminate, Operator::kKontrol, 0, 1, 1, 0, 0, 1) \ 451 V(OsrNormalEntry, Operator::kFoldable, 0, 1, 1, 0, 1, 1) \ 452 V(OsrLoopEntry, Operator::kFoldable | Operator::kNoThrow, 0, 1, 1, 0, 1, 1) \ 453 V(LoopExit, Operator::kKontrol, 0, 0, 2, 0, 0, 1) \ 454 V(LoopExitValue, Operator::kPure, 1, 0, 1, 1, 0, 0) \ 455 V(LoopExitEffect, Operator::kNoThrow, 0, 1, 1, 0, 1, 0) \ 456 V(Checkpoint, Operator::kKontrol, 0, 1, 1, 0, 1, 0) \ 457 V(FinishRegion, Operator::kKontrol, 1, 1, 0, 1, 1, 0) \ 458 V(Retain, Operator::kKontrol, 1, 1, 0, 0, 1, 0) 460 #define CACHED_BRANCH_LIST(V) \ 461 V(None, CriticalSafetyCheck) \ 462 V(True, CriticalSafetyCheck) \ 463 V(False, CriticalSafetyCheck) \ 464 V(None, SafetyCheck) \ 465 V(True, SafetyCheck) \ 466 V(False, SafetyCheck) \ 467 V(None, NoSafetyCheck) \ 468 V(True, NoSafetyCheck) \ 469 V(False, NoSafetyCheck) 471 #define CACHED_RETURN_LIST(V) \ 477 #define CACHED_END_LIST(V) \ 488 #define CACHED_EFFECT_PHI_LIST(V) \ 496 #define CACHED_INDUCTION_VARIABLE_PHI_LIST(V) \ 502 #define CACHED_LOOP_LIST(V) \ 507 #define CACHED_MERGE_LIST(V) \ 517 #define CACHED_DEOPTIMIZE_LIST(V) \ 518 V(Eager, MinusZero) \ 520 V(Soft, InsufficientTypeFeedbackForGenericKeyedAccess) \ 521 V(Soft, InsufficientTypeFeedbackForGenericNamedAccess) 523 #define CACHED_DEOPTIMIZE_IF_LIST(V) \ 524 V(Eager, DivisionByZero, NoSafetyCheck) \ 525 V(Eager, DivisionByZero, SafetyCheck) \ 526 V(Eager, Hole, NoSafetyCheck) \ 527 V(Eager, Hole, SafetyCheck) \ 528 V(Eager, MinusZero, NoSafetyCheck) \ 529 V(Eager, MinusZero, SafetyCheck) \ 530 V(Eager, Overflow, NoSafetyCheck) \ 531 V(Eager, Overflow, SafetyCheck) \ 532 V(Eager, Smi, SafetyCheck) 534 #define CACHED_DEOPTIMIZE_UNLESS_LIST(V) \ 535 V(Eager, LostPrecision, NoSafetyCheck) \ 536 V(Eager, LostPrecision, SafetyCheck) \ 537 V(Eager, LostPrecisionOrNaN, NoSafetyCheck) \ 538 V(Eager, LostPrecisionOrNaN, SafetyCheck) \ 539 V(Eager, NotAHeapNumber, SafetyCheck) \ 540 V(Eager, NotANumberOrOddball, SafetyCheck) \ 541 V(Eager, NotASmi, SafetyCheck) \ 542 V(Eager, OutOfBounds, SafetyCheck) \ 543 V(Eager, WrongInstanceType, SafetyCheck) \ 544 V(Eager, WrongMap, SafetyCheck) 546 #define CACHED_TRAP_IF_LIST(V) \ 547 V(TrapDivUnrepresentable) \ 548 V(TrapFloatUnrepresentable) 551 #define CACHED_TRAP_UNLESS_LIST(V) \ 553 V(TrapMemOutOfBounds) \ 555 V(TrapDivUnrepresentable) \ 557 V(TrapFloatUnrepresentable) \ 559 V(TrapFuncSigMismatch) 561 #define CACHED_PARAMETER_LIST(V) \ 571 #define CACHED_PHI_LIST(V) \ 583 #define CACHED_PROJECTION_LIST(V) \ 588 #define CACHED_STATE_VALUES_LIST(V) \ 606 #define CACHED(Name, properties, value_input_count, effect_input_count, \ 607 control_input_count, value_output_count, effect_output_count, \ 608 control_output_count) \ 609 struct Name##Operator final : public Operator { \ 611 : Operator(IrOpcode::k##Name, properties, #Name, value_input_count, \ 612 effect_input_count, control_input_count, \ 613 value_output_count, effect_output_count, \ 614 control_output_count) {} \ 616 Name##Operator k##Name##Operator; 617 COMMON_CACHED_OP_LIST(CACHED)
620 template <
size_t kInputCount>
624 IrOpcode::kEnd, Operator::kKontrol,
626 0, 0, kInputCount, 0, 0, 0) {}
628 #define CACHED_END(input_count) \ 629 EndOperator<input_count> kEnd##input_count##Operator; 630 CACHED_END_LIST(CACHED_END)
633 template <
size_t kValueInputCount>
637 IrOpcode::kReturn, Operator::kNoThrow,
639 kValueInputCount + 1, 1, 1, 0, 0, 1) {}
641 #define CACHED_RETURN(value_input_count) \ 642 ReturnOperator<value_input_count> kReturn##value_input_count##Operator; 643 CACHED_RETURN_LIST(CACHED_RETURN)
646 template <BranchH
int h
int, IsSafetyCheck is_safety_check>
650 IrOpcode::kBranch, Operator::kKontrol,
655 #define CACHED_BRANCH(Hint, IsCheck) \ 656 BranchOperator<BranchHint::k##Hint, IsSafetyCheck::k##IsCheck> \ 657 kBranch##Hint##IsCheck##Operator; 658 CACHED_BRANCH_LIST(CACHED_BRANCH)
661 template <
int kEffectInputCount>
665 IrOpcode::kEffectPhi, Operator::kKontrol,
667 0, kEffectInputCount, 1, 0, 1, 0) {}
669 #define CACHED_EFFECT_PHI(input_count) \ 670 EffectPhiOperator<input_count> kEffectPhi##input_count##Operator; 671 CACHED_EFFECT_PHI_LIST(CACHED_EFFECT_PHI)
672 #undef CACHED_EFFECT_PHI 674 template <RegionObservability kRegionObservability>
678 IrOpcode::kBeginRegion, Operator::kKontrol,
681 kRegionObservability) {}
684 kBeginRegionObservableOperator;
686 kBeginRegionNotObservableOperator;
688 template <
size_t kInputCount>
692 IrOpcode::kLoop, Operator::kKontrol,
694 0, 0, kInputCount, 0, 0, 1) {}
696 #define CACHED_LOOP(input_count) \ 697 LoopOperator<input_count> kLoop##input_count##Operator; 698 CACHED_LOOP_LIST(CACHED_LOOP)
701 template <
size_t kInputCount>
705 IrOpcode::kMerge, Operator::kKontrol,
707 0, 0, kInputCount, 0, 0, 1) {}
709 #define CACHED_MERGE(input_count) \ 710 MergeOperator<input_count> kMerge##input_count##Operator; 711 CACHED_MERGE_LIST(CACHED_MERGE)
714 template <DeoptimizeKind kKind, DeoptimizeReason kReason>
718 IrOpcode::kDeoptimize,
719 Operator::kFoldable | Operator::kNoThrow,
723 IsSafetyCheck::kNoSafetyCheck)) {}
725 #define CACHED_DEOPTIMIZE(Kind, Reason) \ 726 DeoptimizeOperator<DeoptimizeKind::k##Kind, DeoptimizeReason::k##Reason> \ 727 kDeoptimize##Kind##Reason##Operator; 728 CACHED_DEOPTIMIZE_LIST(CACHED_DEOPTIMIZE)
729 #undef CACHED_DEOPTIMIZE 731 template <DeoptimizeKind kKind, DeoptimizeReason kReason,
732 IsSafetyCheck is_safety_check>
736 IrOpcode::kDeoptimizeIf,
737 Operator::kFoldable | Operator::kNoThrow,
743 #define CACHED_DEOPTIMIZE_IF(Kind, Reason, IsCheck) \ 744 DeoptimizeIfOperator<DeoptimizeKind::k##Kind, DeoptimizeReason::k##Reason, \ 745 IsSafetyCheck::k##IsCheck> \ 746 kDeoptimizeIf##Kind##Reason##IsCheck##Operator; 747 CACHED_DEOPTIMIZE_IF_LIST(CACHED_DEOPTIMIZE_IF)
748 #undef CACHED_DEOPTIMIZE_IF 750 template <DeoptimizeKind kKind, DeoptimizeReason kReason,
751 IsSafetyCheck is_safety_check>
753 :
public Operator1<DeoptimizeParameters> {
756 IrOpcode::kDeoptimizeUnless,
757 Operator::kFoldable | Operator::kNoThrow,
763 #define CACHED_DEOPTIMIZE_UNLESS(Kind, Reason, IsCheck) \ 764 DeoptimizeUnlessOperator<DeoptimizeKind::k##Kind, \ 765 DeoptimizeReason::k##Reason, \ 766 IsSafetyCheck::k##IsCheck> \ 767 kDeoptimizeUnless##Kind##Reason##IsCheck##Operator; 768 CACHED_DEOPTIMIZE_UNLESS_LIST(CACHED_DEOPTIMIZE_UNLESS)
769 #undef CACHED_DEOPTIMIZE_UNLESS 771 template <TrapId trap_
id>
776 Operator::kFoldable | Operator::kNoThrow,
781 #define CACHED_TRAP_IF(Trap) \ 782 TrapIfOperator<TrapId::k##Trap> kTrapIf##Trap##Operator; 783 CACHED_TRAP_IF_LIST(CACHED_TRAP_IF)
784 #undef CACHED_TRAP_IF 786 template <TrapId trap_
id>
790 IrOpcode::kTrapUnless,
791 Operator::kFoldable | Operator::kNoThrow,
796 #define CACHED_TRAP_UNLESS(Trap) \ 797 TrapUnlessOperator<TrapId::k##Trap> kTrapUnless##Trap##Operator; 798 CACHED_TRAP_UNLESS_LIST(CACHED_TRAP_UNLESS)
799 #undef CACHED_TRAP_UNLESS 801 template <MachineRepresentation kRep,
int kInputCount>
805 IrOpcode::kPhi, Operator::kPure,
807 kInputCount, 0, 1, 1, 0, 0,
810 #define CACHED_PHI(rep, input_count) \ 811 PhiOperator<MachineRepresentation::rep, input_count> \ 812 kPhi##rep##input_count##Operator; 813 CACHED_PHI_LIST(CACHED_PHI)
816 template <
int kInputCount>
820 IrOpcode::kInductionVariablePhi, Operator::kPure,
821 "InductionVariablePhi",
822 kInputCount, 0, 1, 1, 0, 0) {}
824 #define CACHED_INDUCTION_VARIABLE_PHI(input_count) \ 825 InductionVariablePhiOperator<input_count> \ 826 kInductionVariablePhi##input_count##Operator; 827 CACHED_INDUCTION_VARIABLE_PHI_LIST(CACHED_INDUCTION_VARIABLE_PHI)
828 #undef CACHED_INDUCTION_VARIABLE_PHI 830 template <
int kIndex>
834 IrOpcode::kParameter, Operator::kPure,
839 #define CACHED_PARAMETER(index) \ 840 ParameterOperator<index> kParameter##index##Operator; 841 CACHED_PARAMETER_LIST(CACHED_PARAMETER)
842 #undef CACHED_PARAMETER 844 template <
size_t kIndex>
848 IrOpcode::kProjection,
854 #define CACHED_PROJECTION(index) \ 855 ProjectionOperator<index> kProjection##index##Operator; 856 CACHED_PROJECTION_LIST(CACHED_PROJECTION)
857 #undef CACHED_PROJECTION 859 template <
int kInputCount>
863 IrOpcode::kStateValues,
866 kInputCount, 0, 0, 1, 0, 0,
867 SparseInputMask::Dense()) {}
869 #define CACHED_STATE_VALUES(input_count) \ 870 StateValuesOperator<input_count> kStateValues##input_count##Operator; 871 CACHED_STATE_VALUES_LIST(CACHED_STATE_VALUES)
872 #undef CACHED_STATE_VALUES 876 kCommonOperatorGlobalCache = LAZY_INSTANCE_INITIALIZER;
878 CommonOperatorBuilder::CommonOperatorBuilder(
Zone* zone)
879 : cache_(kCommonOperatorGlobalCache.Get()), zone_(zone) {}
881 #define CACHED(Name, properties, value_input_count, effect_input_count, \ 882 control_input_count, value_output_count, effect_output_count, \ 883 control_output_count) \ 884 const Operator* CommonOperatorBuilder::Name() { \ 885 return &cache_.k##Name##Operator; \ 887 COMMON_CACHED_OP_LIST(CACHED)
891 const Operator* CommonOperatorBuilder::End(
size_t control_input_count) {
892 switch (control_input_count) {
893 #define CACHED_END(input_count) \ 895 return &cache_.kEnd##input_count##Operator; 896 CACHED_END_LIST(CACHED_END)
902 return new (zone()) Operator(
903 IrOpcode::kEnd, Operator::kKontrol,
905 0, 0, control_input_count, 0, 0, 0);
908 const Operator* CommonOperatorBuilder::Return(
int value_input_count) {
909 switch (value_input_count) {
910 #define CACHED_RETURN(input_count) \ 912 return &cache_.kReturn##input_count##Operator; 913 CACHED_RETURN_LIST(CACHED_RETURN)
919 return new (zone()) Operator(
920 IrOpcode::kReturn, Operator::kNoThrow,
922 value_input_count + 1, 1, 1, 0, 0, 1);
925 const Operator* CommonOperatorBuilder::Branch(BranchHint hint,
926 IsSafetyCheck is_safety_check) {
927 #define CACHED_BRANCH(Hint, IsCheck) \ 928 if (hint == BranchHint::k##Hint && \ 929 is_safety_check == IsSafetyCheck::k##IsCheck) { \ 930 return &cache_.kBranch##Hint##IsCheck##Operator; \ 932 CACHED_BRANCH_LIST(CACHED_BRANCH)
937 const Operator* CommonOperatorBuilder::Deoptimize(
938 DeoptimizeKind kind, DeoptimizeReason reason,
939 VectorSlotPair
const& feedback) {
940 #define CACHED_DEOPTIMIZE(Kind, Reason) \ 941 if (kind == DeoptimizeKind::k##Kind && \ 942 reason == DeoptimizeReason::k##Reason && !feedback.IsValid()) { \ 943 return &cache_.kDeoptimize##Kind##Reason##Operator; \ 945 CACHED_DEOPTIMIZE_LIST(CACHED_DEOPTIMIZE)
946 #undef CACHED_DEOPTIMIZE 948 DeoptimizeParameters parameter(kind, reason, feedback,
949 IsSafetyCheck::kNoSafetyCheck);
950 return new (zone()) Operator1<DeoptimizeParameters>(
951 IrOpcode::kDeoptimize,
952 Operator::kFoldable | Operator::kNoThrow,
958 const Operator* CommonOperatorBuilder::DeoptimizeIf(
959 DeoptimizeKind kind, DeoptimizeReason reason,
960 VectorSlotPair
const& feedback, IsSafetyCheck is_safety_check) {
961 #define CACHED_DEOPTIMIZE_IF(Kind, Reason, IsCheck) \ 962 if (kind == DeoptimizeKind::k##Kind && \ 963 reason == DeoptimizeReason::k##Reason && \ 964 is_safety_check == IsSafetyCheck::k##IsCheck && !feedback.IsValid()) { \ 965 return &cache_.kDeoptimizeIf##Kind##Reason##IsCheck##Operator; \ 967 CACHED_DEOPTIMIZE_IF_LIST(CACHED_DEOPTIMIZE_IF)
968 #undef CACHED_DEOPTIMIZE_IF 970 DeoptimizeParameters parameter(kind, reason, feedback, is_safety_check);
971 return new (zone()) Operator1<DeoptimizeParameters>(
972 IrOpcode::kDeoptimizeIf,
973 Operator::kFoldable | Operator::kNoThrow,
979 const Operator* CommonOperatorBuilder::DeoptimizeUnless(
980 DeoptimizeKind kind, DeoptimizeReason reason,
981 VectorSlotPair
const& feedback, IsSafetyCheck is_safety_check) {
982 #define CACHED_DEOPTIMIZE_UNLESS(Kind, Reason, IsCheck) \ 983 if (kind == DeoptimizeKind::k##Kind && \ 984 reason == DeoptimizeReason::k##Reason && \ 985 is_safety_check == IsSafetyCheck::k##IsCheck && !feedback.IsValid()) { \ 986 return &cache_.kDeoptimizeUnless##Kind##Reason##IsCheck##Operator; \ 988 CACHED_DEOPTIMIZE_UNLESS_LIST(CACHED_DEOPTIMIZE_UNLESS)
989 #undef CACHED_DEOPTIMIZE_UNLESS 991 DeoptimizeParameters parameter(kind, reason, feedback, is_safety_check);
992 return new (zone()) Operator1<DeoptimizeParameters>(
993 IrOpcode::kDeoptimizeUnless,
994 Operator::kFoldable | Operator::kNoThrow,
1000 const Operator* CommonOperatorBuilder::TrapIf(TrapId trap_id) {
1002 #define CACHED_TRAP_IF(Trap) \ 1003 case TrapId::k##Trap: \ 1004 return &cache_.kTrapIf##Trap##Operator; 1005 CACHED_TRAP_IF_LIST(CACHED_TRAP_IF)
1006 #undef CACHED_TRAP_IF 1011 return new (zone()) Operator1<TrapId>(
1013 Operator::kFoldable | Operator::kNoThrow,
1019 const Operator* CommonOperatorBuilder::TrapUnless(TrapId trap_id) {
1021 #define CACHED_TRAP_UNLESS(Trap) \ 1022 case TrapId::k##Trap: \ 1023 return &cache_.kTrapUnless##Trap##Operator; 1024 CACHED_TRAP_UNLESS_LIST(CACHED_TRAP_UNLESS)
1025 #undef CACHED_TRAP_UNLESS 1030 return new (zone()) Operator1<TrapId>(
1031 IrOpcode::kTrapUnless,
1032 Operator::kFoldable | Operator::kNoThrow,
1038 const Operator* CommonOperatorBuilder::Switch(
size_t control_output_count) {
1039 return new (zone()) Operator(
1040 IrOpcode::kSwitch, Operator::kKontrol,
1042 1, 0, 1, 0, 0, control_output_count);
1045 const Operator* CommonOperatorBuilder::IfValue(int32_t index,
1046 int32_t comparison_order) {
1047 return new (zone()) Operator1<IfValueParameters>(
1048 IrOpcode::kIfValue, Operator::kKontrol,
1051 IfValueParameters(index, comparison_order));
1055 const Operator* CommonOperatorBuilder::Start(
int value_output_count) {
1056 return new (zone()) Operator(
1057 IrOpcode::kStart, Operator::kFoldable | Operator::kNoThrow,
1059 0, 0, 0, value_output_count, 1, 1);
1063 const Operator* CommonOperatorBuilder::Loop(
int control_input_count) {
1064 switch (control_input_count) {
1065 #define CACHED_LOOP(input_count) \ 1067 return &cache_.kLoop##input_count##Operator; 1068 CACHED_LOOP_LIST(CACHED_LOOP)
1074 return new (zone()) Operator(
1075 IrOpcode::kLoop, Operator::kKontrol,
1077 0, 0, control_input_count, 0, 0, 1);
1081 const Operator* CommonOperatorBuilder::Merge(
int control_input_count) {
1082 switch (control_input_count) {
1083 #define CACHED_MERGE(input_count) \ 1085 return &cache_.kMerge##input_count##Operator; 1086 CACHED_MERGE_LIST(CACHED_MERGE)
1092 return new (zone()) Operator(
1093 IrOpcode::kMerge, Operator::kKontrol,
1095 0, 0, control_input_count, 0, 0, 1);
1099 const Operator* CommonOperatorBuilder::Parameter(
int index,
1100 const char* debug_name) {
1103 #define CACHED_PARAMETER(index) \ 1105 return &cache_.kParameter##index##Operator; 1106 CACHED_PARAMETER_LIST(CACHED_PARAMETER)
1107 #undef CACHED_PARAMETER 1113 return new (zone()) Operator1<ParameterInfo>(
1114 IrOpcode::kParameter, Operator::kPure,
1117 ParameterInfo(index, debug_name));
1120 const Operator* CommonOperatorBuilder::OsrValue(
int index) {
1121 return new (zone()) Operator1<int>(
1122 IrOpcode::kOsrValue, Operator::kNoProperties,
1128 const Operator* CommonOperatorBuilder::Int32Constant(int32_t value) {
1129 return new (zone()) Operator1<int32_t>(
1130 IrOpcode::kInt32Constant, Operator::kPure,
1137 const Operator* CommonOperatorBuilder::Int64Constant(
int64_t value) {
1138 return new (zone()) Operator1<int64_t>(
1139 IrOpcode::kInt64Constant, Operator::kPure,
1146 const Operator* CommonOperatorBuilder::Float32Constant(
volatile float value) {
1147 return new (zone()) Operator1<float>(
1148 IrOpcode::kFloat32Constant, Operator::kPure,
1155 const Operator* CommonOperatorBuilder::Float64Constant(
volatile double value) {
1156 return new (zone()) Operator1<double>(
1157 IrOpcode::kFloat64Constant, Operator::kPure,
1164 const Operator* CommonOperatorBuilder::ExternalConstant(
1165 const ExternalReference& value) {
1166 return new (zone()) Operator1<ExternalReference>(
1167 IrOpcode::kExternalConstant, Operator::kPure,
1174 const Operator* CommonOperatorBuilder::NumberConstant(
volatile double value) {
1175 return new (zone()) Operator1<double>(
1176 IrOpcode::kNumberConstant, Operator::kPure,
1182 const Operator* CommonOperatorBuilder::PointerConstant(intptr_t value) {
1183 return new (zone()) Operator1<intptr_t>(
1184 IrOpcode::kPointerConstant, Operator::kPure,
1190 const Operator* CommonOperatorBuilder::HeapConstant(
1191 const Handle<HeapObject>& value) {
1192 return new (zone()) Operator1<Handle<HeapObject>>(
1193 IrOpcode::kHeapConstant, Operator::kPure,
1199 Handle<HeapObject> HeapConstantOf(
const Operator* op) {
1200 DCHECK_EQ(IrOpcode::kHeapConstant, op->opcode());
1201 return OpParameter<Handle<HeapObject>>(op);
1204 const StringConstantBase* StringConstantBaseOf(
const Operator* op) {
1205 DCHECK_EQ(IrOpcode::kDelayedStringConstant, op->opcode());
1206 return OpParameter<const StringConstantBase*>(op);
1209 const Operator* CommonOperatorBuilder::RelocatableInt32Constant(
1210 int32_t value, RelocInfo::Mode rmode) {
1211 return new (zone()) Operator1<RelocatablePtrConstantInfo>(
1212 IrOpcode::kRelocatableInt32Constant, Operator::kPure,
1213 "RelocatableInt32Constant",
1215 RelocatablePtrConstantInfo(value, rmode));
1218 const Operator* CommonOperatorBuilder::RelocatableInt64Constant(
1219 int64_t value, RelocInfo::Mode rmode) {
1220 return new (zone()) Operator1<RelocatablePtrConstantInfo>(
1221 IrOpcode::kRelocatableInt64Constant, Operator::kPure,
1222 "RelocatableInt64Constant",
1224 RelocatablePtrConstantInfo(value, rmode));
1227 const Operator* CommonOperatorBuilder::ObjectId(
uint32_t object_id) {
1228 return new (zone()) Operator1<uint32_t>(
1229 IrOpcode::kObjectId, Operator::kPure,
1235 const Operator* CommonOperatorBuilder::Select(MachineRepresentation rep,
1237 return new (zone()) Operator1<SelectParameters>(
1238 IrOpcode::kSelect, Operator::kPure,
1241 SelectParameters(rep, hint));
1245 const Operator* CommonOperatorBuilder::Phi(MachineRepresentation rep,
1246 int value_input_count) {
1247 DCHECK_LT(0, value_input_count);
1248 #define CACHED_PHI(kRep, kValueInputCount) \ 1249 if (MachineRepresentation::kRep == rep && \ 1250 kValueInputCount == value_input_count) { \ 1251 return &cache_.kPhi##kRep##kValueInputCount##Operator; \ 1253 CACHED_PHI_LIST(CACHED_PHI)
1256 return new (zone()) Operator1<MachineRepresentation>(
1257 IrOpcode::kPhi, Operator::kPure,
1259 value_input_count, 0, 1, 1, 0, 0,
1263 const Operator* CommonOperatorBuilder::TypeGuard(
Type type) {
1264 return new (zone()) Operator1<Type>(
1265 IrOpcode::kTypeGuard, Operator::kPure,
1271 const Operator* CommonOperatorBuilder::EffectPhi(
int effect_input_count) {
1272 DCHECK_LT(0, effect_input_count);
1273 switch (effect_input_count) {
1274 #define CACHED_EFFECT_PHI(input_count) \ 1276 return &cache_.kEffectPhi##input_count##Operator; 1277 CACHED_EFFECT_PHI_LIST(CACHED_EFFECT_PHI)
1278 #undef CACHED_EFFECT_PHI 1283 return new (zone()) Operator(
1284 IrOpcode::kEffectPhi, Operator::kKontrol,
1286 0, effect_input_count, 1, 0, 1, 0);
1289 const Operator* CommonOperatorBuilder::InductionVariablePhi(
int input_count) {
1290 DCHECK_LE(4, input_count);
1292 switch (input_count) {
1293 #define CACHED_INDUCTION_VARIABLE_PHI(input_count) \ 1295 return &cache_.kInductionVariablePhi##input_count##Operator; 1296 CACHED_INDUCTION_VARIABLE_PHI_LIST(CACHED_INDUCTION_VARIABLE_PHI)
1297 #undef CACHED_INDUCTION_VARIABLE_PHI 1302 return new (zone()) Operator(
1303 IrOpcode::kInductionVariablePhi, Operator::kPure,
1304 "InductionVariablePhi",
1305 input_count, 0, 1, 1, 0, 0);
1308 const Operator* CommonOperatorBuilder::BeginRegion(
1309 RegionObservability region_observability) {
1310 switch (region_observability) {
1311 case RegionObservability::kObservable:
1312 return &cache_.kBeginRegionObservableOperator;
1313 case RegionObservability::kNotObservable:
1314 return &cache_.kBeginRegionNotObservableOperator;
1319 const Operator* CommonOperatorBuilder::StateValues(
int arguments,
1320 SparseInputMask bitmask) {
1321 if (bitmask.IsDense()) {
1322 switch (arguments) {
1323 #define CACHED_STATE_VALUES(arguments) \ 1325 return &cache_.kStateValues##arguments##Operator; 1326 CACHED_STATE_VALUES_LIST(CACHED_STATE_VALUES)
1327 #undef CACHED_STATE_VALUES 1334 DCHECK(bitmask.IsDense() || bitmask.CountReal() == arguments);
1338 return new (zone()) Operator1<SparseInputMask>(
1339 IrOpcode::kStateValues, Operator::kPure,
1341 arguments, 0, 0, 1, 0, 0,
1345 const Operator* CommonOperatorBuilder::TypedStateValues(
1346 const ZoneVector<MachineType>* types, SparseInputMask bitmask) {
1348 DCHECK(bitmask.IsDense() ||
1349 bitmask.CountReal() ==
static_cast<int>(types->size()));
1352 return new (zone()) Operator1<TypedStateValueInfo>(
1353 IrOpcode::kTypedStateValues, Operator::kPure,
1355 static_cast<int>(types->size()), 0, 0, 1, 0, 0,
1356 TypedStateValueInfo(types, bitmask));
1359 const Operator* CommonOperatorBuilder::ArgumentsElementsState(
1360 ArgumentsStateType type) {
1361 return new (zone()) Operator1<ArgumentsStateType>(
1362 IrOpcode::kArgumentsElementsState, Operator::kPure,
1363 "ArgumentsElementsState",
1368 const Operator* CommonOperatorBuilder::ArgumentsLengthState(
1369 ArgumentsStateType type) {
1370 return new (zone()) Operator1<ArgumentsStateType>(
1371 IrOpcode::kArgumentsLengthState, Operator::kPure,
1372 "ArgumentsLengthState",
1377 ArgumentsStateType ArgumentsStateTypeOf(Operator
const* op) {
1378 DCHECK(op->opcode() == IrOpcode::kArgumentsElementsState ||
1379 op->opcode() == IrOpcode::kArgumentsLengthState);
1380 return OpParameter<ArgumentsStateType>(op);
1383 const Operator* CommonOperatorBuilder::ObjectState(
uint32_t object_id,
1384 int pointer_slots) {
1385 return new (zone()) Operator1<ObjectStateInfo>(
1386 IrOpcode::kObjectState, Operator::kPure,
1388 pointer_slots, 0, 0, 1, 0, 0,
1389 ObjectStateInfo{object_id, pointer_slots});
1392 const Operator* CommonOperatorBuilder::TypedObjectState(
1393 uint32_t object_id,
const ZoneVector<MachineType>* types) {
1394 return new (zone()) Operator1<TypedObjectStateInfo>(
1395 IrOpcode::kTypedObjectState, Operator::kPure,
1397 static_cast<int>(types->size()), 0, 0, 1, 0, 0,
1398 TypedObjectStateInfo(object_id, types));
1401 uint32_t ObjectIdOf(Operator
const* op) {
1402 switch (op->opcode()) {
1403 case IrOpcode::kObjectState:
1404 return OpParameter<ObjectStateInfo>(op).object_id();
1405 case IrOpcode::kTypedObjectState:
1406 return OpParameter<TypedObjectStateInfo>(op).object_id();
1407 case IrOpcode::kObjectId:
1408 return OpParameter<uint32_t>(op);
1414 MachineRepresentation DeadValueRepresentationOf(Operator
const* op) {
1415 DCHECK_EQ(IrOpcode::kDeadValue, op->opcode());
1416 return OpParameter<MachineRepresentation>(op);
1419 const Operator* CommonOperatorBuilder::FrameState(
1420 BailoutId bailout_id, OutputFrameStateCombine state_combine,
1421 const FrameStateFunctionInfo* function_info) {
1422 FrameStateInfo state_info(bailout_id, state_combine, function_info);
1423 return new (zone()) Operator1<FrameStateInfo>(
1424 IrOpcode::kFrameState, Operator::kPure,
1430 const Operator* CommonOperatorBuilder::Call(
1431 const CallDescriptor* call_descriptor) {
1432 class CallOperator final :
public Operator1<const CallDescriptor*> {
1434 explicit CallOperator(
const CallDescriptor* call_descriptor)
1435 : Operator1<const CallDescriptor*>(
1436 IrOpcode::kCall, call_descriptor->properties(),
"Call",
1437 call_descriptor->InputCount() +
1438 call_descriptor->FrameStateCount(),
1439 Operator::ZeroIfPure(call_descriptor->properties()),
1440 Operator::ZeroIfEliminatable(call_descriptor->properties()),
1441 call_descriptor->ReturnCount(),
1442 Operator::ZeroIfPure(call_descriptor->properties()),
1443 Operator::ZeroIfNoThrow(call_descriptor->properties()),
1446 void PrintParameter(std::ostream& os,
1447 PrintVerbosity verbose)
const override {
1448 os <<
"[" << *parameter() <<
"]";
1451 return new (zone()) CallOperator(call_descriptor);
1454 const Operator* CommonOperatorBuilder::CallWithCallerSavedRegisters(
1455 const CallDescriptor* call_descriptor) {
1456 class CallOperator final :
public Operator1<const CallDescriptor*> {
1458 explicit CallOperator(
const CallDescriptor* call_descriptor)
1459 : Operator1<const CallDescriptor*>(
1460 IrOpcode::kCallWithCallerSavedRegisters,
1461 call_descriptor->properties(),
"CallWithCallerSavedRegisters",
1462 call_descriptor->InputCount() +
1463 call_descriptor->FrameStateCount(),
1464 Operator::ZeroIfPure(call_descriptor->properties()),
1465 Operator::ZeroIfEliminatable(call_descriptor->properties()),
1466 call_descriptor->ReturnCount(),
1467 Operator::ZeroIfPure(call_descriptor->properties()),
1468 Operator::ZeroIfNoThrow(call_descriptor->properties()),
1471 void PrintParameter(std::ostream& os,
1472 PrintVerbosity verbose)
const override {
1473 os <<
"[" << *parameter() <<
"]";
1476 return new (zone()) CallOperator(call_descriptor);
1479 const Operator* CommonOperatorBuilder::TailCall(
1480 const CallDescriptor* call_descriptor) {
1481 class TailCallOperator final :
public Operator1<const CallDescriptor*> {
1483 explicit TailCallOperator(
const CallDescriptor* call_descriptor)
1484 : Operator1<const CallDescriptor*>(
1485 IrOpcode::kTailCall,
1486 call_descriptor->properties() | Operator::kNoThrow,
"TailCall",
1487 call_descriptor->InputCount() +
1488 call_descriptor->FrameStateCount(),
1489 1, 1, 0, 0, 1, call_descriptor) {}
1491 void PrintParameter(std::ostream& os,
1492 PrintVerbosity verbose)
const override {
1493 os <<
"[" << *parameter() <<
"]";
1496 return new (zone()) TailCallOperator(call_descriptor);
1499 const Operator* CommonOperatorBuilder::Projection(
size_t index) {
1501 #define CACHED_PROJECTION(index) \ 1503 return &cache_.kProjection##index##Operator; 1504 CACHED_PROJECTION_LIST(CACHED_PROJECTION)
1505 #undef CACHED_PROJECTION 1510 return new (zone()) Operator1<size_t>(
1511 IrOpcode::kProjection,
1519 const Operator* CommonOperatorBuilder::ResizeMergeOrPhi(
const Operator* op,
1521 if (op->opcode() == IrOpcode::kPhi) {
1522 return Phi(PhiRepresentationOf(op), size);
1523 }
else if (op->opcode() == IrOpcode::kEffectPhi) {
1524 return EffectPhi(size);
1525 }
else if (op->opcode() == IrOpcode::kMerge) {
1527 }
else if (op->opcode() == IrOpcode::kLoop) {
1534 const FrameStateFunctionInfo*
1535 CommonOperatorBuilder::CreateFrameStateFunctionInfo(
1536 FrameStateType type,
int parameter_count,
int local_count,
1537 Handle<SharedFunctionInfo> shared_info) {
1538 return new (zone()->New(
sizeof(FrameStateFunctionInfo)))
1539 FrameStateFunctionInfo(type, parameter_count, local_count, shared_info);
1542 const Operator* CommonOperatorBuilder::DeadValue(MachineRepresentation rep) {
1543 return new (zone()) Operator1<MachineRepresentation>(
1544 IrOpcode::kDeadValue, Operator::kPure,
1550 const FrameStateInfo& FrameStateInfoOf(
const Operator* op) {
1551 DCHECK_EQ(IrOpcode::kFrameState, op->opcode());
1552 return OpParameter<FrameStateInfo>(op);
1555 IsSafetyCheck CombineSafetyChecks(IsSafetyCheck a, IsSafetyCheck b) {
1556 if (a == IsSafetyCheck::kCriticalSafetyCheck ||
1557 b == IsSafetyCheck::kCriticalSafetyCheck) {
1558 return IsSafetyCheck::kCriticalSafetyCheck;
1560 if (a == IsSafetyCheck::kSafetyCheck || b == IsSafetyCheck::kSafetyCheck) {
1561 return IsSafetyCheck::kSafetyCheck;
1563 return IsSafetyCheck::kNoSafetyCheck;
1566 #undef COMMON_CACHED_OP_LIST 1567 #undef CACHED_BRANCH_LIST 1568 #undef CACHED_RETURN_LIST 1569 #undef CACHED_END_LIST 1570 #undef CACHED_EFFECT_PHI_LIST 1571 #undef CACHED_INDUCTION_VARIABLE_PHI_LIST 1572 #undef CACHED_LOOP_LIST 1573 #undef CACHED_MERGE_LIST 1574 #undef CACHED_DEOPTIMIZE_LIST 1575 #undef CACHED_DEOPTIMIZE_IF_LIST 1576 #undef CACHED_DEOPTIMIZE_UNLESS_LIST 1577 #undef CACHED_TRAP_IF_LIST 1578 #undef CACHED_TRAP_UNLESS_LIST 1579 #undef CACHED_PARAMETER_LIST 1580 #undef CACHED_PHI_LIST 1581 #undef CACHED_PROJECTION_LIST 1582 #undef CACHED_STATE_VALUES_LIST