v8
V8 is Google’s open source high-performance JavaScript and WebAssembly engine, written in C++.
Loading...
Searching...
No Matches
builtin-call-descriptors.h
Go to the documentation of this file.
1// Copyright 2023 the V8 project authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5#ifndef V8_COMPILER_TURBOSHAFT_BUILTIN_CALL_DESCRIPTORS_H_
6#define V8_COMPILER_TURBOSHAFT_BUILTIN_CALL_DESCRIPTORS_H_
7
11#include "src/compiler/frame.h"
17
19
21 private:
22 template <typename Derived>
23 struct Descriptor {
24 static const TSCallDescriptor* Create(
25 StubCallMode call_mode, Zone* zone,
26 LazyDeoptOnThrow lazy_deopt_on_throw = LazyDeoptOnThrow::kNo) {
27 CallInterfaceDescriptor interface_descriptor =
28 Builtins::CallInterfaceDescriptorFor(Derived::kFunction);
29 auto descriptor = Linkage::GetStubCallDescriptor(
30 zone, interface_descriptor,
31 interface_descriptor.GetStackParameterCount(),
32 Derived::kNeedsFrameState ? CallDescriptor::kNeedsFrameState
34 Derived::kProperties, call_mode);
35#ifdef DEBUG
36 Derived::Verify(descriptor);
37#endif // DEBUG
38 bool can_throw = !(Derived::kProperties & Operator::kNoThrow);
40 descriptor, can_throw ? CanThrow::kYes : CanThrow::kNo,
41 lazy_deopt_on_throw, zone);
42 }
43
44#ifdef DEBUG
45 static void Verify(const CallDescriptor* desc) {
46 using results_t = typename Derived::results_t;
47 using arguments_t = typename Derived::arguments_t;
48 DCHECK_EQ(desc->ReturnCount(), std::tuple_size_v<results_t>);
49 if constexpr (std::tuple_size_v<results_t> >= 1) {
50 using result0_t = std::tuple_element_t<0, results_t>;
51 DCHECK(AllowsRepresentation<result0_t>(
53 desc->GetReturnType(0).representation())));
54 }
55 if constexpr (std::tuple_size_v<results_t> >= 2) {
56 using result1_t = std::tuple_element_t<1, results_t>;
57 DCHECK(AllowsRepresentation<result1_t>(
59 desc->GetReturnType(1).representation())));
60 }
61 DCHECK_EQ(desc->NeedsFrameState(), Derived::kNeedsFrameState);
62 DCHECK_EQ(desc->properties(), Derived::kProperties);
63 DCHECK_EQ(desc->ParameterCount(), std::tuple_size_v<arguments_t> +
64 (Derived::kNeedsContext ? 1 : 0));
65 DCHECK(VerifyArguments<arguments_t>(desc));
66 }
67
68 template <typename Arguments>
69 static bool VerifyArguments(const CallDescriptor* desc) {
70 return VerifyArgumentsImpl<Arguments>(
71 desc, std::make_index_sequence<std::tuple_size_v<Arguments>>());
72 }
73
74 private:
75 template <typename T>
76 static bool AllowsRepresentation(RegisterRepresentation rep) {
77 if constexpr (std::is_same_v<T, OpIndex>) {
78 return true;
79 } else {
80 // T is V<...>
81 return T::allows_representation(rep);
82 }
83 }
84 template <typename Arguments, size_t... Indices>
85 static bool VerifyArgumentsImpl(const CallDescriptor* desc,
86 std::index_sequence<Indices...>) {
87 return (AllowsRepresentation<std::tuple_element_t<Indices, Arguments>>(
89 desc->GetParameterType(Indices).representation())) &&
90 ...);
91 }
92#endif // DEBUG
93 };
94
96 // TODO(nicohartmann@): Unfortunately, we cannot define builtins with
97 // void/never return types properly (e.g. in Torque), but they typically have
98 // a JSAny dummy return type. Use Void/Never sentinels to express that in
99 // Turboshaft's descriptors. We should find a better way to model this.
100 using Void = std::tuple<OpIndex>;
101 using Never = std::tuple<OpIndex>;
102
103 public:
104 struct CheckTurbofanType : public Descriptor<CheckTurbofanType> {
105 static constexpr auto kFunction = Builtin::kCheckTurbofanType;
106 using arguments_t = std::tuple<V<Object>, V<TurbofanType>, V<Smi>>;
107 using results_t = std::tuple<V<Object>>;
108
109 static constexpr bool kNeedsFrameState = false;
110 static constexpr bool kNeedsContext = true;
113 static constexpr OpEffects kEffects =
115 };
116
117#define DECL_GENERIC_BINOP(Name) \
118 struct Name : public Descriptor<Name> { \
119 static constexpr auto kFunction = Builtin::k##Name; \
120 using arguments_t = std::tuple<V<Object>, V<Object>>; \
121 using results_t = std::tuple<V<Object>>; \
122 \
123 static constexpr bool kNeedsFrameState = true; \
124 static constexpr bool kNeedsContext = true; \
125 static constexpr Operator::Properties kProperties = \
126 Operator::kNoProperties; \
127 static constexpr OpEffects kEffects = base_effects.CanCallAnything(); \
128 };
130#undef DECL_GENERIC_BINOP
131
132#define DECL_GENERIC_UNOP(Name) \
133 struct Name : public Descriptor<Name> { \
134 static constexpr auto kFunction = Builtin::k##Name; \
135 using arguments_t = std::tuple<V<Object>>; \
136 using results_t = std::tuple<V<Object>>; \
137 \
138 static constexpr bool kNeedsFrameState = true; \
139 static constexpr bool kNeedsContext = true; \
140 static constexpr Operator::Properties kProperties = \
141 Operator::kNoProperties; \
142 static constexpr OpEffects kEffects = base_effects.CanCallAnything(); \
143 };
145#undef DECL_GENERIC_UNOP
146
147 struct ToNumber : public Descriptor<ToNumber> {
148 static constexpr auto kFunction = Builtin::kToNumber;
149 using arguments_t = std::tuple<V<Object>>;
150 using results_t = std::tuple<V<Number>>;
151
152 static constexpr bool kNeedsFrameState = true;
153 static constexpr bool kNeedsContext = true;
156 };
157
158 struct NonNumberToNumber : public Descriptor<NonNumberToNumber> {
159 static constexpr auto kFunction = Builtin::kNonNumberToNumber;
160 using arguments_t = std::tuple<V<JSAnyNotNumber>>;
161 using results_t = std::tuple<V<Number>>;
162
163 static constexpr bool kNeedsFrameState = false;
164 static constexpr bool kNeedsContext = true;
167 };
168
169 struct ToNumeric : public Descriptor<ToNumeric> {
170 static constexpr auto kFunction = Builtin::kToNumeric;
171 using arguments_t = std::tuple<V<Object>>;
172 using results_t = std::tuple<V<Numeric>>;
173
174 static constexpr bool kNeedsFrameState = true;
175 static constexpr bool kNeedsContext = true;
178 };
179
180 struct NonNumberToNumeric : public Descriptor<NonNumberToNumeric> {
181 static constexpr auto kFunction = Builtin::kNonNumberToNumeric;
182 using arguments_t = std::tuple<V<JSAnyNotNumber>>;
183 using results_t = std::tuple<V<Numeric>>;
184
185 static constexpr bool kNeedsFrameState = false;
186 static constexpr bool kNeedsContext = true;
189 };
190
192 : public Descriptor<CopyFastSmiOrObjectElements> {
193 static constexpr auto kFunction = Builtin::kCopyFastSmiOrObjectElements;
194 using arguments_t = std::tuple<V<Object>>;
195 using results_t = std::tuple<V<Object>>;
196
197 static constexpr bool kNeedsFrameState = false;
198 static constexpr bool kNeedsContext = false;
200 static constexpr OpEffects kEffects =
202 };
203
204 template <Builtin B, typename Input>
205 struct DebugPrint : public Descriptor<DebugPrint<B, Input>> {
206 static constexpr auto kFunction = B;
207 using arguments_t = std::tuple<V<Input>>;
208 using results_t = std::tuple<V<Object>>;
209
210 static constexpr bool kNeedsFrameState = false;
211 static constexpr bool kNeedsContext = true;
215 };
218
219 template <Builtin B>
220 struct FindOrderedHashEntry : public Descriptor<FindOrderedHashEntry<B>> {
221 static constexpr auto kFunction = B;
222 using arguments_t = std::tuple<V<Object>, V<Smi>>;
223 using results_t = std::tuple<V<Smi>>;
224
225 static constexpr bool kNeedsFrameState = false;
226 static constexpr bool kNeedsContext = true;
228 static constexpr OpEffects kEffects =
230 };
235
236 template <Builtin B>
237 struct GrowFastElements : public Descriptor<GrowFastElements<B>> {
238 static constexpr auto kFunction = B;
239 using arguments_t = std::tuple<V<Object>, V<Smi>>;
240 using results_t = std::tuple<V<Object>>;
241
242 static constexpr bool kNeedsFrameState = false;
243 static constexpr bool kNeedsContext = false;
245 static constexpr OpEffects kEffects =
247 };
252
253 template <Builtin B>
254 struct NewArgumentsElements : public Descriptor<NewArgumentsElements<B>> {
255 static constexpr auto kFunction = B;
256 // TODO(nicohartmann@): First argument should be replaced by a proper
257 // RawPtr.
258 using arguments_t = std::tuple<V<WordPtr>, V<WordPtr>, V<Smi>>;
259 using results_t = std::tuple<V<FixedArray>>;
260
261 static constexpr bool kNeedsFrameState = false;
262 static constexpr bool kNeedsContext = false;
265 };
272
273 struct NumberToString : public Descriptor<NumberToString> {
274 static constexpr auto kFunction = Builtin::kNumberToString;
275 using arguments_t = std::tuple<V<Number>>;
276 using results_t = std::tuple<V<String>>;
277
278 static constexpr bool kNeedsFrameState = false;
279 static constexpr bool kNeedsContext = false;
281 static constexpr OpEffects kEffects =
283 };
284
285 struct ToString : public Descriptor<ToString> {
286 static constexpr auto kFunction = Builtin::kToString;
287 using arguments_t = std::tuple<V<Object>>;
288 using results_t = std::tuple<V<String>>;
289
290 static constexpr bool kNeedsFrameState = true;
291 static constexpr bool kNeedsContext = true;
294 };
295
296 struct PlainPrimitiveToNumber : public Descriptor<PlainPrimitiveToNumber> {
297 static constexpr auto kFunction = Builtin::kPlainPrimitiveToNumber;
298 using arguments_t = std::tuple<V<PlainPrimitive>>;
299 using results_t = std::tuple<V<Number>>;
300
301 static constexpr bool kNeedsFrameState = false;
302 static constexpr bool kNeedsContext = false;
304 static constexpr OpEffects kEffects =
306 };
307
308 struct SameValue : public Descriptor<SameValue> {
309 static constexpr auto kFunction = Builtin::kSameValue;
310 using arguments_t = std::tuple<V<Object>, V<Object>>;
311 using results_t = std::tuple<V<Boolean>>;
312
313 static constexpr bool kNeedsFrameState = false;
314 static constexpr bool kNeedsContext = false;
316 static constexpr OpEffects kEffects =
318 };
319
320 struct SameValueNumbersOnly : public Descriptor<SameValueNumbersOnly> {
321 static constexpr auto kFunction = Builtin::kSameValueNumbersOnly;
322 using arguments_t = std::tuple<V<Object>, V<Object>>;
323 using results_t = std::tuple<V<Boolean>>;
324
325 static constexpr bool kNeedsFrameState = false;
326 static constexpr bool kNeedsContext = false;
329 };
330
331 struct StringAdd_CheckNone : public Descriptor<StringAdd_CheckNone> {
332 static constexpr auto kFunction = Builtin::kStringAdd_CheckNone;
333 using arguments_t = std::tuple<V<String>, V<String>>;
334 using results_t = std::tuple<V<String>>;
335
336 static constexpr bool kNeedsFrameState = false;
337 static constexpr bool kNeedsContext = true;
340 // This will only write in a fresh object, so the writes are not visible
341 // from Turboshaft, and CanAllocate is enough.
342 static constexpr OpEffects kEffects =
344 };
345
346 struct StringEqual : public Descriptor<StringEqual> {
347 static constexpr auto kFunction = Builtin::kStringEqual;
348 using arguments_t = std::tuple<V<String>, V<String>, V<WordPtr>>;
349 using results_t = std::tuple<V<Boolean>>;
350
351 static constexpr bool kNeedsFrameState = false;
352 static constexpr bool kNeedsContext = false;
354 // If the strings aren't flat, StringEqual could flatten them, which will
355 // allocate new strings.
356 static constexpr OpEffects kEffects =
358 };
359
360 struct StringFromCodePointAt : public Descriptor<StringFromCodePointAt> {
361 static constexpr auto kFunction = Builtin::kStringFromCodePointAt;
362 using arguments_t = std::tuple<V<String>, V<WordPtr>>;
363 using results_t = std::tuple<V<String>>;
364
365 static constexpr bool kNeedsFrameState = false;
366 static constexpr bool kNeedsContext = false;
368 static constexpr OpEffects kEffects =
370 };
371
372 struct StringIndexOf : public Descriptor<StringIndexOf> {
373 static constexpr auto kFunction = Builtin::kStringIndexOf;
374 using arguments_t = std::tuple<V<String>, V<String>, V<Smi>>;
375 using results_t = std::tuple<V<Smi>>;
376
377 static constexpr bool kNeedsFrameState = false;
378 static constexpr bool kNeedsContext = false;
380 // StringIndexOf does a ToString on the receiver, which can allocate a new
381 // string.
382 static constexpr OpEffects kEffects =
384 };
385
386 struct StringCompare : public Descriptor<StringCompare> {
387 static constexpr auto kFunction = Builtin::kStringCompare;
388 using arguments_t = std::tuple<V<String>, V<String>>;
389 using results_t = std::tuple<V<Smi>>;
390
391 static constexpr bool kNeedsFrameState = false;
392 static constexpr bool kNeedsContext = false;
394 static constexpr OpEffects kEffects =
396 };
397
398 template <Builtin B>
399 struct StringComparison : public Descriptor<StringComparison<B>> {
400 static constexpr auto kFunction = B;
401 using arguments_t = std::tuple<V<String>, V<String>>;
402 using results_t = std::tuple<V<Boolean>>;
403
404 static constexpr bool kNeedsFrameState = false;
405 static constexpr bool kNeedsContext = false;
407 static constexpr OpEffects kEffects =
409 };
413
414 struct StringSubstring : public Descriptor<StringSubstring> {
415 static constexpr auto kFunction = Builtin::kStringSubstring;
416 using arguments_t = std::tuple<V<String>, V<WordPtr>, V<WordPtr>>;
417 using results_t = std::tuple<V<String>>;
418
419 static constexpr bool kNeedsFrameState = false;
420 static constexpr bool kNeedsContext = false;
422 static constexpr OpEffects kEffects =
424 };
425
426#ifdef V8_INTL_SUPPORT
427 struct StringToLowerCaseIntl : public Descriptor<StringToLowerCaseIntl> {
428 static constexpr auto kFunction = Builtin::kStringToLowerCaseIntl;
429 using arguments_t = std::tuple<V<String>>;
430 using results_t = std::tuple<V<String>>;
431
432 static constexpr bool kNeedsFrameState = false;
433 static constexpr bool kNeedsContext = true;
434 static constexpr Operator::Properties kProperties =
435 Operator::kNoDeopt | Operator::kNoThrow;
436 static constexpr OpEffects kEffects =
438 };
439#endif // V8_INTL_SUPPORT
440
441 struct StringToNumber : public Descriptor<StringToNumber> {
442 static constexpr auto kFunction = Builtin::kStringToNumber;
443 using arguments_t = std::tuple<V<String>>;
444 using results_t = std::tuple<V<Number>>;
445
446 static constexpr bool kNeedsFrameState = false;
447 static constexpr bool kNeedsContext = false;
449 static constexpr OpEffects kEffects =
451 };
452
453 struct ToBoolean : public Descriptor<ToBoolean> {
454 static constexpr auto kFunction = Builtin::kToBoolean;
455 using arguments_t = std::tuple<V<Object>>;
456 using results_t = std::tuple<V<Boolean>>;
457
458 static constexpr bool kNeedsFrameState = false;
459 static constexpr bool kNeedsContext = false;
462 };
463
464 struct ToObject : public Descriptor<ToObject> {
465 static constexpr auto kFunction = Builtin::kToObject;
466 using arguments_t = std::tuple<V<JSPrimitive>>;
467 using results_t = std::tuple<V<JSReceiver>>;
468
469 static constexpr bool kNeedsFrameState = false;
470 static constexpr bool kNeedsContext = true;
472 static constexpr OpEffects kEffects =
474 };
475
476 template <Builtin B>
477 struct CreateFunctionContext : public Descriptor<CreateFunctionContext<B>> {
478 static constexpr auto kFunction = B;
479 using arguments_t = std::tuple<V<ScopeInfo>, V<Word32>>;
480 using results_t = std::tuple<V<Context>>;
481
482 static constexpr bool kNeedsFrameState = true;
483 static constexpr bool kNeedsContext = true;
485 static constexpr OpEffects kEffects =
487 };
488
493
494 struct FastNewClosure : public Descriptor<FastNewClosure> {
495 static constexpr auto kFunction = Builtin::kFastNewClosure;
496 using arguments_t = std::tuple<V<SharedFunctionInfo>, V<FeedbackCell>>;
497 using results_t = std::tuple<V<JSFunction>>;
498
499 static constexpr bool kNeedsFrameState = true;
500 static constexpr bool kNeedsContext = true;
503 static constexpr OpEffects kEffects =
505 };
506
507 struct Typeof : public Descriptor<Typeof> {
508 static constexpr auto kFunction = Builtin::kTypeof;
509 using arguments_t = std::tuple<V<Object>>;
510 using results_t = std::tuple<V<String>>;
511
512 static constexpr bool kNeedsFrameState = false;
513 static constexpr bool kNeedsContext = false;
516 };
517
519 : public Descriptor<CheckTurboshaftWord32Type> {
520 static constexpr auto kFunction = Builtin::kCheckTurboshaftWord32Type;
521 using arguments_t = std::tuple<V<Word32>, V<TurboshaftWord32Type>, V<Smi>>;
522 using results_t = std::tuple<V<Oddball>>;
523 static constexpr bool kNeedsFrameState = false;
524 static constexpr bool kNeedsContext = false;
527 };
528
530 : public Descriptor<CheckTurboshaftWord64Type> {
531 static constexpr auto kFunction = Builtin::kCheckTurboshaftWord64Type;
533 std::tuple<V<Word32>, V<Word32>, V<TurboshaftWord64Type>, V<Smi>>;
534 using results_t = std::tuple<V<Oddball>>;
535 static constexpr bool kNeedsFrameState = false;
536 static constexpr bool kNeedsContext = false;
539 };
540
542 : public Descriptor<CheckTurboshaftFloat32Type> {
543 static constexpr auto kFunction = Builtin::kCheckTurboshaftFloat32Type;
545 std::tuple<V<Float32>, V<TurboshaftFloat64Type>, V<Smi>>;
546 using results_t = std::tuple<V<Oddball>>;
547 static constexpr bool kNeedsFrameState = false;
548 static constexpr bool kNeedsContext = false;
551 };
552
554 : public Descriptor<CheckTurboshaftFloat64Type> {
555 static constexpr auto kFunction = Builtin::kCheckTurboshaftFloat64Type;
557 std::tuple<V<Float64>, V<TurboshaftFloat64Type>, V<Smi>>;
558 using results_t = std::tuple<V<Oddball>>;
559 static constexpr bool kNeedsFrameState = false;
560 static constexpr bool kNeedsContext = false;
563 };
564
565#ifdef V8_ENABLE_WEBASSEMBLY
566
567 struct WasmStringAsWtf8 : public Descriptor<WasmStringAsWtf8> {
568 static constexpr auto kFunction = Builtin::kWasmStringAsWtf8;
569 using arguments_t = std::tuple<V<String>>;
570 using results_t = std::tuple<V<ByteArray>>;
571
572 static constexpr bool kNeedsFrameState = false;
573 static constexpr bool kNeedsContext = false;
574 static constexpr Operator::Properties kProperties = Operator::kEliminatable;
575 static constexpr OpEffects kEffects =
577 };
578
579 struct WasmStringAsWtf16 : public Descriptor<WasmStringAsWtf16> {
580 static constexpr auto kFunction = Builtin::kWasmStringAsWtf16;
581 using arguments_t = std::tuple<V<String>>;
582 using results_t = std::tuple<V<String>>;
583
584 static constexpr bool kNeedsFrameState = false;
585 static constexpr bool kNeedsContext = false;
586 static constexpr Operator::Properties kProperties = Operator::kEliminatable;
587 static constexpr OpEffects kEffects =
589 };
590
591 struct WasmInt32ToHeapNumber : public Descriptor<WasmInt32ToHeapNumber> {
592 static constexpr auto kFunction = Builtin::kWasmInt32ToHeapNumber;
593 using arguments_t = std::tuple<V<Word32>>;
594 using results_t = std::tuple<V<HeapNumber>>;
595
596 static constexpr bool kNeedsFrameState = false;
597 static constexpr bool kNeedsContext = false;
598 static constexpr Operator::Properties kProperties = Operator::kPure;
599 static constexpr OpEffects kEffects =
600 base_effects.CanAllocateWithoutIdentity();
601 };
602
603 struct WasmRefFunc : public Descriptor<WasmRefFunc> {
604 static constexpr auto kFunction = Builtin::kWasmRefFunc;
605 using arguments_t = std::tuple<V<Word32>, V<Word32>>;
606 using results_t = std::tuple<V<WasmFuncRef>>;
607
608 static constexpr bool kNeedsFrameState = false;
609 static constexpr bool kNeedsContext = false;
610 static constexpr Operator::Properties kProperties = Operator::kNoThrow;
611 // TODO(nicohartmann@): Use more precise effects.
612 static constexpr OpEffects kEffects = base_effects.CanCallAnything();
613 };
614
615 struct WasmAllocateDescriptorStruct
616 : public Descriptor<WasmAllocateDescriptorStruct> {
617 static constexpr auto kFunction = Builtin::kWasmAllocateDescriptorStruct;
618 using arguments_t = std::tuple<V<Map>, V<Word32>>;
619 using results_t = std::tuple<V<WasmStruct>>;
620
621 static constexpr bool kNeedsFrameState = false;
622 static constexpr bool kNeedsContext = false;
623 static constexpr Operator::Properties kProperties = Operator::kEliminatable;
624 static constexpr OpEffects kEffects = base_effects.CanAllocate();
625 };
626
627 struct WasmGetOwnProperty : public Descriptor<WasmGetOwnProperty> {
628 static constexpr auto kFunction = Builtin::kWasmGetOwnProperty;
629 using arguments_t = std::tuple<V<Object>, V<Symbol>>;
630 using results_t = std::tuple<V<Object>>;
631
632 static constexpr bool kNeedsFrameState = false;
633 static constexpr bool kNeedsContext = true;
634 static constexpr Operator::Properties kProperties = Operator::kNoThrow;
635 static constexpr OpEffects kEffects = base_effects.CanReadHeapMemory();
636 };
637
638 struct WasmRethrow : public Descriptor<WasmRethrow> {
639 static constexpr auto kFunction = Builtin::kWasmRethrow;
640 using arguments_t = std::tuple<V<Object>>;
641 using results_t = std::tuple<OpIndex>;
642
643 static constexpr bool kNeedsFrameState = false;
644 static constexpr bool kNeedsContext = false;
645 static constexpr Operator::Properties kProperties = Operator::kNoProperties;
646 static constexpr OpEffects kEffects = base_effects.CanChangeControlFlow();
647 };
648
649 struct WasmThrowRef : public Descriptor<WasmThrowRef> {
650 static constexpr auto kFunction = Builtin::kWasmThrowRef;
651 using arguments_t = std::tuple<V<Object>>;
652 using results_t = std::tuple<OpIndex>;
653
654 static constexpr bool kNeedsFrameState = false;
655 static constexpr bool kNeedsContext = false;
656 static constexpr Operator::Properties kProperties = Operator::kNoProperties;
657 static constexpr OpEffects kEffects = base_effects.CanChangeControlFlow();
658 };
659
660 struct WasmMemoryGrow : public Descriptor<WasmMemoryGrow> {
661 static constexpr auto kFunction = Builtin::kWasmMemoryGrow;
662 using arguments_t = std::tuple<V<Word32>, V<Word32>>;
663 using results_t = std::tuple<V<Word32>>;
664
665 static constexpr bool kNeedsFrameState = false;
666 static constexpr bool kNeedsContext = false;
667 static constexpr Operator::Properties kProperties = Operator::kNoProperties;
668 static constexpr OpEffects kEffects =
669 base_effects.CanReadMemory().CanWriteMemory();
670 };
671
672 struct WasmStringFromCodePoint : public Descriptor<WasmStringFromCodePoint> {
673 static constexpr auto kFunction = Builtin::kWasmStringFromCodePoint;
674 using arguments_t = std::tuple<V<Word32>>;
675 using results_t = std::tuple<V<String>>;
676
677 static constexpr bool kNeedsFrameState = false;
678 static constexpr bool kNeedsContext = false;
679 static constexpr Operator::Properties kProperties =
680 Operator::kNoDeopt | Operator::kNoWrite;
681 static constexpr OpEffects kEffects =
683 };
684
685 struct WasmStringNewWtf8Array : public Descriptor<WasmStringNewWtf8Array> {
686 static constexpr auto kFunction = Builtin::kWasmStringNewWtf8Array;
687 using arguments_t = std::tuple<V<Word32>, V<Word32>, V<WasmArray>, V<Smi>>;
688 using results_t = std::tuple<V<WasmStringRefNullable>>;
689
690 static constexpr bool kNeedsFrameState = false;
691 static constexpr bool kNeedsContext = false;
692 static constexpr Operator::Properties kProperties =
693 Operator::kNoDeopt | Operator::kNoThrow;
694 static constexpr OpEffects kEffects = base_effects.CanReadHeapMemory()
697 };
698
699 struct WasmStringNewWtf16Array : public Descriptor<WasmStringNewWtf16Array> {
700 static constexpr auto kFunction = Builtin::kWasmStringNewWtf16Array;
701 using arguments_t = std::tuple<V<WasmArray>, V<Word32>, V<Word32>>;
702 using results_t = std::tuple<V<String>>;
703
704 static constexpr bool kNeedsFrameState = false;
705 static constexpr bool kNeedsContext = false;
706 static constexpr Operator::Properties kProperties =
707 Operator::kNoDeopt | Operator::kNoThrow;
708 static constexpr OpEffects kEffects = base_effects.CanReadHeapMemory()
711 };
712
713 struct WasmStringViewWtf8Slice : public Descriptor<WasmStringViewWtf8Slice> {
714 static constexpr auto kFunction = Builtin::kWasmStringViewWtf8Slice;
715 using arguments_t = std::tuple<V<ByteArray>, V<Word32>, V<Word32>>;
716 using results_t = std::tuple<V<String>>;
717
718 static constexpr bool kNeedsFrameState = false;
719 static constexpr bool kNeedsContext = false;
720 static constexpr Operator::Properties kProperties = Operator::kEliminatable;
721 static constexpr OpEffects kEffects =
723 };
724
725 struct WasmStringViewWtf16Slice
726 : public Descriptor<WasmStringViewWtf16Slice> {
727 static constexpr auto kFunction = Builtin::kWasmStringViewWtf16Slice;
728 using arguments_t = std::tuple<V<String>, V<Word32>, V<Word32>>;
729 using results_t = std::tuple<V<String>>;
730
731 static constexpr bool kNeedsFrameState = false;
732 static constexpr bool kNeedsContext = false;
733 static constexpr Operator::Properties kProperties = Operator::kEliminatable;
734 static constexpr OpEffects kEffects =
736 };
737
738 struct WasmStringEncodeWtf8Array
739 : public Descriptor<WasmStringEncodeWtf8Array> {
740 static constexpr auto kFunction = Builtin::kWasmStringEncodeWtf8Array;
741 using arguments_t = std::tuple<V<String>, V<WasmArray>, V<Word32>, V<Smi>>;
742 using results_t = std::tuple<V<Word32>>;
743
744 static constexpr bool kNeedsFrameState = false;
745 static constexpr bool kNeedsContext = false;
746 static constexpr Operator::Properties kProperties =
747 Operator::kNoDeopt | Operator::kNoThrow;
748 static constexpr OpEffects kEffects =
749 base_effects.CanReadMemory().CanWriteHeapMemory();
750 };
751
752 struct WasmStringToUtf8Array : public Descriptor<WasmStringToUtf8Array> {
753 static constexpr auto kFunction = Builtin::kWasmStringToUtf8Array;
754 using arguments_t = std::tuple<V<String>>;
755 using results_t = std::tuple<V<WasmArray>>;
756 static constexpr bool kNeedsFrameState = false;
757 static constexpr bool kNeedsContext = false;
758 static constexpr Operator::Properties kProperties =
759 Operator::kNoDeopt | Operator::kNoThrow;
760 static constexpr OpEffects kEffects =
761 base_effects.CanReadMemory().CanAllocate();
762 };
763
764 struct WasmStringEncodeWtf16Array
765 : public Descriptor<WasmStringEncodeWtf16Array> {
766 static constexpr auto kFunction = Builtin::kWasmStringEncodeWtf16Array;
767 using arguments_t = std::tuple<V<String>, V<WasmArray>, V<Word32>>;
768 using results_t = std::tuple<V<Word32>>;
769
770 static constexpr bool kNeedsFrameState = false;
771 static constexpr bool kNeedsContext = false;
772 static constexpr Operator::Properties kProperties =
773 Operator::kNoDeopt | Operator::kNoThrow;
774 static constexpr OpEffects kEffects = base_effects.CanReadMemory()
777 };
778
779 struct WasmFloat64ToString : public Descriptor<WasmFloat64ToString> {
780 static constexpr auto kFunction = Builtin::kWasmFloat64ToString;
781 using arguments_t = std::tuple<V<Float64>>;
782 using results_t = std::tuple<V<String>>;
783
784 static constexpr bool kNeedsFrameState = false;
785 static constexpr bool kNeedsContext = false;
786 static constexpr Operator::Properties kProperties = Operator::kEliminatable;
787 static constexpr OpEffects kEffects =
788 base_effects.CanAllocateWithoutIdentity();
789 };
790
791 struct WasmIntToString : public Descriptor<WasmIntToString> {
792 static constexpr auto kFunction = Builtin::kWasmIntToString;
793 using arguments_t = std::tuple<V<Word32>, V<Word32>>;
794 using results_t = std::tuple<V<String>>;
795
796 static constexpr bool kNeedsFrameState = false;
797 static constexpr bool kNeedsContext = false;
798 static constexpr Operator::Properties kProperties = Operator::kNoDeopt;
799 static constexpr OpEffects kEffects =
800 base_effects.CanAllocateWithoutIdentity();
801 };
802
803 struct WasmStringToDouble : public Descriptor<WasmStringToDouble> {
804 static constexpr auto kFunction = Builtin::kWasmStringToDouble;
805 using arguments_t = std::tuple<V<String>>;
806 using results_t = std::tuple<V<Float64>>;
807
808 static constexpr bool kNeedsFrameState = false;
809 static constexpr bool kNeedsContext = false;
810 static constexpr Operator::Properties kProperties = Operator::kEliminatable;
811 static constexpr OpEffects kEffects = base_effects.CanReadMemory();
812 };
813
814 struct WasmAllocateFixedArray : public Descriptor<WasmAllocateFixedArray> {
815 static constexpr auto kFunction = Builtin::kWasmAllocateFixedArray;
816 using arguments_t = std::tuple<V<WordPtr>>;
817 using results_t = std::tuple<V<FixedArray>>;
818
819 static constexpr bool kNeedsFrameState = false;
820 static constexpr bool kNeedsContext = false;
821 static constexpr Operator::Properties kProperties = Operator::kNoProperties;
822 static constexpr OpEffects kEffects = base_effects.CanAllocate();
823 };
824
825 struct WasmThrow : public Descriptor<WasmThrow> {
826 static constexpr auto kFunction = Builtin::kWasmThrow;
827 using arguments_t = std::tuple<V<Object>, V<FixedArray>>;
828 using results_t = std::tuple<OpIndex>;
829
830 static constexpr bool kNeedsFrameState = false;
831 static constexpr bool kNeedsContext = false;
832 static constexpr Operator::Properties kProperties = Operator::kNoProperties;
833 static constexpr OpEffects kEffects =
835 };
836
837 struct WasmI32AtomicWait : public Descriptor<WasmI32AtomicWait> {
838 static constexpr auto kFunction = Builtin::kWasmI32AtomicWait;
839 using arguments_t = std::tuple<V<Word32>, V<WordPtr>, V<Word32>, V<BigInt>>;
840 using results_t = std::tuple<V<Word32>>;
841
842 static constexpr bool kNeedsFrameState = false;
843 static constexpr bool kNeedsContext = false;
844 static constexpr Operator::Properties kProperties = Operator::kNoProperties;
845 static constexpr OpEffects kEffects = base_effects.CanCallAnything();
846 };
847
848 struct WasmI64AtomicWait : public Descriptor<WasmI64AtomicWait> {
849 static constexpr auto kFunction = Builtin::kWasmI64AtomicWait;
850 using arguments_t = std::tuple<V<Word32>, V<WordPtr>, V<BigInt>, V<BigInt>>;
851 using results_t = std::tuple<V<Word32>>;
852
853 static constexpr bool kNeedsFrameState = false;
854 static constexpr bool kNeedsContext = false;
855 static constexpr Operator::Properties kProperties = Operator::kNoProperties;
856 static constexpr OpEffects kEffects = base_effects.CanCallAnything();
857 };
858
859 struct WasmFunctionTableGet : public Descriptor<WasmFunctionTableGet> {
860 static constexpr auto kFunction = Builtin::kWasmFunctionTableGet;
861 using arguments_t = std::tuple<V<WordPtr>, V<WordPtr>, V<Word32>>;
862 using results_t = std::tuple<V<Object>>;
863
864 static constexpr bool kNeedsFrameState = false;
865 static constexpr bool kNeedsContext = false;
866 static constexpr Operator::Properties kProperties = Operator::kNoProperties;
867 static constexpr OpEffects kEffects =
868 base_effects.CanReadMemory().CanWriteMemory().CanAllocate();
869 };
870
871 struct WasmTableSetFuncRef : public Descriptor<WasmTableSetFuncRef> {
872 static constexpr auto kFunction = Builtin::kWasmTableSetFuncRef;
873 using arguments_t =
874 std::tuple<V<WordPtr>, V<Word32>, V<WordPtr>, V<WasmFuncRef>>;
875 using results_t = std::tuple<V<Object>>;
876
877 static constexpr bool kNeedsFrameState = false;
878 static constexpr bool kNeedsContext = false;
879 static constexpr Operator::Properties kProperties = Operator::kNoProperties;
880 static constexpr OpEffects kEffects = base_effects.CanWriteMemory();
881 };
882
883 struct WasmTableSet : public Descriptor<WasmTableSet> {
884 static constexpr auto kFunction = Builtin::kWasmTableSet;
885 using arguments_t =
886 std::tuple<V<WordPtr>, V<Word32>, V<WordPtr>, V<Object>>;
887 using results_t = std::tuple<V<Object>>;
888
889 static constexpr bool kNeedsFrameState = false;
890 static constexpr bool kNeedsContext = false;
891 static constexpr Operator::Properties kProperties = Operator::kNoProperties;
892 static constexpr OpEffects kEffects = base_effects.CanWriteMemory();
893 };
894
895 struct WasmTableInit : public Descriptor<WasmTableInit> {
896 static constexpr auto kFunction = Builtin::kWasmTableInit;
897 using arguments_t =
898 std::tuple<V<WordPtr>, V<Word32>, V<Word32>, V<Smi>, V<Smi>, V<Smi>>;
899 using results_t = std::tuple<V<Object>>;
900
901 static constexpr bool kNeedsFrameState = false;
902 static constexpr bool kNeedsContext = false;
903 static constexpr Operator::Properties kProperties = Operator::kNoProperties;
904 static constexpr OpEffects kEffects = base_effects.CanWriteMemory();
905 };
906
907 struct WasmTableCopy : public Descriptor<WasmTableCopy> {
908 static constexpr auto kFunction = Builtin::kWasmTableCopy;
909 using arguments_t =
910 std::tuple<V<WordPtr>, V<WordPtr>, V<WordPtr>, V<Smi>, V<Smi>, V<Smi>>;
911 using results_t = std::tuple<V<Object>>;
912
913 static constexpr bool kNeedsFrameState = false;
914 static constexpr bool kNeedsContext = false;
915 static constexpr Operator::Properties kProperties = Operator::kNoProperties;
916 static constexpr OpEffects kEffects =
917 base_effects.CanReadMemory().CanWriteMemory();
918 };
919
920 struct WasmTableGrow : public Descriptor<WasmTableGrow> {
921 static constexpr auto kFunction = Builtin::kWasmTableGrow;
922 using arguments_t = std::tuple<V<Smi>, V<WordPtr>, V<Word32>, V<Object>>;
923 using results_t = std::tuple<V<Smi>>;
924
925 static constexpr bool kNeedsFrameState = false;
926 static constexpr bool kNeedsContext = false;
927 static constexpr Operator::Properties kProperties = Operator::kNoProperties;
928 static constexpr OpEffects kEffects =
929 base_effects.CanReadMemory().CanWriteMemory().CanAllocate();
930 };
931
932 struct WasmTableFill : public Descriptor<WasmTableFill> {
933 static constexpr auto kFunction = Builtin::kWasmTableFill;
934 using arguments_t =
935 std::tuple<V<WordPtr>, V<WordPtr>, V<Word32>, V<Smi>, V<Object>>;
936 using results_t = std::tuple<V<Object>>;
937
938 static constexpr bool kNeedsFrameState = false;
939 static constexpr bool kNeedsContext = false;
940 static constexpr Operator::Properties kProperties = Operator::kNoProperties;
941 static constexpr OpEffects kEffects = base_effects.CanWriteMemory();
942 };
943
944 struct WasmArrayNewSegment : public Descriptor<WasmArrayNewSegment> {
945 static constexpr auto kFunction = Builtin::kWasmArrayNewSegment;
946 using arguments_t =
947 std::tuple<V<Word32>, V<Word32>, V<Word32>, V<Smi>, V<Smi>, V<Map>>;
948 using results_t = std::tuple<V<WasmArray>>;
949
950 static constexpr bool kNeedsFrameState = false;
951 static constexpr bool kNeedsContext = false;
952 static constexpr Operator::Properties kProperties = Operator::kNoProperties;
953 static constexpr OpEffects kEffects =
954 base_effects.CanReadHeapMemory().CanAllocate();
955 };
956
957 struct WasmArrayInitSegment : public Descriptor<WasmArrayInitSegment> {
958 static constexpr auto kFunction = Builtin::kWasmArrayInitSegment;
959 using arguments_t = std::tuple<V<Word32>, V<Word32>, V<Word32>, V<Smi>,
961 using results_t = std::tuple<V<Object>>;
962
963 static constexpr bool kNeedsFrameState = false;
964 static constexpr bool kNeedsContext = false;
965 static constexpr Operator::Properties kProperties = Operator::kNoProperties;
966 static constexpr OpEffects kEffects =
967 base_effects.CanWriteHeapMemory().CanReadHeapMemory();
968 };
969
970 struct WasmStringNewWtf8 : public Descriptor<WasmStringNewWtf8> {
971 static constexpr auto kFunction = Builtin::kWasmStringNewWtf8;
972 using arguments_t = std::tuple<V<WordPtr>, V<Word32>, V<Word32>, V<Smi>>;
973 using results_t = std::tuple<V<WasmStringRefNullable>>;
974
975 static constexpr bool kNeedsFrameState = false;
976 static constexpr bool kNeedsContext = false;
977 static constexpr Operator::Properties kProperties =
978 Operator::kNoDeopt | Operator::kNoThrow;
979 static constexpr OpEffects kEffects = base_effects.CanReadMemory()
982 };
983
984 struct WasmStringNewWtf16 : public Descriptor<WasmStringNewWtf16> {
985 static constexpr auto kFunction = Builtin::kWasmStringNewWtf16;
986 using arguments_t = std::tuple<V<Word32>, V<WordPtr>, V<Word32>>;
987 using results_t = std::tuple<V<String>>;
988
989 static constexpr bool kNeedsFrameState = false;
990 static constexpr bool kNeedsContext = false;
991 static constexpr Operator::Properties kProperties =
992 Operator::kNoDeopt | Operator::kNoThrow;
993 static constexpr OpEffects kEffects = base_effects.CanReadHeapMemory()
996 };
997
998 struct WasmStringFromDataSegment
999 : public Descriptor<WasmStringFromDataSegment> {
1000 static constexpr auto kFunction = Builtin::kWasmStringFromDataSegment;
1001 using arguments_t =
1002 std::tuple<V<Word32>, V<Word32>, V<Word32>, V<Smi>, V<Smi>, V<Smi>>;
1003 using results_t = std::tuple<V<WasmStringRefNullable>>;
1004
1005 static constexpr bool kNeedsFrameState = false;
1006 static constexpr bool kNeedsContext = false;
1007 static constexpr Operator::Properties kProperties = Operator::kNoDeopt;
1008 // No "CanReadMemory" because data segments are immutable.
1009 static constexpr OpEffects kEffects =
1011 };
1012
1013 struct WasmStringConst : public Descriptor<WasmStringConst> {
1014 static constexpr auto kFunction = Builtin::kWasmStringConst;
1015 using arguments_t = std::tuple<V<Word32>>;
1016 using results_t = std::tuple<V<String>>;
1017
1018 static constexpr bool kNeedsFrameState = false;
1019 static constexpr bool kNeedsContext = false;
1020 static constexpr Operator::Properties kProperties =
1021 Operator::kNoDeopt | Operator::kNoThrow;
1022 static constexpr OpEffects kEffects =
1024 };
1025
1026 struct WasmStringMeasureUtf8 : public Descriptor<WasmStringMeasureUtf8> {
1027 static constexpr auto kFunction = Builtin::kWasmStringMeasureUtf8;
1028 using arguments_t = std::tuple<V<String>>;
1029 using results_t = std::tuple<V<Word32>>;
1030
1031 static constexpr bool kNeedsFrameState = false;
1032 static constexpr bool kNeedsContext = false;
1033 static constexpr Operator::Properties kProperties = Operator::kEliminatable;
1034 static constexpr OpEffects kEffects = base_effects.CanReadMemory();
1035 };
1036
1037 struct WasmStringMeasureWtf8 : public Descriptor<WasmStringMeasureWtf8> {
1038 static constexpr auto kFunction = Builtin::kWasmStringMeasureWtf8;
1039 using arguments_t = std::tuple<V<String>>;
1040 using results_t = std::tuple<V<Word32>>;
1041
1042 static constexpr bool kNeedsFrameState = false;
1043 static constexpr bool kNeedsContext = false;
1044 static constexpr Operator::Properties kProperties = Operator::kEliminatable;
1045 static constexpr OpEffects kEffects = base_effects.CanReadMemory();
1046 };
1047
1048 struct WasmStringEncodeWtf8 : public Descriptor<WasmStringEncodeWtf8> {
1049 static constexpr auto kFunction = Builtin::kWasmStringEncodeWtf8;
1050 using arguments_t = std::tuple<V<WordPtr>, V<Word32>, V<Word32>, V<String>>;
1051 using results_t = std::tuple<V<Word32>>;
1052
1053 static constexpr bool kNeedsFrameState = false;
1054 static constexpr bool kNeedsContext = false;
1055 static constexpr Operator::Properties kProperties =
1056 Operator::kNoDeopt | Operator::kNoThrow;
1057 static constexpr OpEffects kEffects =
1058 base_effects.CanReadMemory().CanWriteMemory();
1059 };
1060
1061 struct WasmStringEncodeWtf16 : public Descriptor<WasmStringEncodeWtf16> {
1062 static constexpr auto kFunction = Builtin::kWasmStringEncodeWtf16;
1063 using arguments_t = std::tuple<V<String>, V<WordPtr>, V<Word32>>;
1064 using results_t = std::tuple<V<Word32>>;
1065
1066 static constexpr bool kNeedsFrameState = false;
1067 static constexpr bool kNeedsContext = false;
1068 static constexpr Operator::Properties kProperties =
1069 Operator::kNoDeopt | Operator::kNoThrow;
1070 static constexpr OpEffects kEffects =
1072 };
1073
1074 struct WasmStringEqual : public Descriptor<WasmStringEqual> {
1075 static constexpr auto kFunction = Builtin::kWasmStringEqual;
1076 using arguments_t = std::tuple<V<String>, V<String>>;
1077 using results_t = std::tuple<V<Word32>>;
1078
1079 static constexpr bool kNeedsFrameState = false;
1080 static constexpr bool kNeedsContext = false;
1081 static constexpr Operator::Properties kProperties = Operator::kEliminatable;
1082 static constexpr OpEffects kEffects =
1084 };
1085
1086 struct WasmStringIsUSVSequence : public Descriptor<WasmStringIsUSVSequence> {
1087 static constexpr auto kFunction = Builtin::kWasmStringIsUSVSequence;
1088 using arguments_t = std::tuple<V<String>>;
1089 using results_t = std::tuple<V<Word32>>;
1090
1091 static constexpr bool kNeedsFrameState = false;
1092 static constexpr bool kNeedsContext = false;
1093 static constexpr Operator::Properties kProperties = Operator::kEliminatable;
1094 static constexpr OpEffects kEffects = base_effects.CanReadMemory();
1095 };
1096
1097 struct WasmStringViewWtf8Advance
1098 : public Descriptor<WasmStringViewWtf8Advance> {
1099 static constexpr auto kFunction = Builtin::kWasmStringViewWtf8Advance;
1100 using arguments_t = std::tuple<V<ByteArray>, V<Word32>, V<Word32>>;
1101 using results_t = std::tuple<V<Word32>>;
1102
1103 static constexpr bool kNeedsFrameState = false;
1104 static constexpr bool kNeedsContext = false;
1105 static constexpr Operator::Properties kProperties = Operator::kEliminatable;
1106 static constexpr OpEffects kEffects = base_effects.CanReadMemory();
1107 };
1108
1109 struct WasmStringViewWtf8Encode
1110 : public Descriptor<WasmStringViewWtf8Encode> {
1111 static constexpr auto kFunction = Builtin::kWasmStringViewWtf8Encode;
1112 using arguments_t = std::tuple<V<WordPtr>, V<Word32>, V<Word32>,
1114 using results_t = std::tuple<V<Word32>, V<Word32>>;
1115
1116 static constexpr bool kNeedsFrameState = false;
1117 static constexpr bool kNeedsContext = false;
1118 static constexpr Operator::Properties kProperties =
1119 Operator::kNoDeopt | Operator::kNoThrow;
1120 static constexpr OpEffects kEffects =
1122 };
1123
1124 struct WasmStringViewWtf16Encode
1125 : public Descriptor<WasmStringViewWtf16Encode> {
1126 static constexpr auto kFunction = Builtin::kWasmStringViewWtf16Encode;
1127 using arguments_t =
1128 std::tuple<V<WordPtr>, V<Word32>, V<Word32>, V<String>, V<Smi>>;
1129 using results_t = std::tuple<V<Word32>>;
1130
1131 static constexpr bool kNeedsFrameState = false;
1132 static constexpr bool kNeedsContext = false;
1133 static constexpr Operator::Properties kProperties =
1134 Operator::kNoDeopt | Operator::kNoThrow;
1135 static constexpr OpEffects kEffects =
1136 base_effects.CanReadMemory().CanWriteMemory();
1137 };
1138
1139 struct WasmStringViewWtf16GetCodeUnit
1140 : public Descriptor<WasmStringViewWtf16GetCodeUnit> {
1141 static constexpr auto kFunction = Builtin::kWasmStringViewWtf16GetCodeUnit;
1142 using arguments_t = std::tuple<V<String>, V<Word32>>;
1143 using results_t = std::tuple<V<Word32>>;
1144
1145 static constexpr bool kNeedsFrameState = false;
1146 static constexpr bool kNeedsContext = false;
1147 static constexpr Operator::Properties kProperties = Operator::kEliminatable;
1148 static constexpr OpEffects kEffects = base_effects.CanReadMemory();
1149 };
1150
1151 struct WasmStringCodePointAt : public Descriptor<WasmStringCodePointAt> {
1152 static constexpr auto kFunction = Builtin::kWasmStringCodePointAt;
1153 using arguments_t = std::tuple<V<String>, V<Word32>>;
1154 using results_t = std::tuple<V<Word32>>;
1155
1156 static constexpr bool kNeedsFrameState = false;
1157 static constexpr bool kNeedsContext = false;
1158 static constexpr Operator::Properties kProperties = Operator::kEliminatable;
1159 static constexpr OpEffects kEffects = base_effects.CanReadMemory();
1160 };
1161
1162 struct WasmStringAsIter : public Descriptor<WasmStringAsIter> {
1163 static constexpr auto kFunction = Builtin::kWasmStringAsIter;
1164 using arguments_t = std::tuple<V<String>>;
1165 using results_t = std::tuple<V<WasmStringViewIter>>;
1166
1167 static constexpr bool kNeedsFrameState = false;
1168 static constexpr bool kNeedsContext = false;
1169 static constexpr Operator::Properties kProperties = Operator::kEliminatable;
1170 static constexpr OpEffects kEffects = base_effects.CanAllocate();
1171 };
1172
1173 struct WasmStringViewIterNext : public Descriptor<WasmStringViewIterNext> {
1174 static constexpr auto kFunction = Builtin::kWasmStringViewIterNext;
1175 using arguments_t = std::tuple<V<WasmStringViewIter>>;
1176 using results_t = std::tuple<V<Word32>>;
1177
1178 static constexpr bool kNeedsFrameState = false;
1179 static constexpr bool kNeedsContext = false;
1180 static constexpr Operator::Properties kProperties = Operator::kEliminatable;
1181 static constexpr OpEffects kEffects =
1182 base_effects.CanReadMemory().CanWriteHeapMemory();
1183 };
1184
1185 struct WasmStringViewIterAdvance
1186 : public Descriptor<WasmStringViewIterAdvance> {
1187 static constexpr auto kFunction = Builtin::kWasmStringViewIterAdvance;
1188 using arguments_t = std::tuple<V<WasmStringViewIter>, V<Word32>>;
1189 using results_t = std::tuple<V<Word32>>;
1190
1191 static constexpr bool kNeedsFrameState = false;
1192 static constexpr bool kNeedsContext = false;
1193 static constexpr Operator::Properties kProperties = Operator::kEliminatable;
1194 static constexpr OpEffects kEffects =
1195 base_effects.CanReadMemory().CanWriteHeapMemory();
1196 };
1197
1198 struct WasmStringViewIterRewind
1199 : public Descriptor<WasmStringViewIterRewind> {
1200 static constexpr auto kFunction = Builtin::kWasmStringViewIterRewind;
1201 using arguments_t = std::tuple<V<WasmStringViewIter>, V<Word32>>;
1202 using results_t = std::tuple<V<Word32>>;
1203
1204 static constexpr bool kNeedsFrameState = false;
1205 static constexpr bool kNeedsContext = false;
1206 static constexpr Operator::Properties kProperties = Operator::kEliminatable;
1207 static constexpr OpEffects kEffects =
1208 base_effects.CanReadMemory().CanWriteHeapMemory();
1209 };
1210
1211 struct WasmStringViewIterSlice : public Descriptor<WasmStringViewIterSlice> {
1212 static constexpr auto kFunction = Builtin::kWasmStringViewIterSlice;
1213 using arguments_t = std::tuple<V<WasmStringViewIter>, V<Word32>>;
1214 using results_t = std::tuple<V<String>>;
1215
1216 static constexpr bool kNeedsFrameState = false;
1217 static constexpr bool kNeedsContext = false;
1218 static constexpr Operator::Properties kProperties = Operator::kEliminatable;
1219 static constexpr OpEffects kEffects =
1221 };
1222
1223 struct WasmStringHash : public Descriptor<WasmStringHash> {
1224 static constexpr auto kFunction = Builtin::kWasmStringHash;
1225 using arguments_t = std::tuple<V<String>>;
1226 using results_t = std::tuple<V<Word32>>;
1227
1228 static constexpr bool kNeedsFrameState = false;
1229 static constexpr bool kNeedsContext = false;
1230 static constexpr Operator::Properties kProperties = Operator::kEliminatable;
1231 static constexpr OpEffects kEffects = base_effects.CanReadMemory();
1232 };
1233
1234 struct ThrowDataViewDetachedError
1235 : public Descriptor<ThrowDataViewDetachedError> {
1236 static constexpr auto kFunction = Builtin::kThrowDataViewDetachedError;
1237 using arguments_t = std::tuple<>;
1238 using results_t = std::tuple<OpIndex>;
1239
1240 static constexpr bool kNeedsFrameState = false;
1241 static constexpr bool kNeedsContext = false;
1242 static constexpr Operator::Properties kProperties = Operator::kNoProperties;
1243 static constexpr OpEffects kEffects = base_effects.CanChangeControlFlow();
1244 };
1245
1246 struct ThrowDataViewOutOfBounds
1247 : public Descriptor<ThrowDataViewOutOfBounds> {
1248 static constexpr auto kFunction = Builtin::kThrowDataViewOutOfBounds;
1249 using arguments_t = std::tuple<>;
1250 using results_t = Never;
1251
1252 static constexpr bool kNeedsFrameState = false;
1253 static constexpr bool kNeedsContext = false;
1254 static constexpr Operator::Properties kProperties = Operator::kNoProperties;
1255 static constexpr OpEffects kEffects = base_effects.CanChangeControlFlow();
1256 };
1257
1258 struct ThrowDataViewTypeError : public Descriptor<ThrowDataViewTypeError> {
1259 static constexpr auto kFunction = Builtin::kThrowDataViewTypeError;
1260 using arguments_t = std::tuple<V<JSDataView>>;
1261 using results_t = Never;
1262
1263 static constexpr bool kNeedsFrameState = false;
1264 static constexpr bool kNeedsContext = false;
1265 static constexpr Operator::Properties kProperties = Operator::kNoProperties;
1266 static constexpr OpEffects kEffects =
1267 base_effects.CanReadHeapMemory().CanChangeControlFlow();
1268 };
1269
1270 struct ThrowIndexOfCalledOnNull
1271 : public Descriptor<ThrowIndexOfCalledOnNull> {
1272 static constexpr auto kFunction = Builtin::kThrowIndexOfCalledOnNull;
1273 using arguments_t = std::tuple<>;
1274 using results_t = Never;
1275
1276 static constexpr bool kNeedsFrameState = false;
1277 static constexpr bool kNeedsContext = false;
1278 static constexpr Operator::Properties kProperties = Operator::kNoWrite;
1279 static constexpr OpEffects kEffects = base_effects.CanChangeControlFlow();
1280 };
1281
1282 struct ThrowToLowerCaseCalledOnNull
1283 : public Descriptor<ThrowToLowerCaseCalledOnNull> {
1284 static constexpr auto kFunction = Builtin::kThrowToLowerCaseCalledOnNull;
1285 using arguments_t = std::tuple<>;
1286 using results_t = Never;
1287
1288 static constexpr bool kNeedsFrameState = false;
1289 static constexpr bool kNeedsContext = false;
1290 static constexpr Operator::Properties kProperties = Operator::kNoWrite;
1291 static constexpr OpEffects kEffects = base_effects.CanChangeControlFlow();
1292 };
1293
1294 struct WasmFastApiCallTypeCheckAndUpdateIC
1295 : public Descriptor<WasmFastApiCallTypeCheckAndUpdateIC> {
1296 static constexpr auto kFunction =
1297 Builtin::kWasmFastApiCallTypeCheckAndUpdateIC;
1298 using arguments_t = std::tuple<V<Object>, V<Object>>;
1299 using results_t = std::tuple<V<Smi>>;
1300
1301 static constexpr bool kNeedsFrameState = false;
1302 static constexpr bool kNeedsContext = true;
1303 static constexpr Operator::Properties kProperties = Operator::kNoWrite;
1304 static constexpr OpEffects kEffects =
1305 base_effects.CanLeaveCurrentFunction();
1306 };
1307
1308 struct WasmPropagateException : public Descriptor<WasmPropagateException> {
1309 static constexpr auto kFunction = Builtin::kWasmPropagateException;
1310 using arguments_t = std::tuple<>;
1311 using results_t = Never;
1312
1313 static constexpr bool kNeedsFrameState = false;
1314 static constexpr bool kNeedsContext = false;
1315 static constexpr Operator::Properties kProperties = Operator::kNoProperties;
1316 static constexpr OpEffects kEffects = base_effects.CanCallAnything();
1317 };
1318
1319#endif // V8_ENABLE_WEBASSEMBLY
1320};
1321
1322} // namespace v8::internal::compiler::turboshaft
1323
1324#endif // V8_COMPILER_TURBOSHAFT_BUILTIN_CALL_DESCRIPTORS_H_
#define V(Name)
static CallInterfaceDescriptor CallInterfaceDescriptorFor(Builtin builtin)
Definition builtins.cc:189
static CallDescriptor * GetStubCallDescriptor(Zone *zone, const CallInterfaceDescriptor &descriptor, int stack_parameter_count, CallDescriptor::Flags flags, Operator::Properties properties=Operator::kNoProperties, StubCallMode stub_mode=StubCallMode::kCallCodeObject)
Definition linkage.cc:587
static constexpr RegisterRepresentation FromMachineRepresentation(MachineRepresentation rep)
#define DECL_GENERIC_UNOP(Name)
Definition assembler.h:1570
#define DECL_GENERIC_BINOP(Name)
Definition assembler.h:1554
constexpr int B
#define GENERIC_BINOP_LIST(V)
#define GENERIC_UNOP_LIST(V)
#define DCHECK(condition)
Definition logging.h:482
#define DCHECK_EQ(v1, v2)
Definition logging.h:485
std::tuple< V< Float32 >, V< TurboshaftFloat64Type >, V< Smi > > arguments_t
std::tuple< V< Float64 >, V< TurboshaftFloat64Type >, V< Smi > > arguments_t
std::tuple< V< Word32 >, V< TurboshaftWord32Type >, V< Smi > > arguments_t
std::tuple< V< Word32 >, V< Word32 >, V< TurboshaftWord64Type >, V< Smi > > arguments_t
static const TSCallDescriptor * Create(StubCallMode call_mode, Zone *zone, LazyDeoptOnThrow lazy_deopt_on_throw=LazyDeoptOnThrow::kNo)
std::tuple< V< SharedFunctionInfo >, V< FeedbackCell > > arguments_t
constexpr OpEffects CanLeaveCurrentFunction() const
Definition operations.h:778
constexpr OpEffects CanDependOnChecks() const
Definition operations.h:759
constexpr OpEffects CanWriteHeapMemory() const
Definition operations.h:728
constexpr OpEffects CanCallAnything() const
Definition operations.h:796
constexpr OpEffects CanReadHeapMemory() const
Definition operations.h:697
constexpr OpEffects AssumesConsistentHeap() const
Definition operations.h:666
constexpr OpEffects RequiredWhenUnused() const
Definition operations.h:804
constexpr OpEffects CanChangeControlFlow() const
Definition operations.h:765
constexpr OpEffects CanAllocateWithoutIdentity() const
Definition operations.h:677
constexpr OpEffects CanAllocate() const
Definition operations.h:684
constexpr OpEffects CanWriteMemory() const
Definition operations.h:741
constexpr OpEffects CanReadMemory() const
Definition operations.h:745
static const TSCallDescriptor * Create(const CallDescriptor *descriptor, CanThrow can_throw, LazyDeoptOnThrow lazy_deopt_on_throw, Zone *graph_zone, const JSWasmCallParameters *js_wasm_call_parameters=nullptr)