28 constexpr_version_(other.constexpr_version_) {}
34 specialized_from_(specialized_from),
35 constexpr_version_(nullptr) {}
43 for (
const std::string& alias :
aliases_) {
45 result << alias <<
" (aka. ";
63 result <<
"_" << t->SimpleName();
72 const std::string& type_name)
const {
75 return "Handle<" + type_name +
">";
77 return "DirectHandle<" + type_name +
">";
104 if (
const UnionType* union_type = UnionType::DynamicCast(supertype)) {
105 return union_type->IsSupertypeOf(
this);
107 const Type* subtype =
this;
108 while (subtype !=
nullptr) {
109 if (subtype == supertype)
return true;
110 subtype = subtype->
parent();
117 if (constexpr_version ==
nullptr) {
118 Error(
"Type '",
ToString(),
"' requires a constexpr representation");
125 for (
const Type* t =
this; t !=
nullptr; t = t->
parent()) {
126 if (
auto* class_type = ClassType::DynamicCast(t)) {
134 for (
const Type* t =
this; t !=
nullptr; t = t->
parent()) {
135 if (
auto* struct_type = StructType::DynamicCast(t)) {
143 for (
const Type* t =
this; t !=
nullptr; t = t->
parent()) {
144 if (
auto* aggregate_type = AggregateType::DynamicCast(t)) {
145 return aggregate_type;
153 int diff = a->Depth() - b->
Depth();
154 const Type* a_supertype =
a;
155 const Type* b_supertype = b;
156 for (; diff > 0; --diff) a_supertype = a_supertype->
parent();
157 for (; diff < 0; ++diff) b_supertype = b_supertype->
parent();
158 while (a_supertype && b_supertype) {
159 if (a_supertype == b_supertype)
return a_supertype;
160 a_supertype = a_supertype->
parent();
161 b_supertype = b_supertype->
parent();
164 " have no common supertype");
177 return AbstractType::cast(
this)->name() ==
name;
184 "'. Use 'generates' clause in definition.");
193 "'. Use 'generates' clause in definition.");
202 if (std::optional<const Type*> type_wrapped_in_lazy =
205 return "std::function<" + (*type_wrapped_in_lazy)->GetGeneratedTypeName() +
210 return parent()->GetGeneratedTypeName();
222 std::string type_name =
name();
223 if (
auto strong_type =
225 auto strong_runtime_types = (*strong_type)->GetTypeCheckers();
226 std::vector<TypeChecker>
result;
227 for (
const TypeChecker& type : strong_runtime_types) {
230 DCHECK(type.weak_ref_to.empty());
231 result.push_back({type_name, type.type});
235 return {{type_name,
""}};
248 result <<
"BuiltinPointer";
250 result <<
"_" << t->SimpleName();
279 result << t->SimpleName();
287 if (t->IsUnionType()) {
289 names.insert(u->GetGeneratedTNodeTypeName());
292 names.insert(t->GetGeneratedTNodeTypeName());
300 return parent()->GetGeneratedTNodeTypeName();
305 if (simple_name ==
"Object")
return simple_name;
306 if (simple_name ==
"Number")
return simple_name;
307 if (simple_name ==
"Numeric")
return simple_name;
308 if (simple_name ==
"JSAny")
return simple_name;
309 if (simple_name ==
"JSPrimitive")
return simple_name;
311 std::set<std::string> names;
318 for (std::string name : names) {
332 return parent()->GetRuntimeType();
341 if (t->IsUnionType()) {
343 names.insert(u->GetConstexprGeneratedTypeName());
346 names.insert(t->GetConstexprGeneratedTypeName());
360 if (simple_name ==
"Object")
return simple_name;
361 if (simple_name ==
"Number")
return simple_name;
362 if (simple_name ==
"Numeric")
return simple_name;
363 if (simple_name ==
"JSAny")
return simple_name;
364 if (simple_name ==
"JSPrimitive")
return simple_name;
367 std::set<std::string> names;
374 for (std::string name : names) {
401 if ((*it)->IsSubtypeOf(t)) {
418 return "bitfield struct " +
name();
423 if (field.name_and_type.name == name) {
434 std::map<std::string, const AggregateType*> field_names;
436 for (
const Field& field : aggregate_type->fields()) {
437 const std::string& field_name = field.name_and_type.name;
438 auto i = field_names.find(field_name);
439 if (
i != field_names.end()) {
440 CurrentSourcePosition::Scope current_source_position(field.pos);
441 std::string aggregate_type_name =
442 aggregate_type->IsClassType() ?
"class" :
"struct";
443 if (
i->second ==
this) {
445 "' declares a field with the name '", field_name,
449 "' declares a field with the name '", field_name,
450 "' that masks an inherited field from class '",
451 i->second->
name(),
"'");
454 field_names[field_name] = aggregate_type;
461 std::vector<const AggregateType*> hierarchy;
463 while (current_container_type !=
nullptr) {
464 hierarchy.push_back(current_container_type);
465 current_container_type =
467 ? ClassType::cast(current_container_type)->GetSuperClass()
470 std::reverse(hierarchy.begin(), hierarchy.end());
477 if (field.name_and_type.name == name)
return true;
479 if (
parent() !=
nullptr) {
480 if (
auto parent_class = ClassType::DynamicCast(
parent())) {
481 return parent_class->HasField(name);
489 if (field.name_and_type.name == name)
return field;
491 if (
parent() !=
nullptr) {
492 if (
auto parent_class = ClassType::DynamicCast(
parent())) {
493 return parent_class->LookupField(name);
510 generated_type_name_ =
"TorqueStruct" + name();
512 generated_type_name_ =
513 GlobalContext::MakeUniqueName(
"TorqueStruct" + SimpleName());
524 result += std::get<0>(field.GetFieldSizeInformation());
532 const Type* field_type = struct_field.name_and_type.type;
538 result |= (*field_as_struct)->ClassifyContents();
549 if (!specialized_from)
return basename;
551 return torque::ToString(
"const &", *specialized_from->specialized_types[0]);
557 s << basename <<
"<";
559 for (
auto t : specialized_from->specialized_types) {
575 DCHECK_EQ(generic->generic_parameters().size(), 1);
576 if (!type->GetSpecializedFrom()) {
579 auto&
key = type->GetSpecializedFrom().value();
580 if (
key.generic != generic ||
key.specialized_types.size() != 1) {
583 return {
key.specialized_types[0]};
588 std::vector<Method*>
result;
590 [name](
Macro* macro) { return macro->ReadableName() == name; });
593 return (*aggregate_parent)->Methods(name);
604 CurrentScope::Scope scope_activator(
nspace());
605 CurrentSourcePosition::Scope position_activator(
decl_->pos);
619 generates_(generates),
640 CurrentScope::Scope scope_activator(
alias_->ParentScope());
641 CurrentSourcePosition::Scope position_activator(
decl_->pos);
649 std::vector<Field> all_fields;
655 all_fields.insert(all_fields.end(),
fields.begin(),
fields.end());
660 std::vector<Field>
result;
662 if (field.index)
break;
664 DCHECK(std::get<0>(field.GetFieldSizeInformation()) == 0 ||
666 result.push_back(std::move(field));
672 std::vector<Field>
result;
676 DCHECK(std::get<0>(field.GetFieldSizeInformation()) == 0 ||
680 result.push_back(std::move(field));
686 std::optional<int> own, std::optional<std::pair<int, int>> range)
const {
704void ComputeSlotKindsHelper(std::vector<ObjectSlotKind>* slots,
706 const std::vector<Field>& fields) {
707 size_t offset = start_offset;
708 for (
const Field& field : fields) {
709 size_t field_size = std::get<0>(field.GetFieldSizeInformation());
711 if (field_size == 0)
continue;
718 while (used_slots > slots->size()) {
721 const Type* type = field.name_and_type.type;
722 if (
auto struct_type = type->StructSupertype()) {
723 ComputeSlotKindsHelper(slots,
offset, (*struct_type)->fields());
727 if (field.custom_weak_marking) {
733 DCHECK(!field.custom_weak_marking);
739 slots->at(slot_index) =
kind;
748 std::vector<ObjectSlotKind>
result;
750 ComputeSlotKindsHelper(&
result, 0, header_fields);
758 std::vector<ObjectSlotKind> kinds;
760 if (kinds.empty())
return std::nullopt;
761 std::sort(kinds.begin(), kinds.end());
762 if (kinds.front() == kinds.back())
return {kinds.front()};
767 Error(
"Array fields mix types with different GC visitation requirements.")
776 for (
size_t i = 1;
i < header_slot_kinds.
size(); ++
i) {
786 for (
const auto& field :
fields_) {
787 if (field.index.has_value())
return true;
790 return parent->HasIndexedFieldsIncludingInParents();
796 if (field_index > 0) {
797 return &
fields_[field_index - 1];
800 return parent->GetFieldPreceding(
parent->fields_.size());
814 return "FieldSlice" + declarer->
name() +
819 bool at_or_after_indexed_field =
false;
821 at_or_after_indexed_field =
parent->HasIndexedFieldsIncludingInParents();
825 for (
size_t field_index = 0; field_index <
fields_.size(); ++field_index) {
830 at_or_after_indexed_field =
831 at_or_after_indexed_field || field.
index.has_value();
832 CurrentSourcePosition::Scope position_activator(field.
pos);
839 if (at_or_after_indexed_field) {
840 if (!field.
index.has_value()) {
844 "Torque doesn't yet support non-indexed fields after indexed "
858 bool use_index = field.
index && !field.
index->optional;
861 std::string load_macro_name =
"Load" + this->
name() + camel_field_name;
881 load_signature, load_body, std::nullopt);
886 std::string store_macro_name =
"Store" + this->
name() + camel_field_name;
909 store_signature, store_body, std::nullopt,
954 std::vector<Statement*> statements;
959 if (field.
offset.has_value()) {
966 const Type* previous_slice_type =
974 {
"torque_internal"},
"%FieldSlice",
983 statements.push_back(define_previous);
986 size_t previous_element_size;
987 std::tie(previous_element_size, std::ignore) =
989 Expression* previous_element_size_expression =
1005 "*", {previous_element_size_expression, previous_length_expression});
1009 "+", {previous_offset_expression, offset_expression});
1026 {
"torque_internal",
"unsafe"},
1030 new_struct, {parameter, offset_expression, length_expression});
1037 signature, block, std::nullopt);
1040 macro->Position().source);
1043 macro->Position().source);
1063 for (
size_t i = 0;
i <
sig.parameter_types.types.
size(); ++
i) {
1064 if (
i == 0 &&
sig.implicit_count != 0) os <<
"implicit ";
1065 if (
sig.implicit_count > 0 &&
sig.implicit_count ==
i) {
1068 if (
i > 0) os <<
", ";
1070 if (with_names && !
sig.parameter_names.empty()) {
1071 if (
i <
sig.parameter_names.
size()) {
1072 os <<
sig.parameter_names[
i] <<
": ";
1075 os << *
sig.parameter_types.types[
i];
1077 if (
sig.parameter_types.var_args) {
1078 if (!
sig.parameter_names.empty()) os <<
", ";
1082 os <<
": " << *
sig.return_type;
1084 if (
sig.labels.empty())
return;
1087 for (
size_t i = 0;
i <
sig.labels.
size(); ++
i) {
1088 if (
i > 0) os <<
", ";
1089 os <<
sig.labels[
i].name;
1090 if (!
sig.labels[
i].types.empty()) os <<
"(" <<
sig.labels[
i].types <<
")";
1104 os <<
" (custom weak)";
1122 if (!p.
types.empty()) os <<
", ";
1130 auto compare_types =
types();
1131 auto other_compare_types = other.types();
1134 other_compare_types = other.GetExplicitTypes();
1136 if (!(compare_types == other_compare_types &&
1141 if (
labels.size() != other.labels.size()) {
1145 for (
const auto& l :
labels) {
1146 if (l.types != other.labels[
i++].types) {
1154bool FirstTypeIsContext(
const std::vector<const Type*>& parameter_types) {
1155 return !parameter_types.empty() &&
1162 return FirstTypeIsContext(
types());
1170 if (to == from)
return true;
1171 if (from->IsSubtypeOf(to))
return true;
1178 const std::string& fieldname) {
1183 auto& fields = type->fields();
1184 for (
auto& field : fields) {
1186 if (field.name_and_type.name == fieldname) {
1192 ReportError(
"struct '", type->name(),
"' doesn't contain a field '",
1197void AppendLoweredTypes(
const Type* type, std::vector<const Type*>*
result) {
1198 if (type->IsConstexpr())
return;
1199 if (type->IsVoidOrNever())
return;
1200 if (std::optional<const StructType*> s = type->StructSupertype()) {
1201 for (
const Field& field : (*s)->fields()) {
1202 AppendLoweredTypes(field.name_and_type.type,
result);
1212 AppendLoweredTypes(type, &
result);
1219 std::vector<const Type*>
result;
1220 for (
const Type* t : parameters) {
1221 AppendLoweredTypes(t, &
result);
1229 for (
size_t i = parameter_types.
types.size();
i < arg_count; ++
i) {
1243 const Type* from_type) {
1251 if (optional.has_value()) {
1309 size_t alignment_log_2 = 0;
1312 std::max(alignment_log_2, field.name_and_type.type->AlignmentLog2());
1314 return alignment_log_2;
1319 std::optional<const StructType*> struct_type = type->StructSupertype();
1322 for (
const Field& field : (*struct_type)->fields()) {
1323 field.ValidateAlignment(at_offset);
1324 size_t field_size = std::get<0>(field.GetFieldSizeInformation());
1325 at_offset += field_size;
1331 size_t{1} << alignment_log_2,
"-byte aligned.")
1337std::optional<std::tuple<size_t, std::string>>
SizeOf(
const Type* type) {
1338 std::string size_string;
1342 size_string =
"kTaggedSize";
1345 size_string =
"kSystemPointerSize";
1348 size_string =
"kExternalPointerSlotSize";
1351 size_string =
"kCppHeapPointerSlotSize";
1354 size_string =
"kTrustedPointerSize";
1357 size_string =
"kTaggedSize";
1363 size_string =
"kUInt8Size";
1366 size_string =
"kUInt8Size";
1369 size_string =
"kUInt16Size";
1372 size_string =
"kUInt16Size";
1375 size_string =
"kInt32Size";
1378 size_string =
"kInt32Size";
1381 size_string =
"kDoubleSize";
1384 size_string =
"kIntptrSize";
1387 size_string =
"kIntptrSize";
1388 }
else if (
auto struct_type = type->StructSupertype()) {
1391 size_string =
"kDoubleSize";
1393 size = (*struct_type)->PackedSize();
1394 size_string = std::to_string(size);
1399 return std::make_tuple(size, size_string);
1411 if (type->IsBitFieldStructType()) {
1436 IdentifierExpression::DynamicCast(array_size);
1438 !
identifier->namespace_qualification.empty())
1449 if (std::optional<const StructType*> struct_type =
StructSupertype()) {
1450 std::stringstream
result;
1454 if (!first)
result <<
", ";
1456 result << field_type->GetRuntimeType();
1469 if (std::optional<const StructType*> struct_type =
StructSupertype()) {
1470 std::stringstream
result;
1474 if (!first)
result <<
", ";
1476 result << field_type->GetDebugType();
NameAndType name_and_type
std::vector< TypeChecker > GetTypeCheckers() const override
const std::string & name() const
bool IsConstexpr() const final
bool UseParentTypeChecker() const
std::string GetGeneratedTypeNameImpl() const override
size_t AlignmentLog2() const override
const std::string generated_type_
std::string GetGeneratedTNodeTypeNameImpl() const override
const Field & LookupFieldInternal(const std::string &name) const
std::vector< Field > fields_
Namespace * nspace() const
const Field & LookupField(const std::string &name) const
const std::string & name() const
const std::vector< Field > & fields() const
virtual void Finalize() const =0
void CheckForDuplicateFields() const
std::vector< Method * > methods_
std::vector< const AggregateType * > GetHierarchy() const
const std::vector< Method * > & Methods() const
bool HasField(const std::string &name) const
const BitField & LookupField(const std::string &name) const
const std::string & name() const
std::string ToExplicitString() const override
std::vector< BitField > fields_
const Type *const return_type_
std::string ToExplicitString() const override
const TypeVector parameter_types_
const TypeVector & parameter_types() const
bool HasContextParameter() const
std::string SimpleNameImpl() const override
const ClassType * GetSuperClass() const
bool ShouldGenerateCppObjectLayoutDefinitionAsserts() const
SourcePosition GetPosition() const
const ClassType * GetClassDeclaringField(const Field &f) const
std::optional< ObjectSlotKind > ComputeArraySlotKind() const
std::optional< std::pair< int, int > > InstanceTypeRange() const
void Finalize() const override
size_t header_size() const
std::optional< int > own_instance_type_
ClassType(const Type *parent, Namespace *nspace, const std::string &name, ClassFlags flags, const std::string &generates, const ClassDeclaration *decl, const TypeAlias *alias)
std::string GetGeneratedTNodeTypeNameImpl() const override
std::optional< int > OwnInstanceType() const
bool HasNoPointerSlotsExceptMap() const
const Field * GetFieldPreceding(size_t field_index) const
ResidueClass size() const
bool HasStaticSize() const
void InitializeInstanceTypes(std::optional< int > own, std::optional< std::pair< int, int > > range) const
std::string GetGeneratedTypeNameImpl() const override
std::string GetSliceMacroName(const Field &field) const
void GenerateSliceAccessor(size_t field_index)
std::string ToExplicitString() const override
const ClassDeclaration * decl_
bool AllowInstantiation() const
std::vector< Field > ComputeHeaderFields() const
std::vector< Field > ComputeAllFields() const
SourceId AttributedToFile() const
bool HasIndexedFieldsIncludingInParents() const
bool ShouldExport() const
const std::string generates_
std::vector< Field > ComputeArrayFields() const
std::vector< ObjectSlotKind > ComputeHeaderSlotKinds() const
std::optional< std::pair< int, int > > instance_type_range_
static Macro * DeclareMacro(const std::string &name, bool accessible_from_csa, std::optional< std::string > external_assembler_name, const Signature &signature, std::optional< Statement * > body, std::optional< std::string > op={}, bool is_user_defined=true)
static bool IsInstanceTypesInitialized()
static void EnsureInCCDebugOutputList(TorqueMacro *macro, SourceId source)
static void EnsureInCCOutputList(TorqueMacro *macro, SourceId source)
MessageBuilder & Position(SourcePosition position)
std::optional< size_t > SingleValue() const
size_t AlignmentLog2() const
static const std::string & PathFromV8Root(SourceId file)
static SourceId GetSourceId(const std::string &path)
std::string generated_type_name_
std::string GetGeneratedTypeNameImpl() const override
size_t AlignmentLog2() const override
const StructDeclaration * decl_
std::string SimpleNameImpl() const override
void Finalize() const override
Classification ClassifyContents() const
std::string ToExplicitString() const override
StructType(Namespace *nspace, const StructDeclaration *decl, MaybeSpecializationKey specialized_from=std::nullopt)
size_t PackedSize() const
static size_t ProtectedPointerSize()
static size_t CppHeapPointerSize()
static size_t RawPtrSize()
static size_t TrustedPointerSize()
static size_t TaggedSize()
static size_t ExternalPointerSize()
bool IsAbstractType() const
static const Type * GetStrongTaggedType()
static const Type * GetUint31Type()
static const Type * GetFloat64Type()
static const Type * GetUnionType(UnionType type)
static const Type * GetUint32Type()
static const Type * GetInt8Type()
static const Type * GetRawPtrType()
static const Type * GetNoContextType()
static const Type * GetTaggedType()
static std::optional< const Type * > ImplicitlyConvertableFrom(const Type *to, const Type *from)
static const Type * GetUint8Type()
static GenericType * GetMutableReferenceGeneric()
static size_t FreshTypeId()
static const Type * GetUint16Type()
static const Type * GetExternalPointerType()
static const Type * GetObjectType()
static const Type * GetMutableSliceType(const Type *referenced_type)
static const Type * GetVoidType()
static const Type * GetInt32Type()
static const Type * GetUIntPtrType()
static const Type * GetJSObjectType()
static const TopType * GetTopType(std::string reason, const Type *source_type)
static const Type * GetIntPtrType()
static const Type * GetBoolType()
static const Type * GetSmiType()
static const Type * GetMapType()
static const Type * GetContextType()
static const Type * GetTrustedPointerType()
static GenericType * GetWeakGeneric()
static const Type * GetProtectedPointerType()
static GenericType * GetLazyGeneric()
static GenericType * GetConstReferenceGeneric()
static const Type * GetConstSliceType(const Type *referenced_type)
static const Type * GetNeverType()
static const Type * GetFloat64OrUndefinedOrHoleType()
static const Type * GetInt16Type()
static const Type * GetCppHeapPointerType()
static void VisitStructMethods(StructType *struct_type, const StructDeclaration *struct_declaration)
static void VisitClassFieldsAndMethods(ClassType *class_type, const ClassDeclaration *class_declaration)
bool IsAbstractName(const std::string &name) const
virtual std::string GetConstexprGeneratedTypeName() const
static std::optional< const Type * > MatchUnaryGeneric(const Type *type, GenericType *generic)
std::string GetGeneratedTNodeTypeName() const
virtual std::string GetGeneratedTNodeTypeNameImpl() const =0
virtual bool IsSubtypeOf(const Type *supertype) const
std::optional< const AggregateType * > AggregateSupertype() const
virtual std::string GetRuntimeType() const
static std::string ComputeName(const std::string &basename, MaybeSpecializationKey specialized_from)
std::optional< const StructType * > StructSupertype() const
std::string GetHandleTypeName(HandleKind kind, const std::string &type_name) const
virtual std::string ToExplicitString() const =0
virtual std::string SimpleNameImpl() const =0
virtual std::string GetGeneratedTypeNameImpl() const =0
virtual size_t AlignmentLog2() const
std::string GetGeneratedTypeName() const
virtual std::string GetDebugType() const
std::string HandlifiedCppTypeName(HandleKind kind) const
std::optional< const ClassType * > ClassSupertype() const
const MaybeSpecializationKey & GetSpecializedFrom() const
virtual const Type * ConstexprVersion() const
std::string ToString() const
static const Type * CommonSupertype(const Type *a, const Type *b)
void set_parent(const Type *t)
virtual std::string SimpleName() const
std::set< std::string > aliases_
std::string TagglifiedCppTypeName() const
virtual bool IsConstexpr() const
const Type * parent() const
std::set< const Type *, TypeLess > types_
std::string GetConstexprGeneratedTypeName() const override
static void InsertGeneratedTNodeTypeName(std::set< std::string > &names, const Type *t)
std::string GetGeneratedTNodeTypeNameImpl() const override
std::string ToExplicitString() const override
std::string GetRuntimeType() const override
static UnionType FromType(const Type *t)
std::string SimpleNameImpl() const override
static void InsertConstexprGeneratedTypeName(std::set< std::string > &names, const Type *t)
void Subtract(const Type *t)
std::string GetDebugType() const override
static VisitResult NeverResult()
static VisitResult TopTypeResult(std::string top_reason, const Type *from_type)
const Type * type() const
const StackRange & stack_range() const
std::optional< TNode< JSArray > > a
ZoneVector< RpoNumber > & result
constexpr int WhichPowerOfTwo(T value)
VarDeclarationStatement * MakeConstDeclarationStatement(std::string name, Expression *initializer)
bool operator<(const Type &a, const Type &b)
bool IsAssignableFrom(const Type *to, const Type *from)
std::ostream & operator<<(std::ostream &os, Identifier *id)
size_t LoweredSlotCount(const Type *type)
std::optional< NameAndType > ExtractSimpleFieldArraySize(const ClassType &class_type, Expression *array_size)
std::string StringLiteralQuote(const std::string &s)
void ReportError(Args &&... args)
bool IsAnyUnsignedInteger(const Type *type)
T * MakeNode(Args... args)
std::string ToString(Args &&... args)
void PrintSignature(std::ostream &os, const Signature &sig, bool with_names)
VisitResult ProjectStructField(VisitResult structure, const std::string &fieldname)
FieldAccessExpression * MakeFieldAccessExpression(Expression *object, std::string field)
std::optional< SpecializationKey< GenericType > > MaybeSpecializationKey
bool Is32BitIntegralType(const Type *type)
std::string CamelifyString(const std::string &underscore_string)
bool IsAllowedAsBitField(const Type *type)
std::optional< std::tuple< size_t, std::string > > SizeOf(const Type *type)
bool IsPointerSizeIntegralType(const Type *type)
bool StringStartsWith(const std::string &s, const std::string &prefix)
std::vector< const Type * > TypeVector
IdentifierExpression * MakeIdentifierExpression(std::vector< std::string > namespace_qualification, std::string name, std::vector< TypeExpression * > args={})
TypeVector LowerType(const Type *type)
const Type * SubtractType(const Type *a, const Type *b)
void PrintCommaSeparatedList(std::ostream &os, const T &list, C &&transform)
CallExpression * MakeCallExpression(IdentifierExpression *callee, std::vector< Expression * > arguments, std::vector< Identifier * > labels={})
MessageBuilder Error(Args &&... args)
TypeVector LowerParameterTypes(const TypeVector ¶meters)
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 name
kWasmInternalFunctionIndirectPointerTag kProtectedInstanceDataOffset sig
constexpr int kUInt16Size
constexpr int kDoubleSize
BytecodeSequenceNode * parent_
#define DCHECK_NOT_NULL(val)
#define DCHECK_GE(v1, v2)
#define DCHECK(condition)
#define DCHECK_EQ(v1, v2)
std::optional< ClassFieldIndexInfo > index
NameAndType name_and_type
std::optional< size_t > offset
std::tuple< size_t, std::string > GetFieldSizeInformation() const
void ValidateAlignment(ResidueClass at_offset) const
LabelDeclarationVector labels
NameVector parameter_names
ParameterTypes parameter_types
bool HasContextParameter() const
bool HasSameTypesAs(const Signature &other, ParameterMode mode=ParameterMode::kProcessImplicit) const
TypeVector GetExplicitTypes() const
const TypeVector & types() const