Line data Source code
1 : // Copyright 2014 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 : #include "src/compiler/js-operator.h"
6 :
7 : #include <limits>
8 :
9 : #include "src/base/lazy-instance.h"
10 : #include "src/compiler/opcodes.h"
11 : #include "src/compiler/operator.h"
12 : #include "src/feedback-vector.h"
13 : #include "src/handles-inl.h"
14 : #include "src/objects-inl.h"
15 :
16 : namespace v8 {
17 : namespace internal {
18 : namespace compiler {
19 :
20 68290 : VectorSlotPair::VectorSlotPair() {}
21 :
22 :
23 937194 : int VectorSlotPair::index() const {
24 1874388 : return vector_.is_null() ? -1 : FeedbackVector::GetIndex(slot_);
25 : }
26 :
27 :
28 0 : bool operator==(VectorSlotPair const& lhs, VectorSlotPair const& rhs) {
29 0 : return lhs.slot() == rhs.slot() &&
30 0 : lhs.vector().location() == rhs.vector().location();
31 : }
32 :
33 :
34 0 : bool operator!=(VectorSlotPair const& lhs, VectorSlotPair const& rhs) {
35 0 : return !(lhs == rhs);
36 : }
37 :
38 :
39 0 : size_t hash_value(VectorSlotPair const& p) {
40 0 : return base::hash_combine(p.slot(), p.vector().location());
41 : }
42 :
43 :
44 119027 : ConvertReceiverMode ConvertReceiverModeOf(Operator const* op) {
45 : DCHECK_EQ(IrOpcode::kJSConvertReceiver, op->opcode());
46 119027 : return OpParameter<ConvertReceiverMode>(op);
47 : }
48 :
49 :
50 0 : ToBooleanHints ToBooleanHintsOf(Operator const* op) {
51 : DCHECK_EQ(IrOpcode::kJSToBoolean, op->opcode());
52 0 : return OpParameter<ToBooleanHints>(op);
53 : }
54 :
55 0 : bool operator==(ConstructParameters const& lhs,
56 0 : ConstructParameters const& rhs) {
57 0 : return lhs.arity() == rhs.arity() && lhs.frequency() == rhs.frequency() &&
58 0 : lhs.feedback() == rhs.feedback();
59 : }
60 :
61 0 : bool operator!=(ConstructParameters const& lhs,
62 : ConstructParameters const& rhs) {
63 0 : return !(lhs == rhs);
64 : }
65 :
66 0 : size_t hash_value(ConstructParameters const& p) {
67 0 : return base::hash_combine(p.arity(), p.frequency(), p.feedback());
68 : }
69 :
70 0 : std::ostream& operator<<(std::ostream& os, ConstructParameters const& p) {
71 0 : return os << p.arity() << ", " << p.frequency();
72 : }
73 :
74 72546 : ConstructParameters const& ConstructParametersOf(Operator const* op) {
75 : DCHECK_EQ(IrOpcode::kJSConstruct, op->opcode());
76 72546 : return OpParameter<ConstructParameters>(op);
77 : }
78 :
79 0 : bool operator==(SpreadWithArityParameter const& lhs,
80 : SpreadWithArityParameter const& rhs) {
81 0 : return lhs.arity() == rhs.arity();
82 : }
83 :
84 0 : bool operator!=(SpreadWithArityParameter const& lhs,
85 : SpreadWithArityParameter const& rhs) {
86 0 : return !(lhs == rhs);
87 : }
88 :
89 0 : size_t hash_value(SpreadWithArityParameter const& p) {
90 0 : return base::hash_combine(p.arity());
91 : }
92 :
93 0 : std::ostream& operator<<(std::ostream& os, SpreadWithArityParameter const& p) {
94 0 : return os << p.arity();
95 : }
96 :
97 965 : SpreadWithArityParameter const& SpreadWithArityParameterOf(Operator const* op) {
98 : DCHECK(op->opcode() == IrOpcode::kJSConstructWithSpread ||
99 : op->opcode() == IrOpcode::kJSCallWithSpread);
100 965 : return OpParameter<SpreadWithArityParameter>(op);
101 : }
102 :
103 0 : std::ostream& operator<<(std::ostream& os, CallParameters const& p) {
104 0 : os << p.arity() << ", " << p.frequency() << ", " << p.convert_mode() << ", "
105 0 : << p.tail_call_mode();
106 0 : return os;
107 : }
108 :
109 1169893 : const CallParameters& CallParametersOf(const Operator* op) {
110 : DCHECK_EQ(IrOpcode::kJSCall, op->opcode());
111 1169893 : return OpParameter<CallParameters>(op);
112 : }
113 :
114 0 : std::ostream& operator<<(std::ostream& os,
115 : CallForwardVarargsParameters const& p) {
116 0 : return os << p.start_index() << ", " << p.tail_call_mode();
117 : }
118 :
119 240 : CallForwardVarargsParameters const& CallForwardVarargsParametersOf(
120 : Operator const* op) {
121 : DCHECK_EQ(IrOpcode::kJSCallForwardVarargs, op->opcode());
122 240 : return OpParameter<CallForwardVarargsParameters>(op);
123 : }
124 :
125 :
126 0 : bool operator==(CallRuntimeParameters const& lhs,
127 0 : CallRuntimeParameters const& rhs) {
128 0 : return lhs.id() == rhs.id() && lhs.arity() == rhs.arity();
129 : }
130 :
131 :
132 0 : bool operator!=(CallRuntimeParameters const& lhs,
133 : CallRuntimeParameters const& rhs) {
134 0 : return !(lhs == rhs);
135 : }
136 :
137 :
138 0 : size_t hash_value(CallRuntimeParameters const& p) {
139 0 : return base::hash_combine(p.id(), p.arity());
140 : }
141 :
142 :
143 0 : std::ostream& operator<<(std::ostream& os, CallRuntimeParameters const& p) {
144 0 : return os << p.id() << ", " << p.arity();
145 : }
146 :
147 :
148 10316807 : const CallRuntimeParameters& CallRuntimeParametersOf(const Operator* op) {
149 : DCHECK_EQ(IrOpcode::kJSCallRuntime, op->opcode());
150 10316807 : return OpParameter<CallRuntimeParameters>(op);
151 : }
152 :
153 :
154 0 : ContextAccess::ContextAccess(size_t depth, size_t index, bool immutable)
155 : : immutable_(immutable),
156 : depth_(static_cast<uint16_t>(depth)),
157 1021378 : index_(static_cast<uint32_t>(index)) {
158 : DCHECK(depth <= std::numeric_limits<uint16_t>::max());
159 : DCHECK(index <= std::numeric_limits<uint32_t>::max());
160 0 : }
161 :
162 :
163 0 : bool operator==(ContextAccess const& lhs, ContextAccess const& rhs) {
164 0 : return lhs.depth() == rhs.depth() && lhs.index() == rhs.index() &&
165 0 : lhs.immutable() == rhs.immutable();
166 : }
167 :
168 :
169 0 : bool operator!=(ContextAccess const& lhs, ContextAccess const& rhs) {
170 0 : return !(lhs == rhs);
171 : }
172 :
173 :
174 0 : size_t hash_value(ContextAccess const& access) {
175 0 : return base::hash_combine(access.depth(), access.index(), access.immutable());
176 : }
177 :
178 :
179 0 : std::ostream& operator<<(std::ostream& os, ContextAccess const& access) {
180 0 : return os << access.depth() << ", " << access.index() << ", "
181 0 : << access.immutable();
182 : }
183 :
184 :
185 3514932 : ContextAccess const& ContextAccessOf(Operator const* op) {
186 : DCHECK(op->opcode() == IrOpcode::kJSLoadContext ||
187 : op->opcode() == IrOpcode::kJSStoreContext);
188 3514932 : return OpParameter<ContextAccess>(op);
189 : }
190 :
191 0 : CreateCatchContextParameters::CreateCatchContextParameters(
192 : Handle<String> catch_name, Handle<ScopeInfo> scope_info)
193 0 : : catch_name_(catch_name), scope_info_(scope_info) {}
194 :
195 0 : bool operator==(CreateCatchContextParameters const& lhs,
196 : CreateCatchContextParameters const& rhs) {
197 0 : return lhs.catch_name().location() == rhs.catch_name().location() &&
198 0 : lhs.scope_info().location() == rhs.scope_info().location();
199 : }
200 :
201 0 : bool operator!=(CreateCatchContextParameters const& lhs,
202 : CreateCatchContextParameters const& rhs) {
203 0 : return !(lhs == rhs);
204 : }
205 :
206 0 : size_t hash_value(CreateCatchContextParameters const& parameters) {
207 : return base::hash_combine(parameters.catch_name().location(),
208 0 : parameters.scope_info().location());
209 : }
210 :
211 0 : std::ostream& operator<<(std::ostream& os,
212 : CreateCatchContextParameters const& parameters) {
213 0 : return os << Brief(*parameters.catch_name()) << ", "
214 0 : << Brief(*parameters.scope_info());
215 : }
216 :
217 25969 : CreateCatchContextParameters const& CreateCatchContextParametersOf(
218 : Operator const* op) {
219 : DCHECK_EQ(IrOpcode::kJSCreateCatchContext, op->opcode());
220 25969 : return OpParameter<CreateCatchContextParameters>(op);
221 : }
222 :
223 0 : CreateFunctionContextParameters::CreateFunctionContextParameters(
224 : int slot_count, ScopeType scope_type)
225 0 : : slot_count_(slot_count), scope_type_(scope_type) {}
226 :
227 0 : bool operator==(CreateFunctionContextParameters const& lhs,
228 0 : CreateFunctionContextParameters const& rhs) {
229 0 : return lhs.slot_count() == rhs.slot_count() &&
230 0 : lhs.scope_type() == rhs.scope_type();
231 : }
232 :
233 0 : bool operator!=(CreateFunctionContextParameters const& lhs,
234 : CreateFunctionContextParameters const& rhs) {
235 0 : return !(lhs == rhs);
236 : }
237 :
238 0 : size_t hash_value(CreateFunctionContextParameters const& parameters) {
239 : return base::hash_combine(parameters.slot_count(),
240 0 : static_cast<int>(parameters.scope_type()));
241 : }
242 :
243 0 : std::ostream& operator<<(std::ostream& os,
244 0 : CreateFunctionContextParameters const& parameters) {
245 0 : return os << parameters.slot_count() << ", " << parameters.scope_type();
246 : }
247 :
248 17624 : CreateFunctionContextParameters const& CreateFunctionContextParametersOf(
249 : Operator const* op) {
250 : DCHECK_EQ(IrOpcode::kJSCreateFunctionContext, op->opcode());
251 17624 : return OpParameter<CreateFunctionContextParameters>(op);
252 : }
253 :
254 0 : bool operator==(StoreNamedOwnParameters const& lhs,
255 : StoreNamedOwnParameters const& rhs) {
256 0 : return lhs.name().location() == rhs.name().location() &&
257 0 : lhs.feedback() == rhs.feedback();
258 : }
259 :
260 0 : bool operator!=(StoreNamedOwnParameters const& lhs,
261 : StoreNamedOwnParameters const& rhs) {
262 0 : return !(lhs == rhs);
263 : }
264 :
265 0 : size_t hash_value(StoreNamedOwnParameters const& p) {
266 0 : return base::hash_combine(p.name().location(), p.feedback());
267 : }
268 :
269 0 : std::ostream& operator<<(std::ostream& os, StoreNamedOwnParameters const& p) {
270 0 : return os << Brief(*p.name());
271 : }
272 :
273 70738 : StoreNamedOwnParameters const& StoreNamedOwnParametersOf(const Operator* op) {
274 : DCHECK_EQ(IrOpcode::kJSStoreNamedOwn, op->opcode());
275 70738 : return OpParameter<StoreNamedOwnParameters>(op);
276 : }
277 :
278 0 : bool operator==(FeedbackParameter const& lhs, FeedbackParameter const& rhs) {
279 0 : return lhs.feedback() == rhs.feedback();
280 : }
281 :
282 0 : bool operator!=(FeedbackParameter const& lhs, FeedbackParameter const& rhs) {
283 0 : return !(lhs == rhs);
284 : }
285 :
286 0 : size_t hash_value(FeedbackParameter const& p) {
287 0 : return base::hash_combine(p.feedback());
288 : }
289 :
290 0 : std::ostream& operator<<(std::ostream& os, FeedbackParameter const& p) {
291 0 : return os;
292 : }
293 :
294 88292 : FeedbackParameter const& FeedbackParameterOf(const Operator* op) {
295 : DCHECK(op->opcode() == IrOpcode::kJSStoreDataPropertyInLiteral);
296 88292 : return OpParameter<FeedbackParameter>(op);
297 : }
298 :
299 0 : bool operator==(NamedAccess const& lhs, NamedAccess const& rhs) {
300 0 : return lhs.name().location() == rhs.name().location() &&
301 0 : lhs.language_mode() == rhs.language_mode() &&
302 0 : lhs.feedback() == rhs.feedback();
303 : }
304 :
305 :
306 0 : bool operator!=(NamedAccess const& lhs, NamedAccess const& rhs) {
307 0 : return !(lhs == rhs);
308 : }
309 :
310 :
311 0 : size_t hash_value(NamedAccess const& p) {
312 : return base::hash_combine(p.name().location(), p.language_mode(),
313 0 : p.feedback());
314 : }
315 :
316 :
317 0 : std::ostream& operator<<(std::ostream& os, NamedAccess const& p) {
318 0 : return os << Brief(*p.name()) << ", " << p.language_mode();
319 : }
320 :
321 :
322 1320241 : NamedAccess const& NamedAccessOf(const Operator* op) {
323 : DCHECK(op->opcode() == IrOpcode::kJSLoadNamed ||
324 : op->opcode() == IrOpcode::kJSStoreNamed);
325 1320241 : return OpParameter<NamedAccess>(op);
326 : }
327 :
328 :
329 0 : std::ostream& operator<<(std::ostream& os, PropertyAccess const& p) {
330 0 : return os << p.language_mode();
331 : }
332 :
333 :
334 0 : bool operator==(PropertyAccess const& lhs, PropertyAccess const& rhs) {
335 0 : return lhs.language_mode() == rhs.language_mode() &&
336 0 : lhs.feedback() == rhs.feedback();
337 : }
338 :
339 :
340 0 : bool operator!=(PropertyAccess const& lhs, PropertyAccess const& rhs) {
341 0 : return !(lhs == rhs);
342 : }
343 :
344 :
345 229617 : PropertyAccess const& PropertyAccessOf(const Operator* op) {
346 : DCHECK(op->opcode() == IrOpcode::kJSLoadProperty ||
347 : op->opcode() == IrOpcode::kJSStoreProperty);
348 229617 : return OpParameter<PropertyAccess>(op);
349 : }
350 :
351 :
352 0 : size_t hash_value(PropertyAccess const& p) {
353 0 : return base::hash_combine(p.language_mode(), p.feedback());
354 : }
355 :
356 :
357 0 : bool operator==(LoadGlobalParameters const& lhs,
358 0 : LoadGlobalParameters const& rhs) {
359 0 : return lhs.name().location() == rhs.name().location() &&
360 0 : lhs.feedback() == rhs.feedback() &&
361 0 : lhs.typeof_mode() == rhs.typeof_mode();
362 : }
363 :
364 :
365 0 : bool operator!=(LoadGlobalParameters const& lhs,
366 : LoadGlobalParameters const& rhs) {
367 0 : return !(lhs == rhs);
368 : }
369 :
370 :
371 0 : size_t hash_value(LoadGlobalParameters const& p) {
372 0 : return base::hash_combine(p.name().location(), p.typeof_mode());
373 : }
374 :
375 :
376 0 : std::ostream& operator<<(std::ostream& os, LoadGlobalParameters const& p) {
377 0 : return os << Brief(*p.name()) << ", " << p.typeof_mode();
378 : }
379 :
380 :
381 620345 : const LoadGlobalParameters& LoadGlobalParametersOf(const Operator* op) {
382 : DCHECK_EQ(IrOpcode::kJSLoadGlobal, op->opcode());
383 620345 : return OpParameter<LoadGlobalParameters>(op);
384 : }
385 :
386 :
387 0 : bool operator==(StoreGlobalParameters const& lhs,
388 0 : StoreGlobalParameters const& rhs) {
389 0 : return lhs.language_mode() == rhs.language_mode() &&
390 0 : lhs.name().location() == rhs.name().location() &&
391 0 : lhs.feedback() == rhs.feedback();
392 : }
393 :
394 :
395 0 : bool operator!=(StoreGlobalParameters const& lhs,
396 : StoreGlobalParameters const& rhs) {
397 0 : return !(lhs == rhs);
398 : }
399 :
400 :
401 0 : size_t hash_value(StoreGlobalParameters const& p) {
402 : return base::hash_combine(p.language_mode(), p.name().location(),
403 0 : p.feedback());
404 : }
405 :
406 :
407 0 : std::ostream& operator<<(std::ostream& os, StoreGlobalParameters const& p) {
408 0 : return os << p.language_mode() << ", " << Brief(*p.name());
409 : }
410 :
411 :
412 54507 : const StoreGlobalParameters& StoreGlobalParametersOf(const Operator* op) {
413 : DCHECK_EQ(IrOpcode::kJSStoreGlobal, op->opcode());
414 54507 : return OpParameter<StoreGlobalParameters>(op);
415 : }
416 :
417 :
418 19363 : CreateArgumentsType const& CreateArgumentsTypeOf(const Operator* op) {
419 : DCHECK_EQ(IrOpcode::kJSCreateArguments, op->opcode());
420 19363 : return OpParameter<CreateArgumentsType>(op);
421 : }
422 :
423 :
424 0 : bool operator==(CreateArrayParameters const& lhs,
425 0 : CreateArrayParameters const& rhs) {
426 0 : return lhs.arity() == rhs.arity() &&
427 0 : lhs.site().location() == rhs.site().location();
428 : }
429 :
430 :
431 0 : bool operator!=(CreateArrayParameters const& lhs,
432 : CreateArrayParameters const& rhs) {
433 0 : return !(lhs == rhs);
434 : }
435 :
436 :
437 0 : size_t hash_value(CreateArrayParameters const& p) {
438 0 : return base::hash_combine(p.arity(), p.site().location());
439 : }
440 :
441 :
442 0 : std::ostream& operator<<(std::ostream& os, CreateArrayParameters const& p) {
443 : os << p.arity();
444 0 : if (!p.site().is_null()) os << ", " << Brief(*p.site());
445 0 : return os;
446 : }
447 :
448 :
449 7426 : const CreateArrayParameters& CreateArrayParametersOf(const Operator* op) {
450 : DCHECK_EQ(IrOpcode::kJSCreateArray, op->opcode());
451 7426 : return OpParameter<CreateArrayParameters>(op);
452 : }
453 :
454 :
455 0 : bool operator==(CreateClosureParameters const& lhs,
456 0 : CreateClosureParameters const& rhs) {
457 0 : return lhs.pretenure() == rhs.pretenure() &&
458 0 : lhs.feedback() == rhs.feedback() &&
459 0 : lhs.shared_info().location() == rhs.shared_info().location();
460 : }
461 :
462 :
463 0 : bool operator!=(CreateClosureParameters const& lhs,
464 : CreateClosureParameters const& rhs) {
465 0 : return !(lhs == rhs);
466 : }
467 :
468 :
469 0 : size_t hash_value(CreateClosureParameters const& p) {
470 : return base::hash_combine(p.pretenure(), p.shared_info().location(),
471 0 : p.feedback());
472 : }
473 :
474 :
475 0 : std::ostream& operator<<(std::ostream& os, CreateClosureParameters const& p) {
476 0 : return os << p.pretenure() << ", " << Brief(*p.shared_info());
477 : }
478 :
479 :
480 186130 : const CreateClosureParameters& CreateClosureParametersOf(const Operator* op) {
481 : DCHECK_EQ(IrOpcode::kJSCreateClosure, op->opcode());
482 186130 : return OpParameter<CreateClosureParameters>(op);
483 : }
484 :
485 :
486 0 : bool operator==(CreateLiteralParameters const& lhs,
487 0 : CreateLiteralParameters const& rhs) {
488 0 : return lhs.constant().location() == rhs.constant().location() &&
489 0 : lhs.length() == rhs.length() && lhs.flags() == rhs.flags() &&
490 0 : lhs.index() == rhs.index();
491 : }
492 :
493 :
494 0 : bool operator!=(CreateLiteralParameters const& lhs,
495 : CreateLiteralParameters const& rhs) {
496 0 : return !(lhs == rhs);
497 : }
498 :
499 :
500 0 : size_t hash_value(CreateLiteralParameters const& p) {
501 : return base::hash_combine(p.constant().location(), p.length(), p.flags(),
502 0 : p.index());
503 : }
504 :
505 :
506 0 : std::ostream& operator<<(std::ostream& os, CreateLiteralParameters const& p) {
507 0 : return os << Brief(*p.constant()) << ", " << p.length() << ", " << p.flags()
508 0 : << ", " << p.index();
509 : }
510 :
511 :
512 151355 : const CreateLiteralParameters& CreateLiteralParametersOf(const Operator* op) {
513 : DCHECK(op->opcode() == IrOpcode::kJSCreateLiteralArray ||
514 : op->opcode() == IrOpcode::kJSCreateLiteralObject ||
515 : op->opcode() == IrOpcode::kJSCreateLiteralRegExp);
516 151355 : return OpParameter<CreateLiteralParameters>(op);
517 : }
518 :
519 0 : bool operator==(GeneratorStoreParameters const& lhs,
520 0 : GeneratorStoreParameters const& rhs) {
521 0 : return lhs.register_count() == rhs.register_count() &&
522 0 : lhs.suspend_type() == rhs.suspend_type();
523 : }
524 0 : bool operator!=(GeneratorStoreParameters const& lhs,
525 : GeneratorStoreParameters const& rhs) {
526 0 : return !(lhs == rhs);
527 : }
528 :
529 0 : size_t hash_value(GeneratorStoreParameters const& p) {
530 : return base::hash_combine(p.register_count(),
531 0 : static_cast<int>(p.suspend_type()));
532 : }
533 :
534 0 : std::ostream& operator<<(std::ostream& os, GeneratorStoreParameters const& p) {
535 0 : const char* suspend_type = SuspendTypeFor(p.suspend_type());
536 0 : return os << p.register_count() << " (" << suspend_type << ")";
537 : }
538 :
539 6429 : const GeneratorStoreParameters& GeneratorStoreParametersOf(const Operator* op) {
540 : DCHECK_EQ(op->opcode(), IrOpcode::kJSGeneratorStore);
541 6429 : return OpParameter<GeneratorStoreParameters>(op);
542 : }
543 :
544 45495 : BinaryOperationHint BinaryOperationHintOf(const Operator* op) {
545 : DCHECK_EQ(IrOpcode::kJSAdd, op->opcode());
546 45495 : return OpParameter<BinaryOperationHint>(op);
547 : }
548 :
549 674832 : CompareOperationHint CompareOperationHintOf(const Operator* op) {
550 : DCHECK(op->opcode() == IrOpcode::kJSEqual ||
551 : op->opcode() == IrOpcode::kJSStrictEqual ||
552 : op->opcode() == IrOpcode::kJSLessThan ||
553 : op->opcode() == IrOpcode::kJSGreaterThan ||
554 : op->opcode() == IrOpcode::kJSLessThanOrEqual ||
555 : op->opcode() == IrOpcode::kJSGreaterThanOrEqual);
556 674832 : return OpParameter<CompareOperationHint>(op);
557 : }
558 :
559 : #define CACHED_OP_LIST(V) \
560 : V(BitwiseOr, Operator::kNoProperties, 2, 1) \
561 : V(BitwiseXor, Operator::kNoProperties, 2, 1) \
562 : V(BitwiseAnd, Operator::kNoProperties, 2, 1) \
563 : V(ShiftLeft, Operator::kNoProperties, 2, 1) \
564 : V(ShiftRight, Operator::kNoProperties, 2, 1) \
565 : V(ShiftRightLogical, Operator::kNoProperties, 2, 1) \
566 : V(Subtract, Operator::kNoProperties, 2, 1) \
567 : V(Multiply, Operator::kNoProperties, 2, 1) \
568 : V(Divide, Operator::kNoProperties, 2, 1) \
569 : V(Modulus, Operator::kNoProperties, 2, 1) \
570 : V(ToInteger, Operator::kNoProperties, 1, 1) \
571 : V(ToLength, Operator::kNoProperties, 1, 1) \
572 : V(ToName, Operator::kNoProperties, 1, 1) \
573 : V(ToNumber, Operator::kNoProperties, 1, 1) \
574 : V(ToObject, Operator::kFoldable, 1, 1) \
575 : V(ToString, Operator::kNoProperties, 1, 1) \
576 : V(Create, Operator::kNoProperties, 2, 1) \
577 : V(CreateIterResultObject, Operator::kEliminatable, 2, 1) \
578 : V(CreateKeyValueArray, Operator::kEliminatable, 2, 1) \
579 : V(HasProperty, Operator::kNoProperties, 2, 1) \
580 : V(ClassOf, Operator::kPure, 1, 1) \
581 : V(TypeOf, Operator::kPure, 1, 1) \
582 : V(InstanceOf, Operator::kNoProperties, 2, 1) \
583 : V(OrdinaryHasInstance, Operator::kNoProperties, 2, 1) \
584 : V(ForInNext, Operator::kNoProperties, 4, 1) \
585 : V(ForInPrepare, Operator::kNoProperties, 1, 3) \
586 : V(LoadMessage, Operator::kNoThrow | Operator::kNoWrite, 0, 1) \
587 : V(StoreMessage, Operator::kNoRead | Operator::kNoThrow, 1, 0) \
588 : V(GeneratorRestoreContinuation, Operator::kNoThrow, 1, 1) \
589 : V(StackCheck, Operator::kNoWrite, 0, 0) \
590 : V(Debugger, Operator::kNoProperties, 0, 0) \
591 : V(GetSuperConstructor, Operator::kNoWrite, 1, 1)
592 :
593 : #define BINARY_OP_LIST(V) V(Add)
594 :
595 : #define COMPARE_OP_LIST(V) \
596 : V(Equal, Operator::kNoProperties) \
597 : V(StrictEqual, Operator::kPure) \
598 : V(LessThan, Operator::kNoProperties) \
599 : V(GreaterThan, Operator::kNoProperties) \
600 : V(LessThanOrEqual, Operator::kNoProperties) \
601 : V(GreaterThanOrEqual, Operator::kNoProperties)
602 :
603 16151 : struct JSOperatorGlobalCache final {
604 : #define CACHED_OP(Name, properties, value_input_count, value_output_count) \
605 : struct Name##Operator final : public Operator { \
606 : Name##Operator() \
607 : : Operator(IrOpcode::kJS##Name, properties, "JS" #Name, \
608 : value_input_count, Operator::ZeroIfPure(properties), \
609 : Operator::ZeroIfEliminatable(properties), \
610 : value_output_count, Operator::ZeroIfPure(properties), \
611 : Operator::ZeroIfNoThrow(properties)) {} \
612 : }; \
613 : Name##Operator k##Name##Operator;
614 1001362 : CACHED_OP_LIST(CACHED_OP)
615 : #undef CACHED_OP
616 :
617 : #define BINARY_OP(Name) \
618 : template <BinaryOperationHint kHint> \
619 : struct Name##Operator final : public Operator1<BinaryOperationHint> { \
620 : Name##Operator() \
621 : : Operator1<BinaryOperationHint>(IrOpcode::kJS##Name, \
622 : Operator::kNoProperties, "JS" #Name, \
623 : 2, 1, 1, 1, 1, 2, kHint) {} \
624 : }; \
625 : Name##Operator<BinaryOperationHint::kNone> k##Name##NoneOperator; \
626 : Name##Operator<BinaryOperationHint::kSignedSmall> \
627 : k##Name##SignedSmallOperator; \
628 : Name##Operator<BinaryOperationHint::kSigned32> k##Name##Signed32Operator; \
629 : Name##Operator<BinaryOperationHint::kNumberOrOddball> \
630 : k##Name##NumberOrOddballOperator; \
631 : Name##Operator<BinaryOperationHint::kString> k##Name##StringOperator; \
632 : Name##Operator<BinaryOperationHint::kAny> k##Name##AnyOperator;
633 193812 : BINARY_OP_LIST(BINARY_OP)
634 : #undef BINARY_OP
635 :
636 : #define COMPARE_OP(Name, properties) \
637 : template <CompareOperationHint kHint> \
638 : struct Name##Operator final : public Operator1<CompareOperationHint> { \
639 : Name##Operator() \
640 : : Operator1<CompareOperationHint>( \
641 : IrOpcode::kJS##Name, properties, "JS" #Name, 2, 1, 1, 1, 1, \
642 : Operator::ZeroIfNoThrow(properties), kHint) {} \
643 : }; \
644 : Name##Operator<CompareOperationHint::kNone> k##Name##NoneOperator; \
645 : Name##Operator<CompareOperationHint::kSignedSmall> \
646 : k##Name##SignedSmallOperator; \
647 : Name##Operator<CompareOperationHint::kNumber> k##Name##NumberOperator; \
648 : Name##Operator<CompareOperationHint::kNumberOrOddball> \
649 : k##Name##NumberOrOddballOperator; \
650 : Name##Operator<CompareOperationHint::kInternalizedString> \
651 : k##Name##InternalizedStringOperator; \
652 : Name##Operator<CompareOperationHint::kString> k##Name##StringOperator; \
653 : Name##Operator<CompareOperationHint::kReceiver> k##Name##ReceiverOperator; \
654 : Name##Operator<CompareOperationHint::kAny> k##Name##AnyOperator;
655 1550496 : COMPARE_OP_LIST(COMPARE_OP)
656 : #undef COMPARE_OP
657 : };
658 :
659 : static base::LazyInstance<JSOperatorGlobalCache>::type kCache =
660 : LAZY_INSTANCE_INITIALIZER;
661 :
662 575636 : JSOperatorBuilder::JSOperatorBuilder(Zone* zone)
663 575637 : : cache_(kCache.Get()), zone_(zone) {}
664 :
665 : #define CACHED_OP(Name, properties, value_input_count, value_output_count) \
666 : const Operator* JSOperatorBuilder::Name() { \
667 : return &cache_.k##Name##Operator; \
668 : }
669 860726 : CACHED_OP_LIST(CACHED_OP)
670 : #undef CACHED_OP
671 :
672 : #define BINARY_OP(Name) \
673 : const Operator* JSOperatorBuilder::Name(BinaryOperationHint hint) { \
674 : switch (hint) { \
675 : case BinaryOperationHint::kNone: \
676 : return &cache_.k##Name##NoneOperator; \
677 : case BinaryOperationHint::kSignedSmall: \
678 : return &cache_.k##Name##SignedSmallOperator; \
679 : case BinaryOperationHint::kSigned32: \
680 : return &cache_.k##Name##Signed32Operator; \
681 : case BinaryOperationHint::kNumberOrOddball: \
682 : return &cache_.k##Name##NumberOrOddballOperator; \
683 : case BinaryOperationHint::kString: \
684 : return &cache_.k##Name##StringOperator; \
685 : case BinaryOperationHint::kAny: \
686 : return &cache_.k##Name##AnyOperator; \
687 : } \
688 : UNREACHABLE(); \
689 : return nullptr; \
690 : }
691 275339 : BINARY_OP_LIST(BINARY_OP)
692 : #undef BINARY_OP
693 :
694 : #define COMPARE_OP(Name, ...) \
695 : const Operator* JSOperatorBuilder::Name(CompareOperationHint hint) { \
696 : switch (hint) { \
697 : case CompareOperationHint::kNone: \
698 : return &cache_.k##Name##NoneOperator; \
699 : case CompareOperationHint::kSignedSmall: \
700 : return &cache_.k##Name##SignedSmallOperator; \
701 : case CompareOperationHint::kNumber: \
702 : return &cache_.k##Name##NumberOperator; \
703 : case CompareOperationHint::kNumberOrOddball: \
704 : return &cache_.k##Name##NumberOrOddballOperator; \
705 : case CompareOperationHint::kInternalizedString: \
706 : return &cache_.k##Name##InternalizedStringOperator; \
707 : case CompareOperationHint::kString: \
708 : return &cache_.k##Name##StringOperator; \
709 : case CompareOperationHint::kReceiver: \
710 : return &cache_.k##Name##ReceiverOperator; \
711 : case CompareOperationHint::kAny: \
712 : return &cache_.k##Name##AnyOperator; \
713 : } \
714 : UNREACHABLE(); \
715 : return nullptr; \
716 : }
717 404723 : COMPARE_OP_LIST(COMPARE_OP)
718 : #undef COMPARE_OP
719 :
720 44214 : const Operator* JSOperatorBuilder::StoreDataPropertyInLiteral(
721 44214 : const VectorSlotPair& feedback) {
722 : FeedbackParameter parameters(feedback);
723 : return new (zone()) Operator1<FeedbackParameter>( // --
724 : IrOpcode::kJSStoreDataPropertyInLiteral,
725 : Operator::kNoThrow, // opcode
726 : "JSStoreDataPropertyInLiteral", // name
727 : 4, 1, 1, 0, 1, 0, // counts
728 44214 : parameters); // parameter
729 : }
730 :
731 233298 : const Operator* JSOperatorBuilder::ToBoolean(ToBooleanHints hints) {
732 : // TODO(turbofan): Cache most important versions of this operator.
733 : return new (zone()) Operator1<ToBooleanHints>( //--
734 : IrOpcode::kJSToBoolean, Operator::kPure, // opcode
735 : "JSToBoolean", // name
736 : 1, 0, 0, 1, 0, 0, // inputs/outputs
737 233298 : hints); // parameter
738 : }
739 :
740 215 : const Operator* JSOperatorBuilder::CallForwardVarargs(
741 215 : uint32_t start_index, TailCallMode tail_call_mode) {
742 : CallForwardVarargsParameters parameters(start_index, tail_call_mode);
743 : return new (zone()) Operator1<CallForwardVarargsParameters>( // --
744 : IrOpcode::kJSCallForwardVarargs, Operator::kNoProperties, // opcode
745 : "JSCallForwardVarargs", // name
746 : 2, 1, 1, 1, 1, 2, // counts
747 215 : parameters); // parameter
748 : }
749 :
750 640791 : const Operator* JSOperatorBuilder::Call(size_t arity, float frequency,
751 : VectorSlotPair const& feedback,
752 : ConvertReceiverMode convert_mode,
753 640791 : TailCallMode tail_call_mode) {
754 : CallParameters parameters(arity, frequency, feedback, tail_call_mode,
755 : convert_mode);
756 : return new (zone()) Operator1<CallParameters>( // --
757 : IrOpcode::kJSCall, Operator::kNoProperties, // opcode
758 : "JSCall", // name
759 : parameters.arity(), 1, 1, 1, 1, 2, // inputs/outputs
760 640791 : parameters); // parameter
761 : }
762 :
763 484 : const Operator* JSOperatorBuilder::CallWithSpread(uint32_t arity) {
764 : SpreadWithArityParameter parameters(arity);
765 : return new (zone()) Operator1<SpreadWithArityParameter>( // --
766 : IrOpcode::kJSCallWithSpread, Operator::kNoProperties, // opcode
767 : "JSCallWithSpread", // name
768 : parameters.arity(), 1, 1, 1, 1, 2, // counts
769 484 : parameters); // parameter
770 : }
771 :
772 162397 : const Operator* JSOperatorBuilder::CallRuntime(Runtime::FunctionId id) {
773 162397 : const Runtime::Function* f = Runtime::FunctionForId(id);
774 162397 : return CallRuntime(f, f->nargs);
775 : }
776 :
777 :
778 259860 : const Operator* JSOperatorBuilder::CallRuntime(Runtime::FunctionId id,
779 : size_t arity) {
780 259860 : const Runtime::Function* f = Runtime::FunctionForId(id);
781 259860 : return CallRuntime(f, arity);
782 : }
783 :
784 :
785 422257 : const Operator* JSOperatorBuilder::CallRuntime(const Runtime::Function* f,
786 422257 : size_t arity) {
787 422257 : CallRuntimeParameters parameters(f->function_id, arity);
788 : DCHECK(f->nargs == -1 || f->nargs == static_cast<int>(parameters.arity()));
789 : return new (zone()) Operator1<CallRuntimeParameters>( // --
790 : IrOpcode::kJSCallRuntime, Operator::kNoProperties, // opcode
791 : "JSCallRuntime", // name
792 : parameters.arity(), 1, 1, f->result_size, 1, 2, // inputs/outputs
793 844514 : parameters); // parameter
794 : }
795 :
796 34118 : const Operator* JSOperatorBuilder::Construct(uint32_t arity, float frequency,
797 34118 : VectorSlotPair const& feedback) {
798 : ConstructParameters parameters(arity, frequency, feedback);
799 : return new (zone()) Operator1<ConstructParameters>( // --
800 : IrOpcode::kJSConstruct, Operator::kNoProperties, // opcode
801 : "JSConstruct", // name
802 : parameters.arity(), 1, 1, 1, 1, 2, // counts
803 68236 : parameters); // parameter
804 : }
805 :
806 494 : const Operator* JSOperatorBuilder::ConstructWithSpread(uint32_t arity) {
807 : SpreadWithArityParameter parameters(arity);
808 : return new (zone()) Operator1<SpreadWithArityParameter>( // --
809 : IrOpcode::kJSConstructWithSpread, Operator::kNoProperties, // opcode
810 : "JSConstructWithSpread", // name
811 : parameters.arity(), 1, 1, 1, 1, 2, // counts
812 494 : parameters); // parameter
813 : }
814 :
815 119194 : const Operator* JSOperatorBuilder::ConvertReceiver(
816 119194 : ConvertReceiverMode convert_mode) {
817 : return new (zone()) Operator1<ConvertReceiverMode>( // --
818 : IrOpcode::kJSConvertReceiver, Operator::kEliminatable, // opcode
819 : "JSConvertReceiver", // name
820 : 1, 1, 1, 1, 1, 0, // counts
821 119194 : convert_mode); // parameter
822 : }
823 :
824 460716 : const Operator* JSOperatorBuilder::LoadNamed(Handle<Name> name,
825 460716 : const VectorSlotPair& feedback) {
826 : NamedAccess access(SLOPPY, name, feedback);
827 : return new (zone()) Operator1<NamedAccess>( // --
828 : IrOpcode::kJSLoadNamed, Operator::kNoProperties, // opcode
829 : "JSLoadNamed", // name
830 : 1, 1, 1, 1, 1, 2, // counts
831 460716 : access); // parameter
832 : }
833 :
834 75186 : const Operator* JSOperatorBuilder::LoadProperty(
835 75186 : VectorSlotPair const& feedback) {
836 : PropertyAccess access(SLOPPY, feedback);
837 : return new (zone()) Operator1<PropertyAccess>( // --
838 : IrOpcode::kJSLoadProperty, Operator::kNoProperties, // opcode
839 : "JSLoadProperty", // name
840 : 2, 1, 1, 1, 1, 2, // counts
841 75186 : access); // parameter
842 : }
843 :
844 6707 : const Operator* JSOperatorBuilder::GeneratorStore(int register_count,
845 6707 : SuspendFlags suspend_flags) {
846 : GeneratorStoreParameters parameters(register_count, suspend_flags);
847 : return new (zone()) Operator1<GeneratorStoreParameters>( // --
848 : IrOpcode::kJSGeneratorStore, Operator::kNoThrow, // opcode
849 : "JSGeneratorStore", // name
850 6707 : 3 + register_count, 1, 1, 0, 1, 0, // counts
851 13414 : parameters); // parameter
852 : }
853 :
854 32463 : const Operator* JSOperatorBuilder::GeneratorRestoreRegister(int index) {
855 : return new (zone()) Operator1<int>( // --
856 : IrOpcode::kJSGeneratorRestoreRegister, Operator::kNoThrow, // opcode
857 : "JSGeneratorRestoreRegister", // name
858 : 1, 1, 1, 1, 1, 0, // counts
859 32463 : index); // parameter
860 : }
861 :
862 64546 : const Operator* JSOperatorBuilder::StoreNamed(LanguageMode language_mode,
863 : Handle<Name> name,
864 64546 : VectorSlotPair const& feedback) {
865 : NamedAccess access(language_mode, name, feedback);
866 : return new (zone()) Operator1<NamedAccess>( // --
867 : IrOpcode::kJSStoreNamed, Operator::kNoProperties, // opcode
868 : "JSStoreNamed", // name
869 : 2, 1, 1, 0, 1, 2, // counts
870 64546 : access); // parameter
871 : }
872 :
873 :
874 44913 : const Operator* JSOperatorBuilder::StoreProperty(
875 44913 : LanguageMode language_mode, VectorSlotPair const& feedback) {
876 : PropertyAccess access(language_mode, feedback);
877 : return new (zone()) Operator1<PropertyAccess>( // --
878 : IrOpcode::kJSStoreProperty, Operator::kNoProperties, // opcode
879 : "JSStoreProperty", // name
880 : 3, 1, 1, 0, 1, 2, // counts
881 44913 : access); // parameter
882 : }
883 :
884 34419 : const Operator* JSOperatorBuilder::StoreNamedOwn(
885 34419 : Handle<Name> name, VectorSlotPair const& feedback) {
886 : StoreNamedOwnParameters parameters(name, feedback);
887 : return new (zone()) Operator1<StoreNamedOwnParameters>( // --
888 : IrOpcode::kJSStoreNamedOwn, Operator::kNoProperties, // opcode
889 : "JSStoreNamedOwn", // name
890 : 2, 1, 1, 0, 1, 2, // counts
891 34419 : parameters); // parameter
892 : }
893 :
894 3408 : const Operator* JSOperatorBuilder::DeleteProperty() {
895 : return new (zone()) Operator( // --
896 : IrOpcode::kJSDeleteProperty, Operator::kNoProperties, // opcode
897 : "JSDeleteProperty", // name
898 1704 : 3, 1, 1, 1, 1, 2); // counts
899 : }
900 :
901 :
902 528324 : const Operator* JSOperatorBuilder::LoadGlobal(const Handle<Name>& name,
903 : const VectorSlotPair& feedback,
904 528324 : TypeofMode typeof_mode) {
905 : LoadGlobalParameters parameters(name, feedback, typeof_mode);
906 : return new (zone()) Operator1<LoadGlobalParameters>( // --
907 : IrOpcode::kJSLoadGlobal, Operator::kNoProperties, // opcode
908 : "JSLoadGlobal", // name
909 : 0, 1, 1, 1, 1, 2, // counts
910 528324 : parameters); // parameter
911 : }
912 :
913 :
914 36946 : const Operator* JSOperatorBuilder::StoreGlobal(LanguageMode language_mode,
915 : const Handle<Name>& name,
916 36946 : const VectorSlotPair& feedback) {
917 : StoreGlobalParameters parameters(language_mode, feedback, name);
918 : return new (zone()) Operator1<StoreGlobalParameters>( // --
919 : IrOpcode::kJSStoreGlobal, Operator::kNoProperties, // opcode
920 : "JSStoreGlobal", // name
921 : 1, 1, 1, 0, 1, 2, // counts
922 36946 : parameters); // parameter
923 : }
924 :
925 :
926 857684 : const Operator* JSOperatorBuilder::LoadContext(size_t depth, size_t index,
927 857684 : bool immutable) {
928 : ContextAccess access(depth, index, immutable);
929 : return new (zone()) Operator1<ContextAccess>( // --
930 : IrOpcode::kJSLoadContext, // opcode
931 : Operator::kNoWrite | Operator::kNoThrow, // flags
932 : "JSLoadContext", // name
933 : 0, 1, 0, 1, 1, 0, // counts
934 857684 : access); // parameter
935 : }
936 :
937 :
938 327388 : const Operator* JSOperatorBuilder::StoreContext(size_t depth, size_t index) {
939 : ContextAccess access(depth, index, false);
940 : return new (zone()) Operator1<ContextAccess>( // --
941 : IrOpcode::kJSStoreContext, // opcode
942 : Operator::kNoRead | Operator::kNoThrow, // flags
943 : "JSStoreContext", // name
944 : 1, 1, 1, 0, 1, 0, // counts
945 163694 : access); // parameter
946 : }
947 :
948 406 : const Operator* JSOperatorBuilder::LoadModule(int32_t cell_index) {
949 : return new (zone()) Operator1<int32_t>( // --
950 : IrOpcode::kJSLoadModule, // opcode
951 : Operator::kNoWrite | Operator::kNoThrow, // flags
952 : "JSLoadModule", // name
953 : 1, 1, 1, 1, 1, 0, // counts
954 406 : cell_index); // parameter
955 : }
956 :
957 486 : const Operator* JSOperatorBuilder::StoreModule(int32_t cell_index) {
958 : return new (zone()) Operator1<int32_t>( // --
959 : IrOpcode::kJSStoreModule, // opcode
960 : Operator::kNoRead | Operator::kNoThrow, // flags
961 : "JSStoreModule", // name
962 : 2, 1, 1, 0, 1, 0, // counts
963 486 : cell_index); // parameter
964 : }
965 :
966 9437 : const Operator* JSOperatorBuilder::CreateArguments(CreateArgumentsType type) {
967 : return new (zone()) Operator1<CreateArgumentsType>( // --
968 : IrOpcode::kJSCreateArguments, Operator::kEliminatable, // opcode
969 : "JSCreateArguments", // name
970 : 1, 1, 0, 1, 1, 0, // counts
971 9437 : type); // parameter
972 : }
973 :
974 :
975 3875 : const Operator* JSOperatorBuilder::CreateArray(size_t arity,
976 3875 : Handle<AllocationSite> site) {
977 : // constructor, new_target, arg1, ..., argN
978 3875 : int const value_input_count = static_cast<int>(arity) + 2;
979 : CreateArrayParameters parameters(arity, site);
980 : return new (zone()) Operator1<CreateArrayParameters>( // --
981 : IrOpcode::kJSCreateArray, Operator::kNoProperties, // opcode
982 : "JSCreateArray", // name
983 : value_input_count, 1, 1, 1, 1, 2, // counts
984 7750 : parameters); // parameter
985 : }
986 :
987 184171 : const Operator* JSOperatorBuilder::CreateClosure(
988 : Handle<SharedFunctionInfo> shared_info, VectorSlotPair const& feedback,
989 184171 : PretenureFlag pretenure) {
990 : CreateClosureParameters parameters(shared_info, feedback, pretenure);
991 : return new (zone()) Operator1<CreateClosureParameters>( // --
992 : IrOpcode::kJSCreateClosure, Operator::kNoThrow, // opcode
993 : "JSCreateClosure", // name
994 : 0, 1, 1, 1, 1, 0, // counts
995 184171 : parameters); // parameter
996 : }
997 :
998 25657 : const Operator* JSOperatorBuilder::CreateLiteralArray(
999 : Handle<ConstantElementsPair> constant_elements, int literal_flags,
1000 25657 : int literal_index, int number_of_elements) {
1001 : CreateLiteralParameters parameters(constant_elements, number_of_elements,
1002 : literal_flags, literal_index);
1003 : return new (zone()) Operator1<CreateLiteralParameters>( // --
1004 : IrOpcode::kJSCreateLiteralArray, Operator::kNoProperties, // opcode
1005 : "JSCreateLiteralArray", // name
1006 : 1, 1, 1, 1, 1, 2, // counts
1007 25657 : parameters); // parameter
1008 : }
1009 :
1010 48949 : const Operator* JSOperatorBuilder::CreateLiteralObject(
1011 : Handle<BoilerplateDescription> constant_properties, int literal_flags,
1012 48949 : int literal_index, int number_of_properties) {
1013 : CreateLiteralParameters parameters(constant_properties, number_of_properties,
1014 : literal_flags, literal_index);
1015 : return new (zone()) Operator1<CreateLiteralParameters>( // --
1016 : IrOpcode::kJSCreateLiteralObject, Operator::kNoProperties, // opcode
1017 : "JSCreateLiteralObject", // name
1018 : 1, 1, 1, 1, 1, 2, // counts
1019 48949 : parameters); // parameter
1020 : }
1021 :
1022 :
1023 10158 : const Operator* JSOperatorBuilder::CreateLiteralRegExp(
1024 10158 : Handle<String> constant_pattern, int literal_flags, int literal_index) {
1025 : CreateLiteralParameters parameters(constant_pattern, -1, literal_flags,
1026 : literal_index);
1027 : return new (zone()) Operator1<CreateLiteralParameters>( // --
1028 : IrOpcode::kJSCreateLiteralRegExp, Operator::kNoProperties, // opcode
1029 : "JSCreateLiteralRegExp", // name
1030 : 1, 1, 1, 1, 1, 2, // counts
1031 10158 : parameters); // parameter
1032 : }
1033 :
1034 17893 : const Operator* JSOperatorBuilder::CreateFunctionContext(int slot_count,
1035 17893 : ScopeType scope_type) {
1036 : CreateFunctionContextParameters parameters(slot_count, scope_type);
1037 : return new (zone()) Operator1<CreateFunctionContextParameters>( // --
1038 : IrOpcode::kJSCreateFunctionContext, Operator::kNoProperties, // opcode
1039 : "JSCreateFunctionContext", // name
1040 : 1, 1, 1, 1, 1, 2, // counts
1041 17893 : parameters); // parameter
1042 : }
1043 :
1044 26879 : const Operator* JSOperatorBuilder::CreateCatchContext(
1045 26879 : const Handle<String>& name, const Handle<ScopeInfo>& scope_info) {
1046 : CreateCatchContextParameters parameters(name, scope_info);
1047 : return new (zone()) Operator1<CreateCatchContextParameters>(
1048 : IrOpcode::kJSCreateCatchContext, Operator::kNoProperties, // opcode
1049 : "JSCreateCatchContext", // name
1050 : 2, 1, 1, 1, 1, 2, // counts
1051 26879 : parameters); // parameter
1052 : }
1053 :
1054 841 : const Operator* JSOperatorBuilder::CreateWithContext(
1055 841 : const Handle<ScopeInfo>& scope_info) {
1056 : return new (zone()) Operator1<Handle<ScopeInfo>>(
1057 : IrOpcode::kJSCreateWithContext, Operator::kNoProperties, // opcode
1058 : "JSCreateWithContext", // name
1059 : 2, 1, 1, 1, 1, 2, // counts
1060 1682 : scope_info); // parameter
1061 : }
1062 :
1063 6677 : const Operator* JSOperatorBuilder::CreateBlockContext(
1064 6677 : const Handle<ScopeInfo>& scope_info) {
1065 : return new (zone()) Operator1<Handle<ScopeInfo>>( // --
1066 : IrOpcode::kJSCreateBlockContext, Operator::kNoProperties, // opcode
1067 : "JSCreateBlockContext", // name
1068 : 1, 1, 1, 1, 1, 2, // counts
1069 13354 : scope_info); // parameter
1070 : }
1071 :
1072 0 : const Operator* JSOperatorBuilder::CreateScriptContext(
1073 0 : const Handle<ScopeInfo>& scope_info) {
1074 : return new (zone()) Operator1<Handle<ScopeInfo>>( // --
1075 : IrOpcode::kJSCreateScriptContext, Operator::kNoProperties, // opcode
1076 : "JSCreateScriptContext", // name
1077 : 1, 1, 1, 1, 1, 2, // counts
1078 0 : scope_info); // parameter
1079 : }
1080 :
1081 : } // namespace compiler
1082 : } // namespace internal
1083 : } // namespace v8
|