5 #include "src/compiler/js-operator.h" 9 #include "src/base/lazy-instance.h" 10 #include "src/compiler/opcodes.h" 11 #include "src/compiler/operator.h" 12 #include "src/handles-inl.h" 13 #include "src/objects-inl.h" 14 #include "src/vector-slot-pair.h" 20 std::ostream& operator<<(std::ostream& os, CallFrequency f) {
21 if (f.IsUnknown())
return os <<
"unknown";
22 return os << f.value();
25 CallFrequency CallFrequencyOf(Operator
const* op) {
26 DCHECK(op->opcode() == IrOpcode::kJSCallWithArrayLike ||
27 op->opcode() == IrOpcode::kJSConstructWithArrayLike);
28 return OpParameter<CallFrequency>(op);
32 std::ostream& operator<<(std::ostream& os,
33 ConstructForwardVarargsParameters
const& p) {
34 return os << p.arity() <<
", " << p.start_index();
37 ConstructForwardVarargsParameters
const& ConstructForwardVarargsParametersOf(
39 DCHECK_EQ(IrOpcode::kJSConstructForwardVarargs, op->opcode());
40 return OpParameter<ConstructForwardVarargsParameters>(op);
43 bool operator==(ConstructParameters
const& lhs,
44 ConstructParameters
const& rhs) {
45 return lhs.arity() == rhs.arity() && lhs.frequency() == rhs.frequency() &&
46 lhs.feedback() == rhs.feedback();
49 bool operator!=(ConstructParameters
const& lhs,
50 ConstructParameters
const& rhs) {
54 size_t hash_value(ConstructParameters
const& p) {
55 return base::hash_combine(p.arity(), p.frequency(), p.feedback());
58 std::ostream& operator<<(std::ostream& os, ConstructParameters
const& p) {
59 return os << p.arity() <<
", " << p.frequency();
62 ConstructParameters
const& ConstructParametersOf(Operator
const* op) {
63 DCHECK(op->opcode() == IrOpcode::kJSConstruct ||
64 op->opcode() == IrOpcode::kJSConstructWithSpread);
65 return OpParameter<ConstructParameters>(op);
68 std::ostream& operator<<(std::ostream& os, CallParameters
const& p) {
69 return os << p.arity() <<
", " << p.frequency() <<
", " << p.convert_mode();
72 const CallParameters& CallParametersOf(
const Operator* op) {
73 DCHECK(op->opcode() == IrOpcode::kJSCall ||
74 op->opcode() == IrOpcode::kJSCallWithSpread);
75 return OpParameter<CallParameters>(op);
78 std::ostream& operator<<(std::ostream& os,
79 CallForwardVarargsParameters
const& p) {
80 return os << p.arity() <<
", " << p.start_index();
83 CallForwardVarargsParameters
const& CallForwardVarargsParametersOf(
85 DCHECK_EQ(IrOpcode::kJSCallForwardVarargs, op->opcode());
86 return OpParameter<CallForwardVarargsParameters>(op);
90 bool operator==(CallRuntimeParameters
const& lhs,
91 CallRuntimeParameters
const& rhs) {
92 return lhs.id() == rhs.id() && lhs.arity() == rhs.arity();
96 bool operator!=(CallRuntimeParameters
const& lhs,
97 CallRuntimeParameters
const& rhs) {
102 size_t hash_value(CallRuntimeParameters
const& p) {
103 return base::hash_combine(p.id(), p.arity());
107 std::ostream& operator<<(std::ostream& os, CallRuntimeParameters
const& p) {
108 return os << p.id() <<
", " << p.arity();
112 const CallRuntimeParameters& CallRuntimeParametersOf(
const Operator* op) {
113 DCHECK_EQ(IrOpcode::kJSCallRuntime, op->opcode());
114 return OpParameter<CallRuntimeParameters>(op);
118 ContextAccess::ContextAccess(
size_t depth,
size_t index,
bool immutable)
119 : immutable_(immutable),
120 depth_(static_cast<uint16_t>(depth)),
121 index_(static_cast<
uint32_t>(index)) {
122 DCHECK(depth <= std::numeric_limits<uint16_t>::max());
123 DCHECK(index <= std::numeric_limits<uint32_t>::max());
127 bool operator==(ContextAccess
const& lhs, ContextAccess
const& rhs) {
128 return lhs.depth() == rhs.depth() && lhs.index() == rhs.index() &&
129 lhs.immutable() == rhs.immutable();
133 bool operator!=(ContextAccess
const& lhs, ContextAccess
const& rhs) {
134 return !(lhs == rhs);
138 size_t hash_value(ContextAccess
const& access) {
139 return base::hash_combine(access.depth(), access.index(), access.immutable());
143 std::ostream& operator<<(std::ostream& os, ContextAccess
const& access) {
144 return os << access.depth() <<
", " << access.index() <<
", " 145 << access.immutable();
149 ContextAccess
const& ContextAccessOf(Operator
const* op) {
150 DCHECK(op->opcode() == IrOpcode::kJSLoadContext ||
151 op->opcode() == IrOpcode::kJSStoreContext);
152 return OpParameter<ContextAccess>(op);
155 CreateFunctionContextParameters::CreateFunctionContextParameters(
156 Handle<ScopeInfo> scope_info,
int slot_count, ScopeType scope_type)
157 : scope_info_(scope_info),
158 slot_count_(slot_count),
159 scope_type_(scope_type) {}
161 bool operator==(CreateFunctionContextParameters
const& lhs,
162 CreateFunctionContextParameters
const& rhs) {
163 return lhs.scope_info().location() == rhs.scope_info().location() &&
164 lhs.slot_count() == rhs.slot_count() &&
165 lhs.scope_type() == rhs.scope_type();
168 bool operator!=(CreateFunctionContextParameters
const& lhs,
169 CreateFunctionContextParameters
const& rhs) {
170 return !(lhs == rhs);
173 size_t hash_value(CreateFunctionContextParameters
const& parameters) {
174 return base::hash_combine(parameters.scope_info().location(),
175 parameters.slot_count(),
176 static_cast<int>(parameters.scope_type()));
179 std::ostream& operator<<(std::ostream& os,
180 CreateFunctionContextParameters
const& parameters) {
181 return os << parameters.slot_count() <<
", " << parameters.scope_type();
184 CreateFunctionContextParameters
const& CreateFunctionContextParametersOf(
185 Operator
const* op) {
186 DCHECK_EQ(IrOpcode::kJSCreateFunctionContext, op->opcode());
187 return OpParameter<CreateFunctionContextParameters>(op);
190 bool operator==(StoreNamedOwnParameters
const& lhs,
191 StoreNamedOwnParameters
const& rhs) {
192 return lhs.name().location() == rhs.name().location() &&
193 lhs.feedback() == rhs.feedback();
196 bool operator!=(StoreNamedOwnParameters
const& lhs,
197 StoreNamedOwnParameters
const& rhs) {
198 return !(lhs == rhs);
201 size_t hash_value(StoreNamedOwnParameters
const& p) {
202 return base::hash_combine(p.name().location(), p.feedback());
205 std::ostream& operator<<(std::ostream& os, StoreNamedOwnParameters
const& p) {
206 return os << Brief(*p.name());
209 StoreNamedOwnParameters
const& StoreNamedOwnParametersOf(
const Operator* op) {
210 DCHECK_EQ(IrOpcode::kJSStoreNamedOwn, op->opcode());
211 return OpParameter<StoreNamedOwnParameters>(op);
214 bool operator==(FeedbackParameter
const& lhs, FeedbackParameter
const& rhs) {
215 return lhs.feedback() == rhs.feedback();
218 bool operator!=(FeedbackParameter
const& lhs, FeedbackParameter
const& rhs) {
219 return !(lhs == rhs);
222 size_t hash_value(FeedbackParameter
const& p) {
223 return base::hash_combine(p.feedback());
226 std::ostream& operator<<(std::ostream& os, FeedbackParameter
const& p) {
230 FeedbackParameter
const& FeedbackParameterOf(
const Operator* op) {
231 DCHECK(op->opcode() == IrOpcode::kJSCreateEmptyLiteralArray ||
232 op->opcode() == IrOpcode::kJSInstanceOf ||
233 op->opcode() == IrOpcode::kJSStoreDataPropertyInLiteral ||
234 op->opcode() == IrOpcode::kJSStoreInArrayLiteral);
235 return OpParameter<FeedbackParameter>(op);
238 bool operator==(NamedAccess
const& lhs, NamedAccess
const& rhs) {
239 return lhs.name().location() == rhs.name().location() &&
240 lhs.language_mode() == rhs.language_mode() &&
241 lhs.feedback() == rhs.feedback();
245 bool operator!=(NamedAccess
const& lhs, NamedAccess
const& rhs) {
246 return !(lhs == rhs);
250 size_t hash_value(NamedAccess
const& p) {
251 return base::hash_combine(p.name().location(), p.language_mode(),
256 std::ostream& operator<<(std::ostream& os, NamedAccess
const& p) {
257 return os << Brief(*p.name()) <<
", " << p.language_mode();
261 NamedAccess
const& NamedAccessOf(
const Operator* op) {
262 DCHECK(op->opcode() == IrOpcode::kJSLoadNamed ||
263 op->opcode() == IrOpcode::kJSStoreNamed);
264 return OpParameter<NamedAccess>(op);
268 std::ostream& operator<<(std::ostream& os, PropertyAccess
const& p) {
269 return os << p.language_mode() <<
", " << p.feedback();
273 bool operator==(PropertyAccess
const& lhs, PropertyAccess
const& rhs) {
274 return lhs.language_mode() == rhs.language_mode() &&
275 lhs.feedback() == rhs.feedback();
279 bool operator!=(PropertyAccess
const& lhs, PropertyAccess
const& rhs) {
280 return !(lhs == rhs);
284 PropertyAccess
const& PropertyAccessOf(
const Operator* op) {
285 DCHECK(op->opcode() == IrOpcode::kJSLoadProperty ||
286 op->opcode() == IrOpcode::kJSStoreProperty);
287 return OpParameter<PropertyAccess>(op);
291 size_t hash_value(PropertyAccess
const& p) {
292 return base::hash_combine(p.language_mode(), p.feedback());
296 bool operator==(LoadGlobalParameters
const& lhs,
297 LoadGlobalParameters
const& rhs) {
298 return lhs.name().location() == rhs.name().location() &&
299 lhs.feedback() == rhs.feedback() &&
300 lhs.typeof_mode() == rhs.typeof_mode();
304 bool operator!=(LoadGlobalParameters
const& lhs,
305 LoadGlobalParameters
const& rhs) {
306 return !(lhs == rhs);
310 size_t hash_value(LoadGlobalParameters
const& p) {
311 return base::hash_combine(p.name().location(), p.typeof_mode());
315 std::ostream& operator<<(std::ostream& os, LoadGlobalParameters
const& p) {
316 return os << Brief(*p.name()) <<
", " << p.typeof_mode();
320 const LoadGlobalParameters& LoadGlobalParametersOf(
const Operator* op) {
321 DCHECK_EQ(IrOpcode::kJSLoadGlobal, op->opcode());
322 return OpParameter<LoadGlobalParameters>(op);
326 bool operator==(StoreGlobalParameters
const& lhs,
327 StoreGlobalParameters
const& rhs) {
328 return lhs.language_mode() == rhs.language_mode() &&
329 lhs.name().location() == rhs.name().location() &&
330 lhs.feedback() == rhs.feedback();
334 bool operator!=(StoreGlobalParameters
const& lhs,
335 StoreGlobalParameters
const& rhs) {
336 return !(lhs == rhs);
340 size_t hash_value(StoreGlobalParameters
const& p) {
341 return base::hash_combine(p.language_mode(), p.name().location(),
346 std::ostream& operator<<(std::ostream& os, StoreGlobalParameters
const& p) {
347 return os << p.language_mode() <<
", " << Brief(*p.name());
351 const StoreGlobalParameters& StoreGlobalParametersOf(
const Operator* op) {
352 DCHECK_EQ(IrOpcode::kJSStoreGlobal, op->opcode());
353 return OpParameter<StoreGlobalParameters>(op);
357 CreateArgumentsType
const& CreateArgumentsTypeOf(
const Operator* op) {
358 DCHECK_EQ(IrOpcode::kJSCreateArguments, op->opcode());
359 return OpParameter<CreateArgumentsType>(op);
363 bool operator==(CreateArrayParameters
const& lhs,
364 CreateArrayParameters
const& rhs) {
365 return lhs.arity() == rhs.arity() &&
366 lhs.site().address() == rhs.site().address();
370 bool operator!=(CreateArrayParameters
const& lhs,
371 CreateArrayParameters
const& rhs) {
372 return !(lhs == rhs);
376 size_t hash_value(CreateArrayParameters
const& p) {
377 return base::hash_combine(p.arity(), p.site().address());
381 std::ostream& operator<<(std::ostream& os, CreateArrayParameters
const& p) {
383 Handle<AllocationSite> site;
384 if (p.site().ToHandle(&site)) os <<
", " << Brief(*site);
388 const CreateArrayParameters& CreateArrayParametersOf(
const Operator* op) {
389 DCHECK_EQ(IrOpcode::kJSCreateArray, op->opcode());
390 return OpParameter<CreateArrayParameters>(op);
393 bool operator==(CreateArrayIteratorParameters
const& lhs,
394 CreateArrayIteratorParameters
const& rhs) {
395 return lhs.kind() == rhs.kind();
398 bool operator!=(CreateArrayIteratorParameters
const& lhs,
399 CreateArrayIteratorParameters
const& rhs) {
400 return !(lhs == rhs);
403 size_t hash_value(CreateArrayIteratorParameters
const& p) {
404 return static_cast<size_t>(p.kind());
407 std::ostream& operator<<(std::ostream& os,
408 CreateArrayIteratorParameters
const& p) {
409 return os << p.kind();
412 const CreateArrayIteratorParameters& CreateArrayIteratorParametersOf(
413 const Operator* op) {
414 DCHECK_EQ(IrOpcode::kJSCreateArrayIterator, op->opcode());
415 return OpParameter<CreateArrayIteratorParameters>(op);
418 bool operator==(CreateCollectionIteratorParameters
const& lhs,
419 CreateCollectionIteratorParameters
const& rhs) {
420 return lhs.collection_kind() == rhs.collection_kind() &&
421 lhs.iteration_kind() == rhs.iteration_kind();
424 bool operator!=(CreateCollectionIteratorParameters
const& lhs,
425 CreateCollectionIteratorParameters
const& rhs) {
426 return !(lhs == rhs);
429 size_t hash_value(CreateCollectionIteratorParameters
const& p) {
430 return base::hash_combine(static_cast<size_t>(p.collection_kind()),
431 static_cast<size_t>(p.iteration_kind()));
434 std::ostream& operator<<(std::ostream& os,
435 CreateCollectionIteratorParameters
const& p) {
436 return os << p.collection_kind() <<
" " << p.iteration_kind();
439 const CreateCollectionIteratorParameters& CreateCollectionIteratorParametersOf(
440 const Operator* op) {
441 DCHECK_EQ(IrOpcode::kJSCreateCollectionIterator, op->opcode());
442 return OpParameter<CreateCollectionIteratorParameters>(op);
445 bool operator==(CreateBoundFunctionParameters
const& lhs,
446 CreateBoundFunctionParameters
const& rhs) {
447 return lhs.arity() == rhs.arity() &&
448 lhs.map().location() == rhs.map().location();
451 bool operator!=(CreateBoundFunctionParameters
const& lhs,
452 CreateBoundFunctionParameters
const& rhs) {
453 return !(lhs == rhs);
456 size_t hash_value(CreateBoundFunctionParameters
const& p) {
457 return base::hash_combine(p.arity(), p.map().location());
460 std::ostream& operator<<(std::ostream& os,
461 CreateBoundFunctionParameters
const& p) {
463 if (!p.map().is_null()) os <<
", " << Brief(*p.map());
467 const CreateBoundFunctionParameters& CreateBoundFunctionParametersOf(
468 const Operator* op) {
469 DCHECK_EQ(IrOpcode::kJSCreateBoundFunction, op->opcode());
470 return OpParameter<CreateBoundFunctionParameters>(op);
473 bool operator==(CreateClosureParameters
const& lhs,
474 CreateClosureParameters
const& rhs) {
475 return lhs.pretenure() == rhs.pretenure() &&
476 lhs.code().location() == rhs.code().location() &&
477 lhs.feedback_cell().location() == rhs.feedback_cell().location() &&
478 lhs.shared_info().location() == rhs.shared_info().location();
482 bool operator!=(CreateClosureParameters
const& lhs,
483 CreateClosureParameters
const& rhs) {
484 return !(lhs == rhs);
488 size_t hash_value(CreateClosureParameters
const& p) {
489 return base::hash_combine(p.pretenure(), p.shared_info().location(),
490 p.feedback_cell().location());
494 std::ostream& operator<<(std::ostream& os, CreateClosureParameters
const& p) {
495 return os << p.pretenure() <<
", " << Brief(*p.shared_info()) <<
", " 496 << Brief(*p.feedback_cell()) <<
", " << Brief(*p.code());
500 const CreateClosureParameters& CreateClosureParametersOf(
const Operator* op) {
501 DCHECK_EQ(IrOpcode::kJSCreateClosure, op->opcode());
502 return OpParameter<CreateClosureParameters>(op);
506 bool operator==(CreateLiteralParameters
const& lhs,
507 CreateLiteralParameters
const& rhs) {
508 return lhs.constant().location() == rhs.constant().location() &&
509 lhs.feedback() == rhs.feedback() && lhs.length() == rhs.length() &&
510 lhs.flags() == rhs.flags();
514 bool operator!=(CreateLiteralParameters
const& lhs,
515 CreateLiteralParameters
const& rhs) {
516 return !(lhs == rhs);
520 size_t hash_value(CreateLiteralParameters
const& p) {
521 return base::hash_combine(p.constant().location(), p.feedback(), p.length(),
526 std::ostream& operator<<(std::ostream& os, CreateLiteralParameters
const& p) {
527 return os << Brief(*p.constant()) <<
", " << p.length() <<
", " << p.flags();
531 const CreateLiteralParameters& CreateLiteralParametersOf(
const Operator* op) {
532 DCHECK(op->opcode() == IrOpcode::kJSCreateLiteralArray ||
533 op->opcode() == IrOpcode::kJSCreateLiteralObject ||
534 op->opcode() == IrOpcode::kJSCreateLiteralRegExp);
535 return OpParameter<CreateLiteralParameters>(op);
538 bool operator==(CloneObjectParameters
const& lhs,
539 CloneObjectParameters
const& rhs) {
540 return lhs.feedback() == rhs.feedback() && lhs.flags() == rhs.flags();
543 bool operator!=(CloneObjectParameters
const& lhs,
544 CloneObjectParameters
const& rhs) {
545 return !(lhs == rhs);
548 size_t hash_value(CloneObjectParameters
const& p) {
549 return base::hash_combine(p.feedback(), p.flags());
552 std::ostream& operator<<(std::ostream& os, CloneObjectParameters
const& p) {
553 return os << p.flags();
556 const CloneObjectParameters& CloneObjectParametersOf(
const Operator* op) {
557 DCHECK(op->opcode() == IrOpcode::kJSCloneObject);
558 return OpParameter<CloneObjectParameters>(op);
561 size_t hash_value(ForInMode mode) {
return static_cast<uint8_t
>(mode); }
563 std::ostream& operator<<(std::ostream& os, ForInMode mode) {
565 case ForInMode::kUseEnumCacheKeysAndIndices:
566 return os <<
"UseEnumCacheKeysAndIndices";
567 case ForInMode::kUseEnumCacheKeys:
568 return os <<
"UseEnumCacheKeys";
569 case ForInMode::kGeneric:
570 return os <<
"Generic";
575 ForInMode ForInModeOf(Operator
const* op) {
576 DCHECK(op->opcode() == IrOpcode::kJSForInNext ||
577 op->opcode() == IrOpcode::kJSForInPrepare);
578 return OpParameter<ForInMode>(op);
581 BinaryOperationHint BinaryOperationHintOf(
const Operator* op) {
582 DCHECK_EQ(IrOpcode::kJSAdd, op->opcode());
583 return OpParameter<BinaryOperationHint>(op);
586 CompareOperationHint CompareOperationHintOf(
const Operator* op) {
587 DCHECK(op->opcode() == IrOpcode::kJSEqual ||
588 op->opcode() == IrOpcode::kJSStrictEqual ||
589 op->opcode() == IrOpcode::kJSLessThan ||
590 op->opcode() == IrOpcode::kJSGreaterThan ||
591 op->opcode() == IrOpcode::kJSLessThanOrEqual ||
592 op->opcode() == IrOpcode::kJSGreaterThanOrEqual);
593 return OpParameter<CompareOperationHint>(op);
596 #define CACHED_OP_LIST(V) \ 597 V(BitwiseOr, Operator::kNoProperties, 2, 1) \ 598 V(BitwiseXor, Operator::kNoProperties, 2, 1) \ 599 V(BitwiseAnd, Operator::kNoProperties, 2, 1) \ 600 V(ShiftLeft, Operator::kNoProperties, 2, 1) \ 601 V(ShiftRight, Operator::kNoProperties, 2, 1) \ 602 V(ShiftRightLogical, Operator::kNoProperties, 2, 1) \ 603 V(Subtract, Operator::kNoProperties, 2, 1) \ 604 V(Multiply, Operator::kNoProperties, 2, 1) \ 605 V(Divide, Operator::kNoProperties, 2, 1) \ 606 V(Modulus, Operator::kNoProperties, 2, 1) \ 607 V(Exponentiate, Operator::kNoProperties, 2, 1) \ 608 V(BitwiseNot, Operator::kNoProperties, 1, 1) \ 609 V(Decrement, Operator::kNoProperties, 1, 1) \ 610 V(Increment, Operator::kNoProperties, 1, 1) \ 611 V(Negate, Operator::kNoProperties, 1, 1) \ 612 V(ToLength, Operator::kNoProperties, 1, 1) \ 613 V(ToName, Operator::kNoProperties, 1, 1) \ 614 V(ToNumber, Operator::kNoProperties, 1, 1) \ 615 V(ToNumberConvertBigInt, Operator::kNoProperties, 1, 1) \ 616 V(ToNumeric, Operator::kNoProperties, 1, 1) \ 617 V(ToObject, Operator::kFoldable, 1, 1) \ 618 V(ToString, Operator::kNoProperties, 1, 1) \ 619 V(Create, Operator::kNoProperties, 2, 1) \ 620 V(CreateIterResultObject, Operator::kEliminatable, 2, 1) \ 621 V(CreateStringIterator, Operator::kEliminatable, 1, 1) \ 622 V(CreateKeyValueArray, Operator::kEliminatable, 2, 1) \ 623 V(CreatePromise, Operator::kEliminatable, 0, 1) \ 624 V(CreateTypedArray, Operator::kNoProperties, 5, 1) \ 625 V(CreateObject, Operator::kNoProperties, 1, 1) \ 626 V(ObjectIsArray, Operator::kNoProperties, 1, 1) \ 627 V(HasProperty, Operator::kNoProperties, 2, 1) \ 628 V(HasInPrototypeChain, Operator::kNoProperties, 2, 1) \ 629 V(OrdinaryHasInstance, Operator::kNoProperties, 2, 1) \ 630 V(ForInEnumerate, Operator::kNoProperties, 1, 1) \ 631 V(AsyncFunctionEnter, Operator::kNoProperties, 2, 1) \ 632 V(AsyncFunctionReject, Operator::kNoDeopt | Operator::kNoThrow, 3, 1) \ 633 V(AsyncFunctionResolve, Operator::kNoDeopt | Operator::kNoThrow, 3, 1) \ 634 V(LoadMessage, Operator::kNoThrow | Operator::kNoWrite, 0, 1) \ 635 V(StoreMessage, Operator::kNoRead | Operator::kNoThrow, 1, 0) \ 636 V(GeneratorRestoreContinuation, Operator::kNoThrow, 1, 1) \ 637 V(GeneratorRestoreContext, Operator::kNoThrow, 1, 1) \ 638 V(GeneratorRestoreInputOrDebugPos, Operator::kNoThrow, 1, 1) \ 639 V(StackCheck, Operator::kNoWrite, 0, 0) \ 640 V(Debugger, Operator::kNoProperties, 0, 0) \ 641 V(FulfillPromise, Operator::kNoDeopt | Operator::kNoThrow, 2, 1) \ 642 V(PerformPromiseThen, Operator::kNoDeopt | Operator::kNoThrow, 4, 1) \ 643 V(PromiseResolve, Operator::kNoProperties, 2, 1) \ 644 V(RejectPromise, Operator::kNoDeopt | Operator::kNoThrow, 3, 1) \ 645 V(ResolvePromise, Operator::kNoDeopt | Operator::kNoThrow, 2, 1) \ 646 V(GetSuperConstructor, Operator::kNoWrite, 1, 1) \ 647 V(ParseInt, Operator::kNoProperties, 2, 1) \ 648 V(RegExpTest, Operator::kNoProperties, 2, 1) 650 #define BINARY_OP_LIST(V) V(Add) 652 #define COMPARE_OP_LIST(V) \ 653 V(Equal, Operator::kNoProperties) \ 654 V(StrictEqual, Operator::kPure) \ 655 V(LessThan, Operator::kNoProperties) \ 656 V(GreaterThan, Operator::kNoProperties) \ 657 V(LessThanOrEqual, Operator::kNoProperties) \ 658 V(GreaterThanOrEqual, Operator::kNoProperties) 661 #define CACHED_OP(Name, properties, value_input_count, value_output_count) \ 662 struct Name##Operator final : public Operator { \ 664 : Operator(IrOpcode::kJS##Name, properties, "JS" #Name, \ 665 value_input_count, Operator::ZeroIfPure(properties), \ 666 Operator::ZeroIfEliminatable(properties), \ 667 value_output_count, Operator::ZeroIfPure(properties), \ 668 Operator::ZeroIfNoThrow(properties)) {} \ 670 Name##Operator k##Name##Operator; 671 CACHED_OP_LIST(CACHED_OP)
674 #define BINARY_OP(Name) \ 675 template <BinaryOperationHint kHint> \ 676 struct Name##Operator final : public Operator1<BinaryOperationHint> { \ 678 : Operator1<BinaryOperationHint>(IrOpcode::kJS##Name, \ 679 Operator::kNoProperties, "JS" #Name, \ 680 2, 1, 1, 1, 1, 2, kHint) {} \ 682 Name##Operator<BinaryOperationHint::kNone> k##Name##NoneOperator; \ 683 Name##Operator<BinaryOperationHint::kSignedSmall> \ 684 k##Name##SignedSmallOperator; \ 685 Name##Operator<BinaryOperationHint::kSignedSmallInputs> \ 686 k##Name##SignedSmallInputsOperator; \ 687 Name##Operator<BinaryOperationHint::kSigned32> k##Name##Signed32Operator; \ 688 Name##Operator<BinaryOperationHint::kNumber> k##Name##NumberOperator; \ 689 Name##Operator<BinaryOperationHint::kNumberOrOddball> \ 690 k##Name##NumberOrOddballOperator; \ 691 Name##Operator<BinaryOperationHint::kString> k##Name##StringOperator; \ 692 Name##Operator<BinaryOperationHint::kBigInt> k##Name##BigIntOperator; \ 693 Name##Operator<BinaryOperationHint::kAny> k##Name##AnyOperator; 694 BINARY_OP_LIST(BINARY_OP)
697 #define COMPARE_OP(Name, properties) \ 698 template <CompareOperationHint kHint> \ 699 struct Name##Operator final : public Operator1<CompareOperationHint> { \ 701 : Operator1<CompareOperationHint>( \ 702 IrOpcode::kJS##Name, properties, "JS" #Name, 2, 1, 1, 1, 1, \ 703 Operator::ZeroIfNoThrow(properties), kHint) {} \ 705 Name##Operator<CompareOperationHint::kNone> k##Name##NoneOperator; \ 706 Name##Operator<CompareOperationHint::kSignedSmall> \ 707 k##Name##SignedSmallOperator; \ 708 Name##Operator<CompareOperationHint::kNumber> k##Name##NumberOperator; \ 709 Name##Operator<CompareOperationHint::kNumberOrOddball> \ 710 k##Name##NumberOrOddballOperator; \ 711 Name##Operator<CompareOperationHint::kInternalizedString> \ 712 k##Name##InternalizedStringOperator; \ 713 Name##Operator<CompareOperationHint::kString> k##Name##StringOperator; \ 714 Name##Operator<CompareOperationHint::kSymbol> k##Name##SymbolOperator; \ 715 Name##Operator<CompareOperationHint::kBigInt> k##Name##BigIntOperator; \ 716 Name##Operator<CompareOperationHint::kReceiver> k##Name##ReceiverOperator; \ 717 Name##Operator<CompareOperationHint::kReceiverOrNullOrUndefined> \ 718 k##Name##ReceiverOrNullOrUndefinedOperator; \ 719 Name##Operator<CompareOperationHint::kAny> k##Name##AnyOperator; 720 COMPARE_OP_LIST(COMPARE_OP)
725 LAZY_INSTANCE_INITIALIZER;
727 JSOperatorBuilder::JSOperatorBuilder(
Zone* zone)
728 : cache_(kJSOperatorGlobalCache.Get()), zone_(zone) {}
730 #define CACHED_OP(Name, properties, value_input_count, value_output_count) \ 731 const Operator* JSOperatorBuilder::Name() { \ 732 return &cache_.k##Name##Operator; \ 734 CACHED_OP_LIST(CACHED_OP)
737 #define BINARY_OP(Name) \ 738 const Operator* JSOperatorBuilder::Name(BinaryOperationHint hint) { \ 740 case BinaryOperationHint::kNone: \ 741 return &cache_.k##Name##NoneOperator; \ 742 case BinaryOperationHint::kSignedSmall: \ 743 return &cache_.k##Name##SignedSmallOperator; \ 744 case BinaryOperationHint::kSignedSmallInputs: \ 745 return &cache_.k##Name##SignedSmallInputsOperator; \ 746 case BinaryOperationHint::kSigned32: \ 747 return &cache_.k##Name##Signed32Operator; \ 748 case BinaryOperationHint::kNumber: \ 749 return &cache_.k##Name##NumberOperator; \ 750 case BinaryOperationHint::kNumberOrOddball: \ 751 return &cache_.k##Name##NumberOrOddballOperator; \ 752 case BinaryOperationHint::kString: \ 753 return &cache_.k##Name##StringOperator; \ 754 case BinaryOperationHint::kBigInt: \ 755 return &cache_.k##Name##BigIntOperator; \ 756 case BinaryOperationHint::kAny: \ 757 return &cache_.k##Name##AnyOperator; \ 762 BINARY_OP_LIST(BINARY_OP)
765 #define COMPARE_OP(Name, ...) \ 766 const Operator* JSOperatorBuilder::Name(CompareOperationHint hint) { \ 768 case CompareOperationHint::kNone: \ 769 return &cache_.k##Name##NoneOperator; \ 770 case CompareOperationHint::kSignedSmall: \ 771 return &cache_.k##Name##SignedSmallOperator; \ 772 case CompareOperationHint::kNumber: \ 773 return &cache_.k##Name##NumberOperator; \ 774 case CompareOperationHint::kNumberOrOddball: \ 775 return &cache_.k##Name##NumberOrOddballOperator; \ 776 case CompareOperationHint::kInternalizedString: \ 777 return &cache_.k##Name##InternalizedStringOperator; \ 778 case CompareOperationHint::kString: \ 779 return &cache_.k##Name##StringOperator; \ 780 case CompareOperationHint::kSymbol: \ 781 return &cache_.k##Name##SymbolOperator; \ 782 case CompareOperationHint::kBigInt: \ 783 return &cache_.k##Name##BigIntOperator; \ 784 case CompareOperationHint::kReceiver: \ 785 return &cache_.k##Name##ReceiverOperator; \ 786 case CompareOperationHint::kReceiverOrNullOrUndefined: \ 787 return &cache_.k##Name##ReceiverOrNullOrUndefinedOperator; \ 788 case CompareOperationHint::kAny: \ 789 return &cache_.k##Name##AnyOperator; \ 794 COMPARE_OP_LIST(COMPARE_OP)
797 const Operator* JSOperatorBuilder::StoreDataPropertyInLiteral(
799 FeedbackParameter parameters(feedback);
800 return new (zone()) Operator1<FeedbackParameter>(
801 IrOpcode::kJSStoreDataPropertyInLiteral,
803 "JSStoreDataPropertyInLiteral",
808 const Operator* JSOperatorBuilder::StoreInArrayLiteral(
809 const VectorSlotPair& feedback) {
810 FeedbackParameter parameters(feedback);
811 return new (zone()) Operator1<FeedbackParameter>(
812 IrOpcode::kJSStoreInArrayLiteral,
814 "JSStoreInArrayLiteral",
819 const Operator* JSOperatorBuilder::CallForwardVarargs(
size_t arity,
821 CallForwardVarargsParameters parameters(arity, start_index);
822 return new (zone()) Operator1<CallForwardVarargsParameters>(
823 IrOpcode::kJSCallForwardVarargs, Operator::kNoProperties,
824 "JSCallForwardVarargs",
825 parameters.arity(), 1, 1, 1, 1, 2,
829 const Operator* JSOperatorBuilder::Call(
size_t arity,
830 CallFrequency
const& frequency,
831 VectorSlotPair
const& feedback,
832 ConvertReceiverMode convert_mode,
833 SpeculationMode speculation_mode) {
834 DCHECK_IMPLIES(speculation_mode == SpeculationMode::kAllowSpeculation,
836 CallParameters parameters(arity, frequency, feedback, convert_mode,
838 return new (zone()) Operator1<CallParameters>(
839 IrOpcode::kJSCall, Operator::kNoProperties,
841 parameters.arity(), 1, 1, 1, 1, 2,
845 const Operator* JSOperatorBuilder::CallWithArrayLike(CallFrequency frequency) {
846 return new (zone()) Operator1<CallFrequency>(
847 IrOpcode::kJSCallWithArrayLike, Operator::kNoProperties,
848 "JSCallWithArrayLike",
853 const Operator* JSOperatorBuilder::CallWithSpread(
854 uint32_t arity, CallFrequency
const& frequency,
855 VectorSlotPair
const& feedback, SpeculationMode speculation_mode) {
856 DCHECK_IMPLIES(speculation_mode == SpeculationMode::kAllowSpeculation,
858 CallParameters parameters(arity, frequency, feedback,
859 ConvertReceiverMode::kAny, speculation_mode);
860 return new (zone()) Operator1<CallParameters>(
861 IrOpcode::kJSCallWithSpread, Operator::kNoProperties,
863 parameters.arity(), 1, 1, 1, 1, 2,
867 const Operator* JSOperatorBuilder::CallRuntime(Runtime::FunctionId
id) {
868 const Runtime::Function* f = Runtime::FunctionForId(
id);
869 return CallRuntime(f, f->nargs);
873 const Operator* JSOperatorBuilder::CallRuntime(Runtime::FunctionId
id,
875 const Runtime::Function* f = Runtime::FunctionForId(
id);
876 return CallRuntime(f, arity);
880 const Operator* JSOperatorBuilder::CallRuntime(
const Runtime::Function* f,
882 CallRuntimeParameters parameters(f->function_id, arity);
883 DCHECK(f->nargs == -1 || f->nargs == static_cast<int>(parameters.arity()));
884 return new (zone()) Operator1<CallRuntimeParameters>(
885 IrOpcode::kJSCallRuntime, Operator::kNoProperties,
887 parameters.arity(), 1, 1, f->result_size, 1, 2,
891 const Operator* JSOperatorBuilder::ConstructForwardVarargs(
892 size_t arity,
uint32_t start_index) {
893 ConstructForwardVarargsParameters parameters(arity, start_index);
894 return new (zone()) Operator1<ConstructForwardVarargsParameters>(
895 IrOpcode::kJSConstructForwardVarargs, Operator::kNoProperties,
896 "JSConstructForwardVarargs",
897 parameters.arity(), 1, 1, 1, 1, 2,
901 const Operator* JSOperatorBuilder::Construct(
uint32_t arity,
902 CallFrequency frequency,
903 VectorSlotPair
const& feedback) {
904 ConstructParameters parameters(arity, frequency, feedback);
905 return new (zone()) Operator1<ConstructParameters>(
906 IrOpcode::kJSConstruct, Operator::kNoProperties,
908 parameters.arity(), 1, 1, 1, 1, 2,
912 const Operator* JSOperatorBuilder::ConstructWithArrayLike(
913 CallFrequency frequency) {
914 return new (zone()) Operator1<CallFrequency>(
915 IrOpcode::kJSConstructWithArrayLike,
916 Operator::kNoProperties,
917 "JSConstructWithArrayLike",
922 const Operator* JSOperatorBuilder::ConstructWithSpread(
923 uint32_t arity, CallFrequency frequency, VectorSlotPair
const& feedback) {
924 ConstructParameters parameters(arity, frequency, feedback);
925 return new (zone()) Operator1<ConstructParameters>(
926 IrOpcode::kJSConstructWithSpread, Operator::kNoProperties,
927 "JSConstructWithSpread",
928 parameters.arity(), 1, 1, 1, 1, 2,
932 const Operator* JSOperatorBuilder::LoadNamed(Handle<Name> name,
933 const VectorSlotPair& feedback) {
934 NamedAccess access(LanguageMode::kSloppy, name, feedback);
935 return new (zone()) Operator1<NamedAccess>(
936 IrOpcode::kJSLoadNamed, Operator::kNoProperties,
942 const Operator* JSOperatorBuilder::LoadProperty(
943 VectorSlotPair
const& feedback) {
944 PropertyAccess access(LanguageMode::kSloppy, feedback);
945 return new (zone()) Operator1<PropertyAccess>(
946 IrOpcode::kJSLoadProperty, Operator::kNoProperties,
952 const Operator* JSOperatorBuilder::InstanceOf(VectorSlotPair
const& feedback) {
953 FeedbackParameter parameter(feedback);
954 return new (zone()) Operator1<FeedbackParameter>(
955 IrOpcode::kJSInstanceOf, Operator::kNoProperties,
961 const Operator* JSOperatorBuilder::ForInNext(ForInMode mode) {
962 return new (zone()) Operator1<ForInMode>(
963 IrOpcode::kJSForInNext, Operator::kNoProperties,
969 const Operator* JSOperatorBuilder::ForInPrepare(ForInMode mode) {
970 return new (zone()) Operator1<ForInMode>(
971 IrOpcode::kJSForInPrepare,
972 Operator::kNoWrite | Operator::kNoThrow,
978 const Operator* JSOperatorBuilder::GeneratorStore(
int register_count) {
979 return new (zone()) Operator1<int>(
980 IrOpcode::kJSGeneratorStore, Operator::kNoThrow,
982 3 + register_count, 1, 1, 0, 1, 0,
986 int RegisterCountOf(Operator
const* op) {
987 DCHECK_EQ(IrOpcode::kJSCreateAsyncFunctionObject, op->opcode());
988 return OpParameter<int>(op);
991 int GeneratorStoreValueCountOf(
const Operator* op) {
992 DCHECK_EQ(IrOpcode::kJSGeneratorStore, op->opcode());
993 return OpParameter<int>(op);
996 const Operator* JSOperatorBuilder::GeneratorRestoreRegister(
int index) {
997 return new (zone()) Operator1<int>(
998 IrOpcode::kJSGeneratorRestoreRegister, Operator::kNoThrow,
999 "JSGeneratorRestoreRegister",
1004 int RestoreRegisterIndexOf(
const Operator* op) {
1005 DCHECK_EQ(IrOpcode::kJSGeneratorRestoreRegister, op->opcode());
1006 return OpParameter<int>(op);
1009 const Operator* JSOperatorBuilder::StoreNamed(LanguageMode language_mode,
1011 VectorSlotPair
const& feedback) {
1012 NamedAccess access(language_mode, name, feedback);
1013 return new (zone()) Operator1<NamedAccess>(
1014 IrOpcode::kJSStoreNamed, Operator::kNoProperties,
1021 const Operator* JSOperatorBuilder::StoreProperty(
1022 LanguageMode language_mode, VectorSlotPair
const& feedback) {
1023 PropertyAccess access(language_mode, feedback);
1024 return new (zone()) Operator1<PropertyAccess>(
1025 IrOpcode::kJSStoreProperty, Operator::kNoProperties,
1031 const Operator* JSOperatorBuilder::StoreNamedOwn(
1032 Handle<Name> name, VectorSlotPair
const& feedback) {
1033 StoreNamedOwnParameters parameters(name, feedback);
1034 return new (zone()) Operator1<StoreNamedOwnParameters>(
1035 IrOpcode::kJSStoreNamedOwn, Operator::kNoProperties,
1041 const Operator* JSOperatorBuilder::DeleteProperty() {
1042 return new (zone()) Operator(
1043 IrOpcode::kJSDeleteProperty, Operator::kNoProperties,
1048 const Operator* JSOperatorBuilder::CreateGeneratorObject() {
1049 return new (zone()) Operator(
1050 IrOpcode::kJSCreateGeneratorObject, Operator::kEliminatable,
1051 "JSCreateGeneratorObject",
1055 const Operator* JSOperatorBuilder::LoadGlobal(
const Handle<Name>& name,
1056 const VectorSlotPair& feedback,
1057 TypeofMode typeof_mode) {
1058 LoadGlobalParameters parameters(name, feedback, typeof_mode);
1059 return new (zone()) Operator1<LoadGlobalParameters>(
1060 IrOpcode::kJSLoadGlobal, Operator::kNoProperties,
1067 const Operator* JSOperatorBuilder::StoreGlobal(LanguageMode language_mode,
1068 const Handle<Name>& name,
1069 const VectorSlotPair& feedback) {
1070 StoreGlobalParameters parameters(language_mode, feedback, name);
1071 return new (zone()) Operator1<StoreGlobalParameters>(
1072 IrOpcode::kJSStoreGlobal, Operator::kNoProperties,
1079 const Operator* JSOperatorBuilder::LoadContext(
size_t depth,
size_t index,
1081 ContextAccess access(depth, index, immutable);
1082 return new (zone()) Operator1<ContextAccess>(
1083 IrOpcode::kJSLoadContext,
1084 Operator::kNoWrite | Operator::kNoThrow,
1091 const Operator* JSOperatorBuilder::StoreContext(
size_t depth,
size_t index) {
1092 ContextAccess access(depth, index,
false);
1093 return new (zone()) Operator1<ContextAccess>(
1094 IrOpcode::kJSStoreContext,
1095 Operator::kNoRead | Operator::kNoThrow,
1101 const Operator* JSOperatorBuilder::LoadModule(int32_t cell_index) {
1102 return new (zone()) Operator1<int32_t>(
1103 IrOpcode::kJSLoadModule,
1104 Operator::kNoWrite | Operator::kNoThrow,
1110 const Operator* JSOperatorBuilder::StoreModule(int32_t cell_index) {
1111 return new (zone()) Operator1<int32_t>(
1112 IrOpcode::kJSStoreModule,
1113 Operator::kNoRead | Operator::kNoThrow,
1119 const Operator* JSOperatorBuilder::CreateArguments(CreateArgumentsType type) {
1120 return new (zone()) Operator1<CreateArgumentsType>(
1121 IrOpcode::kJSCreateArguments, Operator::kEliminatable,
1122 "JSCreateArguments",
1127 const Operator* JSOperatorBuilder::CreateArray(
1128 size_t arity, MaybeHandle<AllocationSite> site) {
1130 int const value_input_count =
static_cast<int>(arity) + 2;
1131 CreateArrayParameters parameters(arity, site);
1132 return new (zone()) Operator1<CreateArrayParameters>(
1133 IrOpcode::kJSCreateArray, Operator::kNoProperties,
1135 value_input_count, 1, 1, 1, 1, 2,
1139 const Operator* JSOperatorBuilder::CreateArrayIterator(IterationKind kind) {
1140 CreateArrayIteratorParameters parameters(kind);
1141 return new (zone()) Operator1<CreateArrayIteratorParameters>(
1142 IrOpcode::kJSCreateArrayIterator, Operator::kEliminatable,
1143 "JSCreateArrayIterator",
1148 const Operator* JSOperatorBuilder::CreateAsyncFunctionObject(
1149 int register_count) {
1150 return new (zone()) Operator1<int>(
1151 IrOpcode::kJSCreateAsyncFunctionObject,
1152 Operator::kEliminatable,
1153 "JSCreateAsyncFunctionObject",
1158 const Operator* JSOperatorBuilder::CreateCollectionIterator(
1159 CollectionKind collection_kind, IterationKind iteration_kind) {
1160 CreateCollectionIteratorParameters parameters(collection_kind,
1162 return new (zone()) Operator1<CreateCollectionIteratorParameters>(
1163 IrOpcode::kJSCreateCollectionIterator, Operator::kEliminatable,
1164 "JSCreateCollectionIterator", 1, 1, 1, 1, 1, 0, parameters);
1167 const Operator* JSOperatorBuilder::CreateBoundFunction(
size_t arity,
1170 int const value_input_count =
static_cast<int>(arity) + 2;
1171 CreateBoundFunctionParameters parameters(arity, map);
1172 return new (zone()) Operator1<CreateBoundFunctionParameters>(
1173 IrOpcode::kJSCreateBoundFunction, Operator::kEliminatable,
1174 "JSCreateBoundFunction",
1175 value_input_count, 1, 1, 1, 1, 0,
1179 const Operator* JSOperatorBuilder::CreateClosure(
1180 Handle<SharedFunctionInfo> shared_info, Handle<FeedbackCell> feedback_cell,
1181 Handle<Code> code, PretenureFlag pretenure) {
1182 CreateClosureParameters parameters(shared_info, feedback_cell, code,
1184 return new (zone()) Operator1<CreateClosureParameters>(
1185 IrOpcode::kJSCreateClosure, Operator::kEliminatable,
1191 const Operator* JSOperatorBuilder::CreateLiteralArray(
1192 Handle<ArrayBoilerplateDescription> description,
1193 VectorSlotPair
const& feedback,
int literal_flags,
int number_of_elements) {
1194 CreateLiteralParameters parameters(description, feedback, number_of_elements,
1196 return new (zone()) Operator1<CreateLiteralParameters>(
1197 IrOpcode::kJSCreateLiteralArray,
1198 Operator::kNoProperties,
1199 "JSCreateLiteralArray",
1204 const Operator* JSOperatorBuilder::CreateEmptyLiteralArray(
1205 VectorSlotPair
const& feedback) {
1206 FeedbackParameter parameters(feedback);
1207 return new (zone()) Operator1<FeedbackParameter>(
1208 IrOpcode::kJSCreateEmptyLiteralArray,
1209 Operator::kEliminatable,
1210 "JSCreateEmptyLiteralArray",
1215 const Operator* JSOperatorBuilder::CreateArrayFromIterable() {
1216 return new (zone()) Operator(
1217 IrOpcode::kJSCreateArrayFromIterable,
1218 Operator::kNoProperties,
1219 "JSCreateArrayFromIterable",
1223 const Operator* JSOperatorBuilder::CreateLiteralObject(
1224 Handle<ObjectBoilerplateDescription> constant_properties,
1225 VectorSlotPair
const& feedback,
int literal_flags,
1226 int number_of_properties) {
1227 CreateLiteralParameters parameters(constant_properties, feedback,
1228 number_of_properties, literal_flags);
1229 return new (zone()) Operator1<CreateLiteralParameters>(
1230 IrOpcode::kJSCreateLiteralObject,
1231 Operator::kNoProperties,
1232 "JSCreateLiteralObject",
1237 const Operator* JSOperatorBuilder::CloneObject(VectorSlotPair
const& feedback,
1238 int literal_flags) {
1239 CloneObjectParameters parameters(feedback, literal_flags);
1240 return new (zone()) Operator1<CloneObjectParameters>(
1241 IrOpcode::kJSCloneObject,
1242 Operator::kNoProperties,
1248 const Operator* JSOperatorBuilder::CreateEmptyLiteralObject() {
1249 return new (zone()) Operator(
1250 IrOpcode::kJSCreateEmptyLiteralObject,
1251 Operator::kNoProperties,
1252 "JSCreateEmptyLiteralObject",
1256 const Operator* JSOperatorBuilder::CreateLiteralRegExp(
1257 Handle<String> constant_pattern, VectorSlotPair
const& feedback,
1258 int literal_flags) {
1259 CreateLiteralParameters parameters(constant_pattern, feedback, -1,
1261 return new (zone()) Operator1<CreateLiteralParameters>(
1262 IrOpcode::kJSCreateLiteralRegExp,
1263 Operator::kNoProperties,
1264 "JSCreateLiteralRegExp",
1269 const Operator* JSOperatorBuilder::CreateFunctionContext(
1270 Handle<ScopeInfo> scope_info,
int slot_count, ScopeType scope_type) {
1271 CreateFunctionContextParameters parameters(scope_info, slot_count,
1273 return new (zone()) Operator1<CreateFunctionContextParameters>(
1274 IrOpcode::kJSCreateFunctionContext, Operator::kNoProperties,
1275 "JSCreateFunctionContext",
1280 const Operator* JSOperatorBuilder::CreateCatchContext(
1281 const Handle<ScopeInfo>& scope_info) {
1282 return new (zone()) Operator1<Handle<ScopeInfo>>(
1283 IrOpcode::kJSCreateCatchContext, Operator::kNoProperties,
1284 "JSCreateCatchContext",
1289 const Operator* JSOperatorBuilder::CreateWithContext(
1290 const Handle<ScopeInfo>& scope_info) {
1291 return new (zone()) Operator1<Handle<ScopeInfo>>(
1292 IrOpcode::kJSCreateWithContext, Operator::kNoProperties,
1293 "JSCreateWithContext",
1298 const Operator* JSOperatorBuilder::CreateBlockContext(
1299 const Handle<ScopeInfo>& scope_info) {
1300 return new (zone()) Operator1<Handle<ScopeInfo>>(
1301 IrOpcode::kJSCreateBlockContext, Operator::kNoProperties,
1302 "JSCreateBlockContext",
1307 Handle<ScopeInfo> ScopeInfoOf(
const Operator* op) {
1308 DCHECK(IrOpcode::kJSCreateBlockContext == op->opcode() ||
1309 IrOpcode::kJSCreateWithContext == op->opcode() ||
1310 IrOpcode::kJSCreateCatchContext == op->opcode());
1311 return OpParameter<Handle<ScopeInfo>>(op);
1314 #undef BINARY_OP_LIST 1315 #undef CACHED_OP_LIST 1316 #undef COMPARE_OP_LIST