41#include "third_party/v8/codegen/fp16-inl.h"
49#define CSA_DCHECK_BRANCH(csa, gen, ...) \
50 (csa)->Dcheck(gen, #gen, __FILE__, __LINE__, CSA_DCHECK_ARGS(__VA_ARGS__))
52#define CSA_DCHECK_BRANCH(csa, ...) ((void)0)
59 case Operation::kLessThan:
60 return Builtin::kBigIntLessThan;
61 case Operation::kGreaterThan:
62 return Builtin::kBigIntGreaterThan;
63 case Operation::kLessThanOrEqual:
64 return Builtin::kBigIntLessThanOrEqual;
65 case Operation::kGreaterThanOrEqual:
66 return Builtin::kBigIntGreaterThanOrEqual;
75 : compiler::CodeAssembler(state),
76 TorqueGeneratedExportedMacrosAssembler(state) {
77 if (
v8_flags.csa_trap_on_node !=
nullptr) {
86 size_t name_length = strlen(name);
87 if (strncmp(
v8_flags.csa_trap_on_node, name, name_length) != 0) {
91 size_t option_length = strlen(
v8_flags.csa_trap_on_node);
92 if (option_length < name_length + 2 ||
93 v8_flags.csa_trap_on_node[name_length] !=
',') {
97 const char*
start = &
v8_flags.csa_trap_on_node[name_length + 1];
99 int node_id =
static_cast<int>(strtol(
start, &
end, 10));
108 const char* message,
const char* file,
int line,
109 std::initializer_list<ExtraNode> extra_nodes,
113 Check(branch, message, file, line, extra_nodes, loc);
119 const char* message,
const char* file,
int line,
120 std::initializer_list<ExtraNode> extra_nodes,
124 Check(condition_body, message, file, line, extra_nodes, loc);
130 const char* message,
const char* file,
int line,
131 std::initializer_list<ExtraNode> extra_nodes,
135 Check(condition_node, message, file, line, extra_nodes, loc);
141 const char* message,
const char* file,
int line,
142 std::initializer_list<ExtraNode> extra_nodes,
146 if (message !=
nullptr) {
147 Comment({
"[ Assert: ", loc}, message);
151 branch(&ok, ¬_ok);
154 std::vector<FileAndLine> file_and_line;
155 if (file !=
nullptr) {
156 file_and_line.push_back({
file, line});
158 FailAssert(message, file_and_line, extra_nodes, loc);
165 const char* message,
const char* file,
int line,
166 std::initializer_list<ExtraNode> extra_nodes,
173 Check(branch, message, file, line, extra_nodes, loc);
177 const char* message,
const char* file,
int line,
178 std::initializer_list<ExtraNode> extra_nodes,
181 Branch(condition_node, ok, not_ok);
184 Check(branch, message, file, line, extra_nodes, loc);
189 Comment(
"increment call count");
211 const char* message,
const std::vector<FileAndLine>& files_and_lines,
212 std::initializer_list<ExtraNode> extra_nodes,
const SourceLocation& loc) {
215 std::stringstream stream;
216 for (
auto it = files_and_lines.rbegin(); it != files_and_lines.rend(); ++it) {
217 if (it->first !=
nullptr) {
218 stream <<
" [" << it->first <<
":" << it->second <<
"]";
226 std::string files_and_lines_text = stream.str();
227 if (!files_and_lines_text.empty()) {
228 SNPrintF(chars,
"%s%s", message, files_and_lines_text.c_str());
229 message = chars.
begin();
235 for (
auto& node : extra_nodes) {
277 ExternalReference::array_buffer_max_allocation_address(
isolate()));
281#define HEAP_CONSTANT_ACCESSOR(rootIndexName, rootAccessorName, name) \
282 TNode<RemoveTagged<decltype(std::declval<Heap>().rootAccessorName())>::type> \
283 CodeStubAssembler::name##Constant() { \
284 return UncheckedCast<RemoveTagged< \
285 decltype(std::declval<Heap>().rootAccessorName())>::type>( \
286 LoadRoot(RootIndex::k##rootIndexName)); \
289#undef HEAP_CONSTANT_ACCESSOR
291#define HEAP_CONSTANT_ACCESSOR(rootIndexName, rootAccessorName, name) \
292 TNode<RemoveTagged< \
293 decltype(std::declval<ReadOnlyRoots>().rootAccessorName())>::type> \
294 CodeStubAssembler::name##Constant() { \
295 return UncheckedCast<RemoveTagged< \
296 decltype(std::declval<ReadOnlyRoots>().rootAccessorName())>::type>( \
297 LoadRoot(RootIndex::k##rootIndexName)); \
300#undef HEAP_CONSTANT_ACCESSOR
302#define HEAP_CONSTANT_TEST(rootIndexName, rootAccessorName, name) \
303 TNode<BoolT> CodeStubAssembler::Is##name(TNode<Object> value) { \
304 return TaggedEqual(value, name##Constant()); \
306 TNode<BoolT> CodeStubAssembler::IsNot##name(TNode<Object> value) { \
307 return TaggedNotEqual(value, name##Constant()); \
310#undef HEAP_CONSTANT_TEST
313#if defined(BINT_IS_SMI)
315#elif defined(BINT_IS_INTPTR)
318#error Unknown architecture.
354 int32_t int32_constant;
356 *value = int32_constant;
364 Comment(
"IntPtrRoundUpToPowerOfTwo32");
367 for (
int i = 1;
i <= 16;
i *= 2) {
391 double max_relative_error) {
396 GotoIf(Float64LessThan(Float64Div(Float64Abs(Float64Sub(
x,
y)),
397 Float64Max(Float64Abs(
x), Float64Abs(
y))),
412 Label return_x(
this);
417 GotoIf(Float64LessThanOrEqual(Float64Sub(var_x.value(), one_half),
x),
419 var_x = Float64Sub(var_x.value(),
one);
423 return var_x.value();
428 Label round_op_supported(
this), round_op_fallback(
this), return_x(
this);
435 BIND(&round_op_supported);
441 var_x = Float64RoundUp(
x);
445 BIND(&round_op_fallback);
452 Label return_minus_x(
this);
455 Label if_xgreaterthanzero(
this), if_xnotgreaterthanzero(
this);
456 Branch(Float64GreaterThan(
x, zero), &if_xgreaterthanzero,
457 &if_xnotgreaterthanzero);
459 BIND(&if_xgreaterthanzero);
462 GotoIf(Float64GreaterThanOrEqual(
x, two_52), &return_x);
465 var_x = Float64Sub(Float64Add(two_52,
x), two_52);
466 GotoIfNot(Float64LessThan(var_x.value(),
x), &return_x);
467 var_x = Float64Add(var_x.value(),
one);
471 BIND(&if_xnotgreaterthanzero);
474 GotoIf(Float64LessThanOrEqual(
x, minus_two_52), &return_x);
475 GotoIfNot(Float64LessThan(
x, zero), &return_x);
479 var_x = Float64Sub(Float64Add(two_52, minus_x), two_52);
480 GotoIfNot(Float64GreaterThan(var_x.value(), minus_x), &return_minus_x);
481 var_x = Float64Sub(var_x.value(),
one);
482 Goto(&return_minus_x);
485 BIND(&return_minus_x);
486 var_x = Float64Neg(var_x.value());
490 return var_x.value();
495 Label round_op_supported(
this), round_op_fallback(
this), return_x(
this);
500 &round_op_supported, &round_op_fallback);
502 BIND(&round_op_supported);
508 var_x = Float64RoundDown(
x);
512 BIND(&round_op_fallback);
519 Label return_minus_x(
this);
522 Label if_xgreaterthanzero(
this), if_xnotgreaterthanzero(
this);
523 Branch(Float64GreaterThan(
x, zero), &if_xgreaterthanzero,
524 &if_xnotgreaterthanzero);
526 BIND(&if_xgreaterthanzero);
529 GotoIf(Float64GreaterThanOrEqual(
x, two_52), &return_x);
532 var_x = Float64Sub(Float64Add(two_52,
x), two_52);
533 GotoIfNot(Float64GreaterThan(var_x.value(),
x), &return_x);
534 var_x = Float64Sub(var_x.value(),
one);
538 BIND(&if_xnotgreaterthanzero);
541 GotoIf(Float64LessThanOrEqual(
x, minus_two_52), &return_x);
542 GotoIfNot(Float64LessThan(
x, zero), &return_x);
546 var_x = Float64Sub(Float64Add(two_52, minus_x), two_52);
547 GotoIfNot(Float64LessThan(var_x.value(), minus_x), &return_minus_x);
548 var_x = Float64Add(var_x.value(),
one);
549 Goto(&return_minus_x);
552 BIND(&return_minus_x);
553 var_x = Float64Neg(var_x.value());
557 return var_x.value();
562 Label round_op_supported(
this), round_op_fallback(
this), done(
this);
567 &round_op_supported, &round_op_fallback);
569 BIND(&round_op_supported);
575 var_result = Float64RoundTiesEven(
x);
579 BIND(&round_op_fallback);
585 Label return_f(
this), return_f_plus_one(
this);
587 GotoIf(Float64LessThan(f_and_half,
x), &return_f_plus_one);
588 GotoIf(Float64LessThan(
x, f_and_half), &return_f);
599 BIND(&return_f_plus_one);
604 return var_result.value();
609 Label trunc_op_supported(
this), trunc_op_fallback(
this), return_x(
this);
614 &trunc_op_supported, &trunc_op_fallback);
616 BIND(&trunc_op_supported);
622 var_x = Float64RoundTruncate(
x);
626 BIND(&trunc_op_fallback);
633 Label return_minus_x(
this);
636 Label if_xgreaterthanzero(
this), if_xnotgreaterthanzero(
this);
637 Branch(Float64GreaterThan(
x, zero), &if_xgreaterthanzero,
638 &if_xnotgreaterthanzero);
640 BIND(&if_xgreaterthanzero);
642 Label round_op_supported(
this), round_op_fallback(
this);
644 &round_op_supported, &round_op_fallback);
645 BIND(&round_op_supported);
651 var_x = Float64RoundDown(
x);
654 BIND(&round_op_fallback);
657 GotoIf(Float64GreaterThanOrEqual(
x, two_52), &return_x);
660 var_x = Float64Sub(Float64Add(two_52,
x), two_52);
661 GotoIfNot(Float64GreaterThan(var_x.value(),
x), &return_x);
662 var_x = Float64Sub(var_x.value(),
one);
667 BIND(&if_xnotgreaterthanzero);
669 Label round_op_supported(
this), round_op_fallback(
this);
671 &round_op_supported, &round_op_fallback);
672 BIND(&round_op_supported);
678 var_x = Float64RoundUp(
x);
681 BIND(&round_op_fallback);
684 GotoIf(Float64LessThanOrEqual(
x, minus_two_52), &return_x);
685 GotoIfNot(Float64LessThan(
x, zero), &return_x);
689 var_x = Float64Sub(Float64Add(two_52, minus_x), two_52);
690 GotoIfNot(Float64GreaterThan(var_x.value(), minus_x), &return_minus_x);
691 var_x = Float64Sub(var_x.value(),
one);
692 Goto(&return_minus_x);
696 BIND(&return_minus_x);
697 var_x = Float64Neg(var_x.value());
701 return var_x.value();
710 constexpr uintptr_t
mask[] = {
static_cast<uintptr_t
>(0x5555555555555555),
711 static_cast<uintptr_t
>(0x3333333333333333),
712 static_cast<uintptr_t
>(0x0f0f0f0f0f0f0f0f)};
763 return Word64Popcnt(value);
777 return Word32Popcnt(value);
793 return Word64Ctz(value);
812 return Word32Ctz(value);
822 return TruncateInt64ToInt32(
Signed(res64));
827 return Word64Clz(value);
831 return Word32Clz(value);
846 return Signed(WordSarShiftOutZeros(BitcastTaggedToWordForTagAndSmiBits(value),
859 return BitcastWordToTaggedSigned(
860 WordShl(BitcastTaggedToWordForTagAndSmiBits(value),
875 WordSar(BitcastTaggedToWordForTagAndSmiBits(value),
899 "Use shifting instead of add");
900 return BitcastWordToTaggedSigned(
913 intptr_t constant_value;
915 return (
static_cast<uintptr_t
>(constant_value) <=
925 int32_t constant_value;
939 intptr_t constant_value;
943 TNode<IntPtrT> raw_bits = BitcastTaggedToWordForTagAndSmiBits(value);
953 return Signed(Word32SarShiftOutZeros(
971 return ChangeInt32ToFloat64(
SmiToInt32(value));
984 Label* if_overflow) {
987 GotoIf(overflow, if_overflow);
993 Label* if_overflow) {
996 GotoIf(overflow, if_overflow);
1002 Label* if_overflow) {
1005 GotoIf(overflow, if_overflow);
1011 Label* if_div_zero) {
1013 return IntPtrDiv(a,
b);
1018 Label* if_div_zero) {
1020 return IntPtrMod(a,
b);
1024 Label* if_overflow) {
1027 GotoIf(overflow, if_overflow);
1032 Label* if_overflow) {
1034 return BitcastWordToTaggedSigned(
1036 BitcastTaggedToWordForTagAndSmiBits(rhs), if_overflow));
1043 GotoIf(overflow, if_overflow);
1050 Label* if_overflow) {
1053 IntPtrSubWithOverflow(BitcastTaggedToWordForTagAndSmiBits(lhs),
1054 BitcastTaggedToWordForTagAndSmiBits(rhs));
1056 GotoIf(overflow, if_overflow);
1058 return BitcastWordToTaggedSigned(
result);
1065 GotoIf(overflow, if_overflow);
1074 IntPtrAbsWithOverflow(BitcastTaggedToWordForTagAndSmiBits(a));
1076 GotoIf(overflow, if_overflow);
1078 return BitcastWordToTaggedSigned(
result);
1085 GotoIf(overflow, if_overflow);
1094 Label done(
this), greater_than_equal_a(
this), greater_than_equal_b(
this);
1099 BIND(&greater_than_equal_a);
1102 BIND(&greater_than_equal_b);
1112 Label done(
this), greater_than_equal_a(
this), greater_than_equal_b(
this);
1117 BIND(&greater_than_equal_a);
1120 BIND(&greater_than_equal_b);
1129 Label return_result(
this, &var_result),
1145 BIND(&if_aisnotnegative);
1150 Goto(&return_result);
1153 BIND(&if_aisnegative);
1175 Goto(&return_result);
1178 BIND(&return_minuszero);
1179 var_result = MinusZeroConstant();
1180 Goto(&return_result);
1183 var_result = NanConstant();
1184 Goto(&return_result);
1186 BIND(&return_result);
1187 return var_result.value();
1194 Label return_result(
this, &var_result);
1199 auto pair = Int32MulWithOverflow(lhs32, rhs32);
1205 Branch(overflow, &if_overflow, &if_notoverflow);
1206 BIND(&if_notoverflow);
1210 Label answer_zero(
this), answer_not_zero(
this);
1214 BIND(&answer_not_zero);
1217 Goto(&return_result);
1222 Label if_should_be_negative_zero(
this), if_should_be_zero(
this);
1223 Branch(Int32LessThan(or_result, zero), &if_should_be_negative_zero,
1224 &if_should_be_zero);
1225 BIND(&if_should_be_negative_zero);
1227 var_result = MinusZeroConstant();
1228 Goto(&return_result);
1230 BIND(&if_should_be_zero);
1233 Goto(&return_result);
1242 Float64Mul(var_lhs_float64.value(), var_rhs_float64.value());
1244 Goto(&return_result);
1247 BIND(&return_result);
1248 return var_result.value();
1259 Label dividend_is_zero(
this), dividend_is_not_zero(
this);
1261 ÷nd_is_not_zero);
1263 BIND(÷nd_is_zero);
1266 Goto(÷nd_is_not_zero);
1268 BIND(÷nd_is_not_zero);
1275 Label divisor_is_minus_one(
this), divisor_is_not_minus_one(
this);
1277 &divisor_is_minus_one, &divisor_is_not_minus_one);
1279 BIND(&divisor_is_minus_one);
1285 Goto(&divisor_is_not_minus_one);
1287 BIND(&divisor_is_not_minus_one);
1289 TNode<Int32T> untagged_result = Int32Div(untagged_dividend, untagged_divisor);
1352#if defined(V8_HOST_ARCH_32_BIT) || defined(V8_31BIT_SMIS_ON_64BIT_ARCH)
1377 CodeAssembler::Bind(
label, debug_info);
1391 static_assert(LAST_JS_RECEIVER_TYPE ==
LAST_TYPE);
1396#ifdef V8_ENABLE_FORCE_SLOW_PATH
1397 bool enable_force_slow_path =
true;
1399 bool enable_force_slow_path =
false;
1415 Branch(force_slow, if_true, &done);
1432 intptr_t size_in_bytes_constant;
1433 bool size_in_bytes_is_constant =
false;
1435 size_in_bytes_is_constant =
true;
1437 CHECK_GT(size_in_bytes_constant, 0);
1459 SmiTag(size_in_bytes), runtime_flags);
1467 if (needs_double_alignment) {
1481 Branch(UintPtrGreaterThanOrEqual(new_top, limit), &runtime_call,
1484 BIND(&runtime_call);
1491 SmiTag(size_in_bytes), runtime_flags);
1495 SmiTag(size_in_bytes), runtime_flags);
1501 BIND(&no_runtime_call);
1508 if (needs_double_alignment) {
1514 OnePointerFillerMapConstant());
1521 result = BitcastWordToTagged(
1526 if (!size_in_bytes_is_constant) {
1527 BIND(&if_out_of_memory);
1528 CallRuntime(Runtime::kFatalProcessOutOfMemoryInAllocateRaw,
1544 return AllocateRaw(size_in_bytes, flags, top_address, limit_address);
1550#if defined(V8_HOST_ARCH_32_BIT)
1552 top_address, limit_address);
1553#elif defined(V8_HOST_ARCH_64_BIT)
1554#ifdef V8_COMPRESS_POINTERS
1562 top_address, limit_address);
1564#error Architecture not supported
1573 return Allocate(size_in_bytes, flags);
1585 if (
v8_flags.sticky_mark_bits && !new_space) {
1592 ? ExternalReference::new_space_allocation_top_address(
isolate())
1593 : ExternalReference::old_space_allocation_top_address(
isolate()));
1598 if (ExternalReference::new_space_allocation_top_address(
isolate())
1601 ExternalReference::new_space_allocation_top_address(
isolate())
1604 ExternalReference::new_space_allocation_limit_address(
isolate())
1611 ExternalReference::old_space_allocation_limit_address(
isolate())
1613 ExternalReference::old_space_allocation_top_address(
isolate())
1661#if V8_STATIC_ROOTS_BOOL
1666 static_assert(StaticReadOnlyRoot::kFirstAllocatedRoot ==
1667 StaticReadOnlyRoot::kUndefinedValue);
1668 static_assert(StaticReadOnlyRoot::kUndefinedValue +
sizeof(
Undefined) ==
1669 StaticReadOnlyRoot::kNullValue);
1670 static_assert(StaticReadOnlyRoot::kNullValue +
sizeof(
Null) ==
1671 StaticReadOnlyRoot::kempty_string);
1672 static_assert(StaticReadOnlyRoot::kempty_string +
1674 StaticReadOnlyRoot::kFalseValue);
1675 static_assert(StaticReadOnlyRoot::kFalseValue +
sizeof(
False) ==
1676 StaticReadOnlyRoot::kTrueValue);
1680 GotoIf(Uint32LessThan(object_as_word32, true_as_word32), if_false);
1690 GotoIf(IsEmptyString(value_heapobject), if_false);
1706 GotoIf(IsHeapNumberMap(value_map), &if_heapnumber);
1715 BIND(&if_heapnumber);
1737#ifdef V8_ENABLE_SANDBOX
1748#ifdef V8_ENABLE_SANDBOX
1758 CSA_CHECK(
this, UintPtrGreaterThanOrEqual(sbx_ptr, sandbox_base));
1759 CSA_CHECK(
this, UintPtrLessThan(sbx_ptr, sandbox_end));
1768#ifdef V8_ENABLE_SANDBOX
1781#ifdef V8_ENABLE_SANDBOX
1794#ifdef V8_ENABLE_SANDBOX
1806#ifdef V8_ENABLE_SANDBOX
1811 ExternalReference::shared_external_pointer_table_address_address(
1817 ExternalReference::external_pointer_table_address(
isolate()));
1824#ifdef V8_ENABLE_SANDBOX
1849 if (tag_range.
Size() == 1) {
1875#ifdef V8_ENABLE_SANDBOX
1906#ifdef V8_ENABLE_SANDBOX
1907 return LoadIndirectPointerFromObject(
object, field_offset, tag);
1916 object, field_offset, kCodeIndirectPointerTag));
1919#ifdef V8_ENABLE_LEAPTIERING
1933TNode<Code> CodeStubAssembler::LoadCodeObjectFromJSDispatchTable(
1934 TNode<JSDispatchHandleT>
handle) {
1935 TNode<RawPtrT> table =
1937 TNode<UintPtrT>
offset = ComputeJSDispatchTableEntryOffset(
handle);
1946 return CAST(BitcastWordToTagged(value));
1949TNode<Uint16T> CodeStubAssembler::LoadParameterCountFromJSDispatchTable(
1950 TNode<JSDispatchHandleT>
handle) {
1951 TNode<RawPtrT> table =
1953 TNode<UintPtrT>
offset = ComputeJSDispatchTableEntryOffset(
handle);
1956 static_assert(JSDispatchEntry::kParameterCountSize == 2);
1962#ifdef V8_ENABLE_SANDBOX
1964TNode<TrustedObject> CodeStubAssembler::LoadIndirectPointerFromObject(
1966 TNode<IndirectPointerHandleT>
handle =
1968 return ResolveIndirectPointerHandle(
handle, tag);
1971TNode<BoolT> CodeStubAssembler::IsTrustedPointerHandle(
1972 TNode<IndirectPointerHandleT>
handle) {
1977TNode<TrustedObject> CodeStubAssembler::ResolveIndirectPointerHandle(
1984 IsTrustedPointerHandle(
handle),
1985 [=,
this] {
return ResolveTrustedPointerHandle(
handle, tag); },
1986 [=,
this] {
return ResolveCodePointerHandle(
handle); });
1987 }
else if (tag == kCodeIndirectPointerTag) {
1988 return ResolveCodePointerHandle(
handle);
1990 return ResolveTrustedPointerHandle(
handle, tag);
1994TNode<Code> CodeStubAssembler::ResolveCodePointerHandle(
1995 TNode<IndirectPointerHandleT>
handle) {
1996 TNode<RawPtrT> table = LoadCodePointerTableBase();
1997 TNode<UintPtrT>
offset = ComputeCodePointerTableEntryOffset(
handle);
2005 return CAST(BitcastWordToTagged(value));
2008TNode<TrustedObject> CodeStubAssembler::ResolveTrustedPointerHandle(
2011 ExternalReference::trusted_pointer_table_base_address(
isolate()));
2012 TNode<Uint32T> index =
2023 return CAST(BitcastWordToTagged(value));
2026TNode<UintPtrT> CodeStubAssembler::ComputeCodePointerTableEntryOffset(
2027 TNode<IndirectPointerHandleT>
handle) {
2028 TNode<Uint32T> index =
2038TNode<RawPtrT> CodeStubAssembler::LoadCodeEntrypointViaCodePointerField(
2039 TNode<HeapObject>
object, TNode<IntPtrT> field_offset,
2041 TNode<IndirectPointerHandleT>
handle =
2043 return LoadCodeEntryFromIndirectPointerHandle(
handle, tag);
2046TNode<RawPtrT> CodeStubAssembler::LoadCodeEntryFromIndirectPointerHandle(
2048 TNode<RawPtrT> table = LoadCodePointerTableBase();
2049 TNode<UintPtrT>
offset = ComputeCodePointerTableEntryOffset(
handle);
2057TNode<RawPtrT> CodeStubAssembler::LoadCodePointerTableBase() {
2058#ifdef V8_COMPRESS_POINTERS_IN_MULTIPLE_CAGES
2061 ExternalReference::code_pointer_table_base_address(
isolate()));
2065 ExternalReference::global_code_pointer_table_base_address());
2073#ifdef V8_ENABLE_LEAPTIERING
2074 dynamic_parameter_count =
2075 LoadParameterCountFromJSDispatchTable(dispatch_handle);
2079 dynamic_parameter_count =
2080 LoadSharedFunctionInfoFormalParameterCountWithReceiver(shared);
2119#if V8_TARGET_LITTLE_ENDIAN
2131 static_assert(offsetof(
HeapNumber,
value_) == Hole::kRawNumericValueOffset);
2155#ifdef V8_MAP_PACKING
2172 if (std::optional<RootIndex> expected_map =
2184 if (std::optional<RootIndex> expected_map =
2198 tagged_is_smi, [=]() {
return tagged_is_smi; },
2205 uint32_t
mask = Map::Bits1::HasNamedInterceptorBit::kMask |
2206 Map::Bits1::IsAccessCheckNeededBit::kMask;
2232 TNode<Object> properties = LoadJSReceiverPropertiesOrHash(
object);
2233 if (skip_empty_check) {
2234 return CAST(properties);
2239 [=,
this] {
return EmptyFixedArrayConstant(); },
2240 [=,
this] {
return CAST(properties); });
2247 TNode<Object> properties = LoadJSReceiverPropertiesOrHash(
object);
2250 return EmptySwissPropertyDictionaryConstant();
2252 return EmptyPropertyDictionaryConstant();
2267 CSA_DCHECK(
this, IsJSArgumentsObjectWithLength(context, array));
2268 constexpr int offset = JSStrictArgumentsObject::kLengthOffset;
2269 static_assert(
offset == JSSloppyArgumentsObject::kLengthOffset);
2282 return CAST(length);
2342 array, DescriptorArray::kNumberOfDescriptorsOffset));
2396 map, Map::kInobjectPropertiesStartOrConstructorFunctionIndexOffset));
2404 UintPtrGreaterThanOrEqual(used_or_unused,
2406 [=] {
return used_or_unused; },
2420 map, Map::kInobjectPropertiesStartOrConstructorFunctionIndexOffset));
2426 map, Map::kConstructorOrBackPointerOrNativeContextOffset));
2438 Map::kConstructorOrBackPointerOrNativeContextOffset);
2452 map, Map::kConstructorOrBackPointerOrNativeContextOffset));
2454 IsMap(
object), [=] {
return object; },
2455 [=,
this] {
return UndefinedConstant(); });
2474 Label done(
this), if_smi(
this), if_property_array(
this),
2475 if_swiss_property_dictionary(
this), if_property_dictionary(
this),
2476 if_fixed_array(
this);
2486 &if_property_array);
2490 &if_swiss_property_dictionary);
2493 &if_property_dictionary, &if_fixed_array);
2495 BIND(&if_fixed_array);
2507 BIND(&if_property_array);
2510 properties, PropertyArray::kLengthAndHashOffset);
2515 BIND(&if_swiss_property_dictionary);
2517 var_hash = LoadSwissNameDictionaryHash(
CAST(properties));
2518 CSA_DCHECK(
this, Uint32LessThanOrEqual(var_hash.value(),
2524 BIND(&if_property_dictionary);
2527 CAST(properties), NameDictionary::kObjectHashIndex)));
2532 if (if_no_hash !=
nullptr) {
2537 return var_hash.value();
2547 Label* if_hash_not_computed) {
2549 if (if_hash_not_computed !=
nullptr) {
2551 if_hash_not_computed);
2563 &if_forwarding_index);
2565 var_raw_hash = raw_hash_field;
2568 BIND(&if_forwarding_index);
2589 return var_raw_hash.value();
2614 Label inner_if_smi(
this), inner_if_strong(
this);
2627 BIND(&inner_if_smi);
2628 *extracted =
CAST(maybe_object);
2631 BIND(&inner_if_strong);
2632 *extracted =
CAST(maybe_object);
2637#ifdef V8_MAP_PACKING
2645 BitcastTaggedToWordForTagAndSmiBits(value)),
2670 BitcastTaggedToWordForTagAndSmiBits(value)),
2732 return WordEqual(BitcastMaybeObjectToWord(maybe_object),
2801template <
typename Array,
typename TIndex,
typename TValue>
2803 int array_header_size,
2805 int additional_offset) {
2808 std::is_same_v<TIndex, Smi> || std::is_same_v<TIndex, UintPtrT> ||
2809 std::is_same_v<TIndex, IntPtrT> ||
2810 std::is_same_v<TIndex, TaggedIndex>,
2811 "Only Smi, UintPtrT, IntPtrT or TaggedIndex indices are allowed");
2815 int32_t header_size = array_header_size + additional_offset -
kHeapObjectTag;
2819 array_header_size));
2839template <
typename TIndex>
2845 std::is_same_v<TIndex, Smi> || std::is_same_v<TIndex, UintPtrT> ||
2846 std::is_same_v<TIndex, IntPtrT> ||
2847 std::is_same_v<TIndex, TaggedIndex>,
2848 "Only Smi, UintPtrT, IntPtrT or TaggedIndex indexes are allowed");
2857 return CAST(element);
2878 int additional_offset) {
2879 if (!
v8_flags.fixed_array_bounds_checks)
return;
2884 if (index_is_constant) {
2896 int additional_offset) {
2897 if (!
v8_flags.fixed_array_bounds_checks)
return;
2902 CSA_CHECK(
this, UintPtrLessThan(effective_index,
2908 int additional_offset = 0;
2910 additional_offset));
2915 int additional_offset) {
2916 if (!
v8_flags.fixed_array_bounds_checks)
return;
2922 CSA_CHECK(
this, UintPtrLessThan(effective_index,
2929 object, PropertyArray::kLengthAndHashOffset);
2954 return RawPtrAdd(external_pointer, base_pointer);
2964#if defined(V8_TARGET_BIG_ENDIAN)
2984 Label high_zero(
this),
negative(
this), allocate_one_digit(
this),
2985 allocate_two_digits(
this), if_zero(
this), done(
this);
2989 &allocate_two_digits);
2993 &allocate_one_digit);
3012 &allocate_one_digit, &allocate_two_digits);
3015 BIND(&allocate_one_digit);
3025 BIND(&allocate_two_digits);
3041 return var_result.value();
3047 Label done(
this), if_positive(
this), if_negative(
this), if_zero(
this);
3079 return var_result.value();
3084 Label if_zero(
this), done(
this);
3090#if defined(V8_TARGET_BIG_ENDIAN)
3107 Label high_zero(
this), if_zero(
this), done(
this);
3126 return var_result.value();
3132 Label done(
this), if_zero(
this);
3142 return var_result.value();
3150 switch (elements_kind) {
3151 case UINT8_ELEMENTS:
3152 case UINT8_CLAMPED_ELEMENTS:
3156 case UINT16_ELEMENTS:
3158 case INT16_ELEMENTS:
3160 case UINT32_ELEMENTS:
3162 case INT32_ELEMENTS:
3164 case FLOAT16_ELEMENTS:
3167 case FLOAT32_ELEMENTS:
3170 case FLOAT64_ELEMENTS:
3172 case BIGINT64_ELEMENTS:
3174 case BIGUINT64_ELEMENTS:
3186 int32_t elements_kinds[] = {
3187#define TYPED_ARRAY_CASE(Type, type, TYPE, ctype) TYPE##_ELEMENTS,
3189#undef TYPED_ARRAY_CASE
3192#define TYPED_ARRAY_CASE(Type, type, TYPE, ctype) Label if_##type##array(this);
3194#undef TYPED_ARRAY_CASE
3196 Label* elements_kind_labels[] = {
3197#define TYPED_ARRAY_CASE(Type, type, TYPE, ctype) &if_##type##array,
3202#undef TYPED_ARRAY_CASE
3206 Switch(elements_kind, &if_unknown_type, elements_kinds, elements_kind_labels,
3209 BIND(&if_unknown_type);
3212#define TYPED_ARRAY_CASE(Type, type, TYPE, ctype) \
3213 BIND(&if_##type##array); \
3215 var_result = LoadFixedTypedArrayElementAsTagged(data_pointer, index, \
3220#undef TYPED_ARRAY_CASE
3223 return var_result.value();
3226template <
typename TIndex>
3229 int additional_offset) {
3230 int32_t header_size = FeedbackVector::kRawFeedbackSlotsOffset +
3236 FeedbackVector::kHeaderSize));
3242 int additional_offset);
3245 int additional_offset);
3248 int additional_offset);
3250template <
typename Array>
3253 int additional_offset) {
3255 int endian_correction = 0;
3256#if V8_TARGET_LITTLE_ENDIAN
3259 int32_t header_size = array_header_size + additional_offset -
kHeapObjectTag +
3264 array_header_size + endian_correction));
3298#ifdef V8_ENABLE_EXPERIMENTAL_UNDEFINED_DOUBLE
3300CodeStubAssembler::LoadFixedDoubleArrayElementWithUndefinedCheck(
3310 return LoadDoubleWithUndefinedAndHoleCheck(
object,
offset, if_undefined,
3311 if_hole, machine_type);
3319 Label done(
this), if_packed(
this), if_holey(
this), if_packed_double(
this),
3334 &if_packed, &if_packed, &if_packed, &if_packed, &if_packed,
3336 &if_holey, &if_holey, &if_holey, &if_holey, &if_holey,
3341 Switch(elements_kind, &if_dictionary, kinds, labels,
arraysize(kinds));
3355 BIND(&if_packed_double);
3362 BIND(&if_holey_double);
3364#ifdef V8_ENABLE_EXPERIMENTAL_UNDEFINED_DOUBLE
3365 Label if_undefined(
this);
3366 TNode<Float64T> float_value = LoadFixedDoubleArrayElementWithUndefinedCheck(
3367 CAST(elements), index, &if_undefined, if_hole);
3371 BIND(&if_undefined);
3373 var_result = UndefinedConstant();
3383 BIND(&if_dictionary);
3387 if_accessor, if_hole);
3392 return var_result.value();
3410#ifdef V8_ENABLE_EXPERIMENTAL_UNDEFINED_DOUBLE
3426TNode<BoolT> CodeStubAssembler::IsDoubleUndefined(TNode<Float64T> value) {
3427 TNode<Int64T> bits = BitcastFloat64ToInt64(value);
3438 if (machine_type.
IsNone()) {
3441#ifdef V8_ENABLE_EXPERIMENTAL_UNDEFINED_DOUBLE
3449#ifdef V8_ENABLE_EXPERIMENTAL_UNDEFINED_DOUBLE
3450TNode<Float64T> CodeStubAssembler::LoadDoubleWithUndefinedAndHoleCheck(
3458 if (machine_type.
IsNone()) {
3460 return TNode<Float64T>();
3495 map, Map::kConstructorOrBackPointerOrNativeContextOffset));
3501 LoadContextElement(
native_context, Context::MODULE_CONTEXT_MAP_INDEX));
3504 Label context_found(
this);
3506 Label context_search(
this, &cur_context);
3509 Goto(&context_search);
3510 BIND(&context_search);
3519 Goto(&context_search);
3522 BIND(&context_found);
3538 return_value =
CallRuntime(Runtime::kGetImportMetaObject, context);
3542 return return_value.value();
3549 return CAST(LoadJSFunctionPrototypeOrInitialMap(object_function));
3555 CSA_DCHECK(
this, UintPtrLessThan(number_of_properties,
3590 function, JSFunction::kSharedFunctionInfoOffset);
3595 SharedFunctionInfo::kFlagsOffset));
3596 return function_kind;
3622 uint32_t
mask = Map::Bits1::HasPrototypeSlotBit::kMask |
3623 Map::Bits1::IsConstructorBit::kMask;
3633 Label next_check(
this);
3646 function, JSFunction::kPrototypeOrInitialMapOffset);
3647 GotoIf(IsTheHole(proto_or_map), if_bailout);
3650 Label done(
this, &var_result);
3657 return var_result.value();
3661#ifdef V8_ENABLE_LEAPTIERING
3663 function, JSFunction::kDispatchHandleOffset);
3664 return LoadCodeObjectFromJSDispatchTable(dispatch_handle);
3672#ifdef V8_ENABLE_SANDBOX
3675 sfi, SharedFunctionInfo::kTrustedFunctionDataOffset);
3682 return ResolveIndirectPointerHandle(trusted_data_handle,
3687 sfi, SharedFunctionInfo::kTrustedFunctionDataOffset);
3694 sfi, SharedFunctionInfo::kUntrustedFunctionDataOffset);
3706 SharedFunctionInfo::kUntrustedFunctionDataOffset);
3712 sfi, SharedFunctionInfo::kTrustedFunctionDataOffset,
3717 Label check_for_interpreter_data(
this, &var_result);
3718 Label done(
this, &var_result);
3721 &check_for_interpreter_data);
3732 code, Code::kDeoptimizationDataOrInterpreterDataOffset));
3733 var_result = baseline_data;
3735 Goto(&check_for_interpreter_data);
3737 BIND(&check_for_interpreter_data);
3741 CAST(var_result.value()), InterpreterData::kBytecodeArrayOffset));
3742 var_result = bytecode_array;
3749 return CAST(var_result.value());
3752#ifdef V8_ENABLE_WEBASSEMBLY
3754CodeStubAssembler::LoadSharedFunctionInfoWasmFunctionData(
3757 sfi, SharedFunctionInfo::kTrustedFunctionDataOffset,
3758 kWasmFunctionDataIndirectPointerTag));
3761TNode<WasmExportedFunctionData>
3762CodeStubAssembler::LoadSharedFunctionInfoWasmExportedFunctionData(
3763 TNode<SharedFunctionInfo> sfi) {
3764 TNode<WasmFunctionData> function_data =
3765 LoadSharedFunctionInfoWasmFunctionData(sfi);
3770 this,
HasInstanceType(function_data, WASM_EXPORTED_FUNCTION_DATA_TYPE));
3771 return CAST(function_data);
3774TNode<WasmJSFunctionData>
3775CodeStubAssembler::LoadSharedFunctionInfoWasmJSFunctionData(
3776 TNode<SharedFunctionInfo> sfi) {
3777 TNode<WasmFunctionData> function_data =
3778 LoadSharedFunctionInfoWasmFunctionData(sfi);
3784 return CAST(function_data);
3791 BytecodeArray::kParameterSizeOffset);
3809#ifdef V8_ENABLE_EXPERIMENTAL_UNDEFINED_DOUBLE
3861#ifdef V8_ENABLE_SANDBOX
3871#ifdef V8_ENABLE_SANDBOX
3880#ifdef V8_ENABLE_SANDBOX
3939template <
typename TIndex>
3944 static_assert(std::is_same_v<TIndex, Smi> ||
3945 std::is_same_v<TIndex, UintPtrT> ||
3946 std::is_same_v<TIndex, IntPtrT>,
3947 "Only Smi, UintPtrT or IntPtrT index is allowed");
3954 static_cast<int>(PropertyArray::kHeaderSize));
3964 static_cast<int>(PropertyArray::kLengthAndHashOffset));
3975 object, PropertyArray::kLengthAndHashOffset);
4011template <
typename TIndex>
4016 static_assert(std::is_same_v<TIndex, Smi> ||
4017 std::is_same_v<TIndex, UintPtrT> ||
4018 std::is_same_v<TIndex, IntPtrT>,
4019 "Only Smi, UintPtrT or IntPtrT index is allowed");
4039 int additional_offset) {
4044 int header_size = FeedbackVector::kRawFeedbackSlotsOffset +
4051 FeedbackVector::kHeaderSize),
4069 Comment(
"Disallow pushing onto prototypes");
4072 EnsureArrayLengthWritable(context, map, bailout);
4083 Label fits(
this, var_elements);
4091 capacity, new_capacity, bailout);
4102 Label pre_bailout(
this);
4103 Label success(
this);
4105 TVARIABLE(BInt, var_length, SmiToBInt(var_tagged_length.value()));
4121 IntPtrToBInt(
IntPtrSub(
args->GetLengthWithoutReceiver(), first));
4123 growth, &pre_bailout);
4138 TNode<Smi> length = BIntToSmi(var_length.value());
4139 var_tagged_length =
length;
4147 var_tagged_length =
length;
4155 return var_tagged_length.value();
4194 TNode<Smi> length = BIntToSmi(var_length.value());
4225 RootIndex heap_map_index = RootIndex::kHeapNumberMap;
4281#ifdef BIGINT_NEEDS_PADDING
4282 static_assert(
arraysize(BigInt::padding_) ==
sizeof(int32_t));
4295 intptr_t digit_index,
4321 intptr_t digit_index) {
4341 Comment(
"AllocateNonEmptyByteArray");
4345 Signed(length), UINT8_ELEMENTS,
4368 Label if_lengthiszero(
this), if_sizeissmall(
this),
4373 Signed(length), UINT8_ELEMENTS,
4378 &if_sizeissmall, &if_notsizeissmall);
4380 BIND(&if_sizeissmall);
4393 BIND(&if_notsizeissmall);
4403 BIND(&if_lengthiszero);
4405 var_result = EmptyByteArrayConstant();
4410 return CAST(var_result.value());
4415 Comment(
"AllocateSeqOneByteString");
4417 return EmptyStringConstant();
4438 [=,
this] {
return IsContext(
CAST(
object)); });
4443 Comment(
"AllocateSeqTwoByteString");
4445 return EmptyStringConstant();
4466 DCHECK(map_root_index == RootIndex::kSlicedOneByteStringMap ||
4467 map_root_index == RootIndex::kSlicedTwoByteStringMap);
4496 int at_least_space_for) {
4535 NameDictionary::kNumberOfDeletedElementsIndex, zero,
4556 NameDictionary::kElementsStartIndex) -
4571 int at_least_space_for) {
4606 Comment(
"Copy boilerplate property dict");
4610 GotoIf(UintPtrGreaterThan(
4612 large_object_fallback);
4621template <
typename CollectionType>
4630template <
typename CollectionType>
4638 IntPtrLessThanOrEqual(
4641 static_assert(CollectionType::kLoadFactor == 2);
4647 IntPtrConstant(CollectionType::HashTableStartIndex()), bucket_count);
4649 IntPtrAdd(data_table_start_index, data_table_length);
4659 Comment(
"Initialize the OrderedHashTable fields.");
4664 CollectionType::NumberOfDeletedElementsIndex(),
4671 static_assert(CollectionType::HashTableStartIndex() ==
4672 CollectionType::NumberOfBucketsIndex() + 1);
4676 intptr_t const_capacity;
4678 const_capacity == CollectionType::kInitialCapacity) {
4679 int const_bucket_count =
4680 static_cast<int>(const_capacity / CollectionType::kLoadFactor);
4681 int const_data_table_length =
4682 static_cast<int>(const_capacity * CollectionType::kEntrySize);
4683 int const_data_table_start_index =
static_cast<int>(
4684 CollectionType::HashTableStartIndex() + const_bucket_count);
4686 Comment(
"Fill the buckets with kNotFound (constant capacity).");
4687 for (
int i = 0;
i < const_bucket_count;
i++) {
4689 CollectionType::HashTableStartIndex() +
i,
4690 not_found_sentinel, barrier_mode);
4693 Comment(
"Fill the data table with undefined (constant capacity).");
4694 for (
int i = 0;
i < const_data_table_length;
i++) {
4696 UndefinedConstant(), barrier_mode);
4699 Comment(
"Fill the buckets with kNotFound.");
4703 CollectionType::HashTableStartIndex()) -
4709 not_found_sentinel);
4711 Comment(
"Fill the data table with undefined.");
4720 UndefinedConstant());
4724 IntPtrSub(data_end_address, buckets_start_address);
4727 array_length,
IntPtrConstant(CollectionType::HashTableStartIndex()));
4777 JS_GLOBAL_OBJECT_TYPE)));
4783 slack_tracking_mode);
4784 return CAST(
object);
4797 RootIndex::kEmptyFixedArray);
4801 IsEmptyFixedArray(*properties)));
4807 RootIndex::kEmptyFixedArray);
4812 switch (slack_tracking_mode) {
4830 RootIndex::kUndefinedValue);
4835 Comment(
"InitializeJSObjectBodyNoSlackTracking");
4838 int start_offset = JSObject::kHeaderSize;
4848 BIND(&slack_tracking);
4850 Comment(
"Decrease construction counter");
4853 static_assert(Map::Bits3::ConstructionCounterBits::kLastUsedBit == 31);
4856 Int32Constant(1 << Map::Bits3::ConstructionCounterBits::kShift));
4862 map, Map::kUsedOrUnusedInstanceSizeInWordsOffset))));
4864 Comment(
"Initialize filler fields");
4866 RootIndex::kOnePointerFillerMap);
4868 Comment(
"Initialize undefined fields");
4870 RootIndex::kUndefinedValue);
4891 CallRuntime(Runtime::kCompleteInobjectSlackTrackingForMap,
4902 Comment(
"StoreFieldsNoWriteBarrier");
4906 start_address, end_address,
4920 StoreMap(array, FixedCOWArrayMapConstant());
4934 int array_header_size) {
4935 Comment(
"begin allocation of JSArray passing in elements");
4938 int base_size = array_header_size;
4939 if (allocation_site) {
4969 Label not_aligned(
this), is_aligned(
this);
4996 int array_header_size) {
4997 Comment(
"begin allocation of JSArray with elements");
5003 Label out(
this), empty(
this), nonempty(
this);
5007 if (capacity_int == 0) {
5009 array =
AllocateJSArray(array_map, empty_array, length, allocation_site,
5011 return {array.value(), empty_array};
5021 array =
AllocateJSArray(array_map, empty_array, length, allocation_site,
5023 elements = empty_array;
5031 if (allocation_site) {
5036 const int elements_offset = base_size;
5067 allocation_site, array_header_size);
5076 elements = InnerAllocateElements(
this, array.value(), elements_offset);
5084 ? RootIndex::kFixedDoubleArrayMap
5085 : RootIndex::kFixedArrayMap;
5097 return {array.value(), elements.value()};
5112 RootIndex::kEmptyFixedArray);
5114 if (allocation_site) {
5135 kind, array_map, length, allocation_site, capacity, allocation_flags);
5137 Label out(
this), nonempty(
this);
5144 RootIndex::kTheHoleValue);
5187 Label allocate_jsarray(
this), holey_extract(
this),
5188 allocate_jsarray_main(
this);
5190 bool need_conversion =
5192 if (need_conversion) {
5205 var_elements_kind.value());
5206 var_new_elements = new_elements;
5207 Goto(&allocate_jsarray);
5209 if (need_conversion) {
5210 BIND(&holey_extract);
5225 var_new_elements = new_elements;
5227 GotoIfNot(var_holes_converted.value(), &allocate_jsarray);
5230 Goto(&allocate_jsarray);
5233 BIND(&allocate_jsarray);
5237 var_elements_kind.value(),
5241 &allocate_jsarray_main);
5243 Goto(&allocate_jsarray_main);
5245 BIND(&allocate_jsarray_main);
5252 CAST(length), allocation_site);
5256template <
typename TIndex>
5260 static_assert(std::is_same_v<TIndex, Smi> || std::is_same_v<TIndex, IntPtrT>,
5261 "Only Smi or IntPtrT capacity is allowed");
5262 Comment(
"AllocateFixedArray");
5269 intptr_t capacity_constant;
5271 CHECK_LE(capacity_constant, kMaxLength);
5275 static_cast<int>(kMaxLength))),
5276 &if_out_of_memory, &next);
5278 BIND(&if_out_of_memory);
5279 CallRuntime(Runtime::kFatalProcessOutOfMemoryInvalidArrayLength,
5290 if (fixed_array_map) {
5304 ? RootIndex::kFixedDoubleArrayMap
5305 : RootIndex::kFixedArrayMap;
5321template <
typename TIndex>
5328 static_assert(std::is_same_v<TIndex, Smi> || std::is_same_v<TIndex, IntPtrT>,
5329 "Only Smi or IntPtrT first, count, and capacity are allowed");
5339 Label done(
this, {&var_result}), is_cow(
this),
5340 new_space_handler(
this, {&var_target_map});
5346 CSA_DCHECK(
this, IsFixedDoubleArrayMap(source_map));
5347 var_target_map = FixedArrayMapConstant();
5348 Goto(&new_space_handler);
5350 CSA_DCHECK(
this, Word32BinaryNot(IsFixedDoubleArrayMap(source_map)));
5352 &is_cow, &new_space_handler);
5362 &new_space_handler, [&] {
5367 var_target_map = FixedArrayMapConstant();
5368 Goto(&new_space_handler);
5373 BIND(&new_space_handler);
5375 Comment(
"Copy FixedArray in young generation");
5380 to_kind, capacity, allocation_flags, var_target_map.value());
5381 var_result = to_elements;
5383#if !defined(V8_ENABLE_SINGLE_GENERATION) && !V8_ENABLE_STICKY_MARK_BITS_BOOL
5404 RootIndex::kTheHoleValue);
5411 var_holes_converted);
5420template <
typename TIndex>
5426 static_assert(std::is_same_v<TIndex, Smi> || std::is_same_v<TIndex, IntPtrT>,
5427 "Only Smi or IntPtrT first, count, and capacity are allowed");
5429 DCHECK_NE(var_holes_converted,
nullptr);
5430 CSA_DCHECK(
this, IsFixedDoubleArrayMap(fixed_array_map));
5436 var_result = to_elements;
5447 Comment(
"[ ExtractFixedDoubleArrayFillingHoles");
5451 capacity, RootIndex::kTheHoleValue);
5453 const int first_element_offset =
5461 first_element_offset));
5463 Label decrement(
this, {&var_from_offset}), done(
this);
5467 Branch(
WordEqual(var_from_offset.value(), limit_offset), &done, &decrement);
5473 var_from_offset = from_offset;
5477 Label if_hole(
this);
5496 kind, allocation_flags, extract_flags,
5498 var_result = to_elements;
5503 Comment(
"] ExtractFixedDoubleArrayFillingHoles");
5504 return var_result.value();
5507template <
typename TIndex>
5513 static_assert(std::is_same_v<TIndex, Smi> || std::is_same_v<TIndex, IntPtrT>,
5514 "Only Smi or IntPtrT first, count, and capacity are allowed");
5530 count = IntPtrOrSmiSub(
5539 CSA_DCHECK(
this, Word32BinaryNot(IntPtrOrSmiGreaterThan(
5540 IntPtrOrSmiAdd(*first, *
count), *capacity)));
5543 Label if_fixed_double_array(
this), empty(
this), done(
this, &var_result);
5549 GotoIf(IsFixedDoubleArrayMap(source_map), &if_fixed_double_array);
5551 CSA_DCHECK(
this, IsFixedDoubleArrayMap(source_map));
5560 allocation_flags, extract_flags, convert_holes, var_holes_converted,
5561 source_elements_kind);
5562 var_result = to_elements;
5567 BIND(&if_fixed_double_array);
5568 Comment(
"Copy FixedDoubleArray");
5572 source, *first, *
count, *capacity, source_map, var_holes_converted,
5573 allocation_flags, extract_flags);
5574 var_result = to_elements;
5583 RootIndex::kTheHoleValue);
5586 var_result = to_elements;
5596 var_result = EmptyFixedArrayConstant();
5601 return var_result.value();
5620 IntPtrLessThanOrEqual(
5623 property_array, PropertyArray::kLengthAndHashOffset,
SmiTag(length));
5632 RootIndex map_index = RootIndex::kPropertyArrayMap;
5637 return property_array;
5646 array,
kind, from_index, to_index,
5654template <
typename TIndex>
5660 static_assert(std::is_same_v<TIndex, Smi> || std::is_same_v<TIndex, IntPtrT>,
5661 "Only Smi or IntPtrT from and to are allowed");
5663 DCHECK(value_root_index == RootIndex::kTheHoleValue ||
5664 value_root_index == RootIndex::kUndefinedValue);
5675 array,
kind, from_index, to_index,
5719#ifdef V8_ENABLE_EXPERIMENTAL_UNDEFINED_DOUBLE
5732 static_assert(kUndefinedNanLower32 == kUndefinedNanUpper32);
5754#ifdef V8_ENABLE_EXPERIMENTAL_UNDEFINED_DOUBLE
5755void CodeStubAssembler::StoreFixedDoubleArrayUndefined(
5764 StoreDoubleUndefined(array,
offset);
5778 CSA_DCHECK(
this, UintPtrLessThan(length, byte_length));
5780 static const int32_t fa_base_data_offset =
5804 CSA_DCHECK(
this, UintPtrLessThan(length, byte_length));
5806 static const int32_t fa_base_data_offset =
5809 fa_base_data_offset);
5823 Label* if_needs_write_barrier) {
5830 GotoIf(may_need_write_barrier, if_needs_write_barrier);
5838 Label finished(
this);
5839 Label needs_barrier(
this);
5840#ifdef V8_DISABLE_WRITE_BARRIERS
5841 const bool needs_barrier_check =
false;
5849 IntPtrLessThanOrEqual(
IntPtrAdd(dst_index, length),
5852 IntPtrLessThanOrEqual(
IntPtrAdd(src_index, length),
5857 if (needs_barrier_check) {
5863 static const int32_t fa_base_data_offset =
5879 if (needs_barrier_check) {
5882 BIND(&needs_barrier);
5894 Store(array, delta_offset, element);
5897 Label iterate_forward(
this);
5898 Label iterate_backward(
this);
5901 BIND(&iterate_forward);
5910 BIND(&iterate_backward);
5929 Label finished(
this);
5930 Label needs_barrier(
this);
5931#ifdef V8_DISABLE_WRITE_BARRIERS
5932 const bool needs_barrier_check =
false;
5951 if (needs_barrier_check) {
5957 static const int32_t fa_base_data_offset =
5965 IntPtrAdd(src_elements_intptr, src_offset_start);
5968 IntPtrAdd(dst_elements_intptr, dst_offset_start);
5976 if (needs_barrier_check) {
5979 BIND(&needs_barrier);
5987 src_elements,
kind, begin,
end,
5993 delta_offset, element);
5995 Store(dst_elements, delta_offset, element);
6028template <
typename TIndex>
6041 static_assert(std::is_same_v<TIndex, Smi> || std::is_same_v<TIndex, IntPtrT>,
6042 "Only Smi or IntPtrT indices are allowed");
6044 const int first_element_offset =
6046 Comment(
"[ CopyFixedArrayElements");
6055 bool doubles_to_objects_conversion =
6057 bool needs_write_barrier =
6058 doubles_to_objects_conversion ||
6060 bool element_offset_matches =
6061 !needs_write_barrier &&
6076 element_count, RootIndex::kUndefinedValue);
6078 RootIndex::kTheHoleValue);
6079 }
else if (doubles_to_objects_conversion) {
6083 capacity, RootIndex::kTheHoleValue);
6084 }
else if (element_count != capacity) {
6086 RootIndex::kTheHoleValue);
6092 first_from_element_offset,
IntPtrConstant(first_element_offset)));
6095 from_kind, first_element_offset));
6099 if (element_offset_matches) {
6100 var_to_offset = var_from_offset.value();
6107 if (var_holes_converted !=
nullptr) vars.
push_back(var_holes_converted);
6108 Label decrement(
this, vars);
6111 element_offset_matches
6115 Branch(
WordEqual(var_from_offset.value(), limit_offset), &done, &decrement);
6120 var_from_offset.value(),
6122 var_from_offset = from_offset;
6125 if (element_offset_matches) {
6126 to_offset = from_offset;
6129 var_to_offset.value(),
6131 var_to_offset = to_offset;
6134 Label next_iter(
this), store_double_hole(
this), signal_hole(
this);
6139 if_hole = &signal_hole;
6140 }
else if (doubles_to_objects_conversion) {
6143 if_hole = &next_iter;
6145 if_hole = &store_double_hole;
6151 if (to_double_elements) {
6152 DCHECK(!needs_write_barrier);
6154 from_array, var_from_offset.value(), from_kind, to_kind, if_hole);
6159 from_array, var_from_offset.value(), from_kind, to_kind, if_hole);
6160 if (needs_write_barrier) {
6162 Store(to_array_adjusted, to_offset, value);
6165 to_array_adjusted, to_offset, value);
6171 if (if_hole == &store_double_hole) {
6172 BIND(&store_double_hole);
6183 to_offset, double_hole);
6186 to_offset, double_hole);
6192 }
else if (if_hole == &signal_hole) {
6195 if (var_holes_converted !=
nullptr) {
6207 Comment(
"] CopyFixedArrayElements");
6212 Label fixed_array(
this);
6227 IsEmptyFixedArray(from_array)));
6228 Comment(
"[ CopyPropertyArrayValues");
6235 needs_write_barrier =
true;
6241 from_array,
kind,
start, property_count,
6242 [
this,
to_array, needs_write_barrier, destroy_source](
6250 if (needs_write_barrier) {
6262 Label did_zap(
this);
6263 GotoIf(IsEmptyFixedArray(from_array), &did_zap);
6270 Comment(
"] CopyPropertyArrayValues");
6288#ifdef V8_ENABLE_EXPERIMENTAL_UNDEFINED_DOUBLE
6289 Label if_undefined(
this);
6298 BIND(&if_undefined);
6300 result = UndefinedConstant();
6341template <
typename TIndex>
6344 static_assert(std::is_same_v<TIndex, Smi> || std::is_same_v<TIndex, IntPtrT>,
6345 "Only Smi or IntPtrT old_capacity is allowed");
6346 Comment(
"TryGrowElementsCapacity");
6348 TNode<TIndex> new_capacity = IntPtrOrSmiAdd(half_old_capacity, old_capacity);
6351 return IntPtrOrSmiAdd(new_capacity, padding);
6370template <
typename TIndex>
6374 static_assert(std::is_same_v<TIndex, Smi> || std::is_same_v<TIndex, IntPtrT>,
6375 "Only Smi or IntPtrT key and capacity nodes are allowed");
6376 Comment(
"TryGrowElementsCapacity");
6381 TNode<TIndex> max_capacity = IntPtrOrSmiAdd(capacity, max_gap);
6382 GotoIf(UintPtrOrSmiGreaterThanOrEqual(
key, max_capacity), bailout);
6389 new_capacity, bailout);
6392template <
typename TIndex>
6397 static_assert(std::is_same_v<TIndex, Smi> || std::is_same_v<TIndex, IntPtrT>,
6398 "Only Smi or IntPtrT capacities are allowed");
6399 Comment(
"[ GrowElementsCapacity");
6405 GotoIf(UintPtrOrSmiGreaterThanOrEqual(new_capacity,
6420 Comment(
"] GrowElementsCapacity");
6421 return new_elements;
6447 Comment(
"[Initialize AllocationMemento");
6449 InnerAllocateMemento(
this,
base, base_allocation_size);
6453 if (
v8_flags.allocation_site_pretenuring) {
6455 allocation_site, offsetof(
AllocationSite, pretenure_create_count_));
6459 allocation_site, offsetof(
AllocationSite, pretenure_create_count_),
6468 Label is_not_smi(
this), have_int32(
this);
6479 GotoIfNot(Float64Equal(value, value64), if_not_possible);
6484 return acc_intptr.value();
6489#ifdef V8_ENABLE_EXPERIMENTAL_UNDEFINED_DOUBLE
6490 Label* if_valueisundefined,
6492 Label* if_valueisnotnumber) {
6496#ifdef V8_ENABLE_EXPERIMENTAL_UNDEFINED_DOUBLE
6497 if (if_valueisundefined) {
6498 GotoIf(IsUndefined(value), if_valueisundefined);
6511 Label loop(
this, &var_value), done_loop(
this, &var_result);
6518 value = var_value.value();
6523#ifdef V8_ENABLE_EXPERIMENTAL_UNDEFINED_DOUBLE
6526 &if_valueisnotnumber);
6529 BIND(&if_valueisnotnumber);
6532 var_value =
CallBuiltin(Builtin::kNonNumberToNumber, context, value);
6537 return var_result.value();
6547 return var_result.value();
6558 if_bigint, if_bigint64, var_maybe_bigint);
6570 feedback, if_bigint, if_bigint64, var_maybe_bigint);
6582 feedback, if_bigint, if_bigint64, var_maybe_bigint);
6585template <Object::Conversion conversion>
6597 if (feedback.var_feedback !=
nullptr) {
6598 loop_vars.push_back(feedback.var_feedback);
6600 Label loop(
this, loop_vars);
6615 value = var_value.value();
6616 Label not_smi(
this), is_heap_number(
this), is_oddball(
this),
6617 maybe_bigint64(
this), is_bigint(
this), check_if_smi(
this);
6621 GotoIf(IsHeapNumberMap(map), &is_heap_number);
6624 if (
Is64() && if_bigint64) {
6633 if (feedback.var_feedback !=
nullptr) {
6637 CSA_DCHECK(
this, SmiEqual(feedback.var_feedback->value(),
6643 ? Builtin::kNonNumberToNumeric
6644 : Builtin::kNonNumberToNumber;
6645 if (feedback.var_feedback !=
nullptr) {
6652 Goto(&check_if_smi);
6654 if (feedback.var_feedback !=
nullptr) {
6655 BIND(&if_exception);
6656 DCHECK(feedback.slot !=
nullptr);
6657 DCHECK(feedback.maybe_feedback_vector !=
nullptr);
6659 (*feedback.maybe_feedback_vector)(), *feedback.slot,
6660 feedback.update_mode);
6661 CallRuntime(Runtime::kReThrow, context, var_exception.value());
6670 Goto(&check_if_smi);
6673 BIND(&is_heap_number);
6679 if (
Is64() && if_bigint64) {
6680 BIND(&maybe_bigint64);
6682 if (var_maybe_bigint) {
6683 *var_maybe_bigint =
CAST(value);
6691 if (var_maybe_bigint) {
6692 *var_maybe_bigint =
CAST(value);
6698 BIND(&check_if_smi);
6699 value = var_value.value();
6712 Label done(
this), if_heapnumber(
this);
6717 BIND(&if_heapnumber);
6719 var_result =
Signed(TruncateFloat64ToWord32(value));
6723 return var_result.value();
6729 return Signed(TruncateFloat64ToWord32(value));
6743 Label if_int32(
this);
6745 GotoIfNot(Float32Equal(value, fvalue), not_smi);
6750 not_smi, &if_int32);
6759 GotoIf(overflow, not_smi);
6769 Label if_int32(
this);
6770 GotoIfNot(Float64Equal(value, value64), not_smi);
6774 not_smi, &if_int32);
6784 GotoIf(overflow, not_smi);
6793 Label if_int32(
this);
6794 GotoIfNot(Float64Equal(value, value64), if_failed);
6799 if_failed, &if_int32);
6809 Label if_int64(
this);
6810 GotoIfNot(Float64Equal(value, value_roundtrip), if_failed);
6843 Label truncate_op_supported(
this), truncate_op_fallback(
this),
6848 &truncate_op_supported, &truncate_op_fallback);
6850 BIND(&truncate_op_supported);
6852 float16_out = TruncateFloat64ToFloat16RawBits(value);
6861 BIND(&truncate_op_fallback);
6870 Label if_infinity_or_nan(
this), if_finite(
this), done(
this);
6871 Branch(Uint64GreaterThanOrEqual(in,
6873 &if_infinity_or_nan, &if_finite);
6875 BIND(&if_infinity_or_nan);
6889 Label if_denormal(
this), not_denormal(
this);
6891 &if_denormal, ¬_denormal);
6907 BIND(¬_denormal);
6941 TNode<Word32T> signed_in_hi_word = Float64ExtractHighWord32(value);
6949 Label if_infinity_or_nan(
this), if_finite(
this), done(
this);
6950 Branch(Uint32GreaterThanOrEqual(
6953 &if_infinity_or_nan, &if_finite);
6955 BIND(&if_infinity_or_nan);
6959 Uint32GreaterThan(in_hi_word,
6970 Label if_denormal(
this), not_denormal(
this);
6973 &if_denormal, ¬_denormal);
6986 Float64ExtractLowWord32(temp), Float64ExtractHighWord32(temp),
6993 BIND(¬_denormal);
7011 in_lo_word, in_hi_word,
7033 return float16_out.value();
7057 Label not_smi(
this), done(
this);
7069 return var_result.value();
7073 Label not_smi(
this), done(
this);
7084 return var_result.value();
7097 Branch(overflow, &if_overflow, &if_notoverflow);
7105 BIND(&if_notoverflow);
7114 return var_result.value();
7137 BIND(&if_not_overflow);
7152 return var_result.value();
7163 BIND(&if_not_overflow);
7178 return var_result.value();
7192 if_valueisstring(
this);
7194 BIND(&if_valueisnotsmi);
7202 &if_valueisnotstring);
7203 BIND(&if_valueisnotstring);
7209 var_value =
CallBuiltin(Builtin::kToString, context, value);
7210 Goto(&if_valueisstring);
7212 BIND(&if_valueisnullorundefined);
7215 ThrowTypeError(context, MessageTemplate::kCalledOnNullOrUndefined,
7220 BIND(&if_valueissmi);
7223 var_value =
CallBuiltin(Builtin::kNumberToString, context, value);
7224 Goto(&if_valueisstring);
7226 BIND(&if_valueisstring);
7227 return CAST(var_value.value());
7241 BIND(&if_heapnumber);
7247 return var_result.value();
7271 IsHeapNumber(input),
7292 IsHeapNumber(
CAST(input)),
7301 return var_result.value();
7319 char const* method_name) {
7322 Label loop(
this, &var_value), done_loop(
this),
7343 &if_valueiswrapper, &if_valueisnotwrapper);
7345 BIND(&if_valueiswrapper);
7353 BIND(&if_valueisnotwrapper);
7355 switch (primitive_type) {
7375 const char* primitive_name =
nullptr;
7376 switch (primitive_type) {
7378 primitive_name =
"Boolean";
7381 primitive_name =
"Number";
7384 primitive_name =
"String";
7387 primitive_name =
"Symbol";
7393 ThrowTypeError(context, MessageTemplate::kNotGeneric, method_name,
7398 return var_value.value();
7404 char const* method_name) {
7417 BIND(&throw_exception);
7418 ThrowTypeError(context, MessageTemplate::kIncompatibleMethodReceiver,
7427 const char* method_name) {
7435 BIND(&throw_exception);
7443 const char* method_name) {
7450 BIND(&throw_exception);
7451 ThrowTypeError(context, MessageTemplate::kCalledNonCallable, method_name);
7463 CallRuntime(Runtime::kThrowRangeError, context, template_index);
7465 CallRuntime(Runtime::kThrowRangeError, context, template_index, *arg0);
7467 CallRuntime(Runtime::kThrowRangeError, context, template_index, *arg0,
7470 CallRuntime(Runtime::kThrowRangeError, context, template_index, *arg0,
7478 char const* arg0,
char const* arg1) {
7479 std::optional<TNode<Object>> arg0_node;
7481 std::optional<TNode<Object>> arg1_node;
7493 CallRuntime(Runtime::kThrowTypeError, context, template_index);
7495 CallRuntime(Runtime::kThrowTypeError, context, template_index, *arg0);
7497 CallRuntime(Runtime::kThrowTypeError, context, template_index, *arg0,
7500 CallRuntime(Runtime::kThrowTypeError, context, template_index, *arg0, *arg1,
7507 CallRuntime(Runtime::kTerminateExecution, context);
7521 JS_MESSAGE_OBJECT_TYPE)));
7530 LoadRoot(RootIndex::kTerminationException));
7535 IsolateField(IsolateFieldId::kContinuationPreservedEmbedderData);
7542 IsolateField(IsolateFieldId::kContinuationPreservedEmbedderData);
7561 Map::Bits3::IsExtensibleBit::kMask | Map::Bits3::IsPrototypeMapBit::kMask;
7562 int kExpected = Map::Bits3::IsExtensibleBit::kMask;
7674 const TNode<Object> initial_array_prototype = LoadContextElement(
7677 return TaggedEqual(proto, initial_array_prototype);
7684 LoadContextElement(
native_context, Context::TYPED_ARRAY_PROTOTYPE_INDEX);
7688 [=,
this] {
return NullConstant(); });
7689 return TaggedEqual(proto_of_proto, typed_array_prototype);
7718 LoadContextElement(
native_context, Context::SLOPPY_ARGUMENTS_MAP_INDEX);
7726 LoadContextElement(
native_context, Context::STRICT_ARGUMENTS_MAP_INDEX);
7767 return Int32LessThanOrEqual(instance_type,
7773 return Int32LessThanOrEqual(instance_type,
7847 static_assert(LAST_JS_RECEIVER_TYPE ==
LAST_TYPE);
7848 return Int32GreaterThanOrEqual(instance_type,
7853#if V8_STATIC_ROOTS_BOOL
7862#if V8_STATIC_ROOTS_BOOL
7866 InstanceTypeChecker::kUniqueMapRangeOfStringType::kSeqString.first == 0);
7869 InstanceTypeChecker::kUniqueMapRangeOfStringType::kSeqString.first,
7870 InstanceTypeChecker::kUniqueMapRangeOfStringType::kSeqString.
second);
7877#if V8_STATIC_ROOTS_BOOL
7880 InstanceTypeChecker::kUniqueMapRangeOfStringType::kExternalString.first,
7881 InstanceTypeChecker::kUniqueMapRangeOfStringType::kExternalString.
second);
7888#if V8_STATIC_ROOTS_BOOL
7891 InstanceTypeChecker::kUniqueMapRangeOfStringType::kUncachedExternalString
7893 InstanceTypeChecker::kUniqueMapRangeOfStringType::kUncachedExternalString
7901#if V8_STATIC_ROOTS_BOOL
7906#define VALIDATE_STRING_MAP_ENCODING_BIT(instance_type, size, name, Name) \
7908 ((instance_type & kStringEncodingMask) == kOneByteStringTag) == \
7909 ((StaticReadOnlyRoot::k##Name##Map & \
7910 InstanceTypeChecker::kStringMapEncodingMask) == \
7911 InstanceTypeChecker::kOneByteStringMapBit)); \
7913 ((instance_type & kStringEncodingMask) == kTwoByteStringTag) == \
7914 ((StaticReadOnlyRoot::k##Name##Map & \
7915 InstanceTypeChecker::kStringMapEncodingMask) == \
7916 InstanceTypeChecker::kTwoByteStringMapBit));
7918#undef VALIDATE_STRING_TYPE_RANGES
7922 Int32Constant(InstanceTypeChecker::kStringMapEncodingMask)),
7934#if V8_STATIC_ROOTS_BOOL
7940 return Uint32GreaterThanOrEqual(
7953#if V8_STATIC_ROOTS_BOOL
7988 static_assert(LAST_JS_OBJECT_TYPE ==
LAST_TYPE);
7989 return Int32GreaterThanOrEqual(instance_type,
8016 JS_FINALIZATION_REGISTRY_TYPE);
8089 return IsInRange(instance_type, FIRST_ALWAYS_SHARED_SPACE_JS_OBJECT_TYPE,
8090 LAST_ALWAYS_SHARED_SPACE_JS_OBJECT_TYPE);
8149 Word32And(Int32GreaterThanOrEqual(instance_type,
8151 Int32LessThanOrEqual(instance_type,
8159 Int32LessThan(instance_type,
Int32Constant(FIRST_WEAK_FIXED_ARRAY_TYPE)),
8160 Int32GreaterThan(instance_type,
8171 return IsInRange(instance_type, FIRST_PROMISE_REACTION_JOB_TASK_TYPE,
8172 LAST_PROMISE_REACTION_JOB_TASK_TYPE);
8198 return var_result.value();
8204 return IsFixedDoubleArray(
object);
8217 return IsPropertyCellMap(
LoadMap(
object));
8249#if V8_STATIC_ROOTS_BOOL
8252 static_assert(InstanceTypeChecker::kStringMapUpperBound + Map::kSize ==
8253 StaticReadOnlyRoot::kSymbolMap);
8254 return Uint32LessThanOrEqual(map_as_word32,
8263 return Int32LessThanOrEqual(instance_type,
Int32Constant(LAST_NAME_TYPE));
8267#if V8_STATIC_ROOTS_BOOL
8271 return Uint32LessThanOrEqual(
8272 map_as_word32,
Int32Constant(InstanceTypeChecker::kStringMapUpperBound));
8374 Label* true_label) {
8380 Label false_label(
this);
8388 1ULL << (
sizeof(uintptr_t) * 8 - 1))))),
8389 &false_label, true_label);
8395 return Int32LessThanOrEqual(instance_type,
8408 Word32And(Int32GreaterThanOrEqual(instance_type,
8410 Int32LessThanOrEqual(instance_type,
8442 FIRST_JS_FUNCTION_OR_BOUND_FUNCTION_OR_WRAPPED_FUNCTION_TYPE,
8443 LAST_JS_FUNCTION_OR_BOUND_FUNCTION_OR_WRAPPED_FUNCTION_TYPE);
8447 return IsInRange(instance_type, FIRST_JS_FUNCTION_TYPE,
8448 LAST_JS_FUNCTION_TYPE);
8513 GotoIf(Float64LessThan(value, smi_min), &out);
8514 GotoIf(Float64GreaterThan(value, smi_max), &out);
8515 GotoIfNot(Float64Equal(value, value), &out);
8521 return var_result.value();
8534 return Float64GreaterThanOrEqual(value, float_zero);
8556 IsHeapNumber(
CAST(number)),
8573 Float64Equal(Float64Sub(number_value, integer),
Float64Constant(0.0)),
8576 return Float64LessThanOrEqual(Float64Abs(integer),
8587 IsHeapNumber(
CAST(number)),
8598 return Float64Equal(Float64Sub(number_value, integer),
Float64Constant(0.0));
8608 return Float64Equal(value, ChangeUint32ToFloat64(int_value));
8628template <
typename TIndex>
8631 static_assert(std::is_same_v<TIndex, Smi> || std::is_same_v<TIndex, IntPtrT>,
8632 "Only Smi or IntPtrT element_count is allowed");
8633 int max_newspace_elements =
8635 return IntPtrOrSmiGreaterThan(
8646 if_stringistwobyte(
this), if_stringisonebyte(
this);
8656 Branch(is_one_byte, &if_stringisonebyte, &if_stringistwobyte);
8658 BIND(&if_stringisonebyte);
8661 Goto(&return_result);
8664 BIND(&if_stringistwobyte);
8667 Goto(&return_result);
8676 Goto(&return_result);
8679 BIND(&return_result);
8680 return var_result.value();
8690 &if_codeisonebyte, &if_codeistwobyte);
8691 BIND(&if_codeisonebyte);
8698 CSA_DCHECK(
this, Word32BinaryNot(IsUndefined(entry)));
8701 var_result =
CAST(entry);
8705 BIND(&if_codeistwobyte);
8718 return var_result.value();
8724 var_string_(string, this),
8726 var_map_(LoadMap(string), this),
8728 var_instance_type_(LoadInstanceType(string), this),
8730 var_offset_(IntPtrConstant(0), this),
8731 var_is_external_(Int32Constant(0), this),
8737#if V8_STATIC_ROOTS_BOOL
8743 Label if_iscons(
this);
8744 Label if_isexternal(
this);
8745 Label if_issliced(
this);
8746 Label if_isthin(
this);
8749#if V8_STATIC_ROOTS_BOOL
8760#if V8_STATIC_ROOTS_BOOL
8764 using StringTypeRange = InstanceTypeChecker::kUniqueMapRangeOfStringType;
8768 static_assert(StringTypeRange::kSeqString.first == 0);
8769 GotoIf(Uint32LessThanOrEqual(
8773 static_assert(StringTypeRange::kSeqString.second + Map::kSize ==
8774 StringTypeRange::kExternalString.first);
8776 Uint32LessThanOrEqual(
8780 static_assert(StringTypeRange::kExternalString.second + Map::kSize ==
8781 StringTypeRange::kConsString.first);
8782 GotoIf(Uint32LessThanOrEqual(
8786 static_assert(StringTypeRange::kConsString.second + Map::kSize ==
8787 StringTypeRange::kSlicedString.first);
8788 GotoIf(Uint32LessThanOrEqual(
8792 static_assert(StringTypeRange::kSlicedString.second + Map::kSize ==
8793 StringTypeRange::kThinString.first);
8795 static_assert(StringTypeRange::kThinString.second ==
8796 InstanceTypeChecker::kStringMapUpperBound);
8799 int32_t values[] = {
8804 &out, &if_iscons, &if_isexternal, &if_issliced, &if_isthin,
8810 Switch(representation, if_bailout, values, labels,
arraysize(values));
8826#if V8_STATIC_ROOTS_BOOL
8849#if V8_STATIC_ROOTS_BOOL
8867#if V8_STATIC_ROOTS_BOOL
8868 var_map_ =
LoadMap(actual_string);
8877 BIND(&if_isexternal);
8892 BIND(&flatten_in_runtime);
8895#if V8_STATIC_ROOTS_BOOL
8912#if V8_STATIC_ROOTS_BOOL
8927 BIND(&if_issequential);
8942 BIND(&if_isexternal);
8944#if V8_STATIC_ROOTS_BOOL
8963 return var_result.value();
8989 return var_result.value();
8996 Label if_smi(
this), not_smi(
this), if_heap_number(
this), done(
this, &
result);
9010 smi_input =
CAST(input);
9013 BIND(&if_heap_number);
9016 Comment(
"NumberToString - HeapNumber");
9023 Comment(
"NumberToString - Smi");
9030 Label if_smi_cache_missed(
this);
9038 BIND(&if_smi_cache_missed);
9040 Label store_to_cache(
this);
9043 const int kFullCacheSize =
9045 Branch(Uint32LessThan(number_string_cache_length,
9047 bailout, &store_to_cache);
9049 BIND(&store_to_cache);
9081 GotoIfNot(IsHeapNumber(number_key_heap_object), bailout);
9123 CSA_DCHECK(
this, Word32BinaryNot(IsHeapNumber(input)));
9129 if_inputisnotreceiver(
this);
9134 &if_inputisnotreceiver);
9136 BIND(&if_inputisreceiver);
9146 Label if_done(
this), if_notdone(
this);
9149 &if_done, &if_notdone);
9165 CSA_DCHECK(
this, Word32BinaryNot(IsHeapNumber(var_input.value())));
9167 Goto(&if_inputisnotreceiver);
9171 BIND(&if_inputisnotreceiver);
9173 Label not_plain_primitive(
this), if_inputisbigint(
this),
9179 ¬_plain_primitive);
9180 var_result = var_result_number.value();
9183 BIND(¬_plain_primitive);
9188 BIND(&if_inputisbigint);
9191 var_result =
CAST(var_input.value());
9196 Goto(&if_inputisother);
9200 var_input.value()));
9206 BIND(&if_inputisother);
9214 ? Runtime::kToNumber
9215 : Runtime::kToNumeric;
9216 var_result =
CAST(
CallRuntime(function_id, context, var_input.value()));
9226 return var_result.value();
9238 CSA_DCHECK(
this, Word32BinaryNot(IsHeapNumber(input)));
9243 Label if_inputisstring(
this);
9251 BIND(&if_inputisstring);
9281 var_result =
CAST(input);
9287 IsHeapNumber(
CAST(input)), [=,
this] {
return CAST(input); },
9289 return CAST(
CallBuiltin(Builtin::kNonNumberToNumber, context, input));
9295 return var_result.value();
9308 var_result = input_smi;
9309 if (var_type_feedback) {
9318 GotoIfNot(IsHeapNumber(input_ho), ¬_heap_number);
9321 var_result = input_hn;
9322 if (var_type_feedback) {
9327 BIND(¬_heap_number);
9331 Label not_bigint(
this);
9334 var_result =
CAST(input_ho);
9342 if (var_type_feedback) {
9350 return var_result.value();
9360 var_result = input_smi;
9367 GotoIfNot(IsHeapNumber(input_ho), ¬_heap_number);
9370 var_result = input_hn;
9373 BIND(¬_heap_number);
9383 return var_result.value();
9389 Label if_bigint(
this), done(
this), if_throw(
this);
9397 var_result =
CAST(input);
9401 ThrowTypeError(context, MessageTemplate::kBigIntFromObject, input);
9404 return var_result.value();
9410 Label if_bigint(
this), if_not_bigint(
this), done(
this);
9414 Goto(&if_not_bigint);
9417 var_result =
CAST(input);
9420 BIND(&if_not_bigint);
9426 return var_result.value();
9435 Label done(
this), is_smi(
this), is_heapnumber(
this), maybe_bigint64(
this),
9436 is_bigint(
this), is_oddball(
this);
9440 GotoIf(IsHeapNumberMap(map), &is_heapnumber);
9442 if (
Is64() && if_bigint64) {
9451 CallBuiltin(Builtin::kNonNumberToNumeric, context, heap_object_value));
9455 *var_bigint =
CAST(numeric_value);
9460 Goto(if_not_bigint);
9462 BIND(&is_heapnumber);
9464 Goto(if_not_bigint);
9466 if (
Is64() && if_bigint64) {
9467 BIND(&maybe_bigint64);
9469 *var_bigint =
CAST(value);
9475 *var_bigint =
CAST(value);
9481 Goto(if_not_bigint);
9505 var_result = number;
9514 Label if_isnegativesmi(
this), if_isheapnumber(
this);
9517 BIND(&if_isnegativesmi);
9525 BIND(&if_isheapnumber);
9527 Label return_zero(
this);
9533 Branch(Float64Equal(value, float_zero), &return_zero, &next);
9540 Branch(Float64Equal(value, value), &next, &return_zero);
9549 Branch(Float64Equal(value, positive_infinity), &return_zero, &next);
9558 Branch(Float64Equal(value, negative_infinity), &return_zero, &next);
9568 x = Float64Mod(
x, float_two_32);
9569 x = Float64Add(
x, float_two_32);
9570 x = Float64Mod(
x, float_two_32);
9585 return CAST(var_result.value());
9597 var_result =
CallBuiltin(Builtin::kToString, context, input);
9601 return CAST(var_result.value());
9617 BIND(&if_isreceiver);
9623 BIND(&if_isnotreceiver);
9649 uint32_t shift, uint32_t
mask) {
9651 if ((std::numeric_limits<uint32_t>::max() >> shift) ==
9652 ((std::numeric_limits<uint32_t>::max() &
mask) >> shift)) {
9663 if ((std::numeric_limits<uintptr_t>::max() >> shift) ==
9664 ((std::numeric_limits<uintptr_t>::max() &
mask) >> shift)) {
9674 uint32_t shift, uint32_t
mask,
9675 bool starts_as_zero) {
9681 if (starts_as_zero) {
9687 return Word32Or(masked_word, encoded_value);
9692 uint32_t shift, uintptr_t
mask,
9693 bool starts_as_zero) {
9700 if (starts_as_zero) {
9706 return WordOr(masked_word, encoded_value);
9746template <
typename TIndex>
9767 Label* if_keyisunique,
9770 Label* if_notinternalized) {
9774 Label if_keyisnotindex(
this);
9775 *var_index =
TryToIntptr(
key, &if_keyisnotindex, &var_instance_type);
9776 Goto(if_keyisindex);
9778 BIND(&if_keyisnotindex);
9780 Label if_symbol(
this), if_string(
this),
9787 static_assert(FIRST_NAME_TYPE ==
FIRST_TYPE);
9795 Goto(if_keyisunique);
9801 Label check_string_hash(
this, {&var_raw_hash});
9804 var_raw_hash = LoadNameRawHashField(
CAST(
key));
9805 Goto(&check_string_hash);
9806 BIND(&check_string_hash);
9808 Label if_thinstring(
this), if_has_cached_index(
this),
9814 &if_has_cached_index);
9829 &if_forwarding_index);
9834 if_notinternalized !=
nullptr ? if_notinternalized : if_bailout);
9837 Goto(if_keyisunique);
9839 BIND(&if_thinstring);
9843 Goto(if_keyisunique);
9846 BIND(&if_forwarding_index);
9848 Label if_external(
this), if_internalized(
this);
9850 raw_hash_field,
true),
9851 &if_external, &if_internalized);
9857 ExternalReference::raw_hash_from_forward_table());
9868 Goto(&check_string_hash);
9871 BIND(&if_internalized);
9877 raw_hash_field,
false));
9879 ExternalReference::string_from_forward_table());
9890 Goto(if_keyisunique);
9894 BIND(&if_has_cached_index);
9901 Goto(if_keyisindex);
9906 BIND(&if_keyisother);
9912 Goto(if_keyisunique);
9962#ifdef V8_INTL_SUPPORT
9971#ifdef V8_INTL_SUPPORT
9983 Label* if_not_internalized,
Label* if_bailout) {
9985 ExternalReference::try_string_to_index_or_lookup_existing());
9992 Label internalized(
this);
9996 if_not_internalized);
9999 *var_index = word_result;
10002 BIND(&internalized);
10004 Goto(if_internalized);
10007template <
typename Dictionary>
10016template <
typename T>
10019 int additional_offset) {
10021 object, DescriptorArray::kHeaderSize, index, additional_offset);
10031 const int kKeyToDetailsOffset =
10034 container, DescriptorArray::kHeaderSize, key_index, kKeyToDetailsOffset));
10039 const int kKeyToValueOffset =
10042 kKeyToValueOffset);
10047 const int kKeyToValueOffset =
10050 kKeyToValueOffset);
10076 container, DescriptorArray::kHeaderSize,
10111template <
class ContainerType>
10114 static_assert(!std::is_same_v<ContainerType, DescriptorArray>,
10115 "Use the non-templatized version for DescriptorArray");
10116 const int kKeyToValueOffset =
10117 (ContainerType::kEntryValueIndex - ContainerType::kEntryKeyIndex) *
10131template <
class ContainerType>
10134 static_assert(!std::is_same_v<ContainerType, DescriptorArray>,
10135 "Use the non-templatized version for DescriptorArray");
10136 const int kKeyToDetailsOffset =
10137 (ContainerType::kEntryDetailsIndex - ContainerType::kEntryKeyIndex) *
10140 kKeyToDetailsOffset));
10153template <
class ContainerType>
10157 const int kKeyToDetailsOffset =
10158 (ContainerType::kEntryDetailsIndex - ContainerType::kEntryKeyIndex) *
10175template <
class ContainerType>
10180 const int kKeyToValueOffset =
10181 (ContainerType::kEntryValueIndex - ContainerType::kEntryKeyIndex) *
10184 kKeyToValueOffset);
10195 switch (write_barrier) {
10241 intptr_t left_constant;
10242 intptr_t right_constant;
10253 intptr_t left_constant;
10254 intptr_t right_constant;
10265 intptr_t left_constant;
10266 intptr_t right_constant;
10269 return UintPtrConstant(std::min(
static_cast<uintptr_t
>(left_constant),
10270 static_cast<uintptr_t
>(right_constant)));
10285 TNode<HeapObject>
key) {
10286 TNode<PropertyCell> property_cell =
CAST(
key);
10292 TNode<HeapObject>
key) {
10301 Label index_found(
this, {&var_entry});
10303 &var_entry, not_found,
10305 BIND(&index_found);
10311template <
typename Dictionary>
10315 static_assert(std::is_same_v<Dictionary, NameDictionary> ||
10316 std::is_same_v<Dictionary, GlobalDictionary> ||
10317 std::is_same_v<Dictionary, NameToIndexHashTable>,
10318 "Unexpected NameDictionary");
10322 Comment(
"NameDictionaryLookup");
10345 if (var_name_index) loop_vars.
push_back(var_name_index);
10346 Label loop(
this, loop_vars);
10350 Label next_probe(
this);
10354 if (var_name_index) *var_name_index =
index;
10365 if (Dictionary::TodoShape::kMatchNeedsHoleCheck) {
10383 BIND(&if_not_computed);
10390 var_name_index, if_not_found, mode);
10404template <
typename Dictionary>
10410 if constexpr (std::is_same_v<Dictionary, NameDictionary>) {
10412 ? ER::name_dictionary_find_insertion_entry_forwarded_string()
10413 : ER::name_dictionary_lookup_forwarded_string();
10414 }
else if constexpr (std::is_same_v<Dictionary, GlobalDictionary>) {
10417 ? ER::global_dictionary_find_insertion_entry_forwarded_string()
10418 : ER::global_dictionary_lookup_forwarded_string();
10421 ER::name_to_index_hashtable_find_insertion_entry_forwarded_string();
10422 auto ref1 = ER::name_to_index_hashtable_lookup_forwarded_string();
10440 Goto(if_not_found);
10453 var_name_index, if_not_found,
10470 function_addr, type_uint32, std::make_pair(type_ptr, isolate_ptr),
10482 var_name_index, if_not_found);
10490 Comment(
"NumberDictionaryLookup");
10508 Label loop(
this, {&var_count, var_entry});
10509 *var_entry = initial_entry;
10518 Label next_probe(
this);
10520 Label if_currentissmi(
this), if_currentisnotsmi(
this);
10522 BIND(&if_currentissmi);
10525 Branch(
WordEqual(current_value, intptr_index), if_found, &next_probe);
10527 BIND(&if_currentisnotsmi);
10532 Branch(Float64Equal(current_value, key_as_float64), if_found,
10542 *var_entry = entry;
10551 Label if_found(
this);
10568template <
class Dictionary>
10585template <
class Dictionary>
10600 UndefinedConstant()),
10602 TheHoleConstant())));
10621 Label not_private(
this, &var_details);
10625 var_details = SmiOr(var_details.value(), dont_enum);
10626 Goto(¬_private);
10627 BIND(¬_private);
10631 var_details.value());
10641template <
class Dictionary>
10645 CSA_DCHECK(
this, Word32BinaryNot(IsEmptyPropertyDictionary(dictionary)));
10652 TNode<Smi> required_capacity_pseudo_smi = SmiAdd(new_nof,
SmiShr(new_nof, 1));
10653 GotoIf(SmiBelow(capacity, required_capacity_pseudo_smi), bailout);
10656 CSA_DCHECK(
this, SmiAbove(capacity, new_nof));
10658 GotoIf(SmiAbove(deleted, half_of_free_elements), bailout);
10664 GotoIf(SmiAbove(new_enum_index, max_enum_index), bailout);
10672 if (insertion_index.has_value()) {
10697 Label not_private(
this);
10701 var_details = details_byte_dont_enum;
10702 Goto(¬_private);
10704 BIND(¬_private);
10713template <
class Dictionary>
10767template <
typename Array>
10768struct OffsetOfArrayDataStart;
10770struct OffsetOfArrayDataStart<TransitionArray> {
10774struct OffsetOfArrayDataStart<DescriptorArray> {
10775 static constexpr int value = DescriptorArray::kHeaderSize;
10779template <
typename Array>
10785 Label* if_not_found) {
10786 static_assert(std::is_base_of_v<FixedArray, Array> ||
10787 std::is_base_of_v<WeakFixedArray, Array> ||
10788 std::is_base_of_v<DescriptorArray, Array>,
10789 "T must be a descendant of FixedArray or a WeakFixedArray");
10799 last_exclusive, first_inclusive,
10802 array, OffsetOfArrayDataStart<Array>::value, name_index);
10804 *var_name_index = name_index;
10808 Goto(if_not_found);
10829 TNode<TransitionArray> transitions) {
10841template <
typename Array>
10849template <
typename Array>
10871 return transition_number;
10874template <
typename Array>
10877 static_assert(std::is_base_of_v<TransitionArray, Array> ||
10878 std::is_base_of_v<DescriptorArray, Array>,
10879 "T must be a descendant of DescriptorArray or TransitionArray");
10880 const int key_offset = Array::ToKeyIndex(0) *
kTaggedSize;
10884 return CAST(element);
10896 descriptors, DescriptorArray::kHeaderSize,
10900template <
typename Array>
10906 Label* if_not_found) {
10916 CSA_DCHECK(
this, Uint32LessThanOrEqual(var_low.value(), var_high.value()));
10930 Label binary_loop(
this, {&var_high, &var_low});
10931 Goto(&binary_loop);
10932 BIND(&binary_loop);
10934 TNode<Uint32T> mid = calculate_mid(var_low.value(), var_high.value());
10941 Label mid_greater(
this), mid_less(
this), merge(
this);
10942 Branch(Uint32GreaterThanOrEqual(mid_hash, hash), &mid_greater, &mid_less);
10943 BIND(&mid_greater);
10957 Label scan_loop(
this, &var_low);
10961 GotoIf(Int32GreaterThan(var_low.value(), limit), if_not_found);
10970 GotoIf(Uint32GreaterThanOrEqual(sort_index, number_of_valid_entries),
11003 VariableList list({&var_descriptors, &var_stable, &var_has_symbol,
11004 &var_is_symbol_processing_loop, &var_start_key_index,
11005 &var_end_key_index},
11007 Label descriptor_array_loop(
this, list);
11009 Goto(&descriptor_array_loop);
11010 BIND(&descriptor_array_loop);
11013 list, var_start_key_index.value(), var_end_key_index.value(),
11015 TNode<Name> next_key =
11016 LoadKeyByKeyIndex(var_descriptors.value(), descriptor_key_index);
11018 TVARIABLE(Object, var_value_or_accessor, SmiConstant(0));
11019 Label next_iteration(this);
11021 if (mode == kEnumerationOrder) {
11025 Label if_string(this), if_symbol(this), if_name_ok(this);
11026 Branch(IsSymbol(next_key), &if_symbol, &if_string);
11031 GotoIf(var_is_symbol_processing_loop.value(), &if_name_ok);
11034 Label if_first_symbol(this);
11036 var_end_key_index = descriptor_key_index;
11037 Branch(var_has_symbol.value(), &next_iteration, &if_first_symbol);
11038 BIND(&if_first_symbol);
11040 var_start_key_index = descriptor_key_index;
11041 var_has_symbol = Int32TrueConstant();
11042 Goto(&next_iteration);
11047 CSA_DCHECK(this, IsString(next_key));
11050 Branch(var_is_symbol_processing_loop.value(), &next_iteration,
11056 TVARIABLE(Map, var_map);
11057 TVARIABLE(HeapObject, var_meta_storage);
11058 TVARIABLE(IntPtrT, var_entry);
11059 TVARIABLE(Uint32T, var_details);
11060 Label if_found(this);
11062 Label if_found_fast(this), if_found_dict(this);
11064 Label if_stable(this), if_not_stable(this);
11065 Branch(var_stable.value(), &if_stable, &if_not_stable);
11071 var_meta_storage = var_descriptors.value();
11072 var_entry = Signed(descriptor_key_index);
11073 Goto(&if_found_fast);
11075 BIND(&if_not_stable);
11082 &if_found_fast, &if_found_dict,
11083 &var_meta_storage, &var_entry,
11084 &next_iteration, bailout);
11087 BIND(&if_found_fast);
11099 name_index, var_details.value(),
11100 &var_value_or_accessor);
11103 BIND(&if_found_dict);
11106 CAST(var_meta_storage.value());
11115 var_details = details;
11116 var_value_or_accessor =
11124 TNode<Object> value_or_accessor = var_value_or_accessor.value();
11125 body(next_key, [&]() {
11130 value_or_accessor,
object, var_details.value(), context,
11132 Goto(&value_ready);
11136 CallRuntime(Runtime::kGetProperty, context,
object, next_key);
11137 Goto(&value_ready);
11139 BIND(&value_ready);
11140 return var_value.value();
11146 GotoIfNot(var_stable.value(), &next_iteration);
11152 Goto(&next_iteration);
11155 BIND(&next_iteration);
11157 DescriptorArray::kEntrySize, LoopUnrollingMode::kNo,
11158 IndexAdvanceMode::kPost);
11160 if (mode == kEnumerationOrder) {
11162 GotoIf(var_is_symbol_processing_loop.value(), &done);
11163 GotoIfNot(var_has_symbol.value(), &done);
11165 var_is_symbol_processing_loop = Int32TrueConstant();
11168 Increment(&var_end_key_index, DescriptorArray::kEntrySize);
11169 Goto(&descriptor_array_loop);
11177 var_maybe_constructor =
map;
11178 Label loop(
this, &var_maybe_constructor), done(
this);
11179 GotoIfNot(IsMap(var_maybe_constructor.value()), &done);
11184 var_maybe_constructor =
CAST(
11185 LoadObjectField(var_maybe_constructor.value(),
11186 Map::kConstructorOrBackPointerOrNativeContextOffset));
11187 GotoIf(IsMap(var_maybe_constructor.value()), &loop);
11192 return var_maybe_constructor.value();
11199 LoadMapConstructorOrBackPointerOrNativeContext(meta_map);
11200 GotoIf(
IsNull(maybe_context), if_bailout);
11201 return CAST(maybe_context);
11206 return GetCreationContextFromMap(LoadMap(
receiver), if_bailout);
11214 if_simple_case(
this), if_bound_function(
this), if_wrapped_function(
this),
11215 proxy_revoked(
this, Label::kDeferred);
11222 current_map = LoadMap(current.value());
11223 TNode<Int32T> instance_type = LoadMapInstanceType(current_map.value());
11224 GotoIf(IsJSFunctionInstanceType(instance_type), &if_simple_case);
11225 GotoIf(InstanceTypeEqual(instance_type, JS_PROXY_TYPE), &if_proxy);
11226 GotoIf(InstanceTypeEqual(instance_type, JS_BOUND_FUNCTION_TYPE),
11227 &if_bound_function);
11228 GotoIf(InstanceTypeEqual(instance_type, JS_WRAPPED_FUNCTION_TYPE),
11229 &if_wrapped_function);
11230 Goto(&if_simple_case);
11237 CAST(LoadObjectField(proxy, JSProxy::kHandlerOffset));
11239 GotoIfNot(IsJSReceiver(handler), &proxy_revoked);
11241 CAST(LoadObjectField(proxy, JSProxy::kTargetOffset));
11246 BIND(&proxy_revoked);
11247 { ThrowTypeError(context, MessageTemplate::kProxyRevoked,
"apply"); }
11249 BIND(&if_bound_function);
11253 bound_function, JSBoundFunction::kBoundTargetFunctionOffset));
11258 BIND(&if_wrapped_function);
11262 wrapped_function, JSWrappedFunction::kWrappedTargetFunctionOffset));
11267 BIND(&if_simple_case);
11270 return GetCreationContextFromMap(current_map.value(), if_bailout);
11279 Label* if_not_found) {
11280 Comment(
"DescriptorArrayLookup");
11282 DecodeWord32<Map::Bits3::NumberOfOwnDescriptorsBits>(bitfield3);
11283 Lookup<DescriptorArray>(unique_name, descriptors, nof, if_found,
11284 var_name_index, if_not_found);
11291 Label* if_not_found) {
11292 Comment(
"TransitionArrayLookup");
11294 NumberOfEntries<TransitionArray>(transitions);
11295 Lookup<TransitionArray>(unique_name, transitions, number_of_valid_transitions,
11296 if_found, var_name_index, if_not_found);
11299template <
typename Array>
11304 Label* if_not_found) {
11305 Comment(
"ArrayLookup");
11306 if (!number_of_valid_entries) {
11307 number_of_valid_entries = NumberOfEntries(array);
11309 GotoIf(Word32Equal(number_of_valid_entries, Int32Constant(0)), if_not_found);
11310 Label linear_search(
this), binary_search(
this);
11311 const int kMaxElementsForLinearSearch = 32;
11312 Branch(Uint32LessThanOrEqual(number_of_valid_entries,
11313 Int32Constant(kMaxElementsForLinearSearch)),
11314 &linear_search, &binary_search);
11315 BIND(&linear_search);
11317 LookupLinear<Array>(unique_name, array, number_of_valid_entries, if_found,
11318 var_name_index, if_not_found);
11320 BIND(&binary_search);
11322 LookupBinary<Array>(unique_name, array, number_of_valid_entries, if_found,
11323 var_name_index, if_not_found);
11327void CodeStubAssembler::TryLookupPropertyInSimpleObject(
11333 CSA_DCHECK(
this, IsUniqueNameNoCachedIndex(unique_name));
11336 Label if_isfastmap(
this), if_isslowmap(
this);
11337 Branch(IsSetWord32<Map::Bits3::IsDictionaryMapBit>(bit_field3), &if_isslowmap,
11339 BIND(&if_isfastmap);
11342 *var_meta_storage = descriptors;
11344 DescriptorLookup(unique_name, descriptors, bit_field3, if_found_fast,
11345 var_name_index, if_not_found);
11347 BIND(&if_isslowmap);
11350 *var_meta_storage = dictionary;
11352 NameDictionaryLookup<PropertyDictionary>(
11353 dictionary, unique_name, if_found_dict, var_name_index, if_not_found);
11357void CodeStubAssembler::TryLookupProperty(
11362 Label* if_bailout) {
11363 Label if_objectisspecial(
this);
11366 TryLookupPropertyInSimpleObject(
CAST(
object), map, unique_name, if_found_fast,
11367 if_found_dict, var_meta_storage,
11368 var_name_index, if_not_found, if_bailout);
11370 BIND(&if_objectisspecial);
11373 GotoIfNot(InstanceTypeEqual(instance_type, JS_GLOBAL_OBJECT_TYPE),
11378 int mask = Map::Bits1::HasNamedInterceptorBit::kMask |
11379 Map::Bits1::IsAccessCheckNeededBit::kMask;
11380 GotoIf(IsSetWord32(bit_field,
mask), if_bailout);
11383 *var_meta_storage = dictionary;
11385 NameDictionaryLookup<GlobalDictionary>(
11386 dictionary, unique_name, if_found_global, var_name_index, if_not_found);
11395 Label* if_bailout) {
11396 Comment(
"TryHasOwnProperty");
11397 CSA_DCHECK(
this, IsUniqueNameNoCachedIndex(unique_name));
11401 Label if_found_global(
this);
11402 TryLookupProperty(
object, map, instance_type, unique_name, if_found, if_found,
11403 &if_found_global, &var_meta_storage, &var_name_index,
11404 if_not_found, if_bailout);
11406 BIND(&if_found_global);
11411 LoadPropertyFromGlobalDictionary(
CAST(var_meta_storage.value()),
11412 var_name_index.value(), &var_details,
11413 &var_value, if_not_found);
11421 Label* if_null_or_undefined) {
11424 GotoIf(IsUndefined(
method), if_null_or_undefined);
11432 Label* if_iteratorundefined) {
11433 return GetMethod(context, heap_obj,
isolate()->factory()->iterator_symbol(),
11434 if_iteratorundefined);
11439 Label not_receiver(
this, Label::kDeferred);
11443 GotoIf(TaggedIsSmi(sync_iterator), ¬_receiver);
11444 GotoIfNot(IsJSReceiver(
CAST(sync_iterator)), ¬_receiver);
11447 GetProperty(context, sync_iterator, factory()->next_string());
11449 CreateAsyncFromSyncIterator(context,
CAST(sync_iterator), next);
11452 BIND(¬_receiver);
11462 return return_value.value();
11473 StoreObjectFieldNoWriteBarrier(
11474 iterator, JSAsyncFromSyncIterator::kSyncIteratorOffset, sync_iterator);
11475 StoreObjectFieldNoWriteBarrier(iterator, JSAsyncFromSyncIterator::kNextOffset,
11480void CodeStubAssembler::LoadPropertyFromFastObject(
11484 TNode<Uint32T> details = LoadDetailsByKeyIndex(descriptors, name_index);
11485 *var_details = details;
11487 LoadPropertyFromFastObject(
object, map, descriptors, name_index, details,
11491void CodeStubAssembler::LoadPropertyFromFastObject(
11495 Comment(
"[ LoadPropertyFromFastObject");
11498 DecodeWord32<PropertyDetails::LocationField>(details);
11500 Label if_in_field(
this), if_in_descriptor(
this), done(
this);
11501 Branch(Word32Equal(location, Int32Constant(
static_cast<int32_t
>(
11502 PropertyLocation::kField))),
11503 &if_in_field, &if_in_descriptor);
11504 BIND(&if_in_field);
11507 Signed(DecodeWordFromWord32<PropertyDetails::FieldIndexField>(details));
11509 DecodeWord32<PropertyDetails::RepresentationField>(details);
11512 CSA_DCHECK(
this, Word32NotEqual(representation,
11513 Int32Constant(Representation::kWasmValue)));
11515 IntPtrAdd(field_index, LoadMapInobjectPropertiesStartInWords(map));
11516 TNode<IntPtrT> instance_size_in_words = LoadMapInstanceSizeInWords(map);
11518 Label if_inobject(
this), if_backing_store(
this);
11520 Label rebox_double(
this, &var_double_value);
11521 Branch(UintPtrLessThan(field_index, instance_size_in_words), &if_inobject,
11522 &if_backing_store);
11523 BIND(&if_inobject);
11525 Comment(
"if_inobject");
11528 Label if_double(
this), if_tagged(
this);
11529 Branch(Word32NotEqual(representation,
11530 Int32Constant(Representation::kDouble)),
11531 &if_tagged, &if_double);
11534 *var_value = LoadObjectField(
object, field_offset);
11540 CAST(LoadObjectField(
object, field_offset));
11541 var_double_value = LoadHeapNumberValue(heap_number);
11542 Goto(&rebox_double);
11545 BIND(&if_backing_store);
11547 Comment(
"if_backing_store");
11549 field_index = Signed(IntPtrSub(field_index, instance_size_in_words));
11551 LoadPropertyArrayElement(
CAST(properties), field_index);
11553 Label if_double(
this), if_tagged(
this);
11554 Branch(Word32NotEqual(representation,
11555 Int32Constant(Representation::kDouble)),
11556 &if_tagged, &if_double);
11559 *var_value =
value;
11564 var_double_value = LoadHeapNumberValue(
CAST(value));
11565 Goto(&rebox_double);
11568 BIND(&rebox_double);
11570 Comment(
"rebox_double");
11572 AllocateHeapNumberWithValue(var_double_value.value());
11573 *var_value = heap_number;
11577 BIND(&if_in_descriptor);
11579 *var_value = LoadValueByKeyIndex(descriptors, name_index);
11584 Comment(
"] LoadPropertyFromFastObject");
11587template <
typename Dictionary>
11588void CodeStubAssembler::LoadPropertyFromDictionary(
11591 Comment(
"LoadPropertyFromNameDictionary");
11592 *var_details = LoadDetailsByKeyIndex(dictionary, name_index);
11593 *var_value = LoadValueByKeyIndex(dictionary, name_index);
11595 Comment(
"] LoadPropertyFromNameDictionary");
11598void CodeStubAssembler::LoadPropertyFromGlobalDictionary(
11601 Label* if_deleted) {
11602 Comment(
"[ LoadPropertyFromGlobalDictionary");
11604 CAST(LoadFixedArrayElement(dictionary, name_index));
11607 LoadObjectField(property_cell, PropertyCell::kValueOffset);
11608 GotoIf(TaggedEqual(value, PropertyCellHoleConstant()), if_deleted);
11610 *var_value =
value;
11612 TNode<Uint32T> details = Unsigned(LoadAndUntagToWord32ObjectField(
11613 property_cell, PropertyCell::kPropertyDetailsRawOffset));
11614 *var_details = details;
11616 Comment(
"] LoadPropertyFromGlobalDictionary");
11619template void CodeStubAssembler::LoadPropertyFromDictionary(
11623template void CodeStubAssembler::LoadPropertyFromDictionary(
11637 Label done(
this), if_accessor_info(
this, Label::kDeferred);
11641 Word32Equal(
kind, Int32Constant(
static_cast<int>(PropertyKind::kData))),
11645 GotoIfNot(IsAccessorPair(
CAST(value)), &if_accessor_info);
11649 if (mode == kCallJSGetterUseCachedName ||
11650 mode == kCallJSGetterDontUseCachedName) {
11651 Label if_callable(
this), if_function_template_info(
this);
11656 GotoIf(IsCallableMap(getter_map), &if_callable);
11657 GotoIf(IsFunctionTemplateInfoMap(getter_map), &if_function_template_info);
11660 var_value = UndefinedConstant();
11663 BIND(&if_callable);
11674 BIND(&if_function_template_info);
11676 Label use_cached_property(
this);
11678 getter, FunctionTemplateInfo::kCachedPropertyNameOffset);
11680 Label* has_cached_property = mode == kCallJSGetterUseCachedName
11681 ? &use_cached_property
11683 GotoIfNot(IsTheHole(cached_property_name), has_cached_property);
11686 switch (expected_receiver_mode) {
11687 case kExpectingJSReceiver:
11690 case kExpectingAnyReceiver:
11695 js_receiver = ToObject_Inline(context,
receiver);
11700 GetCreationContext(holder_receiver, if_bailout);
11702 var_value = CallBuiltin(
11703 Builtin::kCallFunctionTemplate_Generic, creation_context,
getter,
11707 if (mode == kCallJSGetterUseCachedName) {
11708 Bind(&use_cached_property);
11711 GetProperty(context, holder_receiver, cached_property_name);
11723 BIND(&if_accessor_info);
11726 Label if_array(
this), if_function(
this), if_wrapper(
this);
11730 TNode<Uint16T> holder_instance_type = LoadMapInstanceType(holder_map);
11731 GotoIf(IsJSArrayInstanceType(holder_instance_type), &if_array);
11732 GotoIf(IsJSFunctionInstanceType(holder_instance_type), &if_function);
11733 Branch(IsJSPrimitiveWrapperInstanceType(holder_instance_type), &if_wrapper,
11740 GotoIfNot(IsLengthString(
11741 LoadObjectField(accessor_info, AccessorInfo::kNameOffset)),
11744 var_value = LoadJSArrayLength(array);
11749 BIND(&if_function);
11752 GotoIfNot(IsPrototypeString(
11753 LoadObjectField(accessor_info, AccessorInfo::kNameOffset)),
11757 GotoIfPrototypeRequiresRuntimeLookup(function, holder_map, if_bailout);
11758 var_value = LoadJSFunctionPrototype(function, if_bailout);
11767 GotoIfNot(IsLengthString(
11768 LoadObjectField(accessor_info, AccessorInfo::kNameOffset)),
11771 GotoIfNot(TaggedIsNotSmi(holder_value), if_bailout);
11772 GotoIfNot(IsString(
CAST(holder_value)), if_bailout);
11773 var_value = LoadStringLengthAsSmi(
CAST(holder_value));
11779 return var_value.value();
11782void CodeStubAssembler::TryGetOwnProperty(
11787 TryGetOwnProperty(context,
receiver,
object, map, instance_type, unique_name,
11788 if_found_value, var_value,
nullptr,
nullptr, if_not_found,
11790 receiver ==
object ? kCallJSGetterUseCachedName
11791 : kCallJSGetterDontUseCachedName,
11792 expected_receiver_mode);
11795void CodeStubAssembler::TryGetOwnProperty(
11802 DCHECK_EQ(MachineRepresentation::kTagged, var_value->
rep());
11803 Comment(
"TryGetOwnProperty");
11807 expected_receiver_mode = kExpectingJSReceiver;
11809 CSA_DCHECK(
this, IsUniqueNameNoCachedIndex(unique_name));
11813 Label if_found_fast(
this), if_found_dict(
this), if_found_global(
this);
11816 if (!var_details) {
11817 var_details = &local_var_details;
11819 Label if_found(
this);
11821 TryLookupProperty(
object, map, instance_type, unique_name, &if_found_fast,
11822 &if_found_dict, &if_found_global, &var_meta_storage,
11823 &var_entry, if_not_found, if_bailout);
11824 BIND(&if_found_fast);
11829 LoadPropertyFromFastObject(
object, map, descriptors, name_index,
11830 var_details, var_value);
11833 BIND(&if_found_dict);
11837 LoadPropertyFromDictionary(dictionary, entry, var_details, var_value);
11841 BIND(&if_found_global);
11846 LoadPropertyFromGlobalDictionary(dictionary, entry, var_details, var_value,
11854 if (var_raw_value) {
11855 *var_raw_value = *var_value;
11859 unique_name, if_bailout, mode, expected_receiver_mode);
11860 *var_value =
value;
11861 Goto(if_found_value);
11865void CodeStubAssembler::InitializePropertyDescriptorObject(
11868 Label if_data_property(
this), if_accessor_property(
this),
11869 test_configurable(
this), test_property_type(
this), done(
this);
11871 SmiConstant(PropertyDescriptorObject::HasEnumerableBit::kMask |
11872 PropertyDescriptorObject::HasConfigurableBit::kMask));
11876 Uint32Constant(
DONT_ENUM << PropertyDetails::AttributesField::kShift);
11877 GotoIf(Word32And(details, dont_enum), &test_configurable);
11879 SmiOr(flags.value(),
11880 SmiConstant(PropertyDescriptorObject::IsEnumerableBit::kMask));
11881 Goto(&test_configurable);
11884 BIND(&test_configurable);
11887 Uint32Constant(
DONT_DELETE << PropertyDetails::AttributesField::kShift);
11888 GotoIf(Word32And(details, dont_delete), &test_property_type);
11890 SmiOr(flags.value(),
11891 SmiConstant(PropertyDescriptorObject::IsConfigurableBit::kMask));
11892 Goto(&test_property_type);
11895 BIND(&test_property_type);
11896 BranchIfAccessorPair(value, &if_accessor_property, &if_data_property);
11898 BIND(&if_accessor_property);
11900 Label done_get(
this), store_fields(
this);
11906 Label bind_undefined(
this), return_result(
this);
11907 GotoIf(
IsNull(value), &bind_undefined);
11911 GotoIf(IsFunctionTemplateInfoMap(map), if_bailout);
11912 Goto(&return_result);
11914 BIND(&bind_undefined);
11915 result = UndefinedConstant();
11916 Goto(&return_result);
11918 BIND(&return_result);
11927 Label bind_undefined(
this, Label::kDeferred), return_result(
this);
11928 flags = SmiOr(flags.value(),
11929 SmiConstant(PropertyDescriptorObject::HasGetBit::kMask |
11930 PropertyDescriptorObject::HasSetBit::kMask));
11931 StoreObjectField(descriptor, PropertyDescriptorObject::kFlagsOffset,
11933 StoreObjectField(descriptor, PropertyDescriptorObject::kValueOffset,
11935 StoreObjectField(descriptor, PropertyDescriptorObject::kGetOffset,
11936 BailoutIfTemplateInfo(
getter));
11937 StoreObjectField(descriptor, PropertyDescriptorObject::kSetOffset,
11938 BailoutIfTemplateInfo(
setter));
11942 BIND(&if_data_property);
11944 Label store_fields(
this);
11945 flags = SmiOr(flags.value(),
11946 SmiConstant(PropertyDescriptorObject::HasValueBit::kMask |
11947 PropertyDescriptorObject::HasWritableBit::kMask));
11949 Uint32Constant(
READ_ONLY << PropertyDetails::AttributesField::kShift);
11950 GotoIf(Word32And(details, read_only), &store_fields);
11951 flags = SmiOr(flags.value(),
11952 SmiConstant(PropertyDescriptorObject::IsWritableBit::kMask));
11953 Goto(&store_fields);
11955 BIND(&store_fields);
11956 StoreObjectField(descriptor, PropertyDescriptorObject::kFlagsOffset,
11958 StoreObjectField(descriptor, PropertyDescriptorObject::kValueOffset, value);
11959 StoreObjectField(descriptor, PropertyDescriptorObject::kGetOffset,
11961 StoreObjectField(descriptor, PropertyDescriptorObject::kSetOffset,
11972 TNode<Map> map = GetInstanceTypeMap(PROPERTY_DESCRIPTOR_OBJECT_TYPE);
11973 StoreMapNoWriteBarrier(
result, map);
11975 StoreObjectFieldNoWriteBarrier(
result, PropertyDescriptorObject::kFlagsOffset,
11978 StoreObjectFieldNoWriteBarrier(
result, PropertyDescriptorObject::kValueOffset,
11980 StoreObjectFieldNoWriteBarrier(
result, PropertyDescriptorObject::kGetOffset,
11982 StoreObjectFieldNoWriteBarrier(
result, PropertyDescriptorObject::kSetOffset,
11989 Label return_false(
this), return_true(
this), return_generic(
this);
11992 GotoIf(IsToJSONString(name), &return_true);
11993 GotoIf(IsGetString(name), &return_true);
11994 GotoIfNot(InstanceTypeEqual(LoadMapInstanceType(LoadMap(name)), SYMBOL_TYPE),
11996 Branch(IsSetWord32<Symbol::IsInterestingSymbolBit>(
11997 LoadObjectField<Uint32T>(name, offsetof(
Symbol,
flags_))),
11998 &return_true, &return_false);
12000 BIND(&return_false);
12001 var_result = BoolConstant(
false);
12002 Goto(&return_generic);
12004 BIND(&return_true);
12005 var_result = BoolConstant(
true);
12006 Goto(&return_generic);
12008 BIND(&return_generic);
12009 return var_result.value();
12014 Label* if_not_found) {
12018 return GetInterestingProperty(context,
receiver, &var_holder, &var_holder_map,
12019 name, if_not_found);
12026 CSA_DCHECK(
this, IsInterestingProperty(name));
12029 CSA_DCHECK(
this, TaggedEqual(LoadMap((*var_holder).value()),
12030 (*var_holder_map).value()));
12036 Label loop(
this, {var_holder, var_holder_map}),
12037 lookup(
this, Label::kDeferred);
12041 Label interesting_properties(
this);
12043 TNode<Map> holder_map = (*var_holder_map).value();
12044 GotoIf(
IsNull(holder), if_not_found);
12045 TNode<Uint32T> holder_bit_field3 = LoadMapBitField3(holder_map);
12046 GotoIf(IsSetWord32<Map::Bits3::MayHaveInterestingPropertiesBit>(
12047 holder_bit_field3),
12048 &interesting_properties);
12049 *var_holder = LoadMapPrototype(holder_map);
12050 *var_holder_map = LoadMap((*var_holder).value());
12052 BIND(&interesting_properties);
12055 GotoIf(IsClearWord32<Map::Bits3::IsDictionaryMapBit>(holder_bit_field3),
12058 GotoIf(InstanceTypeEqual(LoadMapInstanceType(holder_map), JS_PROXY_TYPE),
12061 LoadObjectField(holder, JSObject::kPropertiesOrHashOffset);
12062 CSA_DCHECK(
this, TaggedIsNotSmi(properties));
12067 GetNameDictionaryFlags<NameDictionary>(
CAST(properties));
12068 GotoIf(IsSetSmi(flags,
12069 NameDictionary::MayHaveInterestingPropertiesBit::kMask),
12071 *var_holder = LoadMapPrototype(holder_map);
12072 *var_holder_map = LoadMap((*var_holder).value());
12079 return CallBuiltin<JSAny>(Builtin::kGetPropertyWithReceiver, context,
12080 (*var_holder).value(), name,
receiver,
12081 SmiConstant(OnNonExistent::kReturnUndefined));
12084void CodeStubAssembler::TryLookupElement(
12094 Label if_isobjectorsmi(
this), if_isdouble(
this), if_isdictionary(
this),
12095 if_isfaststringwrapper(
this), if_isslowstringwrapper(
this), if_oob(
this),
12096 if_typedarray(
this), if_rab_gsab_typedarray(
this);
12098 int32_t values[] = {
12123 UINT8_CLAMPED_ELEMENTS,
12124 BIGUINT64_ELEMENTS,
12126 RAB_GSAB_UINT8_ELEMENTS,
12127 RAB_GSAB_INT8_ELEMENTS,
12128 RAB_GSAB_UINT16_ELEMENTS,
12129 RAB_GSAB_INT16_ELEMENTS,
12130 RAB_GSAB_UINT32_ELEMENTS,
12131 RAB_GSAB_INT32_ELEMENTS,
12132 RAB_GSAB_FLOAT32_ELEMENTS,
12133 RAB_GSAB_FLOAT64_ELEMENTS,
12134 RAB_GSAB_UINT8_CLAMPED_ELEMENTS,
12135 RAB_GSAB_BIGUINT64_ELEMENTS,
12136 RAB_GSAB_BIGINT64_ELEMENTS,
12138 Label* labels[] = {
12139 &if_isobjectorsmi, &if_isobjectorsmi, &if_isobjectorsmi,
12140 &if_isobjectorsmi, &if_isobjectorsmi, &if_isobjectorsmi,
12141 &if_isobjectorsmi, &if_isobjectorsmi, &if_isobjectorsmi,
12143 &if_isdouble, &if_isdouble,
12145 &if_isfaststringwrapper,
12146 &if_isslowstringwrapper,
12159 &if_rab_gsab_typedarray,
12160 &if_rab_gsab_typedarray,
12161 &if_rab_gsab_typedarray,
12162 &if_rab_gsab_typedarray,
12163 &if_rab_gsab_typedarray,
12164 &if_rab_gsab_typedarray,
12165 &if_rab_gsab_typedarray,
12166 &if_rab_gsab_typedarray,
12167 &if_rab_gsab_typedarray,
12168 &if_rab_gsab_typedarray,
12169 &if_rab_gsab_typedarray,
12173 Switch(elements_kind, if_bailout, values, labels,
arraysize(values));
12175 BIND(&if_isobjectorsmi);
12178 TNode<IntPtrT> length = LoadAndUntagFixedArrayBaseLength(elements);
12180 GotoIfNot(UintPtrLessThan(intptr_index, length), &if_oob);
12182 TNode<Object> element = UnsafeLoadFixedArrayElement(elements, intptr_index);
12184 Branch(TaggedEqual(element, the_hole), if_not_found, if_found);
12186 BIND(&if_isdouble);
12189 TNode<IntPtrT> length = LoadAndUntagFixedArrayBaseLength(elements);
12191 GotoIfNot(UintPtrLessThan(intptr_index, length), &if_oob);
12194 LoadFixedDoubleArrayElement(
CAST(elements), intptr_index, if_not_found,
12195 MachineType::None());
12198 BIND(&if_isdictionary);
12202 GotoIf(UintPtrLessThan(IntPtrConstant(JSObject::kMaxElementIndex),
12206 GotoIf(IntPtrLessThan(intptr_index, IntPtrConstant(0)), if_bailout);
12211 NumberDictionaryLookup(elements, intptr_index, if_found, &var_entry,
12214 BIND(&if_isfaststringwrapper);
12218 GotoIf(UintPtrLessThan(intptr_index, length), if_found);
12219 Goto(&if_isobjectorsmi);
12221 BIND(&if_isslowstringwrapper);
12225 GotoIf(UintPtrLessThan(intptr_index, length), if_found);
12226 Goto(&if_isdictionary);
12228 BIND(&if_typedarray);
12231 GotoIf(IsDetachedBuffer(buffer), if_absent);
12234 Branch(UintPtrLessThan(intptr_index, length), if_found, if_absent);
12236 BIND(&if_rab_gsab_typedarray);
12240 LoadVariableLengthJSTypedArrayLength(
CAST(
object), buffer, if_absent);
12241 Branch(UintPtrLessThan(intptr_index, length), if_found, if_absent);
12248 GotoIf(UintPtrLessThan(IntPtrConstant(JSObject::kMaxElementIndex),
12252 GotoIf(IntPtrLessThan(intptr_index, IntPtrConstant(0)), if_bailout);
12254 Goto(if_not_found);
12259 Label* if_maybe_special_index,
12260 Label* if_not_special_index) {
12265 const int kBufferSize = 24;
12266 TNode<Smi> string_length = LoadStringLengthAsSmi(name_string);
12267 GotoIf(SmiEqual(string_length, SmiConstant(0)), if_not_special_index);
12268 GotoIf(SmiGreaterThan(string_length, SmiConstant(kBufferSize)),
12269 if_not_special_index);
12273 TNode<Int32T> first_char = StringCharCodeAt(name_string, UintPtrConstant(0));
12275 GotoIf(Word32Equal(first_char, Int32Constant(
'-')), if_maybe_special_index);
12277 GotoIf(Word32Equal(first_char, Int32Constant(
'I')), if_maybe_special_index);
12279 GotoIf(Word32Equal(first_char, Int32Constant(
'N')), if_maybe_special_index);
12282 GotoIf(Uint32LessThan(first_char, Int32Constant(
'0')), if_not_special_index);
12283 GotoIf(Uint32LessThan(Int32Constant(
'9'), first_char), if_not_special_index);
12284 Goto(if_maybe_special_index);
12287void CodeStubAssembler::TryPrototypeChainLookup(
12291 Label* if_bailout,
Label* if_proxy,
bool handle_private_names) {
12293 GotoIf(TaggedIsSmi(
receiver), if_bailout);
12299 Label if_objectisreceiver(
this);
12300 Branch(IsJSReceiverInstanceType(instance_type), &if_objectisreceiver,
12302 BIND(&if_objectisreceiver);
12304 GotoIf(InstanceTypeEqual(instance_type, JS_PROXY_TYPE), if_proxy);
12310 Label if_keyisindex(
this), if_iskeyunique(
this);
12311 TryToName(
key, &if_keyisindex, &var_index, &if_iskeyunique, &var_unique,
12314 BIND(&if_iskeyunique);
12320 Label loop(
this, {&var_holder, &var_holder_map, &var_holder_instance_type});
12324 TNode<Map> holder_map = var_holder_map.value();
12325 TNode<Int32T> holder_instance_type = var_holder_instance_type.value();
12327 Label next_proto(
this), check_integer_indexed_exotic(
this);
12328 lookup_property_in_holder(
CAST(
receiver), var_holder.value(), holder_map,
12329 holder_instance_type, var_unique.value(),
12330 &check_integer_indexed_exotic, if_bailout);
12332 BIND(&check_integer_indexed_exotic);
12335 GotoIfNot(InstanceTypeEqual(holder_instance_type, JS_TYPED_ARRAY_TYPE),
12337 GotoIfNot(IsString(var_unique.value()), &next_proto);
12338 BranchIfMaybeSpecialIndex(
CAST(var_unique.value()), if_bailout,
12344 if (handle_private_names) {
12351 GotoIf(
IsNull(proto), if_end);
12354 TNode<Uint16T> proto_instance_type = LoadMapInstanceType(proto_map);
12356 var_holder = proto;
12357 var_holder_map = proto_map;
12358 var_holder_instance_type = proto_instance_type;
12362 BIND(&if_keyisindex);
12368 Label loop(
this, {&var_holder, &var_holder_map, &var_holder_instance_type});
12372 Label next_proto(
this);
12373 lookup_element_in_holder(
CAST(
receiver), var_holder.value(),
12374 var_holder_map.value(),
12375 var_holder_instance_type.value(),
12376 var_index.value(), &next_proto, if_bailout);
12381 GotoIf(
IsNull(proto), if_end);
12384 TNode<Uint16T> proto_instance_type = LoadMapInstanceType(proto_map);
12386 var_holder = proto;
12387 var_holder_map = proto_map;
12388 var_holder_instance_type = proto_instance_type;
12398 Label return_false(
this), return_true(
this),
12399 return_runtime(
this, Label::kDeferred), return_result(
this);
12403 Label loop(
this, &var_object_map);
12408 Label if_objectisdirect(
this), if_objectisspecial(
this, Label::kDeferred);
12409 TNode<Map> object_map = var_object_map.value();
12410 TNode<Uint16T> object_instance_type = LoadMapInstanceType(object_map);
12412 &if_objectisspecial, &if_objectisdirect);
12413 BIND(&if_objectisspecial);
12417 GotoIf(InstanceTypeEqual(object_instance_type, JS_PROXY_TYPE),
12419 TNode<Int32T> object_bitfield = LoadMapBitField(object_map);
12420 int mask = Map::Bits1::HasNamedInterceptorBit::kMask |
12421 Map::Bits1::IsAccessCheckNeededBit::kMask;
12422 Branch(IsSetWord32(object_bitfield,
mask), &return_runtime,
12423 &if_objectisdirect);
12425 BIND(&if_objectisdirect);
12429 GotoIf(
IsNull(object_prototype), &return_false);
12430 GotoIf(TaggedEqual(object_prototype, prototype), &return_true);
12433 CSA_DCHECK(
this, TaggedIsNotSmi(object_prototype));
12434 var_object_map = LoadMap(object_prototype);
12438 BIND(&return_true);
12439 var_result = TrueConstant();
12440 Goto(&return_result);
12442 BIND(&return_false);
12443 var_result = FalseConstant();
12444 Goto(&return_result);
12446 BIND(&return_runtime);
12450 CallRuntime(Runtime::kHasInPrototypeChain, context,
object, prototype));
12452 Goto(&return_result);
12454 BIND(&return_result);
12455 return var_result.value();
12462 Label return_runtime(
this, Label::kDeferred), return_result(
this);
12464 GotoIfForceSlowPath(&return_runtime);
12467 GotoIf(TaggedIsSmi(object_maybe_smi), &return_runtime);
12470 GotoIf(TaggedIsSmi(callable_maybe_smi), &return_runtime);
12476 TNode<Map> callable_map = LoadMap(callable);
12479 TNode<Uint16T> callable_instance_type = LoadMapInstanceType(callable_map);
12480 GotoIfNot(IsJSFunctionInstanceType(callable_instance_type),
12483 GotoIfPrototypeRequiresRuntimeLookup(
CAST(callable), callable_map,
12488 callable, JSFunction::kPrototypeOrInitialMapOffset);
12490 Label no_initial_map(
this), walk_prototype_chain(
this);
12494 GotoIfNot(IsMap(callable_prototype), &no_initial_map);
12495 var_callable_prototype = LoadObjectField<HeapObject>(
12496 callable_prototype, Map::kPrototypeOffset);
12497 Goto(&walk_prototype_chain);
12499 BIND(&no_initial_map);
12502 Branch(TaggedEqual(callable_prototype, TheHoleConstant()),
12503 &return_runtime, &walk_prototype_chain);
12505 BIND(&walk_prototype_chain);
12506 callable_prototype = var_callable_prototype.value();
12510 var_result = HasInPrototypeChain(context,
object, callable_prototype);
12511 Goto(&return_result);
12514 BIND(&return_runtime);
12517 var_result =
CAST(
CallRuntime(Runtime::kOrdinaryHasInstance, context,
12518 callable_maybe_smi, object_maybe_smi));
12520 Goto(&return_result);
12522 BIND(&return_result);
12523 return var_result.value();
12526template <
typename TIndex>
12531 std::is_same_v<TIndex, Smi> || std::is_same_v<TIndex, TaggedIndex> ||
12532 std::is_same_v<TIndex, IntPtrT> || std::is_same_v<TIndex, UintPtrT>,
12533 "Only Smi, UintPtrT or IntPtrT index nodes are allowed");
12535 int element_size = 1 << element_size_shift;
12536 intptr_t index = 0;
12538 bool constant_index =
false;
12539 if (std::is_same_v<TIndex, Smi>) {
12540 TNode<Smi> smi_index_node = ReinterpretCast<Smi>(index_node);
12542 element_size_shift -= kSmiShiftBits;
12544 constant_index = TryToSmiConstant(smi_index_node, &smi_index);
12545 if (constant_index) {
12546 index = smi_index.value();
12549 smi_index_node = NormalizeSmiIndex(smi_index_node);
12552 intptr_index_node = BitcastTaggedToWordForTagAndSmiBits(smi_index_node);
12553 }
else if (std::is_same_v<TIndex, TaggedIndex>) {
12555 ReinterpretCast<TaggedIndex>(index_node);
12557 intptr_index_node = BitcastTaggedToWordForTagAndSmiBits(tagged_index_node);
12558 constant_index = TryToIntPtrConstant(intptr_index_node, &index);
12560 intptr_index_node = ReinterpretCast<IntPtrT>(index_node);
12561 constant_index = TryToIntPtrConstant(intptr_index_node, &index);
12563 if (constant_index) {
12564 return IntPtrConstant(base_size + element_size * index);
12568 (element_size_shift == 0)
12569 ? intptr_index_node
12570 : ((element_size_shift > 0)
12571 ? WordShl(intptr_index_node,
12572 IntPtrConstant(element_size_shift))
12573 : WordSar(intptr_index_node,
12574 IntPtrConstant(-element_size_shift)));
12575 return IntPtrAdd(IntPtrConstant(base_size), Signed(shifted_index));
12580CodeStubAssembler::ElementOffsetFromIndex<Smi>(
TNode<Smi> index_node,
12584CodeStubAssembler::ElementOffsetFromIndex<TaggedIndex>(
12587CodeStubAssembler::ElementOffsetFromIndex<IntPtrT>(
TNode<IntPtrT> index_node,
12599 return IntPtrLessThanOrEqual(
offset, last_offset);
12605 LoadObjectField<FeedbackCell>(closure, JSFunction::kFeedbackCellOffset);
12606 return LoadObjectField<HeapObject>(feedback_cell, FeedbackCell::kValueOffset);
12612 Label if_no_feedback_vector(
this), out(
this);
12614 maybe_vector = LoadFeedbackVector(closure, &if_no_feedback_vector);
12617 BIND(&if_no_feedback_vector);
12621 maybe_vector = UndefinedConstant();
12625 return maybe_vector.value();
12631 GotoIfNot(IsFeedbackVector(maybe_vector), if_no_feedback_vector);
12632 return CAST(maybe_vector);
12642 GotoIf(HasInstanceType(feedback_cell_array.value(),
12643 CLOSURE_FEEDBACK_CELL_ARRAY_TYPE),
12648 feedback_cell_array =
CAST(
12649 LoadObjectField(vector, FeedbackVector::kClosureFeedbackCellArrayOffset));
12653 return CAST(feedback_cell_array.value());
12658 CAST(LoadFromParentFrame(StandardFrameConstants::kFunctionOffset));
12659 return CAST(LoadFeedbackVector(function));
12664 LoadFromParentFrame(BaselineFrameConstants::kBytecodeArrayFromFp));
12669 LoadFromParentFrame(BaselineFrameConstants::kFeedbackVectorFromFp));
12673 return CAST(LoadFromParentFrame(InterpreterFrameConstants::kContextOffset));
12677CodeStubAssembler::LoadFeedbackVectorForStubWithTrampoline() {
12679 TNode<RawPtrT> parent_frame_pointer = Load<RawPtrT>(frame_pointer);
12681 LoadFullTagged(parent_frame_pointer,
12682 IntPtrConstant(StandardFrameConstants::kFunctionOffset)));
12683 return CAST(LoadFeedbackVector(function));
12691 case UpdateFeedbackMode::kOptionalFeedback:
12692 MaybeUpdateFeedback(feedback, maybe_feedback_vector, slot_id);
12694 case UpdateFeedbackMode::kGuaranteedFeedback:
12695 CSA_DCHECK(
this, IsFeedbackVector(maybe_feedback_vector));
12696 UpdateFeedback(feedback,
CAST(maybe_feedback_vector), slot_id);
12698 case UpdateFeedbackMode::kNoFeedback:
12700 CSA_DCHECK(
this, IsUndefined(maybe_feedback_vector));
12712 GotoIf(IsUndefined(maybe_vector), &
end);
12714 UpdateFeedback(feedback,
CAST(maybe_vector), slot_id);
12729 LoadFeedbackVectorSlot(feedback_vector, slot_id);
12731 TNode<Smi> combined_feedback = SmiOr(previous_feedback, feedback);
12733 GotoIf(SmiEqual(previous_feedback, combined_feedback), &
end);
12735 StoreFeedbackVectorSlot(feedback_vector, slot_id, combined_feedback,
12737 ReportFeedbackUpdate(feedback_vector, slot_id,
"UpdateFeedback");
12744void CodeStubAssembler::ReportFeedbackUpdate(
12746 const char* reason) {
12747#ifdef V8_TRACE_FEEDBACK_UPDATES
12749 CallRuntime(Runtime::kTraceUpdateFeedback, NoContextConstant(),
12750 feedback_vector, SmiTag(Signed(slot_id)), StringConstant(reason));
12755 int new_feedback) {
12756 if (existing_feedback ==
nullptr)
return;
12757 *existing_feedback = SmiConstant(new_feedback);
12762 if (existing_feedback ==
nullptr)
return;
12763 *existing_feedback = SmiOr(existing_feedback->
value(), SmiConstant(feedback));
12768 if (existing_feedback ==
nullptr)
return;
12769 *existing_feedback = SmiOr(existing_feedback->
value(), feedback);
12773 Label* if_protector) {
12775 auto first_ptr = Unsigned(
12776 BitcastTaggedToWord(LoadRoot(RootIndex::kFirstNameForProtector)));
12778 Unsigned(BitcastTaggedToWord(LoadRoot(RootIndex::kLastNameForProtector)));
12779 auto name_ptr = Unsigned(BitcastTaggedToWord(name));
12780 GotoIf(IsInRange(name_ptr, first_ptr, last_ptr), if_protector);
12786 case ConvertReceiverMode::kNullOrUndefined:
12789 case ConvertReceiverMode::kNotNullOrUndefined:
12792 case ConvertReceiverMode::kAny:
12799 Label vtrue(
this, Label::kDeferred), vfalse(
this),
end(
this);
12800 Branch(TaggedIsSmi(
receiver), &vtrue, &vfalse);
12804 value = HeapNumberMapConstant();
12809 value = LoadMap(UncheckedCast<HeapObject>(
receiver));
12814 return value.value();
12821 Label done(
this, &var_intptr_key), key_is_smi(
this), key_is_heapnumber(
this);
12822 GotoIf(TaggedIsSmi(
key), &key_is_smi);
12825 if (var_instance_type !=
nullptr) {
12826 *var_instance_type = instance_type;
12829 Branch(IsHeapNumberInstanceType(instance_type), &key_is_heapnumber,
12834 var_intptr_key = SmiUntag(
CAST(
key));
12838 BIND(&key_is_heapnumber);
12841#if V8_TARGET_ARCH_64_BIT
12848 GotoIfNot(Float64Equal(value, RoundIntPtrToFloat64(int_value)),
12850#if V8_TARGET_ARCH_64_BIT
12856 GotoIfNot(IsInRange(int_value,
static_cast<intptr_t
>(-
kMaxSafeInteger),
12862 var_intptr_key = int_value;
12867 return var_intptr_key.value();
12874 LoadContextElement(
native_context, Context::SCRIPT_CONTEXT_TABLE_INDEX));
12875 return LoadArrayElement(script_context_table, context_index);
12883 case UINT8_CLAMPED_ELEMENTS:
12884 case UINT8_ELEMENTS:
12885 case INT8_ELEMENTS:
12886 return MachineRepresentation::kWord8;
12887 case UINT16_ELEMENTS:
12888 case INT16_ELEMENTS:
12889 case FLOAT16_ELEMENTS:
12890 return MachineRepresentation::kWord16;
12891 case UINT32_ELEMENTS:
12892 case INT32_ELEMENTS:
12893 return MachineRepresentation::kWord32;
12894 case FLOAT32_ELEMENTS:
12895 return MachineRepresentation::kFloat32;
12896 case FLOAT64_ELEMENTS:
12897 return MachineRepresentation::kFloat64;
12908template <
typename TIndex>
12914 std::is_same_v<TIndex, UintPtrT> || std::is_same_v<TIndex, IntPtrT>,
12915 "Only UintPtrT or IntPtrT indices is allowed");
12916 DCHECK(
kind == BIGINT64_ELEMENTS ||
kind == BIGUINT64_ELEMENTS);
12921 BigIntToRawBytes(value, &var_low, &var_high);
12924#if defined(V8_TARGET_BIG_ENDIAN)
12926 StoreNoWriteBarrier(rep, elements,
offset, var_high.value());
12927 StoreNoWriteBarrier(rep, elements,
12931 StoreNoWriteBarrier(rep, elements,
offset, var_low.value());
12934 StoreNoWriteBarrier(rep, elements,
offset, var_low.value());
12936 StoreNoWriteBarrier(rep, elements,
12948 StoreElementTypedArrayBigInt(elements,
kind, index, value);
12956 StoreElementTypedArrayBigInt(elements,
kind, index, value);
12959template <
typename TIndex>
12965 std::is_same_v<TIndex, UintPtrT> || std::is_same_v<TIndex, IntPtrT>,
12966 "Only UintPtrT or IntPtrT indices is allowed");
12968 if (
kind == UINT8_CLAMPED_ELEMENTS) {
12969 CSA_DCHECK(
this, Word32Equal(value, Word32And(Int32Constant(0xFF), value)));
12974 StoreNoWriteBarrier(rep, elements,
offset, value);
12982 StoreElementTypedArrayWord32(elements,
kind, index, value);
12990 StoreElementTypedArrayWord32(elements,
kind, index, value);
12993template <
typename TArray,
typename TIndex,
typename TValue>
12999 static_assert(std::is_same_v<TIndex, Smi> ||
13000 std::is_same_v<TIndex, UintPtrT> ||
13001 std::is_same_v<TIndex, IntPtrT>,
13002 "Only Smi, UintPtrT or IntPtrT indices is allowed");
13004 std::is_same_v<TArray, RawPtrT> || std::is_same_v<TArray, FixedArrayBase>,
13005 "Only RawPtrT or FixedArrayBase elements are allowed");
13007 std::is_same_v<TValue, Float16RawBitsT> ||
13008 std::is_same_v<TValue, Int32T> || std::is_same_v<TValue, Float32T> ||
13009 std::is_same_v<TValue, Float64T> || std::is_same_v<TValue, Object>,
13010 "Only Int32T, Float32T, Float64T or object value "
13011 "types are allowed");
13016 StoreNoWriteBarrier(rep, elements,
offset, value);
13019template <
typename TIndex>
13023 static_assert(std::is_same_v<TIndex, Smi> || std::is_same_v<TIndex, IntPtrT>,
13024 "Only Smi or IntPtrT indices are allowed");
13027 StoreElementTypedArray(elements,
kind, index, value);
13030 StoreFixedArrayElement(
CAST(elements), index, smi_value);
13032 StoreFixedArrayElement(
CAST(elements), index, value);
13036template <
typename TIndex>
13040 static_assert(std::is_same_v<TIndex, Smi> || std::is_same_v<TIndex, IntPtrT>,
13041 "Only Smi or IntPtrT indices are allowed");
13043 StoreFixedDoubleArrayElement(
CAST(elements), index, value);
13046template <
typename TIndex,
typename TValue>
13049 static_assert(std::is_same_v<TIndex, Smi> ||
13050 std::is_same_v<TIndex, IntPtrT> ||
13051 std::is_same_v<TIndex, UintPtrT>,
13052 "Only Smi, IntPtrT or UintPtrT indices are allowed");
13054 std::is_same_v<TValue, Float16RawBitsT> ||
13055 std::is_same_v<TValue, Int32T> || std::is_same_v<TValue, Word32T> ||
13056 std::is_same_v<TValue, Float32T> ||
13057 std::is_same_v<TValue, Float64T> || std::is_same_v<TValue, BigInt>,
13058 "Only Int32T, Word32T, Float32T, Float64T or BigInt value types "
13062 StoreElementTypedArray(elements,
kind, index, value);
13089 GotoIf(Uint32LessThanOrEqual(int32_value, int32_255), &done);
13090 var_value = int32_zero;
13091 GotoIf(Int32LessThan(int32_value, int32_zero), &done);
13092 var_value = int32_255;
13095 return UncheckedCast<Uint8T>(var_value.value());
13102 GotoIf(Float64LessThanOrEqual(float64_value, Float64Constant(0.0)), &done);
13103 var_value = Int32Constant(255);
13104 GotoIf(Float64LessThanOrEqual(Float64Constant(255.0), float64_value), &done);
13107 var_value = TruncateFloat64ToWord32(rounded_value);
13111 return UncheckedCast<Uint8T>(var_value.value());
13115TNode<Word32T> CodeStubAssembler::PrepareValueForWriteToTypedArray<Word32T>(
13119 switch (elements_kind) {
13120 case UINT8_ELEMENTS:
13121 case INT8_ELEMENTS:
13122 case UINT16_ELEMENTS:
13123 case INT16_ELEMENTS:
13124 case UINT32_ELEMENTS:
13125 case INT32_ELEMENTS:
13126 case UINT8_CLAMPED_ELEMENTS:
13134 Label done(
this, &var_result), if_smi(
this), if_heapnumber_or_oddball(
this),
13135 convert(
this), loop(
this, &var_input);
13138 GotoIf(TaggedIsSmi(var_input.value()), &if_smi);
13142 TNode<HeapObject> heap_object =
CAST(var_input.value());
13143 GotoIf(IsHeapNumber(heap_object), &if_heapnumber_or_oddball);
13145 offsetof(Oddball, to_number_raw_));
13146 Branch(HasInstanceType(heap_object, ODDBALL_TYPE), &if_heapnumber_or_oddball,
13149 BIND(&if_heapnumber_or_oddball);
13151 TNode<Float64T> value =
13152 LoadObjectField<Float64T>(heap_object, offsetof(HeapNumber,
value_));
13153 if (elements_kind == UINT8_CLAMPED_ELEMENTS) {
13154 var_result = Float64ToUint8Clamped(value);
13155 }
else if (elements_kind == FLOAT16_ELEMENTS) {
13156 var_result = ReinterpretCast<Word32T>(TruncateFloat64ToFloat16(value));
13158 var_result = TruncateFloat64ToWord32(value);
13165 TNode<Int32T> value = SmiToInt32(
CAST(var_input.value()));
13166 if (elements_kind == UINT8_CLAMPED_ELEMENTS) {
13167 var_result = Int32ToUint8Clamped(value);
13168 }
else if (elements_kind == FLOAT16_ELEMENTS) {
13169 var_result = ReinterpretCast<Word32T>(RoundInt32ToFloat16(value));
13171 var_result =
value;
13178 var_input = CallBuiltin(Builtin::kNonNumberToNumber, context, input);
13183 return var_result.value();
13187TNode<Float16RawBitsT>
13188CodeStubAssembler::PrepareValueForWriteToTypedArray<Float16RawBitsT>(
13189 TNode<Object> input, ElementsKind elements_kind, TNode<Context> context) {
13191 CHECK_EQ(elements_kind, FLOAT16_ELEMENTS);
13193 TVARIABLE(Float16RawBitsT, var_result);
13195 Label done(
this, &var_result), if_smi(
this), if_heapnumber_or_oddball(
this),
13196 convert(
this), loop(
this, &var_input);
13199 GotoIf(TaggedIsSmi(var_input.value()), &if_smi);
13203 TNode<HeapObject> heap_object =
CAST(var_input.value());
13204 GotoIf(IsHeapNumber(heap_object), &if_heapnumber_or_oddball);
13206 offsetof(Oddball, to_number_raw_));
13207 Branch(HasInstanceType(heap_object, ODDBALL_TYPE), &if_heapnumber_or_oddball,
13210 BIND(&if_heapnumber_or_oddball);
13212 TNode<Float64T> value =
13213 LoadObjectField<Float64T>(heap_object, offsetof(HeapNumber,
value_));
13214 var_result = TruncateFloat64ToFloat16(value);
13220 TNode<Int32T> value = SmiToInt32(
CAST(var_input.value()));
13221 var_result = RoundInt32ToFloat16(value);
13227 var_input = CallBuiltin(Builtin::kNonNumberToNumber, context, input);
13232 return var_result.value();
13236TNode<Float32T> CodeStubAssembler::PrepareValueForWriteToTypedArray<Float32T>(
13237 TNode<Object> input, ElementsKind elements_kind, TNode<Context> context) {
13239 CHECK_EQ(elements_kind, FLOAT32_ELEMENTS);
13243 Label done(
this, &var_result), if_smi(
this), if_heapnumber_or_oddball(
this),
13244 convert(
this), loop(
this, &var_input);
13247 GotoIf(TaggedIsSmi(var_input.value()), &if_smi);
13251 TNode<HeapObject> heap_object =
CAST(var_input.value());
13252 GotoIf(IsHeapNumber(heap_object), &if_heapnumber_or_oddball);
13254 offsetof(Oddball, to_number_raw_));
13255 Branch(HasInstanceType(heap_object, ODDBALL_TYPE), &if_heapnumber_or_oddball,
13258 BIND(&if_heapnumber_or_oddball);
13260 TNode<Float64T> value =
13261 LoadObjectField<Float64T>(heap_object, offsetof(HeapNumber,
value_));
13262 var_result = TruncateFloat64ToFloat32(value);
13268 TNode<Int32T> value = SmiToInt32(
CAST(var_input.value()));
13269 var_result = RoundInt32ToFloat32(value);
13275 var_input = CallBuiltin(Builtin::kNonNumberToNumber, context, input);
13280 return var_result.value();
13284TNode<Float64T> CodeStubAssembler::PrepareValueForWriteToTypedArray<Float64T>(
13285 TNode<Object> input, ElementsKind elements_kind, TNode<Context> context) {
13287 CHECK_EQ(elements_kind, FLOAT64_ELEMENTS);
13291 Label done(
this, &var_result), if_smi(
this), if_heapnumber_or_oddball(
this),
13292 convert(
this), loop(
this, &var_input);
13295 GotoIf(TaggedIsSmi(var_input.value()), &if_smi);
13299 TNode<HeapObject> heap_object =
CAST(var_input.value());
13300 GotoIf(IsHeapNumber(heap_object), &if_heapnumber_or_oddball);
13302 offsetof(Oddball, to_number_raw_));
13303 Branch(HasInstanceType(heap_object, ODDBALL_TYPE), &if_heapnumber_or_oddball,
13306 BIND(&if_heapnumber_or_oddball);
13309 LoadObjectField<Float64T>(heap_object, offsetof(HeapNumber,
value_));
13315 TNode<Int32T> value = SmiToInt32(
CAST(var_input.value()));
13316 var_result = ChangeInt32ToFloat64(value);
13322 var_input = CallBuiltin(Builtin::kNonNumberToNumber, context, input);
13327 return var_result.value();
13331TNode<BigInt> CodeStubAssembler::PrepareValueForWriteToTypedArray<BigInt>(
13332 TNode<Object> input, ElementsKind elements_kind, TNode<Context> context) {
13333 DCHECK(elements_kind == BIGINT64_ELEMENTS ||
13334 elements_kind == BIGUINT64_ELEMENTS);
13335 return ToBigInt(context, input);
13338#if V8_ENABLE_WEBASSEMBLY
13339TorqueStructInt64AsInt32Pair CodeStubAssembler::BigIntToRawBytes(
13340 TNode<BigInt> value) {
13344 BigIntToRawBytes(value, &var_low, &var_high);
13345 return {var_low.value(), var_high.value()};
13348TNode<RawPtrT> CodeStubAssembler::AllocateBuffer(TNode<IntPtrT> size) {
13349 TNode<ExternalReference> function =
13350 ExternalConstant(ExternalReference::allocate_buffer());
13351 return UncheckedCast<RawPtrT>(CallCFunction(
13352 function, MachineType::UintPtr(),
13353 std::make_pair(MachineType::Pointer(),
13354 IsolateField(IsolateFieldId::kIsolateAddress)),
13355 std::make_pair(MachineType::IntPtr(), size)));
13363 *var_low = Unsigned(IntPtrConstant(0));
13364 *var_high = Unsigned(IntPtrConstant(0));
13366 TNode<Uint32T> length = DecodeWord32<BigIntBase::LengthBits>(bitfield);
13368 GotoIf(Word32Equal(length, Int32Constant(0)), &done);
13369 *var_low = LoadBigIntDigit(bigint, 0);
13371 Label load_done(
this);
13372 GotoIf(Word32Equal(length, Int32Constant(1)), &load_done);
13373 *var_high = LoadBigIntDigit(bigint, 1);
13377 GotoIf(Word32Equal(
sign, Int32Constant(0)), &done);
13380 *var_high = Unsigned(IntPtrSub(IntPtrConstant(0), var_high->
value()));
13381 Label no_carry(
this);
13382 GotoIf(IntPtrEqual(var_low->
value(), IntPtrConstant(0)), &no_carry);
13383 *var_high = Unsigned(IntPtrSub(var_high->
value(), IntPtrConstant(1)));
13387 *var_low = Unsigned(IntPtrSub(IntPtrConstant(0), var_low->
value()));
13393void CodeStubAssembler::EmitElementStoreTypedArrayUpdateValue(
13396 switch (elements_kind) {
13397 case UINT8_ELEMENTS:
13398 case INT8_ELEMENTS:
13399 case UINT16_ELEMENTS:
13400 case INT16_ELEMENTS:
13401 case UINT8_CLAMPED_ELEMENTS:
13402 *maybe_converted_value =
13403 SmiFromInt32(UncheckedCast<Int32T>(converted_value));
13405 case UINT32_ELEMENTS:
13406 *maybe_converted_value =
13407 ChangeUint32ToTagged(UncheckedCast<Uint32T>(converted_value));
13409 case INT32_ELEMENTS:
13410 *maybe_converted_value =
13411 ChangeInt32ToTagged(UncheckedCast<Int32T>(converted_value));
13419void CodeStubAssembler::EmitElementStoreTypedArrayUpdateValue(
13423 Label dont_allocate_heap_number(
this),
end(
this);
13424 GotoIf(TaggedIsSmi(value), &dont_allocate_heap_number);
13425 GotoIf(IsHeapNumber(
CAST(value)), &dont_allocate_heap_number);
13427 *maybe_converted_value =
13428 AllocateHeapNumberWithValue(ChangeFloat16ToFloat64(converted_value));
13431 BIND(&dont_allocate_heap_number);
13433 *maybe_converted_value =
value;
13440void CodeStubAssembler::EmitElementStoreTypedArrayUpdateValue(
13443 Label dont_allocate_heap_number(
this),
end(
this);
13444 GotoIf(TaggedIsSmi(value), &dont_allocate_heap_number);
13445 GotoIf(IsHeapNumber(
CAST(value)), &dont_allocate_heap_number);
13447 *maybe_converted_value =
13448 AllocateHeapNumberWithValue(ChangeFloat32ToFloat64(converted_value));
13451 BIND(&dont_allocate_heap_number);
13453 *maybe_converted_value =
value;
13460void CodeStubAssembler::EmitElementStoreTypedArrayUpdateValue(
13463 Label dont_allocate_heap_number(
this),
end(
this);
13464 GotoIf(TaggedIsSmi(value), &dont_allocate_heap_number);
13465 GotoIf(IsHeapNumber(
CAST(value)), &dont_allocate_heap_number);
13467 *maybe_converted_value = AllocateHeapNumberWithValue(converted_value);
13470 BIND(&dont_allocate_heap_number);
13472 *maybe_converted_value =
value;
13479void CodeStubAssembler::EmitElementStoreTypedArrayUpdateValue(
13482 *maybe_converted_value = converted_value;
13485template <
typename TValue>
13486void CodeStubAssembler::EmitElementStoreTypedArray(
13490 Label done(
this), update_value_and_bailout(
this, Label::kDeferred);
13492 bool is_rab_gsab =
false;
13494 is_rab_gsab =
true;
13501 PrepareValueForWriteToTypedArray<TValue>(value, elements_kind, context);
13511 if (!is_rab_gsab) {
13512 GotoIf(IsDetachedBuffer(buffer), &update_value_and_bailout);
13518 length = LoadVariableLengthJSTypedArrayLength(
13519 typed_array, buffer,
13521 : &update_value_and_bailout);
13523 length = LoadJSTypedArrayLength(typed_array);
13529 GotoIfNot(UintPtrLessThan(
key, length), &done);
13532 GotoIfNot(UintPtrLessThan(
key, length), &update_value_and_bailout);
13536 StoreElement(data_ptr, elements_kind,
key, converted_value);
13540 BIND(&update_value_and_bailout);
13548 if (maybe_converted_value !=
nullptr) {
13549 EmitElementStoreTypedArrayUpdateValue(
13550 value, elements_kind, converted_value, maybe_converted_value);
13558void CodeStubAssembler::EmitElementStore(
13562 CSA_DCHECK(
this, Word32BinaryNot(IsJSProxy(
object)));
13568 CSA_DCHECK(
this, Word32BinaryNot(IsFixedCOWArrayMap(LoadMap(elements))));
13570 GotoIf(IsFixedCOWArrayMap(LoadMap(elements)), bailout);
13580 switch (elements_kind) {
13581 case UINT8_ELEMENTS:
13582 case INT8_ELEMENTS:
13583 case UINT16_ELEMENTS:
13584 case INT16_ELEMENTS:
13585 case UINT32_ELEMENTS:
13586 case INT32_ELEMENTS:
13587 case UINT8_CLAMPED_ELEMENTS:
13588 case RAB_GSAB_UINT8_ELEMENTS:
13589 case RAB_GSAB_INT8_ELEMENTS:
13590 case RAB_GSAB_UINT16_ELEMENTS:
13591 case RAB_GSAB_INT16_ELEMENTS:
13592 case RAB_GSAB_UINT32_ELEMENTS:
13593 case RAB_GSAB_INT32_ELEMENTS:
13594 case RAB_GSAB_UINT8_CLAMPED_ELEMENTS:
13595 EmitElementStoreTypedArray<Word32T>(typed_array, intptr_key, value,
13596 elements_kind, store_mode, bailout,
13597 context, maybe_converted_value);
13599 case FLOAT32_ELEMENTS:
13600 case RAB_GSAB_FLOAT32_ELEMENTS:
13601 EmitElementStoreTypedArray<Float32T>(typed_array, intptr_key, value,
13602 elements_kind, store_mode, bailout,
13603 context, maybe_converted_value);
13605 case FLOAT64_ELEMENTS:
13606 case RAB_GSAB_FLOAT64_ELEMENTS:
13607 EmitElementStoreTypedArray<Float64T>(typed_array, intptr_key, value,
13608 elements_kind, store_mode, bailout,
13609 context, maybe_converted_value);
13611 case BIGINT64_ELEMENTS:
13612 case BIGUINT64_ELEMENTS:
13613 case RAB_GSAB_BIGINT64_ELEMENTS:
13614 case RAB_GSAB_BIGUINT64_ELEMENTS:
13615 EmitElementStoreTypedArray<BigInt>(typed_array, intptr_key, value,
13616 elements_kind, store_mode, bailout,
13617 context, maybe_converted_value);
13619 case FLOAT16_ELEMENTS:
13620 case RAB_GSAB_FLOAT16_ELEMENTS:
13621 EmitElementStoreTypedArray<Float16RawBitsT>(
13622 typed_array, intptr_key, value, elements_kind, store_mode, bailout,
13623 context, maybe_converted_value);
13637 std::optional<TNode<Float64T>> float_value;
13639 GotoIfNot(TaggedIsSmi(value), bailout);
13641#ifdef V8_ENABLE_EXPERIMENTAL_UNDEFINED_DOUBLE
13642 Label float_done(
this), is_undefined(
this);
13644 float_var = TryTaggedToFloat64(value, &is_undefined, bailout);
13647 BIND(&is_undefined);
13649 float_var = Float64Constant(UndefinedNan());
13654 float_value = float_var.value();
13656 float_value = TryTaggedToFloat64(value, bailout);
13664 return CAST(LoadJSArrayLength(
CAST(
object)));
13666 [=,
this]() {
return LoadFixedArrayBaseLength(elements); });
13672 elements = CheckForCapacityGrow(
object, elements, elements_kind, length,
13673 intptr_key, bailout);
13675 GotoIfNot(UintPtrLessThan(Unsigned(intptr_key), length), bailout);
13682 LoadFixedArrayElement(
CAST(elements), intptr_key);
13683 GotoIf(IsTheHole(target_value), bailout);
13691 CSA_DCHECK(
this, Word32BinaryNot(IsFixedCOWArrayMap(LoadMap(elements))));
13693 elements = CopyElementsOnWrite(
object, elements, elements_kind,
13694 Signed(length), bailout);
13697 CSA_DCHECK(
this, Word32BinaryNot(IsFixedCOWArrayMap(LoadMap(elements))));
13699 StoreElement(elements, elements_kind, intptr_key, float_value.value());
13703 SharedValueBarrier(context, &shared_value);
13704 StoreElement(elements, elements_kind, intptr_key, shared_value.value());
13706 StoreElement(elements, elements_kind, intptr_key, value);
13716 Label grow_case(
this), no_grow_case(
this), done(
this),
13717 grow_bailout(
this, Label::kDeferred);
13726 Branch(
condition, &grow_case, &no_grow_case);
13731 LoadAndUntagFixedArrayBaseLength(elements);
13732 checked_elements = elements;
13733 Label fits_capacity(
this);
13735 GotoIf(UintPtrLessThan(
key, current_capacity), &fits_capacity);
13739 object, elements,
kind,
key, current_capacity, &grow_bailout);
13740 checked_elements = new_elements;
13741 Goto(&fits_capacity);
13744 BIND(&grow_bailout);
13746 GotoIf(IntPtrLessThan(
key, IntPtrConstant(0)), bailout);
13749 Runtime::kGrowArrayElements, NoContextConstant(),
object, tagged_key);
13750 GotoIf(TaggedIsSmi(maybe_elements), bailout);
13753 checked_elements = new_elements;
13754 Goto(&fits_capacity);
13757 BIND(&fits_capacity);
13758 GotoIfNot(IsJSArray(
object), &done);
13761 StoreObjectFieldNoWriteBarrier(
object, JSArray::kLengthOffset,
13766 BIND(&no_grow_case);
13768 GotoIfNot(UintPtrLessThan(
key, length), bailout);
13769 checked_elements = elements;
13774 return checked_elements.value();
13783 GotoIfNot(IsFixedCOWArrayMap(LoadMap(elements)), &done);
13785 TNode<IntPtrT> capacity = LoadAndUntagFixedArrayBaseLength(elements);
13787 object, elements,
kind,
kind, length, capacity, bailout);
13788 new_elements_var = new_elements;
13793 return new_elements_var.value();
13802 if (AllocationSite::ShouldTrack(from_kind, to_kind)) {
13803 TrapAllocationMemento(
object, bailout);
13807 Comment(
"Non-simple map transition");
13811 GotoIf(TaggedEqual(elements, EmptyFixedArrayConstant()), &done);
13814 TNode<IntPtrT> elements_length = LoadAndUntagFixedArrayBaseLength(elements);
13819 return PositiveSmiUntag(LoadFastJSArrayLength(
CAST(
object)));
13821 [=]() {
return elements_length; });
13823 CSA_DCHECK(
this, WordNotEqual(elements_length, IntPtrConstant(0)));
13825 GrowElementsCapacity(
object, elements, from_kind, to_kind, array_length,
13826 elements_length, bailout);
13831 StoreMap(
object, map);
13835 Label* memento_found) {
13837 Comment(
"[ TrapAllocationMemento");
13838 Label no_memento_found(
this);
13839 Label top_check(
this), map_check(
this);
13842 ExternalReference::new_space_allocation_top_address(
isolate()));
13843 const int kMementoMapOffset =
13845 const int kMementoLastWordOffset =
13852 TNode<IntPtrT> object_page_header = MemoryChunkFromAddress(object_word);
13855 object_page_header, IntPtrConstant(MemoryChunk::FlagsOffset()));
13859 WordEqual(WordAnd(page_flags,
13860 IntPtrConstant(MemoryChunk::CONTAINS_ONLY_OLD)),
13861 IntPtrConstant(0)),
13862 &no_memento_found);
13865 WordAnd(page_flags,
13866 IntPtrConstant(MemoryChunk::kIsInYoungGenerationMask)),
13867 IntPtrConstant(0)),
13868 &no_memento_found);
13872 GotoIf(WordNotEqual(WordAnd(page_flags,
13873 IntPtrConstant(MemoryChunk::kIsLargePageMask)),
13874 IntPtrConstant(0)),
13875 &no_memento_found);
13879 object_word, IntPtrConstant(kMementoLastWordOffset -
kHeapObjectTag));
13881 MemoryChunkFromAddress(memento_last_word);
13883 TNode<IntPtrT> new_space_top = Load<IntPtrT>(new_space_top_address);
13885 MemoryChunkFromAddress(new_space_top);
13889 GotoIf(WordEqual(memento_last_word_page_header, new_space_top_page_header),
13895 Branch(WordEqual(object_page_header, memento_last_word_page_header),
13896 &map_check, &no_memento_found);
13902 Branch(UintPtrGreaterThanOrEqual(memento_last_word, new_space_top),
13903 &no_memento_found, &map_check);
13910 LoadObjectField(
object, kMementoMapOffset);
13912 LoadRootMapWord(RootIndex::kAllocationMementoMap);
13913 Branch(TaggedEqual(maybe_mapword, memento_mapword), memento_found,
13914 &no_memento_found);
13916 BIND(&no_memento_found);
13917 Comment(
"] TrapAllocationMemento");
13922 return WordAnd(address,
13923 IntPtrConstant(~MemoryChunk::GetAlignmentMaskForAssembler()));
13928#ifdef V8_ENABLE_SANDBOX
13930 ExternalReference::memory_chunk_metadata_table_address());
13932 address, IntPtrConstant(MemoryChunk::MetadataIndexOffset()));
13933 index = Word32And(index,
13934 UniqueUint32Constant(
13935 MemoryChunkConstants::kMetadataPointerTableSizeMask));
13941 TNode<IntPtrT> metadata_chunk = MemoryChunkFromAddress(Load<IntPtrT>(
13942 metadata, IntPtrConstant(MemoryChunkMetadata::AreaStartOffset())));
13943 CSA_CHECK(
this, WordEqual(metadata_chunk, address));
13946 return Load<IntPtrT>(address, IntPtrConstant(MemoryChunk::MetadataOffset()));
13952 return PageMetadataFromMemoryChunk(MemoryChunkFromAddress(address));
13959 StoreMapNoWriteBarrier(site, RootIndex::kAllocationSiteWithWeakNextMap);
13961 TNode<WordT> field = UpdateWord<AllocationSite::ElementsKindBits>(
13963 StoreObjectFieldNoWriteBarrier(
13964 site, offsetof(
AllocationSite, transition_info_or_boilerplate_),
13965 SmiTag(Signed(field)));
13969 StoreObjectFieldNoWriteBarrier(site, offsetof(
AllocationSite, nested_site_),
13973 StoreObjectFieldNoWriteBarrier(
13974 site, offsetof(
AllocationSite, pretenure_data_), Int32Constant(0));
13977 StoreObjectFieldNoWriteBarrier(
13982 StoreObjectFieldRoot(site, offsetof(
AllocationSite, dependent_code_),
13983 DependentCode::kEmptyDependentCode);
13987 ExternalReference::allocation_sites_list_address(
isolate()));
13989 LoadBufferObject(ReinterpretCast<RawPtrT>(site_list), 0);
13998 StoreFullTaggedNoWriteBarrier(site_list, site);
14000 StoreFeedbackVectorSlot(feedback_vector, slot, site);
14008 StoreFeedbackVectorSlot(feedback_vector, slot, weak_value,
14015 return TaggedIsNotSmi(maybe_literal_site);
14023 return transition_info;
14031 return boilerplate;
14036 TNode<Smi> transition_info = LoadTransitionInfo(allocation_site);
14038 Signed(DecodeWord32<AllocationSite::ElementsKindBits>(
14039 SmiToInt32(transition_info)));
14041 return elements_kind;
14046 return LoadObjectField(allocation_site,
14050template <
typename TIndex>
14051void CodeStubAssembler::BuildFastLoop(
14060 !std::is_same_v<TIndex, Smi>,
14061 "Smi indices are currently not supported because it's not clear whether "
14062 "the use case allows unsigned comparisons or not");
14063 var_index = start_index;
14066 Label loop(
this, vars_copy);
14067 Label after_loop(
this), done(
this);
14069 auto loop_body = [&]() {
14070 if (advance_mode == IndexAdvanceMode::kPre) {
14073 body(var_index.
value());
14074 if (advance_mode == IndexAdvanceMode::kPost) {
14086 if (unrolling_mode == LoopUnrollingMode::kNo) {
14088 int32_t first_check_val;
14089 if (TryToInt32Constant(first_check, &first_check_val)) {
14090 if (first_check_val)
return;
14093 Branch(first_check, &done, &loop);
14101 advance_direction == IndexAdvanceDirection::kUp
14102 ? UintPtrOrSmiLessThanOrEqual(var_index.
value(), end_index)
14103 : UintPtrOrSmiLessThanOrEqual(end_index, var_index.
value()));
14104 Branch(UintPtrOrSmiNotEqual(var_index.
value(), end_index), &loop, &done);
14110 DCHECK_EQ(unrolling_mode, LoopUnrollingMode::kYes);
14111 switch (advance_direction) {
14112 case IndexAdvanceDirection::kUp:
14113 CSA_DCHECK(
this, UintPtrOrSmiLessThanOrEqual(start_index, end_index));
14114 GotoIfNot(UintPtrOrSmiLessThanOrEqual(
14115 IntPtrOrSmiAdd(start_index,
increment), end_index),
14118 case IndexAdvanceDirection::kDown:
14120 CSA_DCHECK(
this, UintPtrOrSmiLessThanOrEqual(end_index, start_index));
14121 GotoIfNot(UintPtrOrSmiLessThanOrEqual(
14122 IntPtrOrSmiSub(end_index,
increment), start_index),
14129 advance_direction == IndexAdvanceDirection::kUp
14130 ? UintPtrOrSmiLessThan(start_index, last_index)
14131 : UintPtrOrSmiGreaterThan(start_index, last_index);
14132 int32_t first_check_val;
14133 if (TryToInt32Constant(first_check, &first_check_val)) {
14134 if (first_check_val) {
14140 Branch(first_check, &loop, &after_loop);
14145 Comment(
"Unrolled Loop");
14149 advance_direction == IndexAdvanceDirection::kUp
14150 ? UintPtrOrSmiLessThan(var_index.
value(), last_index)
14151 : UintPtrOrSmiGreaterThan(var_index.
value(), last_index);
14152 Branch(loop_check, &loop, &after_loop);
14156 GotoIfNot(UintPtrOrSmiEqual(var_index.
value(), last_index), &done);
14165template <
typename TIndex>
14166void CodeStubAssembler::BuildFastLoop(
14172 BuildFastLoop(vars, var_index, start_index, end_index, body,
14173 IntPtrOrSmiConstant<TIndex>(
increment), unrolling_mode,
14175 increment > 0 ? IndexAdvanceDirection::kUp
14176 : IndexAdvanceDirection::kDown);
14183 const FastLoopBody<IntPtrT>& body,
int increment,
14184 LoopUnrollingMode unrolling_mode, IndexAdvanceMode advance_mode);
14188 const FastLoopBody<UintPtrT>& body,
int increment,
14189 LoopUnrollingMode unrolling_mode, IndexAdvanceMode advance_mode);
14193 const FastLoopBody<RawPtrT>& body,
int increment,
14194 LoopUnrollingMode unrolling_mode, IndexAdvanceMode advance_mode);
14196template <
typename TIndex>
14197void CodeStubAssembler::BuildFastArrayForEach(
14205 IsPropertyArray(array)));
14207 intptr_t first_val;
14208 bool constant_first =
14209 TryToIntPtrConstant(first_element_inclusive, &first_val);
14211 bool constent_last = TryToIntPtrConstant(last_element_exclusive, &last_val);
14212 if (constant_first && constent_last) {
14213 intptr_t delta = last_val - first_val;
14215 if (delta <= kElementLoopUnrollThreshold) {
14216 if (
direction == ForEachDirection::kForward) {
14217 for (intptr_t
i = first_val;
i < last_val; ++
i) {
14224 for (intptr_t
i = last_val - 1;
i >= first_val; --
i) {
14236 ElementOffsetFromIndex(first_element_inclusive,
kind,
14239 ElementOffsetFromIndex(last_element_exclusive,
kind,
14241 if (
direction == ForEachDirection::kReverse) std::swap(
start, limit);
14244 BuildFastLoop<IntPtrT>(
14247 loop_unrolling_mode,
14248 direction == ForEachDirection::kReverse ? IndexAdvanceMode::kPre
14249 : IndexAdvanceMode::kPost);
14252template <
typename TIndex>
14253void CodeStubAssembler::GotoIfFixedArraySizeDoesntFitInNewSpace(
14255 GotoIf(FixedArraySizeDoesntFitInNewSpace(element_count, base_size),
14264 start_offset = IntPtrAdd(start_offset, IntPtrConstant(-
kHeapObjectTag));
14265 end_offset = IntPtrAdd(end_offset, IntPtrConstant(-
kHeapObjectTag));
14267 if (root_index == RootIndex::kOnePointerFillerMap) {
14268 root_value = LoadRootMapWord(root_index);
14270 root_value = LoadRoot(root_index);
14272 BuildFastLoop<IntPtrT>(
14273 end_offset, start_offset,
14275 StoreNoWriteBarrier(MachineRepresentation::kTagged,
object, current,
14278 -
kTaggedSize, LoopUnrollingMode::kYes, IndexAdvanceMode::kPre);
14281void CodeStubAssembler::BranchIfNumberRelationalComparison(
Operation op,
14286 Label do_float_comparison(
this);
14296 TaggedIsSmi(right),
14303 case Operation::kEqual:
14304 BranchIfSmiEqual(smi_left, smi_right, if_true, if_false);
14306 case Operation::kLessThan:
14307 BranchIfSmiLessThan(smi_left, smi_right, if_true, if_false);
14309 case Operation::kLessThanOrEqual:
14310 BranchIfSmiLessThanOrEqual(smi_left, smi_right, if_true,
14313 case Operation::kGreaterThan:
14314 BranchIfSmiLessThan(smi_right, smi_left, if_true, if_false);
14316 case Operation::kGreaterThanOrEqual:
14317 BranchIfSmiLessThanOrEqual(smi_right, smi_left, if_true,
14325 var_left_float = SmiToFloat64(smi_left);
14326 var_right_float = LoadHeapNumberValue(
CAST(right));
14327 Goto(&do_float_comparison);
14331 var_left_float = LoadHeapNumberValue(
CAST(left));
14334 TaggedIsSmi(right),
14336 var_right_float = SmiToFloat64(
CAST(right));
14337 Goto(&do_float_comparison);
14340 var_right_float = LoadHeapNumberValue(
CAST(right));
14341 Goto(&do_float_comparison);
14345 BIND(&do_float_comparison);
14348 case Operation::kEqual:
14349 Branch(Float64Equal(var_left_float.value(), var_right_float.value()),
14350 if_true, if_false);
14352 case Operation::kLessThan:
14353 Branch(Float64LessThan(var_left_float.value(), var_right_float.value()),
14354 if_true, if_false);
14356 case Operation::kLessThanOrEqual:
14357 Branch(Float64LessThanOrEqual(var_left_float.value(),
14358 var_right_float.value()),
14359 if_true, if_false);
14361 case Operation::kGreaterThan:
14363 Float64GreaterThan(var_left_float.value(), var_right_float.value()),
14364 if_true, if_false);
14366 case Operation::kGreaterThanOrEqual:
14367 Branch(Float64GreaterThanOrEqual(var_left_float.value(),
14368 var_right_float.value()),
14369 if_true, if_false);
14380 Label if_false(
this);
14381 BranchIfNumberRelationalComparison(Operation::kGreaterThanOrEqual, left,
14382 right, if_true, &if_false);
14389 case Operation::kLessThan:
14390 return Operation::kGreaterThan;
14391 case Operation::kLessThanOrEqual:
14392 return Operation::kGreaterThanOrEqual;
14393 case Operation::kGreaterThan:
14394 return Operation::kLessThan;
14395 case Operation::kGreaterThanOrEqual:
14396 return Operation::kLessThanOrEqual;
14409 Label context_search(
this, {&cur_depth, &cur_context});
14410 Label exit_loop(
this);
14411 Label no_extension(
this);
14414 CSA_DCHECK(
this, Word32NotEqual(cur_depth.value(), Int32Constant(0)));
14415 Goto(&context_search);
14416 BIND(&context_search);
14422 auto scope_info = LoadScopeInfo(cur_context.value());
14424 LoadObjectField<Uint32T>(scope_info, ScopeInfo::kFlagsOffset);
14425 auto scope_type = DecodeWord32<ScopeInfo::ScopeTypeBits>(flags);
14427 Int32Constant(ScopeType::SCRIPT_SCOPE)));
14429 Int32Constant(ScopeType::REPL_MODE_SCOPE)));
14434 LoadScopeInfoHasExtensionField(LoadScopeInfo(cur_context.value()));
14435 GotoIfNot(has_extension, &no_extension);
14439 LoadContextElement(cur_context.value(), Context::EXTENSION_INDEX);
14440 Branch(TaggedNotEqual(extension_slot, UndefinedConstant()), target,
14443 BIND(&no_extension);
14445 cur_depth = Unsigned(Int32Sub(cur_depth.value(), Int32Constant(1)));
14446 cur_context =
CAST(
14447 LoadContextElement(cur_context.value(), Context::PREVIOUS_INDEX));
14449 Branch(Word32NotEqual(cur_depth.value(), Int32Constant(0)),
14450 &context_search, &exit_loop);
14454 return cur_context.value();
14459 Label* return_true,
14460 Label* return_false) {
14463 BigIntToRawBytes(
CAST(left), &left_raw, &left_raw);
14464 BigIntToRawBytes(
CAST(right), &right_raw, &right_raw);
14470 case Operation::kEqual:
14471 case Operation::kStrictEqual:
14472 condition = WordEqual(left_raw_value, right_raw_value);
14474 case Operation::kLessThan:
14475 condition = IntPtrLessThan(left_raw_value, right_raw_value);
14477 case Operation::kLessThanOrEqual:
14478 condition = IntPtrLessThanOrEqual(left_raw_value, right_raw_value);
14480 case Operation::kGreaterThan:
14481 condition = IntPtrGreaterThan(left_raw_value, right_raw_value);
14483 case Operation::kGreaterThanOrEqual:
14484 condition = IntPtrGreaterThanOrEqual(left_raw_value, right_raw_value);
14489 Branch(
condition, return_true, return_false);
14495 Label return_true(
this), return_false(
this), do_float_comparison(
this),
14505 VariableList loop_variable_list({&var_left, &var_right}, zone());
14506 if (var_type_feedback !=
nullptr) {
14509 *var_type_feedback = SmiConstant(CompareOperationFeedback::kNone);
14510 loop_variable_list.push_back(var_type_feedback);
14512 Label loop(
this, loop_variable_list);
14516 left = var_left.value();
14517 right = var_right.value();
14519 Label if_left_smi(
this), if_left_not_smi(
this);
14520 Branch(TaggedIsSmi(left), &if_left_smi, &if_left_not_smi);
14522 BIND(&if_left_smi);
14525 Label if_right_smi(
this), if_right_heapnumber(
this),
14526 if_right_bigint(
this, Label::kDeferred),
14527 if_right_not_numeric(
this, Label::kDeferred);
14528 GotoIf(TaggedIsSmi(right), &if_right_smi);
14530 GotoIf(IsHeapNumberMap(right_map), &if_right_heapnumber);
14531 TNode<Uint16T> right_instance_type = LoadMapInstanceType(right_map);
14532 Branch(IsBigIntInstanceType(right_instance_type), &if_right_bigint,
14533 &if_right_not_numeric);
14535 BIND(&if_right_smi);
14538 CombineFeedback(var_type_feedback,
14539 CompareOperationFeedback::kSignedSmall);
14541 case Operation::kLessThan:
14542 BranchIfSmiLessThan(smi_left, smi_right, &return_true,
14545 case Operation::kLessThanOrEqual:
14546 BranchIfSmiLessThanOrEqual(smi_left, smi_right, &return_true,
14549 case Operation::kGreaterThan:
14550 BranchIfSmiLessThan(smi_right, smi_left, &return_true,
14553 case Operation::kGreaterThanOrEqual:
14554 BranchIfSmiLessThanOrEqual(smi_right, smi_left, &return_true,
14562 BIND(&if_right_heapnumber);
14564 CombineFeedback(var_type_feedback, CompareOperationFeedback::kNumber);
14565 var_left_float = SmiToFloat64(smi_left);
14566 var_right_float = LoadHeapNumberValue(
CAST(right));
14567 Goto(&do_float_comparison);
14570 BIND(&if_right_bigint);
14572 OverwriteFeedback(var_type_feedback, CompareOperationFeedback::kAny);
14574 NoContextConstant(),
14575 SmiConstant(Reverse(op)), right, left));
14579 BIND(&if_right_not_numeric);
14581 OverwriteFeedback(var_type_feedback, CompareOperationFeedback::kAny);
14586 var_right = CallBuiltin(Builtin::kNonNumberToNumeric,
context(), right);
14591 BIND(&if_left_not_smi);
14595 Label if_right_smi(
this), if_right_not_smi(
this);
14596 Branch(TaggedIsSmi(right), &if_right_smi, &if_right_not_smi);
14598 BIND(&if_right_smi);
14600 Label if_left_heapnumber(
this), if_left_bigint(
this, Label::kDeferred),
14601 if_left_not_numeric(
this, Label::kDeferred);
14602 GotoIf(IsHeapNumberMap(left_map), &if_left_heapnumber);
14603 TNode<Uint16T> left_instance_type = LoadMapInstanceType(left_map);
14604 Branch(IsBigIntInstanceType(left_instance_type), &if_left_bigint,
14605 &if_left_not_numeric);
14607 BIND(&if_left_heapnumber);
14609 CombineFeedback(var_type_feedback, CompareOperationFeedback::kNumber);
14610 var_left_float = LoadHeapNumberValue(
CAST(left));
14611 var_right_float = SmiToFloat64(
CAST(right));
14612 Goto(&do_float_comparison);
14615 BIND(&if_left_bigint);
14617 OverwriteFeedback(var_type_feedback, CompareOperationFeedback::kAny);
14619 NoContextConstant(), SmiConstant(op),
14624 BIND(&if_left_not_numeric);
14626 OverwriteFeedback(var_type_feedback, CompareOperationFeedback::kAny);
14631 var_left = CallBuiltin(Builtin::kNonNumberToNumeric,
context(), left);
14636 BIND(&if_right_not_smi);
14640 Label if_left_heapnumber(
this), if_left_bigint(
this, Label::kDeferred),
14641 if_left_string(
this, Label::kDeferred),
14642 if_left_other(
this, Label::kDeferred);
14643 GotoIf(IsHeapNumberMap(left_map), &if_left_heapnumber);
14644 TNode<Uint16T> left_instance_type = LoadMapInstanceType(left_map);
14645 GotoIf(IsBigIntInstanceType(left_instance_type), &if_left_bigint);
14646 Branch(IsStringInstanceType(left_instance_type), &if_left_string,
14649 BIND(&if_left_heapnumber);
14651 Label if_right_heapnumber(
this),
14652 if_right_bigint(
this, Label::kDeferred),
14653 if_right_not_numeric(
this, Label::kDeferred);
14654 GotoIf(TaggedEqual(right_map, left_map), &if_right_heapnumber);
14655 TNode<Uint16T> right_instance_type = LoadMapInstanceType(right_map);
14656 Branch(IsBigIntInstanceType(right_instance_type), &if_right_bigint,
14657 &if_right_not_numeric);
14659 BIND(&if_right_heapnumber);
14661 CombineFeedback(var_type_feedback,
14662 CompareOperationFeedback::kNumber);
14663 var_left_float = LoadHeapNumberValue(
CAST(left));
14664 var_right_float = LoadHeapNumberValue(
CAST(right));
14665 Goto(&do_float_comparison);
14668 BIND(&if_right_bigint);
14670 OverwriteFeedback(var_type_feedback,
14671 CompareOperationFeedback::kAny);
14673 Runtime::kBigIntCompareToNumber, NoContextConstant(),
14674 SmiConstant(Reverse(op)), right, left));
14678 BIND(&if_right_not_numeric);
14680 OverwriteFeedback(var_type_feedback,
14681 CompareOperationFeedback::kAny);
14687 CallBuiltin(Builtin::kNonNumberToNumeric,
context(), right);
14692 BIND(&if_left_bigint);
14694 Label if_right_heapnumber(
this), if_right_bigint(
this),
14695 if_right_string(
this), if_right_other(
this);
14696 GotoIf(IsHeapNumberMap(right_map), &if_right_heapnumber);
14697 TNode<Uint16T> right_instance_type = LoadMapInstanceType(right_map);
14698 GotoIf(IsBigIntInstanceType(right_instance_type), &if_right_bigint);
14699 Branch(IsStringInstanceType(right_instance_type), &if_right_string,
14702 BIND(&if_right_heapnumber);
14704 OverwriteFeedback(var_type_feedback,
14705 CompareOperationFeedback::kAny);
14707 NoContextConstant(), SmiConstant(op),
14712 BIND(&if_right_bigint);
14715 Label if_both_bigint(
this);
14716 GotoIfLargeBigInt(
CAST(left), &if_both_bigint);
14717 GotoIfLargeBigInt(
CAST(right), &if_both_bigint);
14719 CombineFeedback(var_type_feedback,
14720 CompareOperationFeedback::kBigInt64);
14721 BigInt64Comparison(op, left, right, &return_true, &return_false);
14722 BIND(&if_both_bigint);
14725 CombineFeedback(var_type_feedback,
14726 CompareOperationFeedback::kBigInt);
14727 var_result =
CAST(CallBuiltin(BigIntComparisonBuiltinOf(op),
14728 NoContextConstant(), left, right));
14732 BIND(&if_right_string);
14734 OverwriteFeedback(var_type_feedback,
14735 CompareOperationFeedback::kAny);
14737 NoContextConstant(), SmiConstant(op),
14743 BIND(&if_right_other);
14745 OverwriteFeedback(var_type_feedback,
14746 CompareOperationFeedback::kAny);
14752 CallBuiltin(Builtin::kNonNumberToNumeric,
context(), right);
14757 BIND(&if_left_string);
14759 TNode<Uint16T> right_instance_type = LoadMapInstanceType(right_map);
14761 Label if_right_not_string(
this, Label::kDeferred);
14762 GotoIfNot(IsStringInstanceType(right_instance_type),
14763 &if_right_not_string);
14766 CombineFeedback(var_type_feedback, CompareOperationFeedback::kString);
14769 case Operation::kLessThan:
14770 builtin = Builtin::kStringLessThan;
14772 case Operation::kLessThanOrEqual:
14773 builtin = Builtin::kStringLessThanOrEqual;
14775 case Operation::kGreaterThan:
14776 builtin = Builtin::kStringGreaterThan;
14778 case Operation::kGreaterThanOrEqual:
14779 builtin = Builtin::kStringGreaterThanOrEqual;
14787 BIND(&if_right_not_string);
14789 OverwriteFeedback(var_type_feedback,
14790 CompareOperationFeedback::kAny);
14795 static_assert(LAST_JS_RECEIVER_TYPE ==
LAST_TYPE);
14796 Label if_right_bigint(
this),
14797 if_right_receiver(
this, Label::kDeferred);
14798 GotoIf(IsBigIntInstanceType(right_instance_type), &if_right_bigint);
14799 GotoIf(IsJSReceiverInstanceType(right_instance_type),
14800 &if_right_receiver);
14803 CallBuiltin(Builtin::kNonNumberToNumeric,
context(), left);
14804 var_right = CallBuiltin(Builtin::kToNumeric,
context(), right);
14807 BIND(&if_right_bigint);
14810 Runtime::kBigIntCompareToString, NoContextConstant(),
14811 SmiConstant(Reverse(op)), right, left));
14815 BIND(&if_right_receiver);
14817 var_right = CallBuiltin(
14818 Builtins::NonPrimitiveToPrimitive(ToPrimitiveHint::kNumber),
14825 BIND(&if_left_other);
14828 if (var_type_feedback !=
nullptr) {
14832 Label collect_any_feedback(
this), collect_oddball_feedback(
this),
14833 collect_feedback_done(
this);
14834 GotoIfNot(InstanceTypeEqual(left_instance_type, ODDBALL_TYPE),
14835 &collect_any_feedback);
14837 GotoIf(IsHeapNumberMap(right_map), &collect_oddball_feedback);
14838 TNode<Uint16T> right_instance_type = LoadMapInstanceType(right_map);
14839 Branch(InstanceTypeEqual(right_instance_type, ODDBALL_TYPE),
14840 &collect_oddball_feedback, &collect_any_feedback);
14842 BIND(&collect_oddball_feedback);
14844 CombineFeedback(var_type_feedback,
14845 CompareOperationFeedback::kNumberOrOddball);
14846 Goto(&collect_feedback_done);
14849 BIND(&collect_any_feedback);
14851 OverwriteFeedback(var_type_feedback,
14852 CompareOperationFeedback::kAny);
14853 Goto(&collect_feedback_done);
14856 BIND(&collect_feedback_done);
14862 static_assert(LAST_JS_RECEIVER_TYPE ==
LAST_TYPE);
14863 Label if_left_receiver(
this, Label::kDeferred);
14864 GotoIf(IsJSReceiverInstanceType(left_instance_type),
14865 &if_left_receiver);
14867 var_right = CallBuiltin(Builtin::kToNumeric,
context(), right);
14868 var_left = CallBuiltin(Builtin::kNonNumberToNumeric,
context(), left);
14871 BIND(&if_left_receiver);
14874 Builtins::NonPrimitiveToPrimitive(ToPrimitiveHint::kNumber);
14875 var_left = CallBuiltin(builtin,
context(), left);
14883 BIND(&do_float_comparison);
14886 case Operation::kLessThan:
14887 Branch(Float64LessThan(var_left_float.value(), var_right_float.value()),
14888 &return_true, &return_false);
14890 case Operation::kLessThanOrEqual:
14891 Branch(Float64LessThanOrEqual(var_left_float.value(),
14892 var_right_float.value()),
14893 &return_true, &return_false);
14895 case Operation::kGreaterThan:
14897 Float64GreaterThan(var_left_float.value(), var_right_float.value()),
14898 &return_true, &return_false);
14900 case Operation::kGreaterThanOrEqual:
14901 Branch(Float64GreaterThanOrEqual(var_left_float.value(),
14902 var_right_float.value()),
14903 &return_true, &return_false);
14910 BIND(&return_true);
14912 var_result = TrueConstant();
14916 BIND(&return_false);
14918 var_result = FalseConstant();
14923 return var_result.value();
14932 CompareOperationFeedback::kInternalizedString,
14933 CompareOperationFeedback::kString);
14938 Label* if_notequal,
14944 Label if_smi(
this), if_heapnumber(
this);
14945 GotoIf(TaggedIsSmi(value), &if_smi);
14948 TNode<Map> value_map = LoadMap(value_heapobject);
14949 GotoIf(IsHeapNumberMap(value_map), &if_heapnumber);
14952 if (var_type_feedback !=
nullptr) {
14955 Label if_string(
this), if_receiver(
this), if_oddball(
this), if_symbol(
this),
14957 GotoIf(IsStringInstanceType(instance_type), &if_string);
14958 GotoIf(IsJSReceiverInstanceType(instance_type), &if_receiver);
14959 GotoIf(IsOddballInstanceType(instance_type), &if_oddball);
14960 Branch(IsBigIntInstanceType(instance_type), &if_bigint, &if_symbol);
14964 CSA_DCHECK(
this, IsString(value_heapobject));
14965 CombineFeedback(var_type_feedback,
14966 CollectFeedbackForString(instance_type));
14972 CSA_DCHECK(
this, IsSymbol(value_heapobject));
14973 CombineFeedback(var_type_feedback, CompareOperationFeedback::kSymbol);
14977 BIND(&if_receiver);
14979 CSA_DCHECK(
this, IsJSReceiver(value_heapobject));
14980 CombineFeedback(var_type_feedback, CompareOperationFeedback::kReceiver);
14986 CSA_DCHECK(
this, IsBigInt(value_heapobject));
14989 Label if_large_bigint(
this);
14990 GotoIfLargeBigInt(
CAST(value_heapobject), &if_large_bigint);
14991 CombineFeedback(var_type_feedback, CompareOperationFeedback::kBigInt64);
14993 BIND(&if_large_bigint);
14995 CombineFeedback(var_type_feedback, CompareOperationFeedback::kBigInt);
15001 CSA_DCHECK(
this, IsOddball(value_heapobject));
15002 Label if_boolean(
this), if_not_boolean(
this);
15003 Branch(
IsBooleanMap(value_map), &if_boolean, &if_not_boolean);
15007 CombineFeedback(var_type_feedback, CompareOperationFeedback::kBoolean);
15011 BIND(&if_not_boolean);
15014 CombineFeedback(var_type_feedback,
15015 CompareOperationFeedback::kReceiverOrNullOrUndefined);
15023 BIND(&if_heapnumber);
15025 CombineFeedback(var_type_feedback, CompareOperationFeedback::kNumber);
15026 TNode<Float64T> number_value = LoadHeapNumberValue(value_heapobject);
15027 BranchIfFloat64IsNaN(number_value, if_notequal, if_equal);
15032 CombineFeedback(var_type_feedback, CompareOperationFeedback::kSignedSmall);
15045 Label if_equal(
this), if_notequal(
this), do_float_comparison(
this),
15046 do_right_stringtonumber(
this, Label::kDeferred),
end(
this);
15053 Label use_symmetry(
this);
15059 VariableList loop_variable_list({&var_left, &var_right}, zone());
15060 if (var_type_feedback !=
nullptr) {
15063 OverwriteFeedback(var_type_feedback, CompareOperationFeedback::kNone);
15064 loop_variable_list.push_back(var_type_feedback);
15066 Label loop(
this, loop_variable_list);
15070 left = var_left.value();
15071 right = var_right.value();
15073 Label if_notsame(
this);
15074 GotoIf(TaggedNotEqual(left, right), &if_notsame);
15078 GenerateEqual_Same(left, &if_equal, &if_notequal, var_type_feedback);
15082 Label if_left_smi(
this), if_left_not_smi(
this);
15083 Branch(TaggedIsSmi(left), &if_left_smi, &if_left_not_smi);
15085 BIND(&if_left_smi);
15087 Label if_right_smi(
this), if_right_not_smi(
this);
15088 CombineFeedback(var_type_feedback,
15089 CompareOperationFeedback::kSignedSmall);
15090 Branch(TaggedIsSmi(right), &if_right_smi, &if_right_not_smi);
15092 BIND(&if_right_smi);
15096 Goto(&if_notequal);
15099 BIND(&if_right_not_smi);
15102 Label if_right_heapnumber(
this), if_right_oddball(
this),
15103 if_right_bigint(
this, Label::kDeferred),
15104 if_right_receiver(
this, Label::kDeferred);
15105 GotoIf(IsHeapNumberMap(right_map), &if_right_heapnumber);
15109 GotoIf(IsStringInstanceType(right_type), &do_right_stringtonumber);
15110 GotoIf(IsOddballInstanceType(right_type), &if_right_oddball);
15111 GotoIf(IsBigIntInstanceType(right_type), &if_right_bigint);
15112 GotoIf(IsJSReceiverInstanceType(right_type), &if_right_receiver);
15113 CombineFeedback(var_type_feedback, CompareOperationFeedback::kAny);
15114 Goto(&if_notequal);
15116 BIND(&if_right_heapnumber);
15118 CombineFeedback(var_type_feedback, CompareOperationFeedback::kNumber);
15119 var_left_float = SmiToFloat64(
CAST(left));
15120 var_right_float = LoadHeapNumberValue(
CAST(right));
15121 Goto(&do_float_comparison);
15124 BIND(&if_right_oddball);
15126 Label if_right_boolean(
this);
15128 CombineFeedback(var_type_feedback,
15129 CompareOperationFeedback::kOddball);
15130 Goto(&if_notequal);
15132 BIND(&if_right_boolean);
15134 CombineFeedback(var_type_feedback,
15135 CompareOperationFeedback::kBoolean);
15137 LoadObjectField(
CAST(right), offsetof(
Oddball, to_number_));
15142 BIND(&if_right_bigint);
15144 CombineFeedback(var_type_feedback, CompareOperationFeedback::kBigInt);
15146 NoContextConstant(), right, left));
15150 BIND(&if_right_receiver);
15152 CombineFeedback(var_type_feedback,
15153 CompareOperationFeedback::kReceiver);
15154 var_right = CallBuiltin(Builtins::NonPrimitiveToPrimitive(),
15161 BIND(&if_left_not_smi);
15163 GotoIf(TaggedIsSmi(right), &use_symmetry);
15165 Label if_left_symbol(
this), if_left_number(
this),
15166 if_left_string(
this, Label::kDeferred),
15167 if_left_bigint(
this, Label::kDeferred), if_left_oddball(
this),
15168 if_left_receiver(
this);
15175 GotoIf(IsStringInstanceType(left_type), &if_left_string);
15176 GotoIf(IsSymbolInstanceType(left_type), &if_left_symbol);
15177 GotoIf(IsHeapNumberInstanceType(left_type), &if_left_number);
15178 GotoIf(IsOddballInstanceType(left_type), &if_left_oddball);
15179 Branch(IsBigIntInstanceType(left_type), &if_left_bigint,
15180 &if_left_receiver);
15182 BIND(&if_left_string);
15184 GotoIfNot(IsStringInstanceType(right_type), &use_symmetry);
15185 Label combine_feedback(
this);
15186 BranchIfStringEqual(
CAST(left),
CAST(right), &combine_feedback,
15187 &combine_feedback, &
result);
15188 BIND(&combine_feedback);
15190 CombineFeedback(var_type_feedback,
15191 SmiOr(CollectFeedbackForString(left_type),
15192 CollectFeedbackForString(right_type)));
15197 BIND(&if_left_number);
15199 Label if_right_not_number(
this);
15201 CombineFeedback(var_type_feedback, CompareOperationFeedback::kNumber);
15202 GotoIf(Word32NotEqual(left_type, right_type), &if_right_not_number);
15204 var_left_float = LoadHeapNumberValue(
CAST(left));
15205 var_right_float = LoadHeapNumberValue(
CAST(right));
15206 Goto(&do_float_comparison);
15208 BIND(&if_right_not_number);
15210 Label if_right_oddball(
this);
15212 GotoIf(IsStringInstanceType(right_type), &do_right_stringtonumber);
15213 GotoIf(IsOddballInstanceType(right_type), &if_right_oddball);
15214 GotoIf(IsBigIntInstanceType(right_type), &use_symmetry);
15215 GotoIf(IsJSReceiverInstanceType(right_type), &use_symmetry);
15216 CombineFeedback(var_type_feedback, CompareOperationFeedback::kAny);
15217 Goto(&if_notequal);
15219 BIND(&if_right_oddball);
15221 Label if_right_boolean(
this);
15223 CombineFeedback(var_type_feedback,
15224 CompareOperationFeedback::kOddball);
15225 Goto(&if_notequal);
15227 BIND(&if_right_boolean);
15229 CombineFeedback(var_type_feedback,
15230 CompareOperationFeedback::kBoolean);
15232 LoadObjectField(
CAST(right), offsetof(
Oddball, to_number_));
15239 BIND(&if_left_bigint);
15241 Label if_right_heapnumber(
this), if_right_bigint(
this),
15242 if_right_string(
this), if_right_boolean(
this);
15243 CombineFeedback(var_type_feedback, CompareOperationFeedback::kBigInt);
15245 GotoIf(IsHeapNumberMap(right_map), &if_right_heapnumber);
15246 GotoIf(IsBigIntInstanceType(right_type), &if_right_bigint);
15247 GotoIf(IsStringInstanceType(right_type), &if_right_string);
15249 Branch(IsJSReceiverInstanceType(right_type), &use_symmetry,
15252 BIND(&if_right_heapnumber);
15254 CombineFeedback(var_type_feedback, CompareOperationFeedback::kNumber);
15256 NoContextConstant(), left, right));
15260 BIND(&if_right_bigint);
15263 Label if_both_bigint(
this);
15264 GotoIfLargeBigInt(
CAST(left), &if_both_bigint);
15265 GotoIfLargeBigInt(
CAST(right), &if_both_bigint);
15267 OverwriteFeedback(var_type_feedback,
15268 CompareOperationFeedback::kBigInt64);
15269 BigInt64Comparison(Operation::kEqual, left, right, &if_equal,
15271 BIND(&if_both_bigint);
15274 CombineFeedback(var_type_feedback, CompareOperationFeedback::kBigInt);
15275 result =
CAST(CallBuiltin(Builtin::kBigIntEqual, NoContextConstant(),
15280 BIND(&if_right_string);
15282 CombineFeedback(var_type_feedback, CompareOperationFeedback::kString);
15284 NoContextConstant(), left, right));
15288 BIND(&if_right_boolean);
15290 CombineFeedback(var_type_feedback,
15291 CompareOperationFeedback::kBoolean);
15293 LoadObjectField(
CAST(right), offsetof(
Oddball, to_number_));
15298 BIND(&if_left_oddball);
15300 Label if_left_boolean(
this), if_left_not_boolean(
this);
15302 if (var_type_feedback !=
nullptr) {
15303 CombineFeedback(var_type_feedback,
15304 CompareOperationFeedback::kNullOrUndefined);
15305 GotoIf(IsUndetectableMap(left_map), &if_left_not_boolean);
15307 Goto(&if_left_not_boolean);
15309 BIND(&if_left_not_boolean);
15313 Label if_right_undetectable(
this), if_right_number(
this),
15314 if_right_oddball(
this),
15315 if_right_not_number_or_oddball_or_undetectable(
this);
15316 GotoIf(IsUndetectableMap(right_map), &if_right_undetectable);
15317 GotoIf(IsHeapNumberInstanceType(right_type), &if_right_number);
15318 GotoIf(IsOddballInstanceType(right_type), &if_right_oddball);
15319 Goto(&if_right_not_number_or_oddball_or_undetectable);
15321 BIND(&if_right_undetectable);
15327 CompareOperationFeedback::kReceiverOrNullOrUndefined);
15331 BIND(&if_right_number);
15333 CombineFeedback(var_type_feedback,
15334 CompareOperationFeedback::kNumber);
15335 Goto(&if_notequal);
15338 BIND(&if_right_oddball);
15340 CombineFeedback(var_type_feedback,
15341 CompareOperationFeedback::kOddball);
15342 Goto(&if_notequal);
15345 BIND(&if_right_not_number_or_oddball_or_undetectable);
15347 if (var_type_feedback !=
nullptr) {
15351 CompareOperationFeedback::kReceiverOrNullOrUndefined);
15352 GotoIf(IsJSReceiverInstanceType(right_type), &if_notequal);
15353 CombineFeedback(var_type_feedback,
15354 CompareOperationFeedback::kAny);
15356 Goto(&if_notequal);
15360 BIND(&if_left_boolean);
15362 CombineFeedback(var_type_feedback,
15363 CompareOperationFeedback::kBoolean);
15366 GotoIf(TaggedEqual(right_map, left_map), &if_notequal);
15369 var_left = LoadObjectField(
CAST(left), offsetof(
Oddball, to_number_));
15374 BIND(&if_left_symbol);
15376 Label if_right_receiver(
this);
15377 GotoIf(IsJSReceiverInstanceType(right_type), &if_right_receiver);
15380 if (var_type_feedback !=
nullptr) {
15381 Label if_right_symbol(
this);
15382 GotoIf(IsSymbolInstanceType(right_type), &if_right_symbol);
15383 *var_type_feedback = SmiConstant(CompareOperationFeedback::kAny);
15384 Goto(&if_notequal);
15386 BIND(&if_right_symbol);
15388 CombineFeedback(var_type_feedback,
15389 CompareOperationFeedback::kSymbol);
15390 Goto(&if_notequal);
15393 Goto(&if_notequal);
15396 BIND(&if_right_receiver);
15400 if (var_type_feedback !=
nullptr) {
15401 *var_type_feedback = SmiConstant(CompareOperationFeedback::kAny);
15403 Goto(&use_symmetry);
15407 BIND(&if_left_receiver);
15409 CSA_DCHECK(
this, IsJSReceiverInstanceType(left_type));
15410 Label if_right_receiver(
this), if_right_not_receiver(
this);
15411 Branch(IsJSReceiverInstanceType(right_type), &if_right_receiver,
15412 &if_right_not_receiver);
15414 BIND(&if_right_receiver);
15417 CombineFeedback(var_type_feedback,
15418 CompareOperationFeedback::kReceiver);
15419 Goto(&if_notequal);
15422 BIND(&if_right_not_receiver);
15426 Label if_right_undetectable(
this),
15427 if_right_not_undetectable(
this, Label::kDeferred);
15428 Branch(IsUndetectableMap(right_map), &if_right_undetectable,
15429 &if_right_not_undetectable);
15431 BIND(&if_right_undetectable);
15435 if (var_type_feedback !=
nullptr) {
15436 *var_type_feedback = SmiConstant(
15437 CompareOperationFeedback::kReceiverOrNullOrUndefined);
15439 Branch(IsUndetectableMap(left_map), &if_equal, &if_notequal);
15442 BIND(&if_right_not_undetectable);
15446 CombineFeedback(var_type_feedback, CompareOperationFeedback::kAny);
15447 var_left = CallBuiltin(Builtins::NonPrimitiveToPrimitive(),
15455 BIND(&do_right_stringtonumber);
15457 if (var_type_feedback !=
nullptr) {
15460 CombineFeedback(var_type_feedback,
15461 CollectFeedbackForString(right_type));
15463 var_right = CallBuiltin(Builtin::kStringToNumber,
context(), right);
15467 BIND(&use_symmetry);
15475 BIND(&do_float_comparison);
15477 Branch(Float64Equal(var_left_float.value(), var_right_float.value()),
15478 &if_equal, &if_notequal);
15483 result = TrueConstant();
15487 BIND(&if_notequal);
15489 result = FalseConstant();
15548 Label if_equal(
this), if_notequal(
this), if_not_equivalent_types(
this),
15552 OverwriteFeedback(var_type_feedback, CompareOperationFeedback::kNone);
15555 Label if_same(
this), if_notsame(
this);
15556 Branch(TaggedEqual(lhs, rhs), &if_same, &if_notsame);
15562 GenerateEqual_Same(lhs, &if_equal, &if_notequal, var_type_feedback);
15571 Label if_lhsissmi(
this), if_lhsisnotsmi(
this);
15572 Branch(TaggedIsSmi(lhs), &if_lhsissmi, &if_lhsisnotsmi);
15574 BIND(&if_lhsisnotsmi);
15580 Label if_lhsisnumber(
this), if_lhsisnotnumber(
this);
15581 Branch(IsHeapNumberMap(lhs_map), &if_lhsisnumber, &if_lhsisnotnumber);
15583 BIND(&if_lhsisnumber);
15586 Label if_rhsissmi(
this), if_rhsisnotsmi(
this);
15587 Branch(TaggedIsSmi(rhs), &if_rhsissmi, &if_rhsisnotsmi);
15589 BIND(&if_rhsissmi);
15595 CombineFeedback(var_type_feedback, CompareOperationFeedback::kNumber);
15598 Branch(Float64Equal(lhs_value, rhs_value), &if_equal, &if_notequal);
15601 BIND(&if_rhsisnotsmi);
15608 Label if_rhsisnumber(
this), if_rhsisnotnumber(
this);
15609 Branch(IsHeapNumberMap(rhs_map), &if_rhsisnumber, &if_rhsisnotnumber);
15611 BIND(&if_rhsisnumber);
15617 CombineFeedback(var_type_feedback,
15618 CompareOperationFeedback::kNumber);
15621 Branch(Float64Equal(lhs_value, rhs_value), &if_equal, &if_notequal);
15624 BIND(&if_rhsisnotnumber);
15625 Goto(&if_not_equivalent_types);
15629 BIND(&if_lhsisnotnumber);
15632 Label if_rhsissmi(
this), if_rhsisnotsmi(
this);
15633 Branch(TaggedIsSmi(rhs), &if_rhsissmi, &if_rhsisnotsmi);
15635 BIND(&if_rhsissmi);
15636 Goto(&if_not_equivalent_types);
15638 BIND(&if_rhsisnotsmi);
15641 TNode<Uint16T> lhs_instance_type = LoadMapInstanceType(lhs_map);
15644 Label if_lhsisstring(
this, Label::kDeferred), if_lhsisnotstring(
this);
15645 Branch(IsStringInstanceType(lhs_instance_type), &if_lhsisstring,
15646 &if_lhsisnotstring);
15648 BIND(&if_lhsisstring);
15654 Label if_rhsisstring(
this, Label::kDeferred),
15655 if_rhsisnotstring(
this);
15656 Branch(IsStringInstanceType(rhs_instance_type), &if_rhsisstring,
15657 &if_rhsisnotstring);
15659 BIND(&if_rhsisstring);
15661 if (var_type_feedback !=
nullptr) {
15663 CollectFeedbackForString(lhs_instance_type);
15665 CollectFeedbackForString(rhs_instance_type);
15666 *var_type_feedback = SmiOr(lhs_feedback, rhs_feedback);
15671 BIND(&if_rhsisnotstring);
15672 Goto(&if_not_equivalent_types);
15675 BIND(&if_lhsisnotstring);
15678 Label if_lhsisbigint(
this), if_lhsisnotbigint(
this);
15679 Branch(IsBigIntInstanceType(lhs_instance_type), &if_lhsisbigint,
15680 &if_lhsisnotbigint);
15682 BIND(&if_lhsisbigint);
15688 Label if_rhsisbigint(
this, Label::kDeferred),
15689 if_rhsisnotbigint(
this);
15690 Branch(IsBigIntInstanceType(rhs_instance_type), &if_rhsisbigint,
15691 &if_rhsisnotbigint);
15693 BIND(&if_rhsisbigint);
15696 Label if_both_bigint(
this);
15697 GotoIfLargeBigInt(
CAST(lhs), &if_both_bigint);
15698 GotoIfLargeBigInt(
CAST(rhs), &if_both_bigint);
15700 OverwriteFeedback(var_type_feedback,
15701 CompareOperationFeedback::kBigInt64);
15702 BigInt64Comparison(Operation::kStrictEqual, lhs, rhs,
15703 &if_equal, &if_notequal);
15704 BIND(&if_both_bigint);
15707 CombineFeedback(var_type_feedback,
15708 CompareOperationFeedback::kBigInt);
15709 result =
CAST(CallBuiltin(Builtin::kBigIntEqual,
15710 NoContextConstant(), lhs, rhs));
15714 BIND(&if_rhsisnotbigint);
15715 Goto(&if_not_equivalent_types);
15718 BIND(&if_lhsisnotbigint);
15719 if (var_type_feedback !=
nullptr) {
15722 TNode<Uint16T> rhs_instance_type = LoadMapInstanceType(rhs_map);
15724 Label if_lhsissymbol(
this), if_lhsisreceiver(
this),
15725 if_lhsisoddball(
this);
15726 GotoIf(IsJSReceiverInstanceType(lhs_instance_type),
15727 &if_lhsisreceiver);
15728 GotoIf(
IsBooleanMap(lhs_map), &if_not_equivalent_types);
15729 GotoIf(IsOddballInstanceType(lhs_instance_type),
15731 Branch(IsSymbolInstanceType(lhs_instance_type), &if_lhsissymbol,
15732 &if_not_equivalent_types);
15734 BIND(&if_lhsisreceiver);
15736 GotoIf(
IsBooleanMap(rhs_map), &if_not_equivalent_types);
15737 OverwriteFeedback(var_type_feedback,
15738 CompareOperationFeedback::kReceiver);
15739 GotoIf(IsJSReceiverInstanceType(rhs_instance_type),
15743 CompareOperationFeedback::kReceiverOrNullOrUndefined);
15744 GotoIf(IsOddballInstanceType(rhs_instance_type), &if_notequal);
15745 Goto(&if_not_equivalent_types);
15748 BIND(&if_lhsisoddball);
15750 static_assert(LAST_PRIMITIVE_HEAP_OBJECT_TYPE ==
15752 GotoIf(Int32LessThan(rhs_instance_type,
15753 Int32Constant(ODDBALL_TYPE)),
15754 &if_not_equivalent_types);
15761 CompareOperationFeedback::kReceiverOrNullOrUndefined);
15762 Goto(&if_notequal);
15765 BIND(&if_lhsissymbol);
15767 GotoIfNot(IsSymbolInstanceType(rhs_instance_type),
15768 &if_not_equivalent_types);
15769 OverwriteFeedback(var_type_feedback,
15770 CompareOperationFeedback::kSymbol);
15771 Goto(&if_notequal);
15774 Goto(&if_notequal);
15781 BIND(&if_lhsissmi);
15788 Label if_rhsissmi(
this), if_rhsisnotsmi(
this);
15789 Branch(TaggedIsSmi(rhs), &if_rhsissmi, &if_rhsisnotsmi);
15791 BIND(&if_rhsissmi);
15792 CombineFeedback(var_type_feedback,
15793 CompareOperationFeedback::kSignedSmall);
15794 Goto(&if_notequal);
15796 BIND(&if_rhsisnotsmi);
15802 GotoIfNot(IsHeapNumberMap(rhs_map), &if_not_equivalent_types);
15808 CombineFeedback(var_type_feedback, CompareOperationFeedback::kNumber);
15811 Branch(Float64Equal(lhs_value, rhs_value), &if_equal, &if_notequal);
15818 result = TrueConstant();
15822 BIND(&if_not_equivalent_types);
15824 OverwriteFeedback(var_type_feedback, CompareOperationFeedback::kAny);
15825 Goto(&if_notequal);
15828 BIND(&if_notequal);
15830 result = FalseConstant();
15848 Label length_equal(
this), length_not_equal(
this);
15849 Branch(IntPtrEqual(lhs_length, rhs_length), &length_equal, &length_not_equal);
15851 BIND(&length_not_equal);
15857 BIND(&length_equal);
15860 Builtin::kStringEqual, NoContextConstant(), lhs, rhs, lhs_length));
15861 if (
result !=
nullptr) {
15864 if (if_true == if_false) {
15867 Branch(TaggedEqual(value, TrueConstant()), if_true, if_false);
15880 Label do_fcmp(
this);
15884 GotoIf(TaggedEqual(lhs, rhs), if_true);
15887 Label if_lhsissmi(
this), if_lhsisheapobject(
this);
15888 Branch(TaggedIsSmi(lhs), &if_lhsissmi, &if_lhsisheapobject);
15890 BIND(&if_lhsissmi);
15894 Branch(TaggedIsSmi(rhs), if_false, [&] {
15895 GotoIfNot(IsHeapNumber(
CAST(rhs)), if_false);
15896 var_lhs_value = SmiToFloat64(
CAST(lhs));
15897 var_rhs_value = LoadHeapNumberValue(
CAST(rhs));
15902 BIND(&if_lhsisheapobject);
15910 GotoIfNot(IsHeapNumber(
CAST(lhs)), if_false);
15911 var_lhs_value = LoadHeapNumberValue(
CAST(lhs));
15912 var_rhs_value = SmiToFloat64(
CAST(rhs));
15920 Label if_lhsisheapnumber(
this), if_lhsisstring(
this),
15921 if_lhsisbigint(
this);
15923 GotoIf(IsHeapNumberMap(lhs_map), &if_lhsisheapnumber);
15924 if (mode != SameValueMode::kNumbersOnly) {
15926 LoadMapInstanceType(lhs_map);
15927 GotoIf(IsStringInstanceType(lhs_instance_type), &if_lhsisstring);
15928 GotoIf(IsBigIntInstanceType(lhs_instance_type), &if_lhsisbigint);
15932 BIND(&if_lhsisheapnumber);
15934 GotoIfNot(IsHeapNumber(
CAST(rhs)), if_false);
15935 var_lhs_value = LoadHeapNumberValue(
CAST(lhs));
15936 var_rhs_value = LoadHeapNumberValue(
CAST(rhs));
15940 if (mode != SameValueMode::kNumbersOnly) {
15941 BIND(&if_lhsisstring);
15945 GotoIfNot(IsString(
CAST(rhs)), if_false);
15946 BranchIfStringEqual(
CAST(lhs),
CAST(rhs), if_true, if_false);
15949 BIND(&if_lhsisbigint);
15951 GotoIfNot(IsBigInt(
CAST(rhs)), if_false);
15953 Runtime::kBigIntEqualToBigInt, NoContextConstant(), lhs, rhs);
15954 Branch(IsTrue(
result), if_true, if_false);
15962 TNode<Float64T> lhs_value = UncheckedCast<Float64T>(var_lhs_value.value());
15963 TNode<Float64T> rhs_value = UncheckedCast<Float64T>(var_rhs_value.value());
15964 BranchIfSameNumberValue(lhs_value, rhs_value, if_true, if_false);
15972 Label if_equal(
this), if_notequal(
this);
15973 Branch(Float64Equal(lhs_value, rhs_value), &if_equal, &if_notequal);
15980 const TNode<Uint32T> lhs_hi_word = Float64ExtractHighWord32(lhs_value);
15981 const TNode<Uint32T> rhs_hi_word = Float64ExtractHighWord32(rhs_value);
15985 Branch(Word32Equal(lhs_hi_word, rhs_hi_word), if_true, if_false);
15988 BIND(&if_notequal);
15991 GotoIf(Float64Equal(lhs_value, lhs_value), if_false);
15992 Branch(Float64Equal(rhs_value, rhs_value), if_false, if_true);
16000 Label call_runtime(
this, Label::kDeferred), return_true(
this),
16001 return_false(
this),
end(
this), if_proxy(
this, Label::kDeferred);
16004 [
this, &return_true](
16008 TryHasOwnProperty(holder, holder_map, holder_instance_type, unique_name,
16009 &return_true, next_holder, if_bailout);
16013 [
this, &return_true, &return_false](
16017 TryLookupElement(holder, holder_map, holder_instance_type, index,
16018 &return_true, &return_false, next_holder, if_bailout);
16021 const bool kHandlePrivateNames = mode == HasPropertyLookupMode::kHasProperty;
16022 TryPrototypeChainLookup(
object,
object,
key, lookup_property_in_holder,
16023 lookup_element_in_holder, &return_false,
16024 &call_runtime, &if_proxy, kHandlePrivateNames);
16036 CallBuiltin(Builtin::kProxyHasProperty, context,
object, name));
16039 case kForInHasProperty:
16040 Goto(&call_runtime);
16045 BIND(&return_true);
16047 result = TrueConstant();
16051 BIND(&return_false);
16053 result = FalseConstant();
16057 BIND(&call_runtime);
16062 fallback_runtime_function_id = Runtime::kHasProperty;
16064 case kForInHasProperty:
16065 fallback_runtime_function_id = Runtime::kForInHasProperty;
16088 Label if_fast(
this), if_slow(
this, Label::kDeferred), out(
this);
16089 Branch(IsMap(enumerator), &if_fast, &if_slow);
16096 CSA_DCHECK(
this, Word32NotEqual(enum_length,
16097 Uint32Constant(kInvalidEnumCacheSentinel)));
16100 descriptors, DescriptorArray::kEnumCacheOffset);
16102 LoadObjectField<FixedArray>(enum_cache, EnumCache::kKeysOffset);
16106 LoadObjectField<FixedArray>(enum_cache, EnumCache::kIndicesOffset);
16108 LoadAndUntagFixedArrayBaseLengthAsUint32(enum_indices);
16110 Uint32LessThanOrEqual(enum_length, enum_indices_length),
16111 static_cast<int>(ForInFeedback::kEnumCacheKeysAndIndices),
16112 static_cast<int>(ForInFeedback::kEnumCacheKeys));
16113 UpdateFeedback(feedback, maybe_feedback_vector, slot, update_feedback_mode);
16115 cache_array = enum_keys;
16116 cache_length = SmiFromUint32(enum_length);
16126 UpdateFeedback(SmiConstant(ForInFeedback::kAny), maybe_feedback_vector,
16127 slot, update_feedback_mode);
16129 cache_array = array_enumerator;
16130 cache_length = LoadFixedArrayBaseLength(array_enumerator);
16135 *cache_array_out = cache_array.value();
16136 *cache_length_out = cache_length.value();
16144 Label return_number(
this, Label::kDeferred), if_oddball(
this),
16145 return_function(
this), return_undefined(
this), return_object(
this),
16146 return_string(
this), return_bigint(
this), return_symbol(
this),
16147 return_result(
this);
16149 GotoIf(TaggedIsSmi(value), &return_number);
16152 TNode<Map> map = LoadMap(value_heap_object);
16154 GotoIf(IsHeapNumberMap(map), &return_number);
16158 GotoIf(InstanceTypeEqual(instance_type, ODDBALL_TYPE), &if_oddball);
16161 Word32And(LoadMapBitField(map),
16162 Int32Constant(Map::Bits1::IsCallableBit::kMask |
16163 Map::Bits1::IsUndetectableBit::kMask));
16165 GotoIf(Word32Equal(callable_or_undetectable_mask,
16166 Int32Constant(Map::Bits1::IsCallableBit::kMask)),
16169 GotoIfNot(Word32Equal(callable_or_undetectable_mask, Int32Constant(0)),
16170 &return_undefined);
16172 GotoIf(IsJSReceiverInstanceType(instance_type), &return_object);
16174 GotoIf(IsStringInstanceType(instance_type), &return_string);
16176 GotoIf(IsBigIntInstanceType(instance_type), &return_bigint);
16178 GotoIf(IsSymbolInstanceType(instance_type), &return_symbol);
16180 Abort(AbortReason::kUnexpectedInstanceType);
16183 if (maybe_feedback_vector.has_value()) {
16184 MaybeUpdateFeedback(SmiConstant(feedback), *maybe_feedback_vector,
16188 BIND(&return_number);
16190 result_var = HeapConstantNoHole(
isolate()->factory()->number_string());
16191 UpdateFeedback(TypeOfFeedback::kNumber);
16192 Goto(&return_result);
16198 CAST(LoadObjectField(value_heap_object, offsetof(
Oddball, type_of_)));
16200 UpdateFeedback(TypeOfFeedback::kAny);
16201 Goto(&return_result);
16204 BIND(&return_function);
16206 result_var = HeapConstantNoHole(
isolate()->factory()->function_string());
16207 UpdateFeedback(TypeOfFeedback::kFunction);
16208 Goto(&return_result);
16211 BIND(&return_undefined);
16213 result_var = HeapConstantNoHole(
isolate()->factory()->undefined_string());
16214 UpdateFeedback(TypeOfFeedback::kAny);
16215 Goto(&return_result);
16218 BIND(&return_object);
16220 result_var = HeapConstantNoHole(
isolate()->factory()->object_string());
16221 UpdateFeedback(TypeOfFeedback::kAny);
16222 Goto(&return_result);
16225 BIND(&return_string);
16227 result_var = HeapConstantNoHole(
isolate()->factory()->string_string());
16228 UpdateFeedback(TypeOfFeedback::kString);
16229 Goto(&return_result);
16232 BIND(&return_bigint);
16234 result_var = HeapConstantNoHole(
isolate()->factory()->bigint_string());
16235 UpdateFeedback(TypeOfFeedback::kAny);
16236 Goto(&return_result);
16239 BIND(&return_symbol);
16241 result_var = HeapConstantNoHole(
isolate()->factory()->symbol_string());
16242 UpdateFeedback(TypeOfFeedback::kAny);
16243 Goto(&return_result);
16246 BIND(&return_result);
16247 return result_var.value();
16253 return LoadMapPrototype(map);
16256void CodeStubAssembler::FindNonDefaultConstructor(
16258 Label* found_default_base_ctor,
Label* found_something_else) {
16259 Label loop(
this, &constructor);
16261 constructor = GetSuperConstructor(this_function);
16265 GotoIf(IsDebugActive(), found_something_else);
16271 GotoIf(IsArrayIteratorProtectorCellInvalid(), found_something_else);
16280 GotoIfNot(IsJSFunction(
CAST(constructor.value())), found_something_else);
16284 LoadObjectField<SharedFunctionInfo>(
16285 CAST(constructor.value()), JSFunction::kSharedFunctionInfoOffset);
16287 DecodeWord32<SharedFunctionInfo::RequiresInstanceMembersInitializerBit>(
16288 LoadObjectField<Uint32T>(shared_function_info,
16289 SharedFunctionInfo::kFlagsOffset));
16291 GotoIf(Word32NotEqual(has_class_fields, Int32Constant(0)),
16292 found_something_else);
16296 LoadJSFunctionContext(
CAST(constructor.value()));
16298 GotoIf(LoadScopeInfoClassScopeHasPrivateBrand(scope_info),
16299 found_something_else);
16302 LoadFunctionKind(
CAST(constructor.value()));
16304 GotoIf(Word32Equal(
16306 static_cast<uint32_t
>(FunctionKind::kDefaultBaseConstructor)),
16307 found_default_base_ctor);
16312 GotoIfNot(Word32Equal(function_kind,
16313 static_cast<uint32_t
>(
16314 FunctionKind::kDefaultDerivedConstructor)),
16315 found_something_else);
16317 constructor = GetSuperConstructor(
CAST(constructor.value()));
16335 GetProperty(context,
object, isolate->factory()->constructor_string());
16339 GotoIf(IsUndefined(constructor), &out);
16342 ThrowIfNotJSReceiver(context, constructor,
16343 MessageTemplate::kConstructorNotReceiver,
"");
16347 GetProperty(context, constructor, isolate->factory()->species_symbol());
16353 Label throw_error(
this);
16354 GotoIf(TaggedIsSmi(species), &throw_error);
16355 GotoIfNot(IsConstructorMap(LoadMap(
CAST(species))), &throw_error);
16356 var_result =
CAST(species);
16360 BIND(&throw_error);
16361 ThrowTypeError(context, MessageTemplate::kSpeciesNotConstructor);
16364 return var_result.value();
16371 Label if_notcallable(
this, Label::kDeferred),
16372 if_notreceiver(
this, Label::kDeferred), if_otherhandler(
this),
16373 if_nohandler(
this, Label::kDeferred), return_true(
this),
16374 return_false(
this), return_result(
this, &var_result);
16377 GotoIf(TaggedIsSmi(callable), &if_notreceiver);
16378 GotoIfNot(IsJSReceiver(
CAST(callable)), &if_notreceiver);
16382 GetProperty(context, callable, HasInstanceSymbolConstant());
16389 LoadContextElement(
native_context, Context::FUNCTION_HAS_INSTANCE_INDEX));
16390 GotoIfNot(TaggedEqual(inst_of_handler, function_has_instance),
16395 var_result =
CAST(CallJSBuiltin(Builtin::kFunctionPrototypeHasInstance,
16396 context, inst_of_handler,
16397 UndefinedConstant(),
16398 callable,
object));
16399 Goto(&return_result);
16402 BIND(&if_otherhandler);
16405 GotoIf(
IsNull(inst_of_handler), &if_nohandler);
16406 GotoIf(IsUndefined(inst_of_handler), &if_nohandler);
16410 Call(context, inst_of_handler, ConvertReceiverMode::kNotNullOrUndefined,
16414 BranchIfToBooleanIsTrue(
result, &return_true, &return_false);
16417 BIND(&if_nohandler);
16420 GotoIfNot(IsCallable(
CAST(callable)), &if_notcallable);
16424 CallBuiltin(Builtin::kOrdinaryHasInstance, context, callable,
object));
16425 Goto(&return_result);
16428 BIND(&if_notcallable);
16429 { ThrowTypeError(context, MessageTemplate::kNonCallableInInstanceOfCheck); }
16431 BIND(&if_notreceiver);
16432 { ThrowTypeError(context, MessageTemplate::kNonObjectInInstanceOfCheck); }
16434 BIND(&return_true);
16435 var_result = TrueConstant();
16436 Goto(&return_result);
16438 BIND(&return_false);
16439 var_result = FalseConstant();
16440 Goto(&return_result);
16442 BIND(&return_result);
16443 return var_result.value();
16449 Label if_issmi(
this), if_isnotsmi(
this), do_finc(
this),
end(
this);
16450 Branch(TaggedIsSmi(value), &if_issmi, &if_isnotsmi);
16454 Label if_overflow(
this);
16457 var_result = TrySmiAdd(smi_value,
one, &if_overflow);
16460 BIND(&if_overflow);
16462 var_finc_value = SmiToFloat64(smi_value);
16467 BIND(&if_isnotsmi);
16469 TNode<HeapNumber> heap_number_value =
CAST(value);
16472 var_finc_value = LoadHeapNumberValue(heap_number_value);
16478 TNode<Float64T> finc_value = var_finc_value.value();
16479 TNode<Float64T>
one = Float64Constant(1.0);
16481 var_result = AllocateHeapNumberWithValue(finc_result);
16486 return var_result.value();
16492 Label if_issmi(
this), if_isnotsmi(
this), do_fdec(
this),
end(
this);
16493 Branch(TaggedIsSmi(value), &if_issmi, &if_isnotsmi);
16499 Label if_overflow(
this);
16500 var_result = TrySmiSub(smi_value,
one, &if_overflow);
16503 BIND(&if_overflow);
16505 var_fdec_value = SmiToFloat64(smi_value);
16510 BIND(&if_isnotsmi);
16515 var_fdec_value = LoadHeapNumberValue(heap_number_value);
16524 var_result = AllocateHeapNumberWithValue(fdec_result);
16529 return var_result.value();
16534 Label float_add(
this, Label::kDeferred),
end(
this);
16535 GotoIf(TaggedIsNotSmi(a), &float_add);
16536 GotoIf(TaggedIsNotSmi(b), &float_add);
16539 var_result = TrySmiAdd(
CAST(a),
CAST(b), &float_add);
16544 var_result = ChangeFloat64ToTagged(
16545 Float64Add(ChangeNumberToFloat64(a), ChangeNumberToFloat64(b)));
16550 return var_result.value();
16555 Label float_sub(
this, Label::kDeferred),
end(
this);
16556 GotoIf(TaggedIsNotSmi(a), &float_sub);
16557 GotoIf(TaggedIsNotSmi(b), &float_sub);
16560 var_result = TrySmiSub(
CAST(a),
CAST(b), &float_sub);
16565 var_result = ChangeFloat64ToTagged(
16566 Float64Sub(ChangeNumberToFloat64(a), ChangeNumberToFloat64(b)));
16571 return var_result.value();
16575 Label* is_not_number) {
16576 Label is_number(
this);
16577 GotoIf(TaggedIsSmi(input), &is_number);
16578 Branch(IsHeapNumber(
CAST(input)), &is_number, is_not_number);
16583 GotoIf(TaggedIsSmi(input), is_number);
16584 GotoIf(IsHeapNumber(
CAST(input)), is_number);
16594 GotoIf(UniqueInt32Constant(Word32ShiftIsSafe()), &done);
16596 result = Word32And(right32, Int32Constant(0x1F));
16606 switch (bitwise_op) {
16607 case Operation::kBitwiseAnd:
16608 return ChangeInt32ToTagged(Signed(Word32And(left32, right32)));
16609 case Operation::kBitwiseOr:
16610 return ChangeInt32ToTagged(Signed(Word32Or(left32, right32)));
16611 case Operation::kBitwiseXor:
16612 return ChangeInt32ToTagged(Signed(Word32Xor(left32, right32)));
16613 case Operation::kShiftLeft:
16614 right32 = NormalizeShift32OperandIfNecessary(right32);
16615 return ChangeInt32ToTagged(Signed(Word32Shl(left32, right32)));
16616 case Operation::kShiftRight:
16617 right32 = NormalizeShift32OperandIfNecessary(right32);
16618 return ChangeInt32ToTagged(Signed(Word32Sar(left32, right32)));
16619 case Operation::kShiftRightLogical:
16620 right32 = NormalizeShift32OperandIfNecessary(right32);
16621 return ChangeUint32ToTagged(Unsigned(Word32Shr(left32, right32)));
16630 switch (bitwise_op) {
16631 case Operation::kBitwiseAnd:
16632 return SmiAnd(left, right);
16633 case Operation::kBitwiseOr:
16634 return SmiOr(left, right);
16635 case Operation::kBitwiseXor:
16636 return SmiXor(left, right);
16639 case Operation::kShiftLeft:
16640 case Operation::kShiftRightLogical:
16641 return BitwiseOp(SmiToInt32(left), SmiToInt32(right), bitwise_op);
16644 case Operation::kShiftRight: {
16647 Signed(NormalizeShift32OperandIfNecessary(SmiToInt32(right)));
16648 return ChangeInt32ToTaggedNoOverflow(Word32Sar(left32, right32));
16661 LoadContextElement(
native_context, Context::ITERATOR_RESULT_MAP_INDEX));
16663 StoreMapNoWriteBarrier(
result, map);
16664 StoreObjectFieldRoot(
result, JSIteratorResult::kPropertiesOrHashOffset,
16665 RootIndex::kEmptyFixedArray);
16666 StoreObjectFieldRoot(
result, JSIteratorResult::kElementsOffset,
16667 RootIndex::kEmptyFixedArray);
16668 StoreObjectFieldNoWriteBarrier(
result, JSIteratorResult::kValueOffset, value);
16669 StoreObjectFieldNoWriteBarrier(
result, JSIteratorResult::kDoneOffset, done);
16677 int const elements_size = FixedArray::SizeFor(2);
16679 UncheckedCast<FixedArray>(Allocate(elements_size));
16681 RootIndex::kFixedArrayMap);
16684 StoreFixedArrayElement(elements, 0,
key);
16685 StoreFixedArrayElement(elements, 1, value);
16690 StoreMapNoWriteBarrier(array, array_map);
16691 StoreObjectFieldRoot(array, JSArray::kPropertiesOrHashOffset,
16692 RootIndex::kEmptyFixedArray);
16693 StoreObjectFieldNoWriteBarrier(array, JSArray::kElementsOffset, elements);
16694 StoreObjectFieldNoWriteBarrier(array, JSArray::kLengthOffset, length);
16696 LoadContextElement(
native_context, Context::ITERATOR_RESULT_MAP_INDEX));
16698 StoreMapNoWriteBarrier(
result, iterator_map);
16699 StoreObjectFieldRoot(
result, JSIteratorResult::kPropertiesOrHashOffset,
16700 RootIndex::kEmptyFixedArray);
16701 StoreObjectFieldRoot(
result, JSIteratorResult::kElementsOffset,
16702 RootIndex::kEmptyFixedArray);
16703 StoreObjectFieldNoWriteBarrier(
result, JSIteratorResult::kValueOffset, array);
16704 StoreObjectFieldRoot(
result, JSIteratorResult::kDoneOffset,
16705 RootIndex::kFalseValue);
16714 native_context, Context::PROMISE_WITHRESOLVERS_RESULT_MAP_INDEX));
16716 StoreMapNoWriteBarrier(
result, map);
16717 StoreObjectFieldRoot(
result,
16718 JSPromiseWithResolversResult::kPropertiesOrHashOffset,
16719 RootIndex::kEmptyFixedArray);
16720 StoreObjectFieldRoot(
result, JSPromiseWithResolversResult::kElementsOffset,
16721 RootIndex::kEmptyFixedArray);
16722 StoreObjectFieldNoWriteBarrier(
16723 result, JSPromiseWithResolversResult::kPromiseOffset, promise);
16724 StoreObjectFieldNoWriteBarrier(
16725 result, JSPromiseWithResolversResult::kResolveOffset, resolve);
16726 StoreObjectFieldNoWriteBarrier(
16727 result, JSPromiseWithResolversResult::kRejectOffset, reject);
16736 return Construct(context, constructor, len);
16739void CodeStubAssembler::ThrowIfArrayBufferIsDetached(
16741 const char* method_name) {
16742 Label if_detached(
this, Label::kDeferred), if_not_detached(
this);
16743 Branch(IsDetachedBuffer(array_buffer), &if_detached, &if_not_detached);
16744 BIND(&if_detached);
16745 ThrowTypeError(context, MessageTemplate::kDetachedOperation, method_name);
16746 BIND(&if_not_detached);
16749void CodeStubAssembler::ThrowIfArrayBufferViewBufferIsDetached(
16751 const char* method_name) {
16753 ThrowIfArrayBufferIsDetached(context, buffer, method_name);
16758 return LoadBoundedSizeFromObject(array_buffer,
16759 JSArrayBuffer::kRawByteLengthOffset);
16764 return LoadBoundedSizeFromObject(array_buffer,
16765 JSArrayBuffer::kRawMaxByteLengthOffset);
16770 return LoadSandboxedPointerFromObject(array_buffer,
16771 JSArrayBuffer::kBackingStoreOffset);
16776 return LoadObjectField<JSArrayBuffer>(array_buffer_view,
16777 JSArrayBufferView::kBufferOffset);
16782 return LoadBoundedSizeFromObject(array_buffer_view,
16783 JSArrayBufferView::kRawByteLengthOffset);
16786void CodeStubAssembler::StoreJSArrayBufferViewByteLength(
16788 StoreBoundedSizeToObject(array_buffer_view,
16789 JSArrayBufferView::kRawByteLengthOffset, value);
16794 return LoadBoundedSizeFromObject(array_buffer_view,
16795 JSArrayBufferView::kRawByteOffsetOffset);
16798void CodeStubAssembler::StoreJSArrayBufferViewByteOffset(
16800 StoreBoundedSizeToObject(array_buffer_view,
16801 JSArrayBufferView::kRawByteOffsetOffset, value);
16806 return LoadBoundedSizeFromObject(typed_array, JSTypedArray::kRawLengthOffset);
16811 StoreBoundedSizeToObject(typed_array, JSTypedArray::kRawLengthOffset, value);
16819 Label variable_length(
this), fixed_length(
this),
end(
this);
16820 Branch(IsVariableLengthJSArrayBufferView(typed_array), &variable_length,
16822 BIND(&variable_length);
16825 LoadVariableLengthJSTypedArrayLength(typed_array, buffer, detached);
16829 BIND(&fixed_length);
16831 Label not_detached(
this);
16832 Branch(IsDetachedBuffer(buffer), detached, ¬_detached);
16833 BIND(¬_detached);
16834 result = LoadJSTypedArrayLength(typed_array);
16844 Label* detached_or_out_of_bounds) {
16846 TNode<UintPtrT> byte_length = LoadVariableLengthJSArrayBufferViewByteLength(
16847 array, buffer, detached_or_out_of_bounds);
16849 RabGsabElementsKindToElementByteSize(LoadElementsKind(array));
16850 return Unsigned(IntPtrDiv(Signed(byte_length), element_size));
16854CodeStubAssembler::LoadVariableLengthJSArrayBufferViewByteLength(
16856 Label* detached_or_out_of_bounds) {
16857 Label is_gsab(
this), is_rab(
this),
end(
this);
16859 TNode<UintPtrT> array_byte_offset = LoadJSArrayBufferViewByteOffset(array);
16861 Branch(IsSharedArrayBuffer(buffer), &is_gsab, &is_rab);
16865 CSA_DCHECK(
this, IsLengthTrackingJSArrayBufferView(array));
16868 ExternalConstant(ExternalReference::gsab_byte_length());
16870 ExternalConstant(ExternalReference::isolate_address());
16872 CallCFunction(byte_length_function, MachineType::UintPtr(),
16873 std::make_pair(MachineType::Pointer(), isolate_ptr),
16874 std::make_pair(MachineType::AnyTagged(), buffer)));
16879 UintPtrGreaterThanOrEqual(buffer_byte_length, array_byte_offset));
16880 result = UintPtrSub(buffer_byte_length, array_byte_offset);
16886 GotoIf(IsDetachedBuffer(buffer), detached_or_out_of_bounds);
16888 TNode<UintPtrT> buffer_byte_length = LoadJSArrayBufferByteLength(buffer);
16890 Label is_length_tracking(
this), not_length_tracking(
this);
16891 Branch(IsLengthTrackingJSArrayBufferView(array), &is_length_tracking,
16892 ¬_length_tracking);
16894 BIND(&is_length_tracking);
16898 GotoIfNot(UintPtrLessThanOrEqual(array_byte_offset, buffer_byte_length),
16899 detached_or_out_of_bounds);
16900 result = UintPtrSub(buffer_byte_length, array_byte_offset);
16904 BIND(¬_length_tracking);
16909 LoadJSArrayBufferViewByteLength(array);
16910 GotoIfNot(UintPtrGreaterThanOrEqual(
16911 buffer_byte_length,
16912 UintPtrAdd(array_byte_offset, array_byte_length)),
16913 detached_or_out_of_bounds);
16914 result = array_byte_length;
16922void CodeStubAssembler::IsJSArrayBufferViewDetachedOrOutOfBounds(
16924 Label* not_detached_nor_oob) {
16927 GotoIf(IsDetachedBuffer(buffer), detached_or_oob);
16928 GotoIfNot(IsVariableLengthJSArrayBufferView(array_buffer_view),
16929 not_detached_nor_oob);
16930 GotoIf(IsSharedArrayBuffer(buffer), not_detached_nor_oob);
16933 TNode<UintPtrT> buffer_byte_length = LoadJSArrayBufferByteLength(buffer);
16935 LoadJSArrayBufferViewByteOffset(array_buffer_view);
16937 Label length_tracking(
this), not_length_tracking(
this);
16938 Branch(IsLengthTrackingJSArrayBufferView(array_buffer_view),
16939 &length_tracking, ¬_length_tracking);
16941 BIND(&length_tracking);
16945 Branch(UintPtrLessThanOrEqual(array_byte_offset, buffer_byte_length),
16946 not_detached_nor_oob, detached_or_oob);
16949 BIND(¬_length_tracking);
16954 LoadJSArrayBufferViewByteLength(array_buffer_view);
16955 Branch(UintPtrGreaterThanOrEqual(
16956 buffer_byte_length,
16957 UintPtrAdd(array_byte_offset, array_byte_length)),
16958 not_detached_nor_oob, detached_or_oob);
16963TNode<BoolT> CodeStubAssembler::IsJSArrayBufferViewDetachedOrOutOfBoundsBoolean(
16965 Label is_detached_or_out_of_bounds(
this),
16966 not_detached_nor_out_of_bounds(
this),
end(
this);
16969 IsJSArrayBufferViewDetachedOrOutOfBounds(array_buffer_view,
16970 &is_detached_or_out_of_bounds,
16971 ¬_detached_nor_out_of_bounds);
16972 BIND(&is_detached_or_out_of_bounds);
16974 result = BoolConstant(
true);
16977 BIND(¬_detached_nor_out_of_bounds);
16979 result = BoolConstant(
false);
16986void CodeStubAssembler::CheckJSTypedArrayIndex(
16988 Label* detached_or_out_of_bounds) {
16990 typed_array, detached_or_out_of_bounds);
16992 GotoIf(UintPtrGreaterThanOrEqual(index, len), detached_or_out_of_bounds);
17003 LoadVariableLengthJSTypedArrayLength(array, buffer, &miss);
17005 RabGsabElementsKindToElementByteSize(LoadElementsKind(array));
17007 TNode<IntPtrT> byte_length = IntPtrMul(Signed(length), element_size);
17008 result = Unsigned(byte_length);
17012 result = UintPtrConstant(0);
17022 Label elements_8(
this), elements_16(
this), elements_32(
this),
17023 elements_64(
this), not_found(
this),
end(
this);
17024 int32_t elements_kinds[] = {
17025 RAB_GSAB_UINT8_ELEMENTS, RAB_GSAB_UINT8_CLAMPED_ELEMENTS,
17026 RAB_GSAB_INT8_ELEMENTS, RAB_GSAB_UINT16_ELEMENTS,
17027 RAB_GSAB_INT16_ELEMENTS, RAB_GSAB_FLOAT16_ELEMENTS,
17028 RAB_GSAB_UINT32_ELEMENTS, RAB_GSAB_INT32_ELEMENTS,
17029 RAB_GSAB_FLOAT32_ELEMENTS, RAB_GSAB_FLOAT64_ELEMENTS,
17030 RAB_GSAB_BIGINT64_ELEMENTS, RAB_GSAB_BIGUINT64_ELEMENTS};
17031 Label* elements_kind_labels[] = {&elements_8, &elements_8, &elements_8,
17032 &elements_16, &elements_16, &elements_16,
17033 &elements_32, &elements_32, &elements_32,
17034 &elements_64, &elements_64, &elements_64};
17035 const size_t kTypedElementsKindCount =
17040 Switch(elements_kind, ¬_found, elements_kinds, elements_kind_labels,
17041 kTypedElementsKindCount);
17044 result = IntPtrConstant(1);
17047 BIND(&elements_16);
17049 result = IntPtrConstant(2);
17052 BIND(&elements_32);
17054 result = IntPtrConstant(4);
17057 BIND(&elements_64);
17059 result = IntPtrConstant(8);
17070 Label call_runtime(
this), done(
this);
17073 GotoIf(IsOnHeapTypedArray(array), &call_runtime);
17076 GotoIf(IsDetachedBuffer(buffer), &call_runtime);
17077 var_result = buffer;
17080 BIND(&call_runtime);
17082 var_result =
CallRuntime(Runtime::kTypedArrayGetBuffer, context, array);
17087 return CAST(var_result.value());
17095 fp_(fp != nullptr ? fp :
assembler_->LoadFramePointer()) {
17156 &argument_missing);
17179 if (first ==
nullptr) {
17182 if (last ==
nullptr) {
17215 &pop_parameter_count, &pop_argument_count);
17228 return Uint32LessThanOrEqual(elements_kind,
17237 static_assert((~PACKED_SMI_ELEMENTS & 1) == 1);
17238 static_assert((~PACKED_ELEMENTS & 1) == 1);
17239 static_assert((~PACKED_DOUBLE_ELEMENTS & 1) == 1);
17252 return Uint32LessThanOrEqual(elements_kind,
17270 return Uint32LessThanOrEqual(elements_kind,
17276 return Uint32LessThanOrEqual(elements_kind,
17308 return Int32GreaterThan(target_kind,
Int32Constant(reference_kind));
17313 return Int32GreaterThanOrEqual(target_kind,
Int32Constant(reference_kind));
17318 return Int32LessThanOrEqual(target_kind,
Int32Constant(reference_kind));
17323 Label is_rab_gsab(
this),
end(
this);
17326 Branch(Int32GreaterThanOrEqual(elements_kind,
17328 &is_rab_gsab, &
end);
17329 BIND(&is_rab_gsab);
17345 ExternalReference::async_event_delegate_address(
isolate())));
17351 ExternalReference::promise_hook_flags_address(
isolate())));
17365#ifdef V8_ENABLE_JAVASCRIPT_PROMISE_HOOKS
17366TNode<BoolT> CodeStubAssembler::IsContextPromiseHookEnabled(
17404#ifdef V8_ENABLE_LEAPTIERING
17408#if V8_STATIC_DISPATCH_HANDLES_BOOL
17409 return LoadBuiltinDispatchHandle(JSBuiltinDispatchHandleRoot::to_idx(idx));
17420#if V8_STATIC_DISPATCH_HANDLES_BOOL
17421TNode<JSDispatchHandleT> CodeStubAssembler::LoadBuiltinDispatchHandle(
17422 JSBuiltinDispatchHandleRoot::Idx dispatch_root_idx) {
17423 DCHECK_LT(dispatch_root_idx, JSBuiltinDispatchHandleRoot::Idx::kCount);
17425 isolate()->builtin_dispatch_handle(dispatch_root_idx).
value()));
17433 Label* if_compile_lazy) {
17436 Label use_untrusted_data(
this);
17437 Label unknown_data(
this);
17444 if (data_type_out) {
17445 *data_type_out = data_type;
17448 int32_t case_values[] = {
17449 BYTECODE_ARRAY_TYPE,
17451 INTERPRETER_DATA_TYPE,
17452 UNCOMPILED_DATA_WITHOUT_PREPARSE_DATA_TYPE,
17453 UNCOMPILED_DATA_WITH_PREPARSE_DATA_TYPE,
17454 UNCOMPILED_DATA_WITHOUT_PREPARSE_DATA_WITH_JOB_TYPE,
17455 UNCOMPILED_DATA_WITH_PREPARSE_DATA_AND_JOB_TYPE,
17456#if V8_ENABLE_WEBASSEMBLY
17457 WASM_CAPI_FUNCTION_DATA_TYPE,
17458 WASM_EXPORTED_FUNCTION_DATA_TYPE,
17459 WASM_JS_FUNCTION_DATA_TYPE,
17462 Label check_is_bytecode_array(
this);
17463 Label check_is_baseline_data(
this);
17464 Label check_is_interpreter_data(
this);
17465 Label check_is_uncompiled_data(
this);
17466 Label check_is_wasm_function_data(
this);
17467 Label* case_labels[] = {
17468 &check_is_bytecode_array, &check_is_baseline_data,
17469 &check_is_interpreter_data, &check_is_uncompiled_data,
17470 &check_is_uncompiled_data, &check_is_uncompiled_data,
17471 &check_is_uncompiled_data,
17472#if V8_ENABLE_WEBASSEMBLY
17473 &check_is_wasm_function_data, &check_is_wasm_function_data,
17474 &check_is_wasm_function_data,
17478 Switch(data_type, &unknown_data, case_values, case_labels,
17482 BIND(&check_is_bytecode_array);
17488 BIND(&check_is_baseline_data);
17491 sfi_code = baseline_code;
17496 BIND(&check_is_interpreter_data);
17499 CAST(sfi_data), InterpreterData::kInterpreterTrampolineOffset));
17500 sfi_code = trampoline;
17506 BIND(&check_is_uncompiled_data);
17508 Goto(if_compile_lazy ? if_compile_lazy : &done);
17510#if V8_ENABLE_WEBASSEMBLY
17512 BIND(&check_is_wasm_function_data);
17514 CAST(sfi_data), WasmExportedFunctionData::kWrapperCodeOffset));
17519 BIND(&use_untrusted_data);
17522 Label check_instance_type(
this);
17526 if (data_type_out) {
17529 if (if_compile_lazy) {
17537 BIND(&check_instance_type);
17539 if (data_type_out) {
17540 *data_type_out = data_type;
17543 int32_t case_values[] = {
17544 FUNCTION_TEMPLATE_INFO_TYPE,
17545#if V8_ENABLE_WEBASSEMBLY
17546 ASM_WASM_DATA_TYPE,
17547 WASM_RESUME_DATA_TYPE,
17550 Label check_is_function_template_info(
this);
17551 Label check_is_asm_wasm_data(
this);
17552 Label check_is_wasm_resume(
this);
17553 Label* case_labels[] = {
17554 &check_is_function_template_info,
17555#if V8_ENABLE_WEBASSEMBLY
17556 &check_is_asm_wasm_data,
17557 &check_is_wasm_resume,
17561 Switch(data_type, &unknown_data, case_values, case_labels,
17565 BIND(&check_is_function_template_info);
17570#if V8_ENABLE_WEBASSEMBLY
17572 BIND(&check_is_asm_wasm_data);
17577 BIND(&check_is_wasm_resume);
17583 BIND(&unknown_data);
17587 return sfi_code.value();
17592#ifdef V8_ENABLE_SANDBOX
17595 return LoadCodeEntrypointViaCodePointerField(
17596 code, Code::kSelfIndirectPointerOffset, tag);
17613 DCHECK(v8::internal::IsSharedFunctionInfo(
17614 isolate()->root(function).GetHeapObject()));
17616 isolate()->root(function).GetHeapObject());
17622 native_context, Context::STRICT_FUNCTION_WITHOUT_PROTOTYPE_MAP_INDEX));
17627 RootIndex::kEmptyFixedArray);
17629 RootIndex::kEmptyFixedArray);
17631 RootIndex::kManyClosuresCell);
17638 DCHECK(sfi->HasBuiltinId());
17639#ifdef V8_ENABLE_LEAPTIERING
17641 LoadBuiltinDispatchHandle(function);
17644 LoadCodeObjectFromJSDispatchTable(dispatch_handle)));
17663 Label loop(
this, {&var_object, &object_map}), done_loop(
this);
17668 Label if_no_elements(
this);
17673 static_assert(
static_cast<int>(JSObject::kElementsOffset) ==
17674 static_cast<int>(JSProxy::kTargetOffset));
17677 GotoIf(IsEmptyFixedArray(object_elements), &if_no_elements);
17678 GotoIf(IsEmptySlowElementDictionary(object_elements), &if_no_elements);
17687 BIND(&if_no_elements);
17692 var_object =
CAST(
object);
17693 object_map =
LoadMap(
object);
17701 Label* if_runtime) {
17710 &if_no_cache, &if_cache);
17712 BIND(&if_no_cache);
17738 static_assert(
static_cast<int>(NameDictionary::kNumberOfElementsIndex) ==
17739 static_cast<int>(GlobalDictionary::kNumberOfElementsIndex));
17757 return receiver_map;
17816 if (prefix !=
nullptr) {
17834 if (prefix !=
nullptr) {
17845 for (
int i = 0;
i < 4; ++
i) {
17853 chunks[2], chunks[1], chunks[0],
SmiConstant(stream));
17858 if (prefix !=
nullptr) {
17883 chunks[2], chunks[1], chunks[0],
SmiConstant(stream));
17905 TNode<BoolT> sp_within_limit = StackPointerGreaterThan(stack_limit);
17907 Branch(sp_within_limit, &ok, &stack_check_interrupt);
17909 BIND(&stack_check_interrupt);
17941 Label allocate_js_array(
this);
17947 Operation::kGreaterThanOrEqual, length,
17954 limit, &runtime, &next);
17962 array_function, UndefinedConstant()));
17970 context, Context::JS_ARRAY_PACKED_SMI_ELEMENTS_MAP_INDEX));
17980 return array.value();
18001 std::make_pair(type_ptr, isolate_ptr),
18010 return CAST(value);
18020 initial_prototype_map_(initial_prototype_map),
18021 properties_(properties) {}
18024 Label* if_unmodified,
18025 Label* if_modified) {
18033 Label* if_fast_check_failed =
18036 : &property_identity_check;
18044 if_fast_check_failed);
18063 CodeAssembler::LoadRoot(
properties_[
i].name_root_index)));
18069 combined_details = details;
18071 combined_details =
Word32And(combined_details, details);
18081 if_unmodified, if_fast_check_failed);
18091 BIND(&property_identity_check);
18093 int max_descriptor_index = -1;
18095 max_descriptor_index =
18096 std::max(max_descriptor_index,
properties_[
i].descriptor_index);
18136 Goto(if_unmodified);
18150class MetaTableAccessor {
18155 TNode<Uint32T>
Load(TNode<ByteArray> meta_table, TNode<IntPtrT> index) {
18156 TNode<IntPtrT>
offset = OverallOffset(meta_table, index);
18158 return csa.UncheckedCast<Uint32T>(
18159 csa.LoadFromObject(mt, meta_table,
offset));
18162 TNode<Uint32T>
Load(TNode<ByteArray> meta_table,
int index) {
18163 return Load(meta_table,
csa.IntPtrConstant(index));
18166 void Store(TNode<ByteArray> meta_table, TNode<IntPtrT> index,
18167 TNode<Uint32T> data) {
18168 TNode<IntPtrT>
offset = OverallOffset(meta_table, index);
18171 int bits =
mt.MemSize() * 8;
18172 TNode<UintPtrT> max_value =
csa.UintPtrConstant((1ULL << bits) - 1);
18178 csa.StoreToObject(
mt.representation(), meta_table,
offset, data,
18182 void Store(TNode<ByteArray> meta_table,
int index, TNode<Uint32T> data) {
18183 Store(meta_table,
csa.IntPtrConstant(index), data);
18187 TNode<IntPtrT> OverallOffset(TNode<ByteArray> meta_table,
18188 TNode<IntPtrT> index) {
18191 int offset_to_data_minus_tag =
18194 TNode<IntPtrT> overall_offset;
18195 int size =
mt.MemSize();
18197 if (
csa.TryToIntPtrConstant(index, &constant)) {
18198 intptr_t index_offset = constant *
size;
18200 csa.IntPtrConstant(offset_to_data_minus_tag + index_offset);
18202 TNode<IntPtrT> index_offset =
18203 csa.IntPtrMul(index,
csa.IntPtrConstant(size));
18204 overall_offset =
csa.IntPtrAdd(
18205 csa.IntPtrConstant(offset_to_data_minus_tag), index_offset);
18209 TNode<IntPtrT> byte_array_data_bytes =
18210 csa.SmiToIntPtr(
csa.LoadFixedArrayBaseLength(meta_table));
18211 TNode<IntPtrT> max_allowed_offset =
csa.IntPtrAdd(
18212 byte_array_data_bytes,
csa.IntPtrConstant(offset_to_data_minus_tag));
18213 CSA_DCHECK(&csa,
csa.UintPtrLessThan(overall_offset, max_allowed_offset));
18216 return overall_offset;
18225using MetaTableAccessFunction = std::function<void(MetaTableAccessor&)>;
18231void GenerateMetaTableAccess(CodeStubAssembler*
csa, TNode<IntPtrT> capacity,
18232 MetaTableAccessFunction builder) {
18237 using Label = compiler::CodeAssemblerLabel;
18238 Label small(
csa), medium(
csa), done(
csa);
18241 csa->IntPtrLessThanOrEqual(
18246 csa->IntPtrLessThanOrEqual(
18271 MetaTableAccessFunction builder = [&](MetaTableAccessor& mta) {
18272 nof = mta.Load(meta_table,
18276 GenerateMetaTableAccess(
this, capacity, builder);
18286 MetaTableAccessFunction builder = [&](MetaTableAccessor& mta) {
18288 mta.Load(meta_table,
18292 GenerateMetaTableAccess(
this, capacity, builder);
18304 MetaTableAccessFunction builder = [&](MetaTableAccessor& mta) {
18305 mta.Store(meta_table, meta_table_index,
Unsigned(entry));
18308 GenerateMetaTableAccess(
this, capacity, builder);
18317 MetaTableAccessFunction builder = [&](MetaTableAccessor& mta) {
18321 mta.Load(meta_table,
18324 GotoIf(Uint32GreaterThanOrEqual(used, max_usable_capacity), bailout);
18331 GenerateMetaTableAccess(
this, capacity, builder);
18332 return used_var.value();
18339 MetaTableAccessFunction builder = [&](MetaTableAccessor& mta) {
18343 mta.Load(meta_table,
18351 mta.Store(meta_table,
18355 new_nof_var = new_nof;
18358 GenerateMetaTableAccess(
this, capacity, builder);
18359 return new_nof_var.value();
18369 SwissNameDictionaryCapacityFor(at_least_space_for));
18375 int at_least_space_for) {
18382 Comment(
"[ AllocateSwissNameDictionaryWithCapacity");
18392 intptr_t capacity_constant;
18397 Branch(UintPtrGreaterThan(
18399 &if_out_of_memory, &next);
18401 BIND(&if_out_of_memory);
18402 CallRuntime(Runtime::kFatalProcessOutOfMemoryInAllocateRaw,
18415 Comment(
"Meta table allocation.");
18417 SwissNameDictionaryMetaTableSizeFor(capacity);
18422 Comment(
"SwissNameDictionary allocation.");
18423 TNode<IntPtrT> total_size = SwissNameDictionarySizeFor(capacity);
18431 "Initialize the hash, capacity, meta table pointer, and number of "
18432 "(deleted) elements.");
18434 StoreSwissNameDictionaryHash(table,
18437 StoreSwissNameDictionaryMetaTable(table, meta_table);
18441 MetaTableAccessFunction builder = [&](MetaTableAccessor& mta) {
18444 mta.Store(meta_table,
18448 GenerateMetaTableAccess(
this, capacity, builder);
18450 Comment(
"Initialize the ctrl table.");
18453 SwissNameDictionaryCtrlTableStartOffsetMT(capacity);
18459 IntPtrAdd(table_address_with_tag, ctrl_table_start_offset_minus_tag);
18461 IntPtrAdd(ctrl_table_start_ptr, ctrl_table_size_bytes);
18474 constexpr uint32_t kEmpty32 =
18475 (kEmpty << 24) | (kEmpty << 16) | (kEmpty << 8) | kEmpty;
18478 ctrl_table_start_ptr, ctrl_table_end_ptr,
18485 Comment(
"Initialize the data table.");
18488 SwissNameDictionaryDataTableStartOffsetMT();
18490 IntPtrAdd(table_address_with_tag, data_table_start_offset_minus_tag);
18496 IntPtrAdd(data_table_ptr, data_table_size),
18497 TheHoleConstant());
18499 Comment(
"AllocateSwissNameDictionaryWithCapacity ]");
18506 Comment(
"[ CopySwissNameDictionary");
18514 Comment(
"Meta table allocation.");
18516 SwissNameDictionaryMetaTableSizeFor(capacity);
18521 Comment(
"SwissNameDictionary allocation.");
18522 TNode<IntPtrT> total_size = SwissNameDictionarySizeFor(capacity);
18529 Comment(
"Copy the hash and capacity.");
18531 StoreSwissNameDictionaryHash(table, LoadSwissNameDictionaryHash(original));
18533 StoreSwissNameDictionaryMetaTable(table, meta_table);
18544 SwissNameDictionaryCtrlTableStartOffsetMT(capacity);
18549 Comment(
"Copy the ctrl table.");
18552 old_table_address_with_tag, ctrl_table_start_offset_minus_tag);
18554 new_table_address_with_tag, ctrl_table_start_offset_minus_tag);
18563 Comment(
"Copy the data table.");
18572 start_offset,
IntPtrAdd(start_offset, data_table_size),
18580 Comment(
"Copy the meta table");
18588 SwissNameDictionaryMetaTableSizeFor(capacity);
18591 old_meta_table_address_with_tag,
18594 new_meta_table_address_with_tag,
18603 Comment(
"Copy the PropertyDetails table");
18611 property_details_start_offset_minus_tag);
18615 VariableList in_loop_variables({&details_table_offset_minus_tag},
zone());
18635 Load<Uint8T>(original, details_table_offset_minus_tag.value());
18638 details_table_offset_minus_tag.value(), details,
18643 details_table_offset_minus_tag =
18644 IntPtrAdd(details_table_offset_minus_tag.value(),
18650 Comment(
"CopySwissNameDictionary ]");
18657 TNode<IntPtrT> data_table_start = SwissNameDictionaryDataTableStartOffsetMT();
18663 if (field_index != 0) {
18668 return IntPtrAdd(data_table_start, offset_within_data_table);
18677 LoadSwissNameDictionaryCapacity(dict))));
18679 TNode<IntPtrT> data_table_start = SwissNameDictionaryDataTableStartOffsetMT();
18690 IntPtrAdd(data_table_start, data_and_ctrl_table_size);
18694 WordEqual(FieldSliceSwissNameDictionaryPropertyDetailsTable(dict).
offset,
18696 IntPtrAdd(property_details_table_start,
18700 return IntPtrAdd(property_details_table_start, offset_within_details_table);
18764#ifdef V8_TARGET_LITTLE_ENDIAN
18774 constexpr int count =
sizeof(uint64_t);
18776 int src_offset =
i * 8;
18777 int dest_offset = (
count -
i - 1) * 8;
18783 src_offset < dest_offset
18797 LoadSwissNameDictionaryCapacity(table))));
18798 CSA_DCHECK(
this, UintPtrLessThan(entry, capacity));
18841 SwissNameDictionaryFindEntrySIMD(table,
key, found, var_found_entry,
18844 SwissNameDictionaryFindEntryPortable(table,
key, found, var_found_entry,
18853 Label* needs_resize) {
18855 SwissNameDictionaryAddSIMD(table,
key, value, property_details,
18858 SwissNameDictionaryAddPortable(table,
key, value, property_details,
18869 Label check_in_shared_heap(
this), slow(
this), skip_barrier(
this), done(
this);
18888 BIND(&check_in_shared_heap);
18894 &skip_barrier, &slow);
18901 *var_shared_value =
18902 CallRuntime(Runtime::kSharedValueBarrierSlow, context, value);
18903 Goto(&skip_barrier);
18906 BIND(&skip_barrier);
18923 Label empty(
this), nonempty(
this), done(
this);
18931 intptr_t capacity_constant;
18937 &if_out_of_memory, &next);
18939 BIND(&if_out_of_memory);
18940 CallRuntime(Runtime::kFatalProcessOutOfMemoryInvalidArrayLength,
18950 RootIndex map_index = RootIndex::kArrayListMap;
18976 result = EmptyArrayListConstant();
18993 GotoIf(SmiGreaterThanOrEqual(capacity, requested_capacity), &done);
19004 result_array = new_array;
19017 return result_array.value();
19031 return array_with_space;
19060 GetMarkBit(BitcastTaggedToWordForTagAndSmiBits(
object), &cell, &
mask);
19096#undef CSA_DCHECK_BRANCH
#define TYPED_ARRAY_CASE(Type, type, TYPE, ctype)
#define CSA_SLOW_DCHECK(csa,...)
#define CSA_SBXCHECK(csa,...)
#define CSA_DCHECK(csa,...)
#define CSA_CHECK(csa, x)
union v8::internal::@341::BuiltinMetadata::KindSpecificData data
#define BUILTIN_CODE(isolate, name)
static constexpr U encode(T value)
static constexpr int kShift
constexpr UnderlyingType & value() &
constexpr T * begin() const
static const bool kDoHashSpreading
static const uint32_t kMaxLength
static constexpr Builtin OrdinaryToPrimitive(OrdinaryToPrimitiveHint hint)
static constexpr int kBuiltinCount
static constexpr Builtin NonPrimitiveToPrimitive(ToPrimitiveHint hint=ToPrimitiveHint::kDefault)
TNode< IntPtrT > GetLengthWithoutReceiver() const
TNode< JSAny > GetOptionalArgumentValue(TNode< IntPtrT > index, TNode< JSAny > default_value)
TNode< JSAny > AtIndex(TNode< IntPtrT > index) const
void SetReceiver(TNode< JSAny > object) const
TNode< IntPtrT > GetLengthWithReceiver() const
std::function< void(TNode< JSAny > arg)> ForEachBodyFunction
void ForEach(const ForEachBodyFunction &body, TNode< IntPtrT > first={}, TNode< IntPtrT > last={}) const
bool MayHavePaddingArguments() const
CodeStubAssembler * assembler_
void PopAndReturn(TNode< JSAny > value)
void SetArgumentValue(TNode< IntPtrT > index, TNode< JSAny > value)
TNode< RawPtrT > AtIndexPtr(TNode< IntPtrT > index) const
TNode< JSAny > GetReceiver() const
void GotoIfMapHasSlowProperties(TNode< Map > map, Label *if_slow)
TNode< CollectionType > AllocateOrderedHashTable(TNode< IntPtrT > capacity)
TNode< String > AllocateSlicedOneByteString(TNode< Uint32T > length, TNode< String > parent, TNode< Smi > offset)
TNode< IntPtrT > GetFixedArrayAllocationSize(TNode< TIndex > element_count, ElementsKind kind)
void StoreIndirectPointerFieldNoWriteBarrier(TNode< HeapObject > object, int offset, IndirectPointerTag tag, TNode< ExposedTrustedObject > value)
TNode< Object > LoadProtectedPointerField(TNode< TrustedObject > object, TNode< IntPtrT > offset)
TNode< BoolT > IsFunctionInstanceType(TNode< Int32T > instance_type)
TNode< IntPtrT > IntPtrRoundUpToPowerOfTwo32(TNode< IntPtrT > value)
std::function< TNode< T >()> NodeGenerator
TNode< IntPtrT > MemoryChunkFromAddress(TNode< IntPtrT > address)
TNode< Float64T > Float64RoundToEven(TNode< Float64T > x)
TNode< Number > SmiMod(TNode< Smi > a, TNode< Smi > b)
TNode< BoolT > IsFixedArrayWithKindOrEmpty(TNode< FixedArrayBase > object, ElementsKind kind)
void GotoIfNumberGreaterThanOrEqual(TNode< Number > left, TNode< Number > right, Label *if_false)
TNode< BoolT > IsUniqueNameNoIndex(TNode< HeapObject > object)
TNode< BoolT > IsJSArrayInstanceType(TNode< Int32T > instance_type)
TNode< BoolT > IsJSObject(TNode< HeapObject > object)
TNode< BoolT > IsSequentialStringMap(TNode< Map > map)
void TaggedToWord32OrBigIntWithFeedback(TNode< Context > context, TNode< Object > value, Label *if_number, TVariable< Word32T > *var_word32, Label *if_bigint, Label *if_bigint64, TVariable< BigInt > *var_maybe_bigint, const FeedbackValues &feedback)
TNode< String > AllocateSeqOneByteString(uint32_t length, AllocationFlags flags=AllocationFlag::kNone)
TNode< JSArray > AllocateJSArray(ElementsKind kind, TNode< Map > array_map, TNode< IntPtrT > capacity, TNode< Smi > length, std::optional< TNode< AllocationSite > > allocation_site, AllocationFlags allocation_flags=AllocationFlag::kNone)
TNode< Uint32T > SwissNameDictionaryIncreaseElementCountOrBailout(TNode< ByteArray > meta_table, TNode< IntPtrT > capacity, TNode< Uint32T > max_usable_capacity, Label *bailout)
TNode< Int32T > SmiShiftBitsConstant32()
TNode< BoolT > IsElementsKindInRange(TNode< Int32T > target_kind, ElementsKind lower_reference_kind, ElementsKind higher_reference_kind)
TNode< UintPtrT > UintPtrMin(TNode< UintPtrT > left, TNode< UintPtrT > right)
TNode< BoolT > IsUndetectableMap(TNode< Map > map)
TNode< Int32T > TryFloat64ToInt32(TNode< Float64T > number, Label *if_failed)
TNode< BoolT > IsJSFunctionWithPrototypeSlot(TNode< HeapObject > object)
TNode< Int32T > LoadNumberOfOwnDescriptors(TNode< Map > map)
TNode< BoolT > IsBoolean(TNode< HeapObject > object)
TNode< Word32T > IsStringWrapperElementsKind(TNode< Map > map)
TNode< MaybeObject > LoadFieldTypeByDescriptorEntry(TNode< DescriptorArray > descriptors, TNode< IntPtrT > descriptor)
TNode< WordT > TimesTaggedSize(TNode< WordT > value)
void FailAssert(const char *message, const std::vector< FileAndLine > &files_and_lines, std::initializer_list< ExtraNode > extra_nodes={}, const SourceLocation &loc=SourceLocation::Current())
TNode< Smi > TryHeapNumberToSmi(TNode< HeapNumber > number, Label *not_smi)
TNode< IntPtrT > LoadAndUntagFixedArrayBaseLength(TNode< FixedArrayBase > array)
void BuildFastArrayForEach(TNode< UnionOf< FixedArray, PropertyArray, HeapObject > > array, ElementsKind kind, TNode< TIndex > first_element_inclusive, TNode< TIndex > last_element_exclusive, const FastArrayForEachBody &body, LoopUnrollingMode loop_unrolling_mode, ForEachDirection direction=ForEachDirection::kReverse)
TNode< Smi > ArrayListGetLength(TNode< ArrayList > array)
TNode< Smi > SmiFromInt32(TNode< Int32T > value)
TNode< IntPtrT > SwissNameDictionaryOffsetIntoPropertyDetailsTableMT(TNode< SwissNameDictionary > dict, TNode< IntPtrT > capacity, TNode< IntPtrT > index)
void PrintErr(const char *s)
void TryLookupPropertyInSimpleObject(TNode< JSObject > object, TNode< Map > map, TNode< Name > unique_name, Label *if_found_fast, Label *if_found_dict, TVariable< HeapObject > *var_meta_storage, TVariable< IntPtrT > *var_name_index, Label *if_not_found, Label *bailout)
TNode< BoolT > IsGeneratorFunction(TNode< JSFunction > function)
TNode< BoolT > IsInternalizedStringInstanceType(TNode< Int32T > instance_type)
void SetSupportsDynamicParameterCount(TNode< JSFunction > callee, TNode< JSDispatchHandleT > dispatch_handle)
TNode< Object > LoadPropertyArrayElement(TNode< PropertyArray > object, TNode< IntPtrT > index)
void BranchIfJSReceiver(TNode< Object > object, Label *if_true, Label *if_false)
TNode< BoolT > IsNullOrUndefined(TNode< Object > object)
void NameDictionaryLookupWithForwardIndex(TNode< Dictionary > dictionary, TNode< Name > unique_name, Label *if_found, TVariable< IntPtrT > *var_name_index, Label *if_not_found, LookupMode mode=kFindExisting)
TNode< Name > LoadKeyByDescriptorEntry(TNode< DescriptorArray > descriptors, TNode< IntPtrT > descriptor)
TNode< FixedArrayBase > AllocateFixedArray(ElementsKind kind, TNode< TIndex > capacity, AllocationFlags flags=AllocationFlag::kNone, std::optional< TNode< Map > > fixed_array_map=std::nullopt)
TNode< Object > GetCoverageInfo(TNode< SharedFunctionInfo > sfi)
TNode< BoolT > IsJSGlobalProxy(TNode< HeapObject > object)
TNode< Number > ChangeInt32ToTagged(TNode< Int32T > value)
void InitializeAllocationMemento(TNode< HeapObject > base, TNode< IntPtrT > base_allocation_size, TNode< AllocationSite > allocation_site)
TNode< BoolT > IsJSTypedArrayMap(TNode< Map > map)
TNode< Smi > TryFloat32ToSmi(TNode< Float32T > number, Label *not_smi)
TNode< Uint32T > LoadNameHash(TNode< Name > name, Label *if_hash_not_computed=nullptr)
TNode< BoolT > IsConstructor(TNode< HeapObject > object)
@ kAllFixedArraysDontCopyCOW
TNode< BoolT > IsNumberNonNegativeSafeInteger(TNode< Number > number)
TNode< Number > ChangeUintPtrToTagged(TNode< UintPtrT > value)
TNode< Int32T > LoadNumberOfDescriptors(TNode< DescriptorArray > array)
TNode< BoolT > IsJSSharedStruct(TNode< HeapObject > object)
TNode< Number > NonNumberToNumber(TNode< Context > context, TNode< HeapObject > input, BigIntHandling bigint_handling=BigIntHandling::kThrow)
TNode< IntPtrT > TryToIntptr(TNode< Object > key, Label *if_not_intptr, TVariable< Int32T > *var_instance_type=nullptr)
TNode< Int32T > LoadMapBitField2(TNode< Map > map)
TNode< BoolT > IsRegExpSpeciesProtectorCellInvalid()
void Check(const BranchGenerator &branch, const char *message, const char *file, int line, std::initializer_list< ExtraNode > extra_nodes={}, const SourceLocation &loc=SourceLocation::Current())
TNode< BoolT > IsCallableMap(TNode< Map > map)
TNode< Smi > GetNumberOfElements(TNode< Dictionary > dictionary)
TNode< BoolT > IsPrimitiveInstanceType(TNode< Int32T > instance_type)
TNode< BoolT > IsPropertyArray(TNode< HeapObject > object)
TNode< IntPtrT > DescriptorEntryToIndex(TNode< IntPtrT > descriptor)
TNode< BoolT > IsPromiseSpeciesProtectorCellInvalid()
TNode< BoolT > IsJSObjectMap(TNode< Map > map)
void NameDictionaryLookup(TNode< Dictionary > dictionary, TNode< Name > unique_name, Label *if_found, TVariable< IntPtrT > *var_name_index, Label *if_not_found, LookupMode mode=kFindExisting)
TNode< Float16RawBitsT > TruncateFloat64ToFloat16(TNode< Float64T > value)
TNode< FixedArrayBase > GrowElementsCapacity(TNode< HeapObject > object, TNode< FixedArrayBase > elements, ElementsKind from_kind, ElementsKind to_kind, TNode< TIndex > capacity, TNode< TIndex > new_capacity, Label *bailout)
TNode< BoolT > IsNumberStringNotRegexpLikeProtectorCellInvalid()
TNode< BoolT > IsJSApiObjectInstanceType(TNode< Int32T > instance_type)
TNode< Float64T > TryTaggedToFloat64(TNode< Object > value, Label *if_valueisnotnumber)
void ClearTrustedPointerField(TNode< HeapObject > object, int offset)
TNode< BoolT > IsIsolatePromiseHookEnabledOrHasAsyncEventDelegate()
TNode< BoolT > IsEqualInWord32(TNode< Word32T > word32, typename BitField::FieldType value)
TNode< Float64T > Float64Round(TNode< Float64T > x)
TNode< SwissNameDictionary > CopySwissNameDictionary(TNode< SwissNameDictionary > original)
TNode< IntPtrT > TryIntPtrDiv(TNode< IntPtrT > a, TNode< IntPtrT > b, Label *if_div_zero)
TNode< HeapNumber > AllocateHeapNumber()
TNode< Numeric > LoadFixedTypedArrayElementAsTagged(TNode< RawPtrT > data_pointer, TNode< UintPtrT > index, ElementsKind elements_kind)
void InsertEntry(TNode< Dictionary > dictionary, TNode< Name > key, TNode< Object > value, TNode< IntPtrT > index, TNode< Smi > enum_index)
TNode< WordT > UpdateWord(TNode< WordT > word, TNode< UintPtrT > value, bool starts_as_zero=false)
TNode< IntPtrT > LoadAndUntagPositiveSmiObjectField(TNode< HeapObject > object, int offset)
void FillPropertyArrayWithUndefined(TNode< PropertyArray > array, TNode< IntPtrT > from_index, TNode< IntPtrT > to_index)
TNode< BoolT > IsJSBoundFunction(TNode< HeapObject > object)
void StoreSandboxedPointerToObject(TNode< HeapObject > object, int offset, TNode< RawPtrT > pointer)
TNode< BigInt > ToBigIntConvertNumber(TNode< Context > context, TNode< Object > input)
void Print(const char *s)
TNode< Int32T > LoadBytecodeArrayParameterCount(TNode< BytecodeArray > bytecode_array)
TNode< BoolT > IsSpecialReceiverMap(TNode< Map > map)
TNode< BoolT > IsStrong(TNode< MaybeObject > value)
TNode< Int32T > LoadHeapInt32Value(TNode< HeapObject > object)
TNode< Int32T > TruncateIntPtrToInt32(TNode< IntPtrT > value)
void SetPendingMessage(TNode< Union< Hole, JSMessageObject > > message)
TNode< Smi > LoadFixedArrayBaseLength(TNode< FixedArrayBase > array)
std::function< void( TNode< JSAnyNotSmi > receiver, TNode< JSAnyNotSmi > holder, TNode< Map > map, TNode< Int32T > instance_type, TNode< IntPtrT > key, Label *next_holder, Label *if_bailout)> LookupElementInHolder
TNode< BoolT > IsJSReceiverMap(TNode< Map > map)
void CopyPropertyArrayValues(TNode< HeapObject > from_array, TNode< PropertyArray > to_array, TNode< IntPtrT > length, WriteBarrierMode barrier_mode, DestroySource destroy_source)
TNode< Uint32T > LoadDetailsByKeyIndex(TNode< ContainerType > container, TNode< IntPtrT > key_index)
TNode< IntPtrT > LoadMapInobjectPropertiesStartInWords(TNode< Map > map)
TNode< IntPtrT > LoadFeedbackVectorLength(TNode< FeedbackVector >)
TNode< BoolT > IsEphemeronHashTable(TNode< HeapObject > object)
TNode< Map > LoadSlowObjectWithNullPrototypeMap(TNode< NativeContext > native_context)
TNode< BoolT > IsOddballInstanceType(TNode< Int32T > instance_type)
TNode< JSDispatchHandleT > InvalidDispatchHandleConstant()
TNode< ArrayList > ArrayListEnsureSpace(TNode< ArrayList > array, TNode< Smi > length)
TNode< BoolT > IsMegaDOMProtectorCellInvalid()
void StoreCellValue(TNode< Cell > cell, TNode< Object > value, WriteBarrierMode mode=UPDATE_WRITE_BARRIER)
TNode< JSAny > BasicLoadNumberDictionaryElement(TNode< NumberDictionary > dictionary, TNode< IntPtrT > intptr_index, Label *not_data, Label *if_hole)
std::function< void(TNode< TIndex > index)> FastLoopBody
TNode< IntPtrT > ParameterToIntPtr(TNode< Smi > value)
TNode< Object > LoadValueByDescriptorEntry(TNode< DescriptorArray > descriptors, TNode< IntPtrT > descriptor)
void Dcheck(const BranchGenerator &branch, const char *message, const char *file, int line, std::initializer_list< ExtraNode > extra_nodes={}, const SourceLocation &loc=SourceLocation::Current())
TNode< Numeric > NonNumberToNumeric(TNode< Context > context, TNode< HeapObject > input)
TNode< IntPtrT > EntryIndexToIndex(TNode< Uint32T > entry_index)
TNode< BoolT > IsUncachedExternalStringMap(TNode< Map > map)
void ThrowIfNotInstanceType(TNode< Context > context, TNode< Object > value, InstanceType instance_type, char const *method_name)
void ThrowIfNotCallable(TNode< Context > context, TNode< Object > value, const char *method_name)
TNode< BoolT > IsPrototypeInitialArrayPrototype(TNode< Context > context, TNode< Map > map)
TNode< BigInt > AllocateBigInt(TNode< IntPtrT > length)
void FindInsertionEntry(TNode< Dictionary > dictionary, TNode< Name > key, TVariable< IntPtrT > *var_key_index)
TNode< A > SelectConstant(TNode< BoolT > condition, TNode< A > true_value, TNode< A > false_value)
void FillEntireFixedArrayWithSmiZero(ElementsKind kind, TNode< FixedArray > array, TNode< IntPtrT > length)
TNode< Smi > TaggedIndexToSmi(TNode< TaggedIndex > value)
TNode< BoolT > IsPrivateName(TNode< Symbol > symbol)
TNode< BoolT > InstanceTypeEqual(TNode< Int32T > instance_type, int type)
void StoreFieldsNoWriteBarrier(TNode< IntPtrT > start_address, TNode< IntPtrT > end_address, TNode< Object > value)
TNode< Int32T > LoadAndUntagToWord32ArrayElement(TNode< Array > array, int array_header_size, TNode< IntPtrT > index, int additional_offset=0)
TNode< BoolT > IsFastElementsKind(TNode< Int32T > elements_kind)
TNode< RawPtrT > EmptyBackingStoreBufferConstant()
TNode< BoolT > IsExtensibleMap(TNode< Map > map)
void SwissNameDictionarySetCtrl(TNode< SwissNameDictionary > table, TNode< IntPtrT > capacity, TNode< IntPtrT > entry, TNode< Uint8T > ctrl)
TNode< BoolT > IsSequentialString(TNode< HeapObject > object)
TNode< RawPtrT > LoadJSTypedArrayExternalPointerPtr(TNode< JSTypedArray > holder)
void FillFixedDoubleArrayWithZero(TNode< FixedDoubleArray > array, TNode< IntPtrT > start, TNode< IntPtrT > length)
TNode< BoolT > IsFastSmiOrTaggedElementsKind(TNode< Int32T > elements_kind)
TNode< BoolT > IsSymbolInstanceType(TNode< Int32T > instance_type)
TNode< Uint32T > PositiveSmiToUint32(TNode< Smi > value)
TNode< Smi > LoadSharedFunctionInfoBuiltinId(TNode< SharedFunctionInfo > sfi)
void StoreFixedArrayElement(TNode< FixedArray > object, int index, TNode< Object > value, WriteBarrierMode barrier_mode=UPDATE_WRITE_BARRIER, CheckBounds check_bounds=CheckBounds::kAlways)
TNode< Name > LoadSwissNameDictionaryKey(TNode< SwissNameDictionary > dict, TNode< IntPtrT > entry)
TNode< DescriptorArray > LoadMapDescriptors(TNode< Map > map)
TNode< BoolT > IsIndirectStringInstanceType(TNode< Int32T > instance_type)
TNode< HeapObject > LoadSlowProperties(TNode< JSReceiver > object)
TNode< Object > UnsafeLoadFixedArrayElement(TNode< FixedArray > object, TNode< IntPtrT > index, int additional_offset=0)
friend class CodeStubArguments
TNode< BoolT > IsIsConcatSpreadableProtectorCellInvalid()
TNode< HeapObject > AllocateInNewSpace(TNode< IntPtrT > size, AllocationFlags flags=AllocationFlag::kNone)
TNode< BoolT > IsFastOrNonExtensibleOrSealedElementsKind(TNode< Int32T > elements_kind)
TNode< BoolT > IsSeqOneByteStringMap(TNode< Map > map)
TNode< TrustedObject > LoadTrustedPointerFromObject(TNode< HeapObject > object, int offset, IndirectPointerTag tag)
TNode< JSArray > ExtractFastJSArray(TNode< Context > context, TNode< JSArray > array, TNode< BInt > begin, TNode< BInt > count)
TNode< BoolT > IsJSReceiver(TNode< HeapObject > object)
TNode< Smi > RefillMathRandom(TNode< NativeContext > native_context)
TNode< Numeric > ToNumberOrNumeric(LazyNode< Context > context, TNode< Object > input, TVariable< Smi > *var_type_feedback, Object::Conversion mode, BigIntHandling bigint_handling=BigIntHandling::kThrow)
TNode< Float16RawBitsT > RoundInt32ToFloat16(TNode< Int32T > value)
TNode< Float64T > Float64Floor(TNode< Float64T > x)
TNode< SwissNameDictionary > AllocateSwissNameDictionary(TNode< IntPtrT > at_least_space_for)
TNode< BoolT > IsRegularHeapObjectSize(TNode< IntPtrT > size)
TNode< Int32T > CountLeadingZeros32(TNode< Word32T > value)
TNode< Object > LoadMapConstructor(TNode< Map > map)
void FillEntireFixedDoubleArrayWithZero(TNode< FixedDoubleArray > array, TNode< IntPtrT > length)
TNode< BoolT > IsDebugActive()
TNode< Number > ChangeFloat64ToTagged(TNode< Float64T > value)
TNode< Smi > GetNameDictionaryFlags(TNode< Dictionary > dictionary)
TNode< Smi > SmiFromIntPtr(TNode< IntPtrT > value)
void StoreFixedArrayOrPropertyArrayElement(TNode< UnionOf< FixedArray, PropertyArray > > array, TNode< TIndex > index, TNode< Object > value, WriteBarrierMode barrier_mode=UPDATE_WRITE_BARRIER, int additional_offset=0)
TNode< Smi > TrySmiSub(TNode< Smi > a, TNode< Smi > b, Label *if_overflow)
TNode< BoolT > DoesntHaveInstanceType(TNode< HeapObject > object, InstanceType type)
void UnsafeStoreObjectFieldNoWriteBarrier(TNode< HeapObject > object, int offset, TNode< Object > value)
TNode< IntPtrT > MapUsedInObjectProperties(TNode< Map > map)
void InitializeFieldsWithRoot(TNode< HeapObject > object, TNode< IntPtrT > start_offset, TNode< IntPtrT > end_offset, RootIndex root)
TNode< BoolT > IsUncachedExternalStringInstanceType(TNode< Int32T > instance_type)
void ThrowRangeError(TNode< Context > context, MessageTemplate message, std::optional< TNode< Object > > arg0=std::nullopt, std::optional< TNode< Object > > arg1=std::nullopt, std::optional< TNode< Object > > arg2=std::nullopt)
TNode< BoolT > FixedArraySizeDoesntFitInNewSpace(TNode< TIndex > element_count, int base_size)
void ThrowTypeError(TNode< Context > context, MessageTemplate message, char const *arg0=nullptr, char const *arg1=nullptr)
TNode< BoolT > IsFunctionWithPrototypeSlotMap(TNode< Map > map)
TNode< BoolT > IsMarked(TNode< Object > object)
TNode< BoolT > IsSloppyArgumentsMap(TNode< Context > context, TNode< Map > map)
void DecrementCounter(StatsCounter *counter, int delta)
void TrySkipWriteBarrier(TNode< Object > object, Label *if_needs_write_barrier)
TNode< JSReceiver > ToObject_Inline(TNode< Context > context, TNode< Object > input)
TNode< Context > LoadModuleContext(TNode< Context > context)
void GotoIfForceSlowPath(Label *if_true)
TNode< UintPtrT > DecodeWord(TNode< WordT > word)
TNode< BoolT > LoadScopeInfoHasExtensionField(TNode< ScopeInfo > scope_info)
TNode< Object > LoadMapBackPointer(TNode< Map > map)
void StringWriteToFlatTwoByte(TNode< String > source, TNode< RawPtrT > sink, TNode< Int32T > start, TNode< Int32T > length)
bool TryGetIntPtrOrSmiConstantValue(TNode< Smi > maybe_constant, int *value)
TNode< IntPtrT > TryIntPtrMod(TNode< IntPtrT > a, TNode< IntPtrT > b, Label *if_div_zero)
TNode< BoolT > TaggedIsCode(TNode< Object > object)
TNode< String > StringFromSingleCharCode(TNode< Int32T > code)
TNode< Smi > SmiTag(TNode< IntPtrT > value)
TNode< Number > ChangeInt32ToTaggedNoOverflow(TNode< Int32T > value)
TNode< BoolT > IsArrayIteratorProtectorCellInvalid()
void Increment(TVariable< TIndex > *variable, int value=1)
void SetNameDictionaryFlags(TNode< Dictionary >, TNode< Smi > flags)
@ kCallJSGetterUseCachedName
TNode< BoolT > IsWeakReferenceTo(TNode< MaybeObject > maybe_object, TNode< HeapObject > heap_object)
TNode< JSReceiver > ToObject(TNode< Context > context, TNode< Object > input)
TNode< Smi > UnsignedSmiShl(TNode< Smi > a, int shift)
TNode< Smi > NormalizeSmiIndex(TNode< Smi > smi_index)
void SetNextEnumerationIndex(TNode< Dictionary > dictionary, TNode< Smi > next_enum_index_smi)
TNode< Float32T > ChangeFloat16ToFloat32(TNode< Float16RawBitsT > value)
TNode< BoolT > IsJSPrimitiveWrapperMap(TNode< Map > map)
TNode< Smi > SmiFromUint32(TNode< Uint32T > value)
TNode< BoolT > IsSafeInteger(TNode< Object > number)
TNode< Word32T > UpdateWord32(TNode< Word32T > word, TNode< Uint32T > value, bool starts_as_zero=false)
TNode< BoolT > WordIsAligned(TNode< WordT > word, size_t alignment)
TNode< Object > LoadSharedFunctionInfoTrustedData(TNode< SharedFunctionInfo > sfi)
TNode< Smi > LoadSmiArrayLength(TNode< Array > array)
void PrintToStream(const char *s, int stream)
TNode< Smi > SmiLexicographicCompare(TNode< Smi > x, TNode< Smi > y)
TNode< Code > LoadCodePointerFromObject(TNode< HeapObject > object, int offset)
TNode< BoolT > IsNumberPositive(TNode< Number > number)
TNode< BoolT > TaggedEqual(TNode< AnyTaggedT > a, TNode< AnyTaggedT > b)
TNode< HeapObject > Allocate(TNode< IntPtrT > size, AllocationFlags flags=AllocationFlag::kNone)
void StoreObjectFieldRoot(TNode< HeapObject > object, int offset, RootIndex root)
void CombineFeedback(TVariable< Smi > *existing_feedback, int feedback)
TNode< FixedArrayBase > LoadElements(TNode< JSObject > object)
void StoreExternalPointerToObject(TNode< HeapObject > object, int offset, TNode< RawPtrT > pointer, ExternalPointerTag tag)
TNode< T > LoadObjectField(TNode< HeapObject > object, int offset)
TNode< Int64T > PopulationCount64(TNode< Word64T > value)
TNode< NameDictionary > AllocateNameDictionary(int at_least_space_for)
TNode< ScopeInfo > LoadScopeInfo(TNode< Context > context)
TNode< IntPtrT > LoadSwissNameDictionaryNumberOfDeletedElements(TNode< SwissNameDictionary > table, TNode< IntPtrT > capacity)
TNode< BoolT > IsJSSharedArrayInstanceType(TNode< Int32T > instance_type)
TNode< HeapObject > AllocateRawUnaligned(TNode< IntPtrT > size_in_bytes, AllocationFlags flags, TNode< RawPtrT > top_address, TNode< RawPtrT > limit_address)
TNode< BoolT > IsSeqOneByteStringInstanceType(TNode< Int32T > instance_type)
TNode< BoolT > IsElementsKindGreaterThanOrEqual(TNode< Int32T > target_kind, ElementsKind reference_kind)
TNode< BoolT > IsNotSetWord32(TNode< Word32T > word32)
TNode< BoolT > IsJSFunction(TNode< HeapObject > object)
TNode< Object > GetContinuationPreservedEmbedderData()
TNode< BoolT > TaggedNotEqual(TNode< AnyTaggedT > a, TNode< AnyTaggedT > b)
TNode< UintPtrT > LoadBigIntDigit(TNode< BigInt > bigint, intptr_t digit_index)
void TaggedPointerToWord32OrBigIntWithFeedback(TNode< Context > context, TNode< HeapObject > pointer, Label *if_number, TVariable< Word32T > *var_word32, Label *if_bigint, Label *if_bigint64, TVariable< BigInt > *var_maybe_bigint, const FeedbackValues &feedback)
TNode< IntPtrT > IntPtrMin(TNode< IntPtrT > left, TNode< IntPtrT > right)
TNode< Int32T > ChangeBoolToInt32(TNode< BoolT > b)
TNode< Uint32T > LoadMapBitField3(TNode< Map > map)
TNode< BoolT > HasSharedStringTableFlag()
TNode< BoolT > TaggedIsNotSmi(TNode< MaybeObject > a)
TNode< Uint32T > LoadAndUntagBytecodeArrayLength(TNode< BytecodeArray > array)
TNode< HeapNumber > AllocateHeapInt32WithValue(TNode< Int32T > value)
TNode< BoolT > IsStrictArgumentsMap(TNode< Context > context, TNode< Map > map)
TNode< IntPtrT > GetArrayAllocationSize(TNode< TIndex > element_count, ElementsKind kind, int header_size)
TNode< BoolT > TaggedIsCallable(TNode< Object > object)
TNode< String > ToString_Inline(TNode< Context > context, TNode< Object > input)
void CopyRange(TNode< HeapObject > dst_object, int dst_offset, TNode< HeapObject > src_object, int src_offset, TNode< IntPtrT > length_in_tagged, WriteBarrierMode mode=UPDATE_WRITE_BARRIER)
TNode< BoolT > IsDoubleElementsKind(TNode< Int32T > elements_kind)
void FixedArrayBoundsCheck(TNode< FixedArrayBase > array, TNode< Smi > index, int additional_offset)
TNode< JSFunction > AllocateRootFunctionWithContext(RootIndex function, TNode< Context > context, std::optional< TNode< NativeContext > > maybe_native_context)
void TryToName(TNode< Object > key, Label *if_keyisindex, TVariable< IntPtrT > *var_index, Label *if_keyisunique, TVariable< Name > *var_unique, Label *if_bailout, Label *if_notinternalized=nullptr)
TNode< UintPtrT > LoadBoundedSizeFromObject(TNode< HeapObject > object, int offset)
TNode< BoolT > TaggedIsPositiveSmi(TNode< Object > a)
TNode< IntPtrT > IntPtrMax(TNode< IntPtrT > left, TNode< IntPtrT > right)
void StoreFeedbackVectorSlot(TNode< FeedbackVector > feedback_vector, TNode< UintPtrT > slot, TNode< AnyTaggedT > value, WriteBarrierMode barrier_mode=UPDATE_WRITE_BARRIER, int additional_offset=0)
TNode< String > ToThisString(TNode< Context > context, TNode< Object > value, TNode< String > method_name)
void GotoIfPrototypeRequiresRuntimeLookup(TNode< JSFunction > function, TNode< Map > map, Label *runtime)
bool ToParameterConstant(TNode< Smi > node, intptr_t *out)
TNode< BoolT > IsJSRegExpStringIterator(TNode< HeapObject > object)
TNode< Smi > LoadStringLengthAsSmi(TNode< String > string)
CodeStubAssembler(compiler::CodeAssemblerState *state)
TNode< IntPtrT > ToKeyIndex(TNode< Uint32T > entry_index)
void StoreFixedDoubleArrayElement(TNode< FixedDoubleArray > object, TNode< TIndex > index, TNode< Float64T > value, CheckBounds check_bounds=CheckBounds::kAlways)
TNode< IntPtrT > ChangePositiveInt32ToIntPtr(TNode< Int32T > input)
TNode< BoolT > WordIsPowerOfTwo(TNode< IntPtrT > value)
TNode< Name > GetKey(TNode< Array > array, TNode< Uint32T > entry_index)
TNode< Number > ChangeUint32ToTagged(TNode< Uint32T > value)
TNode< BoolT > IsSharedStringInstanceType(TNode< Int32T > instance_type)
TNode< IntPtrT > TryIntPtrSub(TNode< IntPtrT > a, TNode< IntPtrT > b, Label *if_overflow)
TNode< Uint32T > GetSortedKeyIndex(TNode< Array > descriptors, TNode< Uint32T > entry_index)
void UnsafeStoreArrayElement(TNode< Array > object, int index, TNode< typename Array::Shape::ElementT > value, WriteBarrierMode barrier_mode=UPDATE_WRITE_BARRIER)
TNode< Number > StringToNumber(TNode< String > input)
TNode< Cell > AllocateCellWithValue(TNode< Object > value, WriteBarrierMode mode=UPDATE_WRITE_BARRIER)
TNode< JSArray > AllocateUninitializedJSArray(TNode< Map > array_map, TNode< Smi > length, std::optional< TNode< AllocationSite > > allocation_site, TNode< IntPtrT > size_in_bytes)
TNode< Smi > GetNumberOfDeletedElements(TNode< Dictionary > dictionary)
TNode< Code > GetSharedFunctionInfoCode(TNode< SharedFunctionInfo > shared_info, TVariable< Uint16T > *data_type_out=nullptr, Label *if_compile_lazy=nullptr)
TNode< Uint32T > DescriptorArrayGetDetails(TNode< DescriptorArray > descriptors, TNode< Uint32T > descriptor_number)
TNode< Object > CallRuntimeNewArray(TNode< Context > context, TNode< JSAny > receiver, TNode< Object > length, TNode< Object > new_target, TNode< Object > allocation_site)
TNode< BigInt > BigIntFromUint64(TNode< UintPtrT > value)
TNode< IntPtrT > LoadMemoryChunkFlags(TNode< HeapObject > object)
TNode< BoolT > IsUniqueName(TNode< HeapObject > object)
void TryPlainPrimitiveNonNumberToNumber(TNode< HeapObject > input, TVariable< Number > *var_result, Label *if_bailout)
TNode< IntPtrT > LoadSwissNameDictionaryNumberOfElements(TNode< SwissNameDictionary > table, TNode< IntPtrT > capacity)
TNode< Code > LoadBuiltin(TNode< Smi > builtin_id)
TNode< BoolT > IsZeroOrContext(TNode< Object > object)
std::pair< TNode< JSArray >, TNode< FixedArrayBase > > AllocateUninitializedJSArrayWithElements(ElementsKind kind, TNode< Map > array_map, TNode< Smi > length, std::optional< TNode< AllocationSite > > allocation_site, TNode< IntPtrT > capacity, AllocationFlags allocation_flags=AllocationFlag::kNone, int array_header_size=JSArray::kHeaderSize)
TNode< FixedArray > ArrayListElements(TNode< ArrayList > array)
TNode< Uint32T > LoadDetailsByDescriptorEntry(TNode< DescriptorArray > descriptors, TNode< IntPtrT > descriptor)
TNode< JSAny > GetArgumentValue(TorqueStructArguments args, TNode< IntPtrT > index)
TNode< AdditiveSafeIntegerT > TryFloat64ToAdditiveSafeInteger(TNode< Float64T > number, Label *if_failed)
TNode< Uint32T > BitcastFloat16ToUint32(TNode< Float16RawBitsT > value)
TNode< Number > NumberMin(TNode< Number > left, TNode< Number > right)
TNode< UintPtrT > ArrayBufferMaxByteLength()
TNode< RawPtrT > LoadExternalPointerFromObject(TNode< HeapObject > object, int offset, ExternalPointerTagRange tag_range)
void LookupLinear(TNode< Name > unique_name, TNode< Array > array, TNode< Uint32T > number_of_valid_entries, Label *if_found, TVariable< IntPtrT > *var_name_index, Label *if_not_found)
TNode< BoolT > IsWeakOrCleared(TNode< MaybeObject > value)
void DcheckHasValidMap(TNode< HeapObject > object)
TNode< BoolT > IsTemporalInstantInstanceType(TNode< Int32T > instance_type)
void StoreValueByKeyIndex(TNode< ContainerType > container, TNode< IntPtrT > key_index, TNode< Object > value, WriteBarrierMode write_barrier=UPDATE_WRITE_BARRIER)
TNode< Number > ToNumber_Inline(TNode< Context > context, TNode< Object > input)
void TryInternalizeString(TNode< String > string, Label *if_index, TVariable< IntPtrT > *var_index, Label *if_internalized, TVariable< Name > *var_internalized, Label *if_not_internalized, Label *if_bailout)
TNode< Uint16T > StringCharCodeAt(TNode< String > string, TNode< UintPtrT > index)
TNode< BoolT > IsFastPackedElementsKind(TNode< Int32T > elements_kind)
TNode< BoolT > IsJSDataView(TNode< HeapObject > object)
TNode< Smi > LoadWeakFixedArrayLength(TNode< WeakFixedArray > array)
TNode< Smi > TrySmiAbs(TNode< Smi > a, Label *if_overflow)
void BranchIfNumberRelationalComparison(Operation op, TNode< Number > left, TNode< Number > right, Label *if_true, Label *if_false)
TNode< JSPrototype > LoadMapPrototype(TNode< Map > map)
TNode< IntPtrT > LoadPropertyArrayLength(TNode< PropertyArray > object)
void SetNumberOfElements(TNode< Dictionary > dictionary, TNode< Smi > num_elements_smi)
TNode< BoolT > IsNameInstanceType(TNode< Int32T > instance_type)
TNode< BoolT > IsSetWord32(TNode< Word32T > word32)
TNode< Int32T > ChangeTaggedNonSmiToInt32(TNode< Context > context, TNode< HeapObject > input)
TNode< ArrayList > ArrayListAdd(TNode< ArrayList > array, TNode< Object > object)
TNode< BoolT > IsJSApiObjectMap(TNode< Map > map)
TNode< BoolT > IsHeapNumberInstanceType(TNode< Int32T > instance_type)
void SwissNameDictionaryFindEntry(TNode< SwissNameDictionary > table, TNode< Name > key, Label *found, TVariable< IntPtrT > *var_found_entry, Label *not_found)
TNode< RawPtr< Uint8T > > ExternalOneByteStringGetChars(TNode< ExternalOneByteString > string)
TNode< BoolT > IsSetIteratorProtectorCellInvalid()
TNode< Uint32T > LoadJSReceiverIdentityHash(TNode< JSReceiver > receiver, Label *if_no_hash=nullptr)
TNode< HeapObject > LoadFastProperties(TNode< JSReceiver > object, bool skip_empty_check=false)
TNode< BInt > BIntConstant(int value)
void StoreCodePointerFieldNoWriteBarrier(TNode< HeapObject > object, int offset, TNode< Code > value)
TNode< IntPtrT > SmiUntag(TNode< Smi > value)
void GetMarkBit(TNode< IntPtrT > object, TNode< IntPtrT > *cell, TNode< IntPtrT > *mask)
TNode< Map > LoadJSArrayElementsMap(ElementsKind kind, TNode< NativeContext > native_context)
TNode< BoolT > IsDeprecatedMap(TNode< Map > map)
TNode< BoolT > IsAnyPromiseHookEnabled()
TNode< BoolT > IsJSGeneratorObject(TNode< HeapObject > object)
TNode< BoolT > IsNoElementsProtectorCellInvalid()
void TailCallRuntimeNewArray(TNode< Context > context, TNode< JSAny > receiver, TNode< Object > length, TNode< Object > new_target, TNode< Object > allocation_site)
TNode< BoolT > IsIsolatePromiseHookEnabledOrDebugIsActiveOrHasAsyncEventDelegate()
TNode< BoolT > IsNotCleared(TNode< MaybeObject > value)
TNode< BoolT > IsAllSetWord32(TNode< Word32T > word32, uint32_t mask)
void CopyFixedArrayElements(ElementsKind kind, TNode< FixedArrayBase > from_array, TNode< FixedArrayBase > to_array, TNode< TIndex > length, WriteBarrierMode barrier_mode=UPDATE_WRITE_BARRIER)
TNode< BoolT > IsJSFunctionMap(TNode< Map > map)
TNode< BoolT > IsJSPrimitiveWrapperInstanceType(TNode< Int32T > instance_type)
TNode< RawPtrT > LoadJSTypedArrayDataPtr(TNode< JSTypedArray > typed_array)
TNode< BytecodeArray > LoadSharedFunctionInfoBytecodeArray(TNode< SharedFunctionInfo > sfi)
TNode< BoolT > IsHoleInstanceType(TNode< Int32T > instance_type)
TNode< BoolT > IsName(TNode< HeapObject > object)
void InitializeJSObjectBodyWithSlackTracking(TNode< HeapObject > object, TNode< Map > map, TNode< IntPtrT > instance_size)
TNode< BoolT > IsGlobalDictionary(TNode< HeapObject > object)
TNode< BoolT > IsPromiseThenProtectorCellInvalid()
TNode< BigInt > BigIntFromInt64(TNode< IntPtrT > value)
TNode< Uint16T > Uint16Constant(uint16_t t)
void StoreHeapInt32Value(TNode< HeapObject > object, TNode< Int32T > value)
TNode< BoolT > IsJSApiObject(TNode< HeapObject > object)
TNode< BoolT > IsJSGlobalProxyMap(TNode< Map > map)
void FillFixedArrayWithSmiZero(ElementsKind kind, TNode< FixedArray > array, TNode< IntPtrT > start, TNode< IntPtrT > length)
TNode< Int32T > SelectInt32Constant(TNode< BoolT > condition, int true_value, int false_value)
IntegerLiteral ConstexprIntegerLiteralBitwiseOr(const IntegerLiteral &lhs, const IntegerLiteral &rhs)
TNode< TIndex > TaggedToParameter(TNode< Smi > value)
TNode< BoolT > IsHeapNumberPositive(TNode< HeapNumber > number)
TNode< BoolT > IsPrototypeTypedArrayPrototype(TNode< Context > context, TNode< Map > map)
TNode< BoolT > IsExecutionTerminating()
TNode< BoolT > IsElementsKindLessThanOrEqual(TNode< Int32T > target_kind, ElementsKind reference_kind)
TNode< Number > ToNumber(TNode< Context > context, TNode< Object > input, BigIntHandling bigint_handling=BigIntHandling::kThrow)
TNode< BoolT > IsCode(TNode< HeapObject > object)
TNode< Uint8T > LoadUint8Ptr(TNode< RawPtrT > ptr, TNode< IntPtrT > offset)
TNode< Word32T > TruncateWord64ToWord32(TNode< Word64T > value)
TNode< BoolT > JSAnyIsNotPrimitiveMap(TNode< Map > map)
TNode< Object > LoadFixedArrayBaseElementAsTagged(TNode< FixedArrayBase > elements, TNode< IntPtrT > index, TNode< Int32T > elements_kind, Label *if_accessor, Label *if_hole)
void UpdateFeedback(TNode< Smi > feedback, TNode< HeapObject > maybe_feedback_vector, TNode< UintPtrT > slot_id, UpdateFeedbackMode mode)
TNode< BoolT > IsDoubleHole(TNode< Object > base, TNode< IntPtrT > offset)
TNode< BoolT > IsJSArray(TNode< HeapObject > object)
TNode< FixedArrayBase > ExtractFixedArray(TNode< FixedArrayBase > source, std::optional< TNode< TIndex > > first, std::optional< TNode< TIndex > > count=std::nullopt, std::optional< TNode< TIndex > > capacity=std::nullopt, ExtractFixedArrayFlags extract_flags=ExtractFixedArrayFlag::kAllFixedArrays, TVariable< BoolT > *var_holes_converted=nullptr, std::optional< TNode< Int32T > > source_elements_kind=std::nullopt)
TNode< BoolT > IsJSStringIterator(TNode< HeapObject > object)
void InitializeJSObjectBodyNoSlackTracking(TNode< HeapObject > object, TNode< Map > map, TNode< IntPtrT > instance_size, int start_offset=JSObject::kHeaderSize)
TNode< Object > LoadRoot(RootIndex root_index)
TNode< OrderedNameDictionary > AllocateOrderedNameDictionary(TNode< IntPtrT > capacity)
TNode< Int32T > TruncateNumberToWord32(TNode< Number > value)
TNode< BoolT > IsPromiseReactionJobTask(TNode< HeapObject > object)
TNode< BoolT > IsHoleyFastElementsKindForRead(TNode< Int32T > elements_kind)
TNode< BoolT > IsPromiseResolveProtectorCellInvalid()
void StoreIndirectPointerField(TNode< HeapObject > object, int offset, IndirectPointerTag tag, TNode< ExposedTrustedObject > value)
void StoreMap(TNode< HeapObject > object, TNode< Map > map)
TNode< Uint32T > DecodeWord32(TNode< Word32T > word32)
TNode< Uint32T > LoadFunctionKind(TNode< JSFunction > function)
TNode< JSArray > ArrayCreate(TNode< Context > context, TNode< Number > length)
TNode< Smi > WordOrSmiShr(TNode< Smi > a, int shift)
TNode< BoolT > IsFastSmiElementsKind(TNode< Int32T > elements_kind)
void StoreElement(TNode< RawPtrT > elements, ElementsKind kind, TNode< TIndex > index, TNode< TValue > value)
TNode< Number > ChangeFloat32ToTagged(TNode< Float32T > value)
TNode< Uint32T > LoadAndUntagFixedArrayBaseLengthAsUint32(TNode< FixedArrayBase > array)
void DispatchMaybeObject(TNode< MaybeObject > maybe_object, Label *if_smi, Label *if_cleared, Label *if_weak, Label *if_strong, TVariable< Object > *extracted)
TNode< BoolT > IsNumberNormalized(TNode< Number > number)
TNode< Object > LoadValueByKeyIndex(TNode< ContainerType > container, TNode< IntPtrT > key_index)
TNode< Uint32T > LoadNameRawHash(TNode< Name > name)
void BuildFastLoop(const VariableList &vars, TVariable< TIndex > &var_index, TNode< TIndex > start_index, TNode< TIndex > end_index, const FastLoopBody< TIndex > &body, TNode< TIndex > increment, LoopUnrollingMode unrolling_mode, IndexAdvanceMode advance_mode, IndexAdvanceDirection advance_direction)
TNode< RawPtr< Uint16T > > ExternalTwoByteStringGetChars(TNode< ExternalTwoByteString > string)
TNode< BoolT > IsHoleyFastElementsKind(TNode< Int32T > elements_kind)
TNode< Map > LoadCachedMap(TNode< NativeContext > native_context, TNode< IntPtrT > number_of_properties, Label *runtime)
TNode< IntPtrT > SelectIntPtrConstant(TNode< BoolT > condition, int true_value, int false_value)
TNode< BoolT > IsSequentialStringInstanceType(TNode< Int32T > instance_type)
TNode< IntPtrT > PageMetadataFromAddress(TNode< IntPtrT > address)
TNode< BoolT > IsCustomElementsReceiverInstanceType(TNode< Int32T > instance_type)
TNode< TResult > LoadElementAndPrepareForStore(TNode< FixedArrayBase > array, TNode< IntPtrT > offset, ElementsKind from_kind, ElementsKind to_kind, Label *if_hole)
TNode< BoolT > IsWeakReferenceToObject(TNode< MaybeObject > maybe_object, TNode< Object > object)
std::function< void( TNode< JSAnyNotSmi > receiver, TNode< JSAnyNotSmi > holder, TNode< Map > map, TNode< Int32T > instance_type, TNode< Name > key, Label *next_holder, Label *if_bailout)> LookupPropertyInHolder
TNode< ArrayList > AllocateArrayList(TNode< Smi > size)
TNode< RawPtrT > LoadSandboxedPointerFromObject(TNode< HeapObject > object, int offset)
void StoreSwissNameDictionaryCapacity(TNode< SwissNameDictionary > table, TNode< Int32T > capacity)
TNode< Float64T > SmiToFloat64(TNode< Smi > value)
TNode< BoolT > IsCleared(TNode< MaybeObject > value)
TNode< Int32T > LoadElementsKind(TNode< HeapObject > object)
TNode< BigInt > BigIntFromInt32Pair(TNode< IntPtrT > low, TNode< IntPtrT > high)
TNode< BoolT > IsExtensibleNonPrototypeMap(TNode< Map > map)
TNode< BoolT > IsInteger(TNode< Object > number)
TNode< JSArray > CloneFastJSArray(TNode< Context > context, TNode< JSArray > array, std::optional< TNode< AllocationSite > > allocation_site=std::nullopt, HoleConversionMode convert_holes=HoleConversionMode::kDontConvert)
void MoveElements(ElementsKind kind, TNode< FixedArrayBase > elements, TNode< IntPtrT > dst_index, TNode< IntPtrT > src_index, TNode< IntPtrT > length)
TNode< BoolT > IsBigIntInstanceType(TNode< Int32T > instance_type)
void InvalidateStringWrapperToPrimitiveProtector()
TNode< NameDictionary > AllocateNameDictionaryWithCapacity(TNode< IntPtrT > capacity, AllocationFlags=AllocationFlag::kNone)
void StoreDetailsByKeyIndex(TNode< ContainerType > container, TNode< IntPtrT > key_index, TNode< Smi > details)
std::function< void(Label *, Label *)> BranchGenerator
TorqueStructArguments GetFrameArguments(TNode< RawPtrT > frame, TNode< IntPtrT > argc, FrameArgumentsArgcType argc_type=FrameArgumentsArgcType::kCountExcludesReceiver)
TNode< BoolT > IsFastAliasedArgumentsMap(TNode< Context > context, TNode< Map > map)
TNode< Int32T > LoadAndUntagToWord32ObjectField(TNode< HeapObject > object, int offset)
TNode< IntPtrT > TryIntPtrMul(TNode< IntPtrT > a, TNode< IntPtrT > b, Label *if_overflow)
TNode< Map > CheckEnumCache(TNode< JSReceiver > receiver, Label *if_empty, Label *if_runtime)
std::function< TNode< T >()> LazyNode
TNode< Word32T > TruncateTaggedToWord32(TNode< Context > context, TNode< Object > value)
void StoreSwissNameDictionaryEnumToEntryMapping(TNode< SwissNameDictionary > table, TNode< IntPtrT > capacity, TNode< IntPtrT > enum_index, TNode< Int32T > entry)
TNode< Smi > ParameterToTagged(TNode< Smi > value)
std::function< void(TNode< HeapObject > array, TNode< IntPtrT > offset)> FastArrayForEachBody
TNode< BoolT > IsOneByteStringMap(TNode< Map > map)
TNode< BoolT > IsJSRabGsabDataView(TNode< HeapObject > object)
TNode< BoolT > IsElementsKindGreaterThan(TNode< Int32T > target_kind, ElementsKind reference_kind)
TNode< IntPtrT > SmiToIntPtr(TNode< Smi > value)
TNode< BoolT > IsClearWord32(TNode< Word32T > word32)
TNode< Uint64T > LoadSwissNameDictionaryCtrlTableGroup(TNode< IntPtrT > address)
TNode< RawPtr< Uint8T > > IntlAsciiCollationWeightsL1()
void SetArgumentValue(TorqueStructArguments args, TNode< IntPtrT > index, TNode< JSAny > value)
TNode< Object > GetImportMetaObject(TNode< Context > context)
void StoreDoubleHole(TNode< HeapObject > object, TNode< IntPtrT > offset)
TNode< BoolT > IsJSObjectInstanceType(TNode< Int32T > instance_type)
void StoreObjectFieldNoWriteBarrier(TNode< HeapObject > object, TNode< IntPtrT > offset, TNode< T > value)
@ kDontInitializeInObjectProperties
TNode< Object > LoadFixedArrayElement(TNode< FixedArray > object, TNode< TIndex > index, int additional_offset=0, CheckBounds check_bounds=CheckBounds::kAlways)
TNode< BoolT > IsExternalStringMap(TNode< Map > map)
TNode< Number > NumberMax(TNode< Number > left, TNode< Number > right)
void IncrementCounter(StatsCounter *counter, int delta)
TNode< Smi > BuildAppendJSArray(ElementsKind kind, TNode< JSArray > array, CodeStubArguments *args, TVariable< IntPtrT > *arg_index, Label *bailout)
void InitializePropertyArrayLength(TNode< PropertyArray > property_array, TNode< IntPtrT > length)
void SetContinuationPreservedEmbedderData(TNode< Object > value)
TNode< MaybeObject > ClearedValue()
TNode< BoolT > IsSeqOneByteString(TNode< HeapObject > object)
void SetCounter(StatsCounter *counter, int value)
TNode< HeapObject > LoadName(TNode< HeapObject > key)
TNode< Word32T > ComputeSeededHash(TNode< IntPtrT > key)
TNode< IntPtrT > SwissNameDictionaryOffsetIntoDataTableMT(TNode< SwissNameDictionary > dict, TNode< IntPtrT > index, int field_index)
TNode< IntPtrT > EntryToIndex(TNode< IntPtrT > entry, int field_index)
TNode< BoolT > IsJSReceiverInstanceType(TNode< Int32T > instance_type)
IntegerLiteral ConstexprIntegerLiteralLeftShift(const IntegerLiteral &lhs, const IntegerLiteral &rhs)
TNode< Object > LoadFromParentFrame(int offset)
TNode< Uint16T > LoadMapInstanceType(TNode< Map > map)
TNode< BoolT > TaggedDoesntHaveInstanceType(TNode< HeapObject > any_tagged, InstanceType type)
TNode< BoolT > IsJSArrayMap(TNode< Map > map)
TNode< SwissNameDictionary > AllocateSwissNameDictionaryWithCapacity(TNode< IntPtrT > capacity)
TNode< FixedArray > HeapObjectToFixedArray(TNode< HeapObject > base, Label *cast_fail)
TNode< BoolT > HasInstanceType(TNode< HeapObject > object, InstanceType type)
TNode< Int32T > CountTrailingZeros32(TNode< Word32T > value)
TNode< BoolT > IsJSWrappedFunction(TNode< HeapObject > object)
TNode< Float64T > LoadDoubleWithHoleCheck(TNode< FixedDoubleArray > array, TNode< IntPtrT > index, Label *if_hole=nullptr)
TNode< IntPtrT > ElementOffsetFromIndex(TNode< TIndex > index, ElementsKind kind, int base_size=0)
IntegerLiteral ConstexprIntegerLiteralAdd(const IntegerLiteral &lhs, const IntegerLiteral &rhs)
TNode< BigInt > LoadFixedBigInt64ArrayElementAsTagged(TNode< RawPtrT > data_pointer, TNode< IntPtrT > offset)
TNode< BoolT > IsPageFlagSet(TNode< IntPtrT > object, int mask)
void UnsafeStoreFixedArrayElement(TNode< FixedArray > object, int index, TNode< Object > value, WriteBarrierMode barrier_mode=UPDATE_WRITE_BARRIER)
TNode< BoolT > IsFixedArraySubclass(TNode< HeapObject > object)
TNode< BoolT > IsSlowAliasedArgumentsMap(TNode< Context > context, TNode< Map > map)
TNode< Name > LoadKeyByKeyIndex(TNode< DescriptorArray > container, TNode< IntPtrT > key_index)
TNode< IntPtrT > LoadStringLengthAsWord(TNode< String > string)
TNode< Smi > SmiShr(TNode< Smi > a, int shift)
void SharedValueBarrier(TNode< Context > context, TVariable< Object > *var_shared_value)
TNode< HeapNumber > AllocateHeapNumberWithValue(TNode< Float64T > value)
TNode< BoolT > IsNotAnyHole(TNode< Object > object)
TNode< BoolT > IsJSArrayIterator(TNode< HeapObject > object)
TNode< Word32T > IsStringWrapper(TNode< HeapObject > object)
TNode< BoolT > IsArraySpeciesProtectorCellInvalid()
TNode< BoolT > IsPropertyDictionary(TNode< HeapObject > object)
void StoreSharedObjectField(TNode< HeapObject > object, TNode< IntPtrT > offset, TNode< Object > value)
void StoreObjectByteNoWriteBarrier(TNode< HeapObject > object, int offset, TNode< Word32T > value)
void ArrayListSet(TNode< ArrayList > array, TNode< Smi > index, TNode< Object > object)
void PerformStackCheck(TNode< Context > context)
TNode< BoolT > IsNumeric(TNode< Object > object)
void StoreBigIntDigit(TNode< BigInt > bigint, intptr_t digit_index, TNode< UintPtrT > digit)
void BranchIfHasPrototypeProperty(TNode< JSFunction > function, TNode< Int32T > function_map_bit_field, Label *if_true, Label *if_false)
TNode< BoolT > IsJSFinalizationRegistry(TNode< HeapObject > object)
TNode< HeapObject > AllocateRaw(TNode< IntPtrT > size_in_bytes, AllocationFlags flags, TNode< RawPtrT > top_address, TNode< RawPtrT > limit_address)
TNode< Code > LoadJSFunctionCode(TNode< JSFunction > function)
TNode< Object > OrdinaryToPrimitive(TNode< Context > context, TNode< Object > input, OrdinaryToPrimitiveHint hint)
TNode< Smi > TryFloat64ToSmi(TNode< Float64T > number, Label *not_smi)
TNode< Float64T > Float64Trunc(TNode< Float64T > x)
TNode< String > AllocateSeqTwoByteString(uint32_t length, AllocationFlags flags=AllocationFlag::kNone)
TNode< Uint16T > LoadInstanceType(TNode< HeapObject > object)
void ArrayListSetLength(TNode< ArrayList > array, TNode< Smi > length)
TNode< IntPtrT > GetPropertyArrayAllocationSize(TNode< IntPtrT > element_count)
void StoreTrustedPointerField(TNode< HeapObject > object, int offset, IndirectPointerTag tag, TNode< ExposedTrustedObject > value)
TNode< IntPtrT > TryTaggedToInt32AsIntPtr(TNode< Object > value, Label *if_not_possible)
TNode< BoolT > IsConstructorMap(TNode< Map > map)
@ kFindExistingOrInsertionIndex
TNode< Smi > NoContextConstant()
TNode< BoolT > IsJSSharedArrayMap(TNode< Map > map)
TNode< BoolT > IsIsolatePromiseHookEnabled(TNode< Uint32T > flags)
TNode< NativeContext > LoadNativeContext(TNode< Context > context)
TNode< JSAny > ToThisValue(TNode< Context > context, TNode< JSAny > value, PrimitiveType primitive_type, char const *method_name)
void StoreBigIntBitfield(TNode< BigInt > bigint, TNode< Word32T > bitfield)
void TerminateExecution(TNode< Context > context)
TNode< BoolT > IsNumberDictionary(TNode< HeapObject > object)
void LookupBinary(TNode< Name > unique_name, TNode< Array > array, TNode< Uint32T > number_of_valid_entries, Label *if_found, TVariable< IntPtrT > *var_name_index, Label *if_not_found)
void GotoIfNotNumber(TNode< Object > value, Label *is_not_number)
TNode< String > AllocateSlicedTwoByteString(TNode< Uint32T > length, TNode< String > parent, TNode< Smi > offset)
TNode< IntPtrT > LoadAndUntagWeakFixedArrayLength(TNode< WeakFixedArray > array)
void StringWriteToFlatOneByte(TNode< String > source, TNode< RawPtrT > sink, TNode< Int32T > start, TNode< Int32T > length)
void TryStoreArrayElement(ElementsKind kind, Label *bailout, TNode< FixedArrayBase > elements, TNode< BInt > index, TNode< Object > value)
constexpr int MaxNumberOfEntries()
void CheckPrototypeEnumCache(TNode< JSReceiver > receiver, TNode< Map > receiver_map, Label *if_fast, Label *if_slow)
TNode< BoolT > LoadScopeInfoClassScopeHasPrivateBrand(TNode< ScopeInfo > scope_info)
TNode< Int32T > LoadAndUntagToWord32FixedArrayElement(TNode< FixedArray > object, TNode< IntPtrT > index, int additional_offset=0)
TNode< MaybeObject > LoadWeakFixedArrayElement(TNode< WeakFixedArray > object, TNode< IntPtrT > index, int additional_offset=0)
TNode< Int32T > EnsureArrayPushable(TNode< Context > context, TNode< Map > map, Label *bailout)
TNode< BoolT > IsMapIteratorProtectorCellInvalid()
TNode< BoolT > IsJSGlobalProxyInstanceType(TNode< Int32T > instance_type)
TNode< OrderedHashSet > AllocateOrderedHashSet()
TNode< T > Select(TNode< BoolT > condition, const NodeGenerator< T > &true_body, const NodeGenerator< T > &false_body, BranchHint branch_hint=BranchHint::kNone)
TNode< RawPtrT > ExternalPointerTableAddress(ExternalPointerTagRange tag_range)
TNode< Uint32T > SwissNameDictionaryUpdateCountsForDeletion(TNode< ByteArray > meta_table, TNode< IntPtrT > capacity)
TNode< Uint8T > LoadSwissNameDictionaryPropertyDetails(TNode< SwissNameDictionary > table, TNode< IntPtrT > capacity, TNode< IntPtrT > entry)
TNode< FixedArrayBase > ExtractFixedDoubleArrayFillingHoles(TNode< FixedArrayBase > source, TNode< TIndex > first, TNode< TIndex > count, TNode< TIndex > capacity, TNode< Map > source_map, TVariable< BoolT > *var_holes_converted, AllocationFlags allocation_flags, ExtractFixedArrayFlags extract_flags)
TNode< BoolT > TaggedIsSmi(TNode< MaybeObject > a)
void StoreContextElementNoWriteBarrier(TNode< Context > context, int slot_index, TNode< Object > value)
TNode< FixedArrayBase > TryGrowElementsCapacity(TNode< HeapObject > object, TNode< FixedArrayBase > elements, ElementsKind kind, TNode< Smi > key, Label *bailout)
TNode< Smi > LoadFastJSArrayLength(TNode< JSArray > array)
TNode< BigInt > AllocateRawBigInt(TNode< IntPtrT > length)
TNode< BoolT > IsSpecialReceiverInstanceType(TNode< Int32T > instance_type)
TNode< IntPtrT > HashTableComputeCapacity(TNode< IntPtrT > at_least_space_for)
TNode< BoolT > IsJSShadowRealm(TNode< HeapObject > object)
TNode< String > NumberToString(TNode< Number > input)
TNode< BoolT > IsJSPromiseMap(TNode< Map > map)
TNode< BoolT > IsJSRegExp(TNode< HeapObject > object)
TNode< BoolT > IsJSFinalizationRegistryMap(TNode< Map > map)
void ThrowIfNotJSReceiver(TNode< Context > context, TNode< Object > value, MessageTemplate msg_template, const char *method_name)
TNode< PropertyArray > AllocatePropertyArray(TNode< IntPtrT > capacity)
TNode< BoolT > IsAdditiveSafeInteger(TNode< Float64T > number)
TNode< BoolT > IsConsStringInstanceType(TNode< Int32T > instance_type)
TNode< Int32T > LoadMapBitField(TNode< Map > map)
TNode< String > TaggedToDirectString(TNode< Object > value, Label *fail)
void StoreSwissNameDictionaryPropertyDetails(TNode< SwissNameDictionary > table, TNode< IntPtrT > capacity, TNode< IntPtrT > entry, TNode< Uint8T > details)
TNode< BoolT > IsJSSharedStructMap(TNode< Map > map)
TNode< BoolT > IsOneByteStringInstanceType(TNode< Int32T > instance_type)
void TaggedToWord32OrBigIntImpl(TNode< Context > context, TNode< Object > value, Label *if_number, TVariable< Word32T > *var_word32, IsKnownTaggedPointer is_known_tagged_pointer, const FeedbackValues &feedback, Label *if_bigint=nullptr, Label *if_bigint64=nullptr, TVariable< BigInt > *var_maybe_bigint=nullptr)
TNode< Int32T > TryInt32Mul(TNode< Int32T > a, TNode< Int32T > b, Label *if_overflow)
TNode< Float64T > Float64Ceil(TNode< Float64T > x)
TNode< BoolT > IsValidPositiveSmi(TNode< IntPtrT > value)
TNode< Float64T > LoadHeapNumberValue(TNode< HeapObject > object)
TNode< BoolT > IsJSSharedStructInstanceType(TNode< Int32T > instance_type)
TNode< TaggedIndex > SmiToTaggedIndex(TNode< Smi > value)
TNode< BoolT > IsMap(TNode< HeapObject > object)
void StoreBoundedSizeToObject(TNode< HeapObject > object, int offset, TNode< UintPtrT > value)
TNode< BoolT > IsDictionaryElementsKind(TNode< Int32T > elements_kind)
TNode< HeapObject > LoadJSFunctionPrototype(TNode< JSFunction > function, Label *if_bailout)
TNode< HeapObjectReference > MakeWeak(TNode< HeapObject > value)
TNode< BigInt > ToBigInt(TNode< Context > context, TNode< Object > input)
TNode< IntPtrT > NameToIndexHashTableLookup(TNode< NameToIndexHashTable > table, TNode< Name > name, Label *not_found)
void OverwriteFeedback(TVariable< Smi > *existing_feedback, int new_feedback)
TNode< BoolT > IsMarkedForDeoptimization(TNode< Code > code)
TNode< BoolT > HasAsyncEventDelegate()
TNode< Object > SetPropertyStrict(TNode< Context > context, TNode< JSAny > receiver, TNode< Object > key, TNode< Object > value)
TNode< OrderedHashMap > AllocateOrderedHashMap()
TNode< BoolT > IsOffsetInBounds(TNode< IntPtrT > offset, TNode< IntPtrT > length, int header_size, ElementsKind kind=HOLEY_ELEMENTS)
TNode< Float64T > LoadFixedDoubleArrayElement(TNode< FixedDoubleArray > object, TNode< IntPtrT > index, Label *if_hole=nullptr, MachineType machine_type=MachineType::Float64())
void StoreSwissNameDictionaryKeyAndValue(TNode< SwissNameDictionary > dict, TNode< IntPtrT > entry, TNode< Object > key, TNode< Object > value)
TNode< Object > LoadJSPrimitiveWrapperValue(TNode< JSPrimitiveWrapper > object)
TNode< Word32T > LoadBigIntBitfield(TNode< BigInt > bigint)
TNode< Float64T > TruncateTaggedToFloat64(TNode< Context > context, TNode< Object > value)
TNode< Map > LoadMap(TNode< HeapObject > object)
TNode< IntPtrT > MapUsedInstanceSizeInWords(TNode< Map > map)
TNode< FixedArray > ExtractToFixedArray(TNode< FixedArrayBase > source, TNode< TIndex > first, TNode< TIndex > count, TNode< TIndex > capacity, TNode< Map > source_map, ElementsKind from_kind, AllocationFlags allocation_flags, ExtractFixedArrayFlags extract_flags, HoleConversionMode convert_holes, TVariable< BoolT > *var_holes_converted=nullptr, std::optional< TNode< Int32T > > source_runtime_kind=std::nullopt)
TNode< Int32T > LoadBytecodeArrayParameterCountWithoutReceiver(TNode< BytecodeArray > bytecode_array)
TNode< BoolT > SharedFunctionInfoHasBaselineCode(TNode< SharedFunctionInfo > sfi)
TNode< ByteArray > AllocateNonEmptyByteArray(TNode< UintPtrT > length, AllocationFlags flags=AllocationFlag::kNone)
void SwissNameDictionaryAdd(TNode< SwissNameDictionary > table, TNode< Name > key, TNode< Object > value, TNode< Uint8T > property_details, Label *needs_resize)
void GotoIfLargeBigInt(TNode< BigInt > bigint, Label *true_label)
TNode< BoolT > IsString(TNode< HeapObject > object)
TNode< Numeric > NonNumberToNumberOrNumeric(TNode< Context > context, TNode< HeapObject > input, Object::Conversion mode, BigIntHandling bigint_handling=BigIntHandling::kThrow)
TNode< BoolT > IsDictionaryMap(TNode< Map > map)
TNode< IntPtrT > PopulationCountFallback(TNode< UintPtrT > value)
TNode< Int32T > SmiToInt32(TNode< Smi > value)
TNode< Uint32T > LoadStringLengthAsWord32(TNode< String > string)
TNode< Number > ToLength_Inline(TNode< Context > context, TNode< Object > input)
TNode< Number > PlainPrimitiveToNumber(TNode< Object > input)
TNode< Int32T > LoadMapElementsKind(TNode< Map > map)
TNode< IntPtrT > TaggedIndexToIntPtr(TNode< TaggedIndex > value)
TNode< BoolT > IsJSProxy(TNode< HeapObject > object)
TNode< Float64T > ChangeNumberToFloat64(TNode< Number > value)
TNode< BoolT > IsOddball(TNode< HeapObject > object)
TNode< JSObject > AllocateJSObjectFromMap(TNode< Map > map, std::optional< TNode< HeapObject > > properties=std::nullopt, std::optional< TNode< FixedArray > > elements=std::nullopt, AllocationFlags flags=AllocationFlag::kNone, SlackTrackingMode slack_tracking_mode=kNoSlackTracking)
TNode< Object > LoadCellValue(TNode< Cell > cell)
TNode< CollectionType > AllocateOrderedHashTableWithCapacity(TNode< IntPtrT > capacity)
TNode< Union< Hole, JSMessageObject > > GetPendingMessage()
TNode< Number > ToUint32(TNode< Context > context, TNode< Object > input)
TNode< BoolT > IsNotWeakFixedArraySubclass(TNode< HeapObject > object)
void MakeFixedArrayCOW(TNode< FixedArray > array)
TNode< Uint32T > LoadAndUntagWeakFixedArrayLengthAsUint32(TNode< WeakFixedArray > array)
TNode< Float64T > ChangeFloat16ToFloat64(TNode< Float16RawBitsT > value)
TNode< MaybeObject > LoadFieldTypeByKeyIndex(TNode< DescriptorArray > container, TNode< IntPtrT > key_index)
void InitializeJSObjectFromMap(TNode< HeapObject > object, TNode< Map > map, TNode< IntPtrT > instance_size, std::optional< TNode< HeapObject > > properties=std::nullopt, std::optional< TNode< FixedArray > > elements=std::nullopt, SlackTrackingMode slack_tracking_mode=kNoSlackTracking)
TNode< Uint32T > LoadMapEnumLength(TNode< Map > map)
TNode< BoolT > IsTypedArraySpeciesProtectorCellInvalid()
TNode< IntPtrT > AlignToAllocationAlignment(TNode< IntPtrT > value)
TNode< Smi > SmiMin(TNode< Smi > a, TNode< Smi > b)
TNode< TIndex > IntPtrOrSmiConstant(int value)
TNode< Int32T > GetNonRabGsabElementsKind(TNode< Int32T > elements_kind)
SmiBelowOrEqual int32_t b
TNode< Int32T > TruncateHeapNumberValueToWord32(TNode< HeapNumber > object)
void BranchIfToBooleanIsTrue(TNode< Object > value, Label *if_true, Label *if_false)
TNode< Uint32T > ChangeNonNegativeNumberToUint32(TNode< Number > value)
TNode< Float16RawBitsT > TruncateFloat32ToFloat16(TNode< Float32T > value)
TNode< IntPtrT > TryIntPtrAdd(TNode< IntPtrT > a, TNode< IntPtrT > b, Label *if_overflow)
TNode< BoolT > IsExternalStringInstanceType(TNode< Int32T > instance_type)
TNode< BigInt > LoadFixedBigUint64ArrayElementAsTagged(TNode< RawPtrT > data_pointer, TNode< IntPtrT > offset)
TNode< PropertyDictionary > AllocatePropertyDictionary(int at_least_space_for)
TNode< BoolT > IsNumberArrayIndex(TNode< Number > number)
Uint32LessThanOrEqual IntPtrGreaterThanOrEqual
TNode< IntPtrT > LoadArrayLength(TNode< Array > array)
void TaggedToBigInt(TNode< Context > context, TNode< Object > value, Label *if_not_bigint, Label *if_bigint, Label *if_bigint64, TVariable< BigInt > *var_bigint, TVariable< Smi > *var_feedback)
TNode< BoolT > IsStringInstanceType(TNode< Int32T > instance_type)
TNode< BoolT > IsAlwaysSharedSpaceJSObjectInstanceType(TNode< Int32T > instance_type)
TNode< Int64T > CountLeadingZeros64(TNode< Word64T > value)
TNode< Smi > SelectSmiConstant(TNode< BoolT > condition, Tagged< Smi > true_value, Tagged< Smi > false_value)
TNode< Object > LoadJSArgumentsObjectLength(TNode< Context > context, TNode< JSArgumentsObject > array)
void StoreFixedDoubleArrayHole(TNode< FixedDoubleArray > array, TNode< IntPtrT > index)
TNode< Smi > TrySmiDiv(TNode< Smi > dividend, TNode< Smi > divisor, Label *bailout)
TNode< BoolT > IsUniqueNameNoCachedIndex(TNode< HeapObject > object)
void FastCheck(TNode< BoolT > condition)
TNode< HeapObject > AllocateRawDoubleAligned(TNode< IntPtrT > size_in_bytes, AllocationFlags flags, TNode< RawPtrT > top_address, TNode< RawPtrT > limit_address)
TNode< BoolT > IsHashTable(TNode< HeapObject > object)
TNode< IntPtrT > PositiveSmiUntag(TNode< Smi > value)
TNode< BoolT > Float64AlmostEqual(TNode< Float64T > x, TNode< Float64T > y, double max_relative_error=0.0000001)
TNode< BoolT > IsCallable(TNode< HeapObject > object)
TNode< BoolT > IsBigInt(TNode< HeapObject > object)
TNode< BoolT > IsJSTypedArray(TNode< HeapObject > object)
TNode< HeapObject > GetHeapObjectIfStrong(TNode< MaybeObject > value, Label *if_not_strong)
TNode< NameDictionary > CopyNameDictionary(TNode< NameDictionary > dictionary, Label *large_object_fallback)
void ForEachEnumerableOwnProperty(TNode< Context > context, TNode< Map > map, TNode< JSObject > object, PropertiesEnumerationMode mode, const ForEachKeyValueFunction &body, Label *bailout)
TNode< RawPtrT > LoadExternalStringResourceDataPtr(TNode< ExternalString > object)
TNode< ByteArray > AllocateByteArray(TNode< UintPtrT > length, AllocationFlags flags=AllocationFlag::kNone)
TNode< Float64T > ChangeTaggedToFloat64(TNode< Context > context, TNode< Object > input)
TNode< Uint32T > LoadNameHashAssumeComputed(TNode< Name > name)
TNode< BoolT > IsJSFunctionInstanceType(TNode< Int32T > instance_type)
void StoreObjectField(TNode< HeapObject > object, int offset, TNode< Smi > value)
TNode< BoolT > IsValidFastJSArrayCapacity(TNode< IntPtrT > capacity)
void FillFixedArrayWithValue(ElementsKind kind, TNode< FixedArrayBase > array, TNode< TIndex > from_index, TNode< TIndex > to_index, RootIndex value_root_index)
TNode< IntPtrT > SmiShiftBitsConstant()
void PossiblyGrowElementsCapacity(ElementsKind kind, TNode< HeapObject > array, TNode< BInt > length, TVariable< FixedArrayBase > *var_elements, TNode< BInt > growth, Label *bailout)
TNode< Int32T > TruncateWordToInt32(TNode< WordT > value)
TNode< UintPtrT > DecodeWordFromWord32(TNode< Word32T > word32)
TNode< BoolT > IsInRange(TNode< Word32T > value, U lower_limit, U higher_limit)
std::function< void(TNode< Name > key, LazyNode< Object > value)> ForEachKeyValueFunction
TNode< Int64T > CountTrailingZeros64(TNode< Word64T > value)
TNode< BigInt > BigIntFromUint32Pair(TNode< UintPtrT > low, TNode< UintPtrT > high)
TNode< BoolT > IsNullOrJSReceiver(TNode< HeapObject > object)
TNode< IntPtrT > LoadMapConstructorFunctionIndex(TNode< Map > map)
void CopyElements(ElementsKind kind, TNode< FixedArrayBase > dst_elements, TNode< IntPtrT > dst_index, TNode< FixedArrayBase > src_elements, TNode< IntPtrT > src_index, TNode< IntPtrT > length, WriteBarrierMode write_barrier=UPDATE_WRITE_BARRIER)
TNode< Smi > GetCapacity(TNode< Dictionary > dictionary)
TNode< Uint32T > PromiseHookFlags()
TNode< Map > GetInstanceTypeMap(InstanceType instance_type)
void SetPropertyLength(TNode< Context > context, TNode< JSAny > array, TNode< Number > length)
TNode< Boolean > SelectBooleanConstant(TNode< BoolT > condition)
TNode< BoolT > NeedsAnyPromiseHooks()
TNode< IntPtrT > LoadMapInstanceSizeInWords(TNode< Map > map)
TNode< MaybeObject > LoadFeedbackVectorSlot(TNode< FeedbackVector > feedback_vector, TNode< TIndex > slot, int additional_offset=0)
TNode< BoolT > IsPropertyCell(TNode< HeapObject > object)
TNode< Map > LoadObjectFunctionInitialMap(TNode< NativeContext > native_context)
TNode< BoolT > IsJSPromise(TNode< HeapObject > object)
TNode< Number > SmiMul(TNode< Smi > a, TNode< Smi > b)
TNode< BoolT > IsJSArrayBuffer(TNode< HeapObject > object)
TNode< RawPtr< Uint8T > > IntlAsciiCollationWeightsL3()
TNode< Uint32T > NumberOfEntries(TNode< Array > array)
TNode< FixedArrayBase > CloneFixedArray(TNode< FixedArrayBase > source, ExtractFixedArrayFlags flags=ExtractFixedArrayFlag::kAllFixedArraysDontCopyCOW)
TNode< TValue > LoadArrayElement(TNode< Array > array, int array_header_size, TNode< TIndex > index, int additional_offset=0)
TNode< BoolT > IsFixedArray(TNode< HeapObject > object)
void LoadPropertyFromFastObject(TNode< HeapObject > object, TNode< Map > map, TNode< DescriptorArray > descriptors, TNode< IntPtrT > name_index, TVariable< Uint32T > *var_details, TVariable< Object > *var_value)
TNode< TIndex > CalculateNewElementsCapacity(TNode< TIndex > old_capacity)
void StoreTrustedPointerFieldNoWriteBarrier(TNode< HeapObject > object, int offset, IndirectPointerTag tag, TNode< ExposedTrustedObject > value)
Uint32LessThanOrEqual Int32GreaterThanOrEqual TNode< Smi > SmiMax(TNode< Smi > a, TNode< Smi > b)
void IncrementCallCount(TNode< FeedbackVector > feedback_vector, TNode< UintPtrT > slot_id)
TNode< BoolT > IsHeapNumberUint32(TNode< HeapNumber > number)
void TaggedToWord32OrBigInt(TNode< Context > context, TNode< Object > value, Label *if_number, TVariable< Word32T > *var_word32, Label *if_bigint, Label *if_bigint64, TVariable< BigInt > *var_maybe_bigint)
TNode< Object > CloneIfMutablePrimitive(TNode< Object > object)
TNode< WordT > TimesDoubleSize(TNode< WordT > value)
TNode< BoolT > IsJSGeneratorMap(TNode< Map > map)
TNode< BoolT > IsJSPrimitiveWrapper(TNode< HeapObject > object)
TNode< TaggedIndex > IntPtrToTaggedIndex(TNode< IntPtrT > value)
TNode< BoolT > IsJSSharedArray(TNode< HeapObject > object)
TNode< Uint32T > EnsureOnlyHasSimpleProperties(TNode< Map > map, TNode< Int32T > instance_type, Label *bailout)
TNode< T > LoadDescriptorArrayElement(TNode< DescriptorArray > object, TNode< IntPtrT > index, int additional_offset)
TNode< Float16RawBitsT > BitcastUint32ToFloat16(TNode< Uint32T > value)
TNode< BoolT > IsJSTypedArrayInstanceType(TNode< Int32T > instance_type)
TNode< HeapObject > GetHeapObjectAssumeWeak(TNode< MaybeObject > value)
TNode< Smi > TrySmiAdd(TNode< Smi > a, TNode< Smi > b, Label *if_overflow)
TNode< Smi > GetNextEnumerationIndex(TNode< Dictionary > dictionary)
TNode< BoolT > IsFixedArrayWithKind(TNode< HeapObject > object, ElementsKind kind)
void StoreHeapNumberValue(TNode< HeapNumber > object, TNode< Float64T > value)
TNode< WordT > TimesSystemPointerSize(TNode< WordT > value)
void StoreMapNoWriteBarrier(TNode< HeapObject > object, RootIndex map_root_index)
TNode< Int32T > PopulationCount32(TNode< Word32T > value)
TNode< Object > CallGetterIfAccessor(TNode< Object > value, TNode< Union< JSReceiver, PropertyCell > > holder, TNode< Uint32T > details, TNode< Context > context, TNode< JSAny > receiver, TNode< Object > name, Label *if_bailout, GetOwnPropertyMode mode=kCallJSGetterDontUseCachedName, ExpectedReceiverMode expected_receiver_mode=kExpectingJSReceiver)
void AddToDictionary(TNode< Dictionary > dictionary, TNode< Name > key, TNode< Object > value, Label *bailout, std::optional< TNode< IntPtrT > > insertion_index=std::nullopt)
TNode< BoolT > IsOrderedNameDictionary(TNode< HeapObject > object)
TNode< BoolT > IsJSAsyncGeneratorObject(TNode< HeapObject > object)
TNode< String > AllocateSlicedString(RootIndex map_root_index, TNode< Uint32T > length, TNode< String > parent, TNode< Smi > offset)
TNode< PropertyDictionary > AllocatePropertyDictionaryWithCapacity(TNode< IntPtrT > capacity, AllocationFlags=AllocationFlag::kNone)
void NumberDictionaryLookup(TNode< NumberDictionary > dictionary, TNode< IntPtrT > intptr_index, Label *if_found, TVariable< IntPtrT > *var_entry, Label *if_not_found)
TNode< Object > LoadSharedFunctionInfoUntrustedData(TNode< SharedFunctionInfo > sfi)
TNode< Uint64T > LoadUint64Ptr(TNode< RawPtrT > ptr, TNode< IntPtrT > index)
TNode< BoolT > JSAnyIsNotPrimitive(TNode< HeapObject > object)
TNode< RawPtrT > LoadCodeInstructionStart(TNode< Code > code, CodeEntrypointTag tag)
static constexpr int kFixedSlotCountAboveFp
@ FIRST_JS_ARRAY_MAP_SLOT
static V8_INLINE constexpr int SlotOffset(int index)
static int ArrayMapIndex(ElementsKind elements_kind)
static const int kNoContext
static const int kEntryDetailsOffset
static constexpr int ToKeyIndex(int descriptor_number)
static const int kEntryKeyOffset
static constexpr int ToValueIndex(int descriptor_number)
static const int kEntryValueOffset
static const int kEntrySize
static constexpr int ToDetailsIndex(int descriptor_number)
static V8_EXPORT_PRIVATE ExternalReference isolate_address()
static V8_EXPORT_PRIVATE ExternalReference address_of_pending_message(LocalIsolate *local_isolate)
static ExternalReference Create(const SCTableReference &table_ref)
Handle< String > InternalizeString(base::Vector< const char > str, bool convert_encoding=false)
static int GetMaxLengthForNewSpaceAllocation(ElementsKind kind)
static constexpr int kHeaderSize
static constexpr int kLengthOffset
static constexpr int kMaxLength
static const int kMinCapacity
static constexpr int kMapOffset
int MaxNumberToStringCacheSize() const
static InternalIndex NotFound()
static const int kExternalPointerTableBasePointerOffset
static V8_INLINE constexpr bool IsValidSmi(T value)
v8::internal::Factory * factory()
static const int kInitialMaxFastElementArray
static constexpr uint32_t kMaxFastArrayLength
static constexpr int kSizeWithoutPrototype
static const int kFieldsAdded
static const int kMapCacheSize
static const uint32_t kMaxGap
static const uint32_t kMinAddedElementsCapacity
static constexpr MachineType Float64()
static constexpr MachineType Pointer()
static constexpr MachineType Uint8()
constexpr bool IsNone() const
static constexpr MachineType Int32()
static constexpr MachineType AnyTagged()
static constexpr MachineType Uint32()
static constexpr MachineType Uint16()
static constexpr MachineType TaggedPointer()
static constexpr MachineType UintPtr()
static constexpr MachineRepresentation PointerRepresentation()
static constexpr MachineType IntPtr()
static const int kNoSlackTracking
static const int kSlackTrackingCounterEnd
static constexpr std::optional< RootIndex > TryGetMapRootIdxFor(InstanceType type)
static constexpr uint32_t kBitsPerCellLog2
static constexpr uint32_t kBytesPerCellLog2
static constexpr uint32_t kBytesPerCell
static constexpr intptr_t FlagsOffset()
@ IN_WRITABLE_SHARED_SPACE
static constexpr MainThreadFlags kIsInYoungGenerationMask
static constexpr MainThreadFlags kPointersFromHereAreInterestingMask
static constexpr intptr_t GetAlignmentMaskForAssembler()
static constexpr intptr_t MarkingBitmapOffset()
static constexpr int kFlagsDefault
static const int kFlagsIndex
static constexpr int kEmptyHashField
static constexpr int kHashNotComputedMask
static const unsigned int kDoesNotContainCachedArrayIndexMask
static const unsigned int kDoesNotContainIntegerOrForwardingIndexMask
static const int kInitialCapacity
static constexpr int PrefixIndex()
static constexpr int kMaxLength
static const int kNoHashSentinel
static constexpr PropertyConstness kConstIfDictConstnessTracking
static const int kInitialIndex
static const int kAttributesDontEnumMask
static const int kProtectorInvalid
const TNode< Map > initial_prototype_map_
PrototypeCheckAssembler(compiler::CodeAssemblerState *state, Flags flags, TNode< NativeContext > native_context, TNode< Map > initial_prototype_map, base::Vector< DescriptorIndexNameValue > properties)
const TNode< NativeContext > native_context_
@ kCheckPrototypePropertyConstness
@ kCheckPrototypePropertyIdentity
void CheckAndBranch(TNode< HeapObject > prototype, Label *if_unmodified, Label *if_modified)
const base::Vector< DescriptorIndexNameValue > properties_
static constexpr bool IsImmortalImmovable(RootIndex root_index)
static V8_INLINE constexpr int32_t SizeFor(int32_t length)
static V8_INLINE constexpr int32_t SizeFor(int32_t length)
static constexpr int ToInt(const Tagged< Object > object)
static constexpr Tagged< Smi > FromInt(int value)
static bool constexpr IsValid(T value)
static constexpr int kMinValue
static constexpr int kMaxValue
V8_EXPORT_PRIVATE bool Enabled()
static const int32_t kMaxOneByteCharCode
static constexpr int kMax1ByteMetaTableCapacity
static constexpr int kMetaTableDeletedElementCountFieldIndex
static constexpr int kDataTableValueEntryIndex
static constexpr int kDataTableEntryCount
static constexpr int kMetaTableEnumerationDataStartIndex
static constexpr int kDataTableKeyEntryIndex
static constexpr int MaxCapacity()
static constexpr int kInitialCapacity
static constexpr int kMetaTableElementCountFieldIndex
static const bool kUseSIMD
static constexpr Offset CapacityOffset()
static constexpr int kMax2ByteMetaTableCapacity
static constexpr Offset DataTableStartOffset()
static const int kGroupWidth
static TNode UncheckedCast(compiler::Node *node)
static constexpr int OffsetOfElementAt(int index)
static constexpr int kMaxCapacity
TVariable< String > var_string_
TNode< String > TryToDirect(Label *if_bailout)
TNode< RawPtrT > TryToSequential(StringPointerKind ptr_kind, Label *if_bailout)
ToDirectStringAssembler(compiler::CodeAssemblerState *state, TNode< String > string, Flags flags=Flags())
TVariable< Int32T > var_instance_type_
TNode< IntPtrT > offset()
@ kDontUnpackSlicedStrings
TNode< RawPtrT > PointerToData(Label *if_bailout)
TNode< Word32T > is_external()
TNode< String > ToDirect()
TVariable< IntPtrT > var_offset_
TVariable< Word32T > var_is_external_
TNode< BoolT > IsOneByte()
static const int kFirstIndex
static const int kTransitionLengthIndex
static const int kMaxNumberOfTransitions
static constexpr bool kUninterestingPagesCanBeSkipped
void push_back(const T &value)
const char * name() const
MachineRepresentation rep() const
CodeAssemblerState * state()
TNode< BoolT > Word32NotEqual(TNode< Word32T > left, TNode< Word32T > right)
TNode< IntPtrT > IntPtrMul(TNode< IntPtrT > left, TNode< IntPtrT > right)
TNode< IntPtrT > IntPtrAdd(TNode< IntPtrT > left, TNode< IntPtrT > right)
TNode< IntPtrT > WordOr(TNode< IntPtrT > left, TNode< IntPtrT > right)
TNode< PairT< Word32T, Word32T > > Int32PairAdd(TNode< Word32T > lhs_lo_word, TNode< Word32T > lhs_hi_word, TNode< Word32T > rhs_lo_word, TNode< Word32T > rhs_hi_word)
TNode< Int32T > Signed(TNode< Word32T > x)
void SetDynamicJSParameterCount(TNode< Uint16T > parameter_count)
bool IsWord64CtzSupported() const
void Comment(MessageWithSourceLocation message, Args &&... args)
TNode< RawPtrT > RawPtrSub(TNode< RawPtrT > left, TNode< IntPtrT > right)
TNode< IntPtrT > IntPtrConstant(intptr_t value)
void OptimizedStoreFieldUnsafeNoWriteBarrier(MachineRepresentation rep, TNode< HeapObject > object, int offset, Node *value)
TNode< Int64T > Int64Constant(int64_t value)
bool IsWord64PopcntSupported() const
void StoreEphemeronKey(Node *base, Node *offset, Node *value)
void UnsafeStoreNoWriteBarrier(MachineRepresentation rep, Node *base, Node *value)
TNode< UintPtrT > ChangeUint32ToWord(TNode< Word32T > value)
TNode< T > UncheckedCast(Node *value)
TNode< IntPtrT > WordShl(TNode< IntPtrT > left, TNode< IntegralT > right)
TNode< Int32T > Int32Mul(TNode< Int32T > left, TNode< Int32T > right)
TNode< BoolT > WordEqual(TNode< WordT > left, TNode< WordT > right)
void GotoIfNot(TNode< IntegralT > condition, Label *false_label, GotoHint goto_hint=GotoHint::kNone)
void PopAndReturn(Node *pop, Node *value)
TNode< IntPtrT > WordSar(TNode< IntPtrT > left, TNode< IntegralT > right)
TNode< Int32T > Word32BitwiseNot(TNode< Int32T > a)
bool IsInt32AbsWithOverflowSupported() const
TNode< Uint32T > Uint64HighWordConstantNoLowWord(uint64_t value)
void OptimizedStoreIndirectPointerField(TNode< HeapObject > object, int offset, IndirectPointerTag tag, Node *value)
Isolate * isolate() const
void StoreToObject(MachineRepresentation rep, TNode< Object > object, TNode< IntPtrT > offset, Node *value, StoreToObjectWriteBarrier write_barrier)
Node * LoadFromObject(MachineType type, TNode< Object > object, TNode< IntPtrT > offset)
bool IsFloat64RoundTruncateSupported() const
TNode< Object > LoadFullTagged(Node *base)
TNode< Uint32T > Unsigned(TNode< Word32T > x)
TNode< Int32T > Word32And(TNode< Int32T > left, TNode< Int32T > right)
TNode< Int32T > UniqueInt32Constant(int32_t value)
TNode< Uint32T > UniqueUint32Constant(int32_t value)
void AbortCSADcheck(Node *message)
bool TryToSmiConstant(TNode< IntegralT > node, Tagged< Smi > *out_value)
TNode< T > ReinterpretCast(Node *value)
bool IsFloat64RoundTiesEvenSupported() const
TNode< Int32T > Int32Add(TNode< Int32T > left, TNode< Int32T > right)
TNode< IntPtrT > BitcastTaggedToWord(TNode< Smi > node)
bool IsWord32CtzSupported() const
TNode< String > StringConstant(const char *str)
TNode< Uint64T > Uint64Constant(uint64_t value)
void TailCallRuntime(Runtime::FunctionId function, TNode< Object > context, TArgs... args)
TNode< Int64T > TruncateFloat64ToInt64(TNode< Float64T > value)
TNode< Uint64T > Uint64Add(TNode< Uint64T > left, TNode< Uint64T > right)
void StoreFullTaggedNoWriteBarrier(TNode< RawPtrT > base, TNode< Object > tagged_value)
TNode< BoolT > Int32FalseConstant()
bool IsFloat64RoundUpSupported() const
TNode< Smi > SmiConstant(Tagged< Smi > value)
void GotoIf(TNode< IntegralT > condition, Label *true_label, GotoHint goto_hint=GotoHint::kNone)
Node * Load(MachineType type, Node *base)
void OptimizedStoreField(MachineRepresentation rep, TNode< HeapObject > object, int offset, Node *value)
void OptimizedStoreMap(TNode< HeapObject > object, TNode< Map >)
TNode< Float64T > RoundIntPtrToFloat64(Node *value)
TNode< IntPtrT > ChangeInt32ToIntPtr(TNode< Word32T > value)
TNode< Int32T > Int32Sub(TNode< Int32T > left, TNode< Int32T > right)
TNode< RawPtrT > LoadParentFramePointer()
TNode< Int32T > Word32Or(TNode< Int32T > left, TNode< Int32T > right)
TNode< Int32T > Word32Shl(TNode< Int32T > left, TNode< Int32T > right)
void BreakOnNode(int node_id)
TNode< BoolT > IntPtrEqual(TNode< WordT > left, TNode< WordT > right)
bool TryToIntPtrConstant(TNode< IntegralT > node, intptr_t *out_value)
TNode< IntPtrT > WordAnd(TNode< IntPtrT > left, TNode< IntPtrT > right)
TNode< Int32T > TruncateFloat32ToInt32(TNode< Float32T > value)
void Switch(Node *index, Label *default_label, const int32_t *case_values, Label **case_labels, size_t case_count)
bool TryToInt32Constant(TNode< IntegralT > node, int32_t *out_value)
bool IsWord32PopcntSupported() const
bool HasDynamicJSParameterCount()
TNode< Int64T > Word64And(TNode< Int64T > left, TNode< Int64T > right)
TNode< Int64T > Int64Sub(TNode< Int64T > left, TNode< Int64T > right)
TNode< IntPtrT > IntPtrSub(TNode< IntPtrT > left, TNode< IntPtrT > right)
TNode< typename std::tuple_element< index, std::tuple< T1, T2 > >::type > Projection(TNode< PairT< T1, T2 > > value)
void OptimizedStoreIndirectPointerFieldNoWriteBarrier(TNode< HeapObject > object, int offset, IndirectPointerTag tag, Node *value)
TNode< Uint32T > Uint64HighWordConstant(uint64_t value)
TNode< Uint32T > Uint32Sub(TNode< Uint32T > left, TNode< Uint32T > right)
TNode< Float64T > Float64Constant(double value)
TNode< Int64T > Word64Xor(TNode< Int64T > left, TNode< Int64T > right)
TNode< BoolT > Int32TrueConstant()
TNode< Float64T > ChangeUintPtrToFloat64(TNode< UintPtrT > value)
TNode< BoolT > BoolConstant(bool value)
TNode< Int64T > Word64Shr(TNode< Int64T > left, TNode< Uint64T > right)
TNode< Uint32T > Word32Shr(TNode< Uint32T > left, TNode< Uint32T > right)
TNode< Uint64T > Uint64Sub(TNode< Uint64T > left, TNode< Uint64T > right)
TNode< Uint32T > Uint64LowWordConstant(uint64_t value)
TNode< ExternalReference > ExternalConstant(ExternalReference address)
TNode< Int32T > Int32Constant(int32_t value)
TNode< BoolT > WordNotEqual(TNode< WordT > left, TNode< WordT > right)
Node * CallCFunction(Node *function, std::optional< MachineType > return_type, CArgs... cargs)
TNode< Uint32T > Uint32Add(TNode< Uint32T > left, TNode< Uint32T > right)
TNode< Uint32T > Uint32Constant(uint32_t value)
TNode< Type > HeapConstantNoHole(Handle< Type > object)
TNode< Type > UnalignedLoad(TNode< RawPtrT > base, TNode< IntPtrT > offset)
TNode< BoolT > Word32Equal(TNode< Word32T > left, TNode< Word32T > right)
TNode< T > CallRuntime(Runtime::FunctionId function, TNode< Object > context, TArgs... args)
TNode< PairT< Word32T, Word32T > > Int32PairSub(TNode< Word32T > lhs_lo_word, TNode< Word32T > lhs_hi_word, TNode< Word32T > rhs_lo_word, TNode< Word32T > rhs_hi_word)
TNode< UintPtrT > UintPtrConstant(uintptr_t value)
TNode< ExternalReference > IsolateField(IsolateFieldId id)
void Store(Node *base, Node *value)
TNode< RawPtrT > RawPtrAdd(TNode< RawPtrT > left, TNode< IntPtrT > right)
TNode< Int64T > Word64Shl(TNode< Int64T > left, TNode< Int64T > right)
TNode< UintPtrT > WordShr(TNode< UintPtrT > left, TNode< IntegralT > right)
TNode< UintPtrT > UintPtrAdd(TNode< UintPtrT > left, TNode< UintPtrT > right)
TNode< Int64T > Word64Not(TNode< Int64T > value)
TNode< T > CallBuiltin(Builtin id, TNode< Object > context, TArgs... args)
bool IsTruncateFloat64ToFloat16RawBitsSupported() const
void Branch(TNode< IntegralT > condition, Label *true_label, Label *false_label, BranchHint branch_hint=BranchHint::kNone)
TNode< HeapObject > OptimizedAllocate(TNode< IntPtrT > size, AllocationType allocation)
void StoreNoWriteBarrier(MachineRepresentation rep, Node *base, Node *value)
TNode< Uint16T > DynamicJSParameterCount()
bool IsFloat64RoundDownSupported() const
TNode< BoolT > Word64Equal(TNode< Word64T > left, TNode< Word64T > right)
#define CSA_DCHECK_BRANCH(csa,...)
#define CSA_SLOW_DCHECK(csa,...)
#define CSA_DCHECK(csa,...)
#define CSA_CHECK(csa, x)
#define HEAP_CONSTANT_ACCESSOR(rootIndexName, rootAccessorName, name)
#define HEAP_CONSTANT_TEST(rootIndexName, rootAccessorName, name)
#define V8_ENABLE_SWISS_NAME_DICTIONARY_BOOL
#define COMPRESS_POINTERS_BOOL
#define V8_COMPRESS_POINTERS_8GB_BOOL
#define ALIGN_TO_ALLOCATION_ALIGNMENT(value)
#define V8_ENABLE_SANDBOX_BOOL
Tagged< NativeContext > native_context_
#define RAB_GSAB_TYPED_ARRAYS(V)
base::Vector< const DirectHandle< Object > > args
DirectHandle< Object > new_target
BytecodeAssembler & assembler_
#define V8_ALLOCATION_SITE_TRACKING_BOOL
#define HEAP_IMMUTABLE_IMMOVABLE_OBJECT_LIST(V)
#define HEAP_IMMOVABLE_OBJECT_LIST(V)
#define HEAP_MUTABLE_IMMOVABLE_OBJECT_LIST(V)
std::optional< TNode< JSArray > > a
ArrayReduceDirection direction
ZoneVector< RpoNumber > & result
InstructionOperand source
constexpr unsigned CountPopulation(T value)
constexpr bool IsPowerOfTwo(T value)
V8_INLINE Dest bit_cast(Source const &source)
constexpr Tagged_t kNonJsReceiverMapLimit
V8_INLINE constexpr std::optional< RootIndex > UniqueMapOfInstanceType(InstanceType type)
TNode< Float64T > Float64Add(TNode< Float64T > a, TNode< Float64T > b)
static constexpr int kNotFullMask
void Store(LiftoffAssembler *assm, LiftoffRegister src, MemOperand dst, ValueKind kind)
const uint32_t kSharedStringTag
const intptr_t kHeapObjectTagMask
V8_INLINE IndirectHandle< T > handle(Tagged< T > object, Isolate *isolate)
PropertiesEnumerationMode
constexpr int kCodePointerTableEntrySizeLog2
const uint32_t kStringEncodingMask
constexpr uint64_t kExternalPointerTagShift
constexpr int kTaggedSize
bool StoreModeHandlesCOW(KeyedAccessStoreMode store_mode)
bool StoreModeIsInBounds(KeyedAccessStoreMode store_mode)
bool StoreModeCanGrow(KeyedAccessStoreMode store_mode)
constexpr double kMaxSafeInteger
constexpr uint64_t kFP64SignMask
constexpr int kMaxRegularHeapObjectSize
constexpr int kBitsPerByte
@ UPDATE_EPHEMERON_KEY_WRITE_BARRIER
@ UNSAFE_SKIP_WRITE_BARRIER
constexpr bool IsHoleyElementsKind(ElementsKind kind)
constexpr intptr_t kObjectAlignment
constexpr JSDispatchHandle kInvalidDispatchHandle(0xffffffff<< kJSDispatchHandleShift)
constexpr int kOneByteSize
bool IsNumber(Tagged< Object > obj)
constexpr uint32_t kStringRepresentationAndEncodingMask
constexpr uint32_t kSeqOneByteStringTag
static V8_INLINE constexpr bool IsSharedExternalPointerType(ExternalPointerTagRange tag_range)
bool IsSpecialReceiverInstanceType(InstanceType instance_type)
Map::Bits1::HasPrototypeSlotBit Map::Bits1::HasNamedInterceptorBit Map::Bits1::IsUndetectableBit Map::Bits1::IsConstructorBit bit_field2
constexpr uint64_t kExternalPointerPayloadMask
@ kUnknownIndirectPointerTag
const uint32_t kUncachedExternalStringTag
bool IsSealedElementsKind(ElementsKind kind)
constexpr ExternalPointerTagRange kAnyExternalPointerTagRange(kFirstExternalPointerTag, kLastExternalPointerTag)
static constexpr InstanceType PROPERTY_DICTIONARY_TYPE
bool IsTypedArrayElementsKind(ElementsKind kind)
constexpr uint64_t kExternalPointerTagMask
bool IsRabGsabTypedArrayElementsKind(ElementsKind kind)
constexpr int kCodePointerTableEntryCodeObjectOffset
constexpr int kTrustedPointerTableEntrySizeLog2
const uint32_t kThinStringTagBit
constexpr size_t kJSDispatchTableReservationSize
constexpr bool IsSmiElementsKind(ElementsKind kind)
const Address kWeakHeapObjectMask
const uint32_t kUncachedExternalStringMask
constexpr uint64_t kHoleNanInt64
constexpr bool IsObjectElementsKind(ElementsKind kind)
const uint32_t kNotInternalizedTag
constexpr uint64_t kMaxSafeIntegerUint64
constexpr int kSystemPointerSizeLog2
bool IsNonextensibleElementsKind(ElementsKind kind)
@ FIRST_ANY_NONEXTENSIBLE_ELEMENTS_KIND
@ LAST_FAST_ELEMENTS_KIND
@ HOLEY_NONEXTENSIBLE_ELEMENTS
@ FIRST_FAST_ELEMENTS_KIND
@ SLOW_STRING_WRAPPER_ELEMENTS
@ PACKED_NONEXTENSIBLE_ELEMENTS
@ LAST_ANY_NONEXTENSIBLE_ELEMENTS_KIND
@ SYSTEM_POINTER_ELEMENTS
@ TERMINAL_FAST_ELEMENTS_KIND
@ FIRST_RAB_GSAB_FIXED_TYPED_ARRAY_ELEMENTS_KIND
@ LAST_RAB_GSAB_FIXED_TYPED_ARRAY_ELEMENTS_KIND
@ FAST_STRING_WRAPPER_ELEMENTS
const uint32_t kStringTag
constexpr int kFP16MantissaBits
constexpr intptr_t kObjectAlignment8GbHeapMask
too high values may cause the compiler to set high thresholds for inlining to as much as possible avoid inlined allocation of objects that cannot escape trace load stores from virtual maglev objects use TurboFan fast string builder analyze liveness of environment slots and zap dead values trace TurboFan load elimination emit data about basic block usage in builtins to this enable builtin reordering when run mksnapshot flag for emit warnings when applying builtin profile data verify register allocation in TurboFan randomly schedule instructions to stress dependency tracking enable store store elimination in TurboFan rewrite far to near simulate GC compiler thread race related to allow float parameters to be passed in simulator mode JS Wasm Run additional turbo_optimize_inlined_js_wasm_wrappers enable experimental feedback collection in generic lowering enable Turboshaft s WasmLoadElimination enable Turboshaft s low level load elimination for JS enable Turboshaft s escape analysis for string concatenation use enable Turbolev features that we want to ship in the not too far future trace individual Turboshaft reduction steps trace intermediate Turboshaft reduction steps invocation count threshold for early optimization Enables optimizations which favor memory size over execution speed Enables sampling allocation profiler with X as a sample interval min size of a semi the new space consists of two semi spaces max size of the Collect garbage after Collect garbage after keeps maps alive for< n > old space garbage collections print one detailed trace line in allocation gc speed threshold for starting incremental marking via a task in percent of available threshold for starting incremental marking immediately in percent of available Use a single schedule for determining a marking schedule between JS and C objects schedules the minor GC task with kUserVisible priority max worker number of concurrent for NumberOfWorkerThreads start background threads that allocate memory concurrent_array_buffer_sweeping use parallel threads to clear weak refs in the atomic pause trace progress of the incremental marking trace object counts and memory usage report a tick only when allocated zone memory changes by this amount TracingFlags::gc_stats TracingFlags::gc_stats track native contexts that are expected to be garbage collected verify heap pointers before and after GC memory reducer runs GC with ReduceMemoryFootprint flag Maximum number of memory reducer GCs scheduled Old gen GC speed is computed directly from gc tracer counters Perform compaction on full GCs based on V8 s default heuristics Perform compaction on every full GC Perform code space compaction when finalizing a full GC with stack Stress GC compaction to flush out bugs with moving objects flush of baseline code when it has not been executed recently Use time base code flushing instead of age Use a progress bar to scan large objects in increments when incremental marking is active force incremental marking for small heaps and run it more often force marking at random points between and force scavenge at random points between and reclaim otherwise unreachable unmodified wrapper objects when possible less compaction in non memory reducing mode use high priority threads for concurrent Marking Test mode only flag It allows an unit test to select evacuation candidates use incremental marking for CppHeap cppheap_concurrent_marking c value for membalancer A special constant to balance between memory and space tradeoff The smaller the more memory it uses enable use of SSE4 instructions if available enable use of AVX VNNI instructions if available enable use of POPCNT instruction if available force all emitted branches to be in long mode(MIPS/PPC only)") DEFINE_BOOL(partial_constant_pool
bool IsSimpleMapChangeTransition(ElementsKind from_kind, ElementsKind to_kind)
const char * ElementsKindToString(ElementsKind kind)
constexpr int kJSArgcReceiverSlots
const uint32_t kOneByteStringTag
StoreToObjectWriteBarrier
constexpr uint64_t kFP64Infinity
ElementsKind GetCorrespondingNonRabGsabElementsKind(ElementsKind typed_array_kind)
bool IsNullOrUndefined(Tagged< Object > obj, Isolate *isolate)
constexpr size_t kCodePointerTableReservationSize
bool IsSmiOrObjectElementsKind(ElementsKind kind)
constexpr TrustedPointerHandle kNullTrustedPointerHandle
constexpr int kSystemPointerSize
constexpr intptr_t kObjectAlignment8GbHeap
constexpr int kAdditiveSafeIntegerBitLength
const int kWeakHeapObjectTag
constexpr int ElementsKindToShiftSize(ElementsKind elements_kind)
constexpr int kTaggedSizeLog2
constexpr uint64_t kFP16InfinityAndNaNInfimum
constexpr intptr_t kObjectAlignmentMask
static const int kInvalidEnumCacheSentinel
bool NeedsBoundsCheck(CheckBounds check_bounds)
DONT_OVERRIDE DISABLE_ALLOCATION_SITES HOLEY_ELEMENTS
const intptr_t kHeapObjectReferenceTagMask
constexpr bool SmiValuesAre31Bits()
bool IsBooleanMap(Tagged< Map > map)
const uint32_t kStringRepresentationMask
typename detail::FlattenUnionHelper< Union<>, Ts... >::type UnionOf
bool IsFastElementsKind(ElementsKind kind)
@ LAST_SPECIAL_RECEIVER_TYPE
@ LAST_CUSTOM_ELEMENTS_RECEIVER
@ INTERNALIZED_TWO_BYTE_STRING_TYPE
DONT_OVERRIDE DISABLE_ALLOCATION_SITES DISABLE_ALLOCATION_SITES HOLEY_DOUBLE_ELEMENTS
static const int kMaxNumberOfDescriptors
Map::Bits1::HasPrototypeSlotBit Map::Bits1::HasNamedInterceptorBit Map::Bits1::IsUndetectableBit Map::Bits1::IsConstructorBit Map::Bits2::IsImmutablePrototypeBit Map::Bits3::IsDeprecatedBit Map::Bits3::IsPrototypeMapBit bit_field3
constexpr uint32_t kTrustedPointerHandleShift
constexpr uint16_t kFP16Infinity
constexpr uint32_t kCodePointerHandleShift
constexpr uint32_t kHoleNanLower32
constexpr uint64_t kFP16DenormalThreshold
@ kExternalPointerNullTag
bool StoreModeIgnoresTypeArrayOOB(KeyedAccessStoreMode store_mode)
const uint32_t kIsIndirectStringTag
V8_EXPORT_PRIVATE FlagValues v8_flags
constexpr int JSParameterCount(int param_count_without_receiver)
constexpr bool SmiValuesAre32Bits()
constexpr uint32_t kHoleNanUpper32
const uint32_t kInternalizedTag
constexpr IndirectPointerHandle kNullIndirectPointerHandle
const uint32_t kSharedStringMask
constexpr int kJSDispatchTableEntrySizeLog2
constexpr size_t kTrustedPointerTableReservationSize
const intptr_t kSmiTagMask
const uint32_t kIsNotInternalizedMask
constexpr intptr_t kSmiSignMask
constexpr int kFP64MantissaBits
bool IsPrivateSymbol(Tagged< Object > obj)
bool IsTypedArrayOrRabGsabTypedArrayElementsKind(ElementsKind kind)
constexpr int kDoubleSizeLog2
@ kConciseGeneratorMethod
@ kAsyncConciseGeneratorMethod
static constexpr Address kNullAddress
const uint32_t kIsNotStringMask
constexpr int kIeeeDoubleExponentWordOffset
constexpr bool IsDoubleElementsKind(ElementsKind kind)
constexpr uint16_t kFP16qNaN
constexpr uint64_t kTrustedPointerTableMarkBit
constexpr int kDoubleSize
constexpr intptr_t kDoubleAlignmentMask
JSArrayBuffer::IsDetachableBit is_shared
ElementsKind GetInitialFastElementsKind()
constexpr uint64_t kFP64To16RebiasExponentAndRound
constexpr uint32_t kCodePointerHandleMarker
const uint32_t kClearedWeakHeapObjectLower32
constexpr int64_t kMinAdditiveSafeInteger
@ kFirstBuiltinWithSfiRoot
@ kLastBuiltinWithSfiRoot
constexpr uint32_t kMaxUInt32
kInstanceDescriptorsOffset kTransitionsOrPrototypeInfoOffset IsNull(value)||IsJSProxy(value)||IsWasmObject(value)||(IsJSObject(value) &&(HeapLayout
constexpr int kIeeeDoubleMantissaWordOffset
const uint32_t kIsIndirectStringMask
constexpr int ElementsKindToByteSize(ElementsKind elements_kind)
constexpr int kIntptrSize
constexpr uint64_t kExternalPointerMarkBit
static V8_INLINE constexpr bool ExternalPointerCanBeEmpty(ExternalPointerTagRange tag_range)
!IsContextMap !IsContextMap native_context
constexpr uint64_t kFP64To16DenormalMagic
Tagged< To > Cast(Tagged< From > value, const v8::SourceLocation &loc=INIT_SOURCE_LOCATION_IN_DEBUG)
V8_INLINE Local< Primitive > Null(Isolate *isolate)
V8_INLINE Local< Boolean > False(Isolate *isolate)
V8_INLINE Local< Primitive > Undefined(Isolate *isolate)
constexpr std::array< std::remove_cv_t< T >, N > to_array(T(&a)[N])
i::Address Load(i::Address address)
#define STRING_TYPE_LIST(V)
BytecodeSequenceNode * parent_
#define DCHECK_LE(v1, v2)
#define CHECK_GT(lhs, rhs)
#define CHECK_LT(lhs, rhs)
#define CHECK_LE(lhs, rhs)
#define DCHECK_NOT_NULL(val)
#define CHECK_NOT_NULL(val)
#define DCHECK_IMPLIES(v1, v2)
#define DCHECK_NE(v1, v2)
#define DCHECK_GE(v1, v2)
#define CHECK_EQ(lhs, rhs)
#define DCHECK(condition)
#define DCHECK_LT(v1, v2)
#define DCHECK_EQ(v1, v2)
#define DCHECK_GT(v1, v2)
#define V8_EXPORT_PRIVATE
constexpr bool IsAligned(T value, U alignment)
int expected_value_context_index
RootIndex name_root_index
constexpr size_t Size() const
constexpr bool IsEmpty() const
#define OFFSET_OF_DATA_START(Type)
#define STATIC_ASSERT_FIELD_OFFSETS_EQUAL(Offset1, Offset2)
#define V8_STATIC_ROOTS_BOOL
std::unique_ptr< ValueMirror > value
std::unique_ptr< ValueMirror > key