Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
kernel_translation_helper.h
Go to the documentation of this file.
1// Copyright (c) 2018, the Dart project authors. Please see the AUTHORS file
2// for details. All rights reserved. Use of this source code is governed by a
3// BSD-style license that can be found in the LICENSE file.
4
5#ifndef RUNTIME_VM_COMPILER_FRONTEND_KERNEL_TRANSLATION_HELPER_H_
6#define RUNTIME_VM_COMPILER_FRONTEND_KERNEL_TRANSLATION_HELPER_H_
7
8#if defined(DART_PRECOMPILED_RUNTIME)
9#error "AOT runtime should not use compiler sources (including header files)"
10#endif // defined(DART_PRECOMPILED_RUNTIME)
11
12#include "vm/compiler/backend/il.h" // For CompileType.
13#include "vm/kernel.h"
14#include "vm/kernel_binary.h"
15#include "vm/object.h"
16
17namespace dart {
18
19namespace kernel {
20
21class ConstantReader;
22class KernelReaderHelper;
23class TypeTranslator;
24
26 public:
28
30
31 virtual ~TranslationHelper() {}
32
33 void Reset();
34
36
37 Thread* thread() { return thread_; }
38
39 Zone* zone() { return zone_; }
40
41 IsolateGroup* isolate_group() { return isolate_group_; }
42
43 Heap::Space allocation_space() { return allocation_space_; }
44
45 // Access to strings.
46 const TypedData& string_offsets() const { return string_offsets_; }
48
49 const TypedDataView& string_data() const { return string_data_; }
51
52 const TypedData& canonical_names() const { return canonical_names_; }
54
55 const TypedDataView& metadata_payloads() const { return metadata_payloads_; }
57
58 const TypedDataView& metadata_mappings() const { return metadata_mappings_; }
60
61 // Access to previously evaluated constants from the constants table.
62 const Array& constants() { return constants_; }
63 void SetConstants(const Array& constants);
64
65 // Access to the raw bytes of the constants table.
66 const TypedDataView& constants_table() const { return constants_table_; }
68
70 const KernelProgramInfo& GetKernelProgramInfo() const { return info_; }
71
72 intptr_t StringOffset(StringIndex index) const;
73 intptr_t StringSize(StringIndex index) const;
74
75 // The address of the backing store of the string with a given index. If the
76 // backing store is in the VM's heap this address is not safe for GC (call the
77 // function and use the result within a NoSafepointScope).
78 uint8_t* StringBuffer(StringIndex index) const;
79
80 uint8_t CharacterAt(StringIndex string_index, intptr_t index);
81 bool StringEquals(StringIndex string_index, const char* other);
82
83 // Accessors and predicates for canonical names.
88 bool IsRoot(NameIndex name);
99
100 // For a member (field, constructor, or procedure) return the canonical name
101 // of the enclosing class or library.
103
104 InstancePtr Canonicalize(const Instance& instance);
105
106 const String& DartString(const char* content) {
107 return DartString(content, allocation_space_);
108 }
109 const String& DartString(const char* content, Heap::Space space);
110
111 String& DartString(StringIndex index) {
112 return DartString(index, allocation_space_);
113 }
114 String& DartString(StringIndex string_index, Heap::Space space);
115
116 String& DartString(const uint8_t* utf8_array,
117 intptr_t len,
118 Heap::Space space);
119
121
122 const String& DartSymbolPlain(const char* content) const;
123 String& DartSymbolPlain(StringIndex string_index) const;
124 const String& DartSymbolObfuscate(const char* content) const;
125 String& DartSymbolObfuscate(StringIndex string_index) const;
126
127 String& DartIdentifier(const Library& lib, StringIndex string_index);
128
129 const String& DartClassName(NameIndex kernel_class);
130
131 const String& DartConstructorName(NameIndex constructor);
132
133 const String& DartProcedureName(NameIndex procedure);
134
135 const String& DartSetterName(NameIndex setter);
136 const String& DartSetterName(NameIndex parent, StringIndex setter);
137
138 const String& DartGetterName(NameIndex getter);
139 const String& DartGetterName(NameIndex parent, StringIndex getter);
140
141 const String& DartFieldName(NameIndex field);
142 const String& DartFieldName(NameIndex parent, StringIndex field);
143
144 const String& DartMethodName(NameIndex method);
145 const String& DartMethodName(NameIndex parent, StringIndex method);
146
147 const String& DartFactoryName(NameIndex factory);
148
149 DART_NORETURN void LookupFailed(NameIndex name);
150 DART_NORETURN void LookupFailed(StringIndex name);
151
152 // A subclass overrides these when reading in the Kernel program in order to
153 // support recursive type expressions (e.g. for "implements X" ...
154 // annotations).
155 virtual LibraryPtr LookupLibraryByKernelLibrary(NameIndex library,
156 bool required = true);
157 virtual ClassPtr LookupClassByKernelClass(NameIndex klass,
158 bool required = true);
159 ClassPtr LookupClassByKernelClassOrLibrary(NameIndex kernel_name,
160 bool required = true);
161
162 FieldPtr LookupFieldByKernelField(NameIndex field, bool required = true);
164 bool required = true);
166 bool required = true);
167 FunctionPtr LookupConstructorByKernelConstructor(NameIndex constructor,
168 bool required = true);
169 FunctionPtr LookupConstructorByKernelConstructor(const Class& owner,
170 NameIndex constructor,
171 bool required = true);
172 FunctionPtr LookupConstructorByKernelConstructor(const Class& owner,
173 StringIndex constructor_name,
174 bool required = true);
176 const String& method_name,
177 bool required = true);
178 ObjectPtr LookupMemberByMember(NameIndex kernel_name, bool required = true);
179 FunctionPtr LookupDynamicFunction(const Class& klass, const String& name);
180
181 Type& GetDeclarationType(const Class& klass);
182
183 void SetupFieldAccessorFunction(const Class& klass,
184 const Function& function,
185 const AbstractType& field_type);
186
187 void ReportError(const char* format, ...) PRINTF_ATTRIBUTE(2, 3);
188 void ReportError(const Script& script,
189 const TokenPosition position,
190 const char* format,
191 ...) PRINTF_ATTRIBUTE(4, 5);
192 void ReportError(const Error& prev_error, const char* format, ...)
193 PRINTF_ATTRIBUTE(3, 4);
194 void ReportError(const Error& prev_error,
195 const Script& script,
196 const TokenPosition position,
197 const char* format,
198 ...) PRINTF_ATTRIBUTE(5, 6);
199
201 ASSERT(expression_evaluation_function_ == nullptr);
202 expression_evaluation_function_ = &Function::Handle(zone_, function.ptr());
203 }
205 if (expression_evaluation_function_ == nullptr) {
206 return Function::null_function();
207 }
208 return *expression_evaluation_function_;
209 }
211 ASSERT(expression_evaluation_class_ == nullptr);
212 ASSERT(!cls.IsNull());
213 expression_evaluation_class_ = &Class::Handle(zone_, cls.ptr());
214 }
216 if (expression_evaluation_class_ == nullptr) {
217 return Class::null_class();
218 }
219 return *expression_evaluation_class_;
220 }
221 void SetExpressionEvaluationRealClass(const Class& real_class) {
222 ASSERT(expression_evaluation_real_class_ == nullptr);
223 ASSERT(!real_class.IsNull());
224 expression_evaluation_real_class_ = &Class::Handle(zone_, real_class.ptr());
225 }
227 if (expression_evaluation_real_class_ == nullptr) {
228 return Class::null_class();
229 }
230 return *expression_evaluation_real_class_;
231 }
232
233 private:
234 // This will mangle [name_to_modify] if necessary and make the result a symbol
235 // if asked. The result will be available in [name_to_modify] and it is also
236 // returned. If the name is private, the canonical name [parent] will be used
237 // to get the import URI of the library where the name is visible.
238 String& ManglePrivateName(NameIndex parent,
239 String* name_to_modify,
240 bool symbolize = true,
241 bool obfuscate = true);
242 String& ManglePrivateName(const Library& library,
243 String* name_to_modify,
244 bool symbolize = true,
245 bool obfuscate = true);
246
247 Thread* thread_;
248 Zone* zone_;
249 IsolateGroup* isolate_group_;
250 Heap::Space allocation_space_;
251
252 TypedData& string_offsets_;
253 TypedDataView& string_data_;
254 TypedData& canonical_names_;
255 TypedDataView& metadata_payloads_;
256 TypedDataView& metadata_mappings_;
257 Array& constants_;
258 TypedDataView& constants_table_;
259 KernelProgramInfo& info_;
260 Smi& name_index_handle_;
261 GrowableObjectArray* potential_extension_libraries_ = nullptr;
262 Function* expression_evaluation_function_ = nullptr;
263
264 // A temporary class needed to contain the function to which an eval
265 // expression is compiled. This is a fresh class so loading the kernel
266 // isn't a no-op. It should be unreachable after the eval function is loaded.
267 Class* expression_evaluation_class_ = nullptr;
268
269 // The original class that is the scope in which the eval expression is
270 // evaluated.
271 Class* expression_evaluation_real_class_ = nullptr;
272
274};
275
276// Helper class that reads a kernel FunctionNode from binary.
277//
278// Use ReadUntilExcluding to read up to but not including a field.
279// One can then for instance read the field from the call-site (and remember to
280// call SetAt to inform this helper class), and then use this to read more.
281// Simple fields are stored (e.g. integers) and can be fetched from this class.
282// If asked to read a compound field (e.g. an expression) it will be skipped.
284 public:
302
303 enum AsyncMarker : intptr_t {
304 kSync = 0,
308 };
309
311 helper_ = helper;
312 next_read_ = kStart;
313 }
314
316 ReadUntilExcluding(static_cast<Field>(static_cast<int>(field) + 1));
317 }
318
319 void ReadUntilExcluding(Field field);
320
321 void SetNext(Field field) { next_read_ = field; }
322 void SetJustRead(Field field) { next_read_ = field + 1; }
323
324 TokenPosition position_ = TokenPosition::kNoSource;
325 TokenPosition end_position_ = TokenPosition::kNoSource;
330
331 private:
332 KernelReaderHelper* helper_;
333 intptr_t next_read_;
334
336};
337
339 public:
350
351 enum Flag {
353 };
354
356 helper_ = helper;
357 next_read_ = kStart;
358 }
359
361 ReadUntilExcluding(static_cast<Field>(static_cast<int>(field) + 1));
362 }
363
364 void ReadUntilExcluding(Field field);
365
366 void SetNext(Field field) { next_read_ = field; }
367 void SetJustRead(Field field) { next_read_ = field + 1; }
368
370 ReadUntilExcluding(field);
371 SetJustRead(field);
372 }
373
375
377 return (flags_ & kIsGenericCovariantImpl) != 0;
378 }
379
380 TokenPosition position_ = TokenPosition::kNoSource;
381 uint8_t flags_ = 0;
382 StringIndex name_index_;
383
384 private:
385 KernelReaderHelper* helper_;
386 intptr_t next_read_;
387
389};
390
391// Helper class that reads a kernel VariableDeclaration from binary.
392//
393// Use ReadUntilExcluding to read up to but not including a field.
394// One can then for instance read the field from the call-site (and remember to
395// call SetAt to inform this helper class), and then use this to read more.
396// Simple fields are stored (e.g. integers) and can be fetched from this class.
397// If asked to read a compound field (e.g. an expression) it will be skipped.
399 public:
410
411 enum Flag {
412 kFinal = 1 << 0,
413 kConst = 1 << 1,
416 kLate = 1 << 5,
417 kRequired = 1 << 6,
418 kCovariant = 1 << 7,
419 kLowered = 1 << 8,
420 kSynthesized = 1 << 9,
421 kHoisted = 1 << 10,
422 };
423
425 : annotation_count_(0), helper_(helper), next_read_(kPosition) {}
426
428 ReadUntilExcluding(static_cast<Field>(static_cast<int>(field) + 1));
429 }
430
431 void ReadUntilExcluding(Field field);
432
433 void SetNext(Field field) { next_read_ = field; }
434 void SetJustRead(Field field) { next_read_ = field + 1; }
435
436 bool IsConst() const { return (flags_ & kConst) != 0; }
437 bool IsFinal() const { return (flags_ & kFinal) != 0; }
438 bool IsCovariant() const { return (flags_ & kCovariant) != 0; }
439 bool IsLate() const { return (flags_ & kLate) != 0; }
440 bool IsRequired() const { return (flags_ & kRequired) != 0; }
441 bool IsSynthesized() const { return (flags_ & kSynthesized) != 0; }
442 bool IsHoisted() const { return (flags_ & kHoisted) != 0; }
444 return (flags_ & kHasDeclaredInitializer) != 0;
445 }
446
448 return (flags_ & kIsGenericCovariantImpl) != 0;
449 }
450
451 TokenPosition position_ = TokenPosition::kNoSource;
452 TokenPosition equals_position_ = TokenPosition::kNoSource;
453 uint32_t flags_ = 0;
454 StringIndex name_index_;
455 intptr_t annotation_count_ = 0;
456
457 private:
458 KernelReaderHelper* helper_;
459 intptr_t next_read_;
460
462};
463
464// Helper class that reads a kernel Field from binary.
465//
466// Use ReadUntilExcluding to read up to but not including a field.
467// One can then for instance read the field from the call-site (and remember to
468// call SetAt to inform this helper class), and then use this to read more.
469// Simple fields are stored (e.g. integers) and can be fetched from this class.
470// If asked to read a compound field (e.g. an expression) it will be skipped.
472 public:
488
489 enum Flag {
490 kFinal = 1 << 0,
491 kConst = 1 << 1,
492 kStatic = 1 << 2,
493 kIsCovariant = 1 << 3,
495 kIsLate = 1 << 5,
497 kLegacy = 1 << 7,
499 kEnumElement = 1 << 9,
501 };
502
504 : helper_(helper), next_read_(kStart) {}
505
506 FieldHelper(KernelReaderHelper* helper, intptr_t offset);
507
509 ReadUntilExcluding(static_cast<Field>(static_cast<int>(field) + 1));
510 }
511
512 void ReadUntilExcluding(Field field);
513
514 void SetNext(Field field) { next_read_ = field; }
515 void SetJustRead(Field field) { next_read_ = field + 1; }
516
517 bool IsConst() { return (flags_ & kConst) != 0; }
518 bool IsFinal() { return (flags_ & kFinal) != 0; }
519 bool IsStatic() { return (flags_ & kStatic) != 0; }
520 bool IsCovariant() const { return (flags_ & kIsCovariant) != 0; }
522 return (flags_ & kIsGenericCovariantImpl) != 0;
523 }
524 bool IsLate() const { return (flags_ & kIsLate) != 0; }
525 bool IsExtensionMember() const { return (flags_ & kExtensionMember) != 0; }
527 return (flags_ & kExtensionTypeMember) != 0;
528 }
529
533 TokenPosition position_ = TokenPosition::kNoSource;
534 TokenPosition end_position_ = TokenPosition::kNoSource;
535 uint32_t flags_ = 0;
536 intptr_t source_uri_index_ = 0;
537 intptr_t annotation_count_ = 0;
538
539 private:
540 KernelReaderHelper* helper_;
541 intptr_t next_read_;
542
544};
545
546// Helper class that reads a kernel Procedure from binary.
547//
548// Use ReadUntilExcluding to read up to but not including a field.
549// One can then for instance read the field from the call-site (and remember to
550// call SetAt to inform this helper class), and then use this to read more.
551// Simple fields are stored (e.g. integers) and can be fetched from this class.
552// If asked to read a compound field (e.g. an expression) it will be skipped.
554 public:
572
580
590
591 enum Flag {
592 kStatic = 1 << 0,
593 kAbstract = 1 << 1,
594 kExternal = 1 << 2,
595 kConst = 1 << 3, // Only for external const factories.
597 kIsLegacy = 1 << 5,
602 };
603
605 : helper_(helper), next_read_(kStart) {}
606
608 ReadUntilExcluding(static_cast<Field>(static_cast<int>(field) + 1));
609 }
610
611 void ReadUntilExcluding(Field field);
612
613 void SetNext(Field field) { next_read_ = field; }
614 void SetJustRead(Field field) { next_read_ = field + 1; }
615
616 bool IsStatic() const { return (flags_ & kStatic) != 0; }
617 bool IsAbstract() const { return (flags_ & kAbstract) != 0; }
618 bool IsExternal() const { return (flags_ & kExternal) != 0; }
619 bool IsConst() const { return (flags_ & kConst) != 0; }
620 bool IsSynthetic() const { return (flags_ & kSyntheticProcedure) != 0; }
622 return (flags_ & kInternalImplementation) != 0;
623 }
631 bool IsExtensionMember() const { return (flags_ & kExtensionMember) != 0; }
633 return (flags_ & kExtensionTypeMember) != 0;
634 }
635 bool IsMemberSignature() const {
637 }
638
640 TokenPosition start_position_ = TokenPosition::kNoSource;
641 TokenPosition position_ = TokenPosition::kNoSource;
642 TokenPosition end_position_ = TokenPosition::kNoSource;
644 uint32_t flags_ = 0;
645 intptr_t source_uri_index_ = 0;
646 intptr_t annotation_count_ = 0;
648
649 // Only valid if the 'isForwardingStub' flag is set.
651
652 private:
653 KernelReaderHelper* helper_;
654 intptr_t next_read_;
655
657};
658
659// Helper class that reads a kernel Constructor from binary.
660//
661// Use ReadUntilExcluding to read up to but not including a field.
662// One can then for instance read the field from the call-site (and remember to
663// call SetAt to inform this helper class), and then use this to read more.
664// Simple fields are stored (e.g. integers) and can be fetched from this class.
665// If asked to read a compound field (e.g. an expression) it will be skipped.
667 public:
682
683 enum Flag {
684 kConst = 1 << 0,
685 kExternal = 1 << 1,
686 kSynthetic = 1 << 2,
687 };
688
690 : helper_(helper), next_read_(kStart) {}
691
693 ReadUntilExcluding(static_cast<Field>(static_cast<int>(field) + 1));
694 }
695
696 void ReadUntilExcluding(Field field);
697
698 void SetNext(Field field) { next_read_ = field; }
699 void SetJustRead(Field field) { next_read_ = field + 1; }
700
701 bool IsExternal() { return (flags_ & kExternal) != 0; }
702 bool IsConst() { return (flags_ & kConst) != 0; }
703 bool IsSynthetic() { return (flags_ & kSynthetic) != 0; }
704
706 TokenPosition start_position_ = TokenPosition::kNoSource;
707 TokenPosition position_ = TokenPosition::kNoSource;
708 TokenPosition end_position_ = TokenPosition::kNoSource;
709 uint8_t flags_ = 0;
710 intptr_t source_uri_index_ = 0;
711 intptr_t annotation_count_ = 0;
712
713 private:
714 KernelReaderHelper* helper_;
715 intptr_t next_read_;
716
718};
719
720// Helper class that reads a kernel Class from binary.
721//
722// Use ReadUntilExcluding to read up to but not including a field.
723// One can then for instance read the field from the call-site (and remember to
724// call SetAt to inform this helper class), and then use this to read more.
725// Simple fields are stored (e.g. integers) and can be fetched from this class.
726// If asked to read a compound field (e.g. an expression) it will be skipped.
728 public:
749
750 enum Flag {
751 kIsAbstract = 1 << 0,
752 kIsEnumClass = 1 << 1,
757 kIsMacro = 1 << 6,
758 kIsSealed = 1 << 7,
760 kIsBase = 1 << 9,
761 kIsInterface = 1 << 10,
762 kIsFinal = 1 << 11,
763 };
764
766 : helper_(helper), next_read_(kStart) {}
767
769 ReadUntilExcluding(static_cast<Field>(static_cast<int>(field) + 1));
770 }
771
772 void ReadUntilExcluding(Field field);
773
774 void SetNext(Field field) { next_read_ = field; }
775 void SetJustRead(Field field) { next_read_ = field + 1; }
776
777 bool is_abstract() const { return (flags_ & Flag::kIsAbstract) != 0; }
778
779 bool is_enum_class() const { return (flags_ & Flag::kIsEnumClass) != 0; }
780
782 return (flags_ & Flag::kIsEliminatedMixin) != 0;
783 }
784
786 return (flags_ & Flag::kHasConstConstructor) != 0;
787 }
788
789 bool is_sealed() const { return (flags_ & Flag::kIsSealed) != 0; }
790
791 bool is_mixin_class() const { return (flags_ & Flag::kIsMixinClass) != 0; }
792
793 bool is_base() const { return (flags_ & Flag::kIsBase) != 0; }
794
795 bool is_interface() const { return (flags_ & Flag::kIsInterface) != 0; }
796
797 bool is_final() const { return (flags_ & Flag::kIsFinal) != 0; }
798
800 TokenPosition start_position_ = TokenPosition::kNoSource;
801 TokenPosition position_ = TokenPosition::kNoSource;
802 TokenPosition end_position_ = TokenPosition::kNoSource;
803 StringIndex name_index_;
804 intptr_t source_uri_index_ = 0;
805 intptr_t annotation_count_ = 0;
806 intptr_t procedure_count_ = 0;
807 uint32_t flags_ = 0;
808
809 private:
810 KernelReaderHelper* helper_;
811 intptr_t next_read_;
812
814};
815
816// Helper class that reads a kernel Library from binary.
817//
818// Use ReadUntilExcluding to read up to but not including a field.
819// One can then for instance read the field from the call-site (and remember to
820// call SetAt to inform this helper class), and then use this to read more.
821// Simple fields are stored (e.g. integers) and can be fetched from this class.
822// If asked to read a compound field (e.g. an expression) it will be skipped.
824 public:
825 enum Field {
827 kLanguageVersion /* from binary version 27 */,
834 // There are other fields in a library:
835 // * kAdditionalExports
836 // * kParts
837 // * kTypedefs
838 // * kClasses
839 // * kExtensions
840 // * kExtensionTypeDeclarations
841 // * kToplevelField
842 // * kToplevelProcedures
843 // * kSourceReferences
844 // * kLibraryIndex
845 // but we never read them via this helper and it makes extending the format
846 // harder to keep the code around.
847 };
848
856
858 : helper_(helper), next_read_(kFlags) {}
859
861 ReadUntilExcluding(static_cast<Field>(static_cast<int>(field) + 1));
862 }
863
864 void ReadUntilExcluding(Field field);
865
866 void SetNext(Field field) { next_read_ = field; }
867 void SetJustRead(Field field) { next_read_ = field + 1; }
868
869 bool IsSynthetic() const { return (flags_ & kSynthetic) != 0; }
870 bool IsNonNullableByDefault() const { return (flags_ & kIsLegacy) == 0; }
874 if (!bit1 && !bit2) return NNBDCompiledMode::kStrong;
875 if (bit1 && !bit2) return NNBDCompiledMode::kWeak;
876 if (bit1 && bit2) return NNBDCompiledMode::kAgnostic;
877 if (!bit1 && bit2) return NNBDCompiledMode::kInvalid;
878 UNREACHABLE();
879 }
880
881 uint8_t flags_ = 0;
883 StringIndex name_index_;
884 intptr_t source_uri_index_ = 0;
885
886 private:
887 KernelReaderHelper* helper_;
888 intptr_t next_read_;
889
891};
892
894 public:
904
905 enum Flag {
906 Export = 1 << 0,
907 Deferred = 1 << 1,
908 };
909
911 Show = 1 << 0,
912 };
913
915 : helper_(helper), next_read_(kFileOffset) {}
916
918 ReadUntilExcluding(static_cast<Field>(static_cast<int>(field) + 1));
919 }
920
921 void ReadUntilExcluding(Field field);
922
923 uint8_t flags_ = 0;
924 StringIndex name_index_;
926 intptr_t annotation_count_ = 0;
927
928 private:
929 KernelReaderHelper* helper_;
930 intptr_t next_read_;
931
933};
934
935// Base class for helpers accessing metadata of a certain kind.
936// Assumes that metadata is accessed in linear order.
938 public:
940 const char* tag,
941 bool precompiler_only);
942
943#if defined(DEBUG)
944 static void VerifyMetadataMappings(const TypedDataView& metadata_mappings);
945#endif
946
947 protected:
948 // Look for metadata mapping with node offset greater or equal than the given.
949 intptr_t FindMetadataMapping(intptr_t node_offset);
950
951 // Return offset of the metadata payload corresponding to the given node,
952 // or -1 if there is no metadata.
953 // Assumes metadata is accesses for nodes in linear order most of the time.
954 intptr_t GetNextMetadataPayloadOffset(intptr_t node_offset);
955
956 // Returns metadata associated with component.
958
961
962 private:
964
965 void SetMetadataMappings(intptr_t mappings_offset, intptr_t mappings_num);
966 void ScanMetadataMappings();
967
968 const char* tag_;
969 bool mappings_scanned_;
970 bool precompiler_only_;
971 intptr_t mappings_offset_;
972 intptr_t mappings_num_;
973 intptr_t last_node_offset_;
974 intptr_t last_mapping_index_;
975
977};
978
980 enum Flag {
982 kFlagClosure = 1 << 1,
983 };
984
985 DirectCallMetadata(const Function& target, bool check_receiver_for_null)
986 : target_(target), check_receiver_for_null_(check_receiver_for_null) {}
987
990};
991
992// Helper class which provides access to direct call metadata.
994 public:
995 static const char* tag() { return "vm.direct-call.metadata"; }
996
998
1003
1004 private:
1005 bool ReadMetadata(intptr_t node_offset,
1006 NameIndex* target_name,
1007 bool* check_receiver_for_null,
1008 intptr_t* closure_id = nullptr);
1009
1011};
1012
1014 enum Flag {
1016 kFlagInt = 1 << 1,
1020 };
1021
1022 // Mask of flags which participate in CompileType computation.
1023 static constexpr intptr_t kCompileTypeFlagsMask = kFlagNullable | kFlagInt;
1024
1026 uint8_t flags_,
1027 const Object& constant_value_ = Object::null_object())
1028 : cid(cid_), flags(flags_), constant_value(constant_value_) {}
1029
1030 const intptr_t cid;
1031 const uint8_t flags;
1033
1034 bool IsTrivial() const {
1035 return (cid == kDynamicCid) &&
1037 }
1038 bool IsNullable() const { return (flags & kFlagNullable) != 0; }
1039 bool IsInt() const {
1040 return (flags & kFlagInt) != 0 || cid == kMintCid || cid == kSmiCid;
1041 }
1042 bool IsSkipCheck() const { return (flags & kFlagSkipCheck) != 0; }
1043 bool IsConstant() const { return (flags & kFlagConstant) != 0; }
1044 bool ReceiverNotInt() const { return (flags & kFlagReceiverNotInt) != 0; }
1045
1046 // Note: when updating this function to use some previously unused flags
1047 // make sure to update |kCompileTypeFlagsMask| above.
1049 const AbstractType* static_type = nullptr,
1050 bool can_be_sentinel = false) const {
1051 if (IsInt() && cid == kDynamicCid) {
1055 IsNullable(), can_be_sentinel);
1056 } else {
1057 return CompileType(IsNullable(), can_be_sentinel, cid, static_type);
1058 }
1059 }
1060};
1061
1062// Helper class which provides access to inferred type metadata.
1064 public:
1065 enum class Kind {
1066 Type, // Inferred type of a call, field or variable.
1067 ArgType, // Inferred incoming argument type.
1068 };
1069
1070 static const char* tag(Kind kind) {
1071 switch (kind) {
1072 case Kind::Type:
1073 return "vm.inferred-type.metadata";
1074 case Kind::ArgType:
1075 return "vm.inferred-arg-type.metadata";
1076 }
1077 UNREACHABLE();
1078 return nullptr;
1079 }
1080
1082 ConstantReader* constant_reader,
1083 Kind kind = Kind::Type);
1084
1085 InferredTypeMetadata GetInferredType(intptr_t node_offset,
1086 bool read_constant = true);
1087
1088 private:
1089 ConstantReader* constant_reader_;
1090
1092};
1093
1107
1108// Helper class which provides access to direct call metadata.
1110 public:
1111 static const char* tag() { return "vm.procedure-attributes.metadata"; }
1112
1114
1116
1117 private:
1118 bool ReadMetadata(intptr_t node_offset,
1119 ProcedureAttributesMetadata* metadata);
1120
1122};
1123
1125 public:
1126 static const char* tag() { return "vm.obfuscation-prohibitions.metadata"; }
1127
1129
1130 void ReadProhibitions() { ReadMetadata(0); }
1131
1132 private:
1133 void ReadMetadata(intptr_t node_offset);
1134
1136};
1137
1139 public:
1140 static const char* tag() { return "vm.loading-units.metadata"; }
1141
1143
1144 void ReadLoadingUnits() { ReadMetadata(0); }
1145
1146 private:
1147 void ReadMetadata(intptr_t node_offset);
1148
1150};
1151
1155
1156// Helper class which provides access to direct call metadata.
1158 public:
1159 static const char* tag() { return "vm.call-site-attributes.metadata"; }
1160
1162 TypeTranslator* type_translator);
1163
1165
1166 private:
1167 bool ReadMetadata(intptr_t node_offset, CallSiteAttributesMetadata* metadata);
1168
1169 TypeTranslator& type_translator_;
1170
1172};
1173
1174// Information about a table selector computed by the TFA.
1176 int call_count = 0;
1177 bool called_on_null = true;
1178 bool torn_off = true;
1179};
1180
1181// Collection of table selector information for all selectors in the program.
1183 public:
1184 explicit TableSelectorMetadata(intptr_t num_selectors)
1185 : selectors(num_selectors) {
1186 selectors.FillWith(TableSelectorInfo(), 0, num_selectors);
1187 }
1188
1190
1192};
1193
1194// Helper class which provides access to table selector metadata.
1196 public:
1197 static const char* tag() { return "vm.table-selector.metadata"; }
1198
1200
1202
1203 private:
1204 static constexpr uint8_t kCalledOnNullBit = 1 << 0;
1205 static constexpr uint8_t kTornOffBit = 1 << 1;
1206
1207 void ReadTableSelectorInfo(TableSelectorInfo* info);
1208
1210};
1211
1212// Information about a function regarding unboxed parameters and return value.
1214 public:
1215 // Should match UnboxingKind in pkg/vm/lib/metadata/unboxing_info.dart.
1223
1228
1229 static constexpr uint8_t kMustUseStackCallingConventionFlag = 1 << 0;
1230 static constexpr uint8_t kHasUnboxedParameterOrReturnValueFlag = 1 << 1;
1231 static constexpr uint8_t kHasOverridesWithLessDirectParametersFlag = 1 << 2;
1232
1234
1235 void SetArgsCount(intptr_t num_args) {
1236 ASSERT(unboxed_args_info.is_empty());
1237 unboxed_args_info.SetLength(num_args);
1238 unboxed_args_info.FillWith(UnboxingType(), 0, num_args);
1239 }
1240
1241 // Caveat: this array does not cover receiver (`this`) which is always
1242 // assumed to be boxed.
1247
1249};
1250
1251// Helper class which provides access to unboxing information metadata.
1253 public:
1254 static const char* tag() { return "vm.unboxing-info.metadata"; }
1255
1257
1258 UnboxingInfoMetadata* GetUnboxingInfoMetadata(intptr_t node_offset);
1259
1260 private:
1261 UnboxingInfoMetadata::UnboxingType ReadUnboxingType() const;
1262
1264};
1265
1267 public:
1269 TranslationHelper* translation_helper,
1270 const TypedDataBase& data,
1271 intptr_t data_program_offset)
1272 : zone_(zone),
1273 translation_helper_(*translation_helper),
1274 reader_(data),
1275 data_program_offset_(data_program_offset) {}
1276
1277 virtual ~KernelReaderHelper() = default;
1278
1279 void SetOffset(intptr_t offset);
1280
1281 intptr_t ReadListLength();
1283
1284 virtual void ReportUnexpectedTag(const char* variant, Tag tag);
1285
1286 void ReadUntilFunctionNode();
1287
1288 Tag PeekTag(uint8_t* payload = nullptr);
1289
1290 protected:
1291 virtual void set_current_script_id(intptr_t id) {
1292 // Do nothing by default.
1293 // This is overridden in KernelTokenPositionCollector.
1294 USE(id);
1295 }
1296
1297 virtual void RecordTokenPosition(TokenPosition position) {
1298 // Do nothing by default.
1299 // This is overridden in KernelTokenPositionCollector.
1300 USE(position);
1301 }
1302
1303 intptr_t ReaderOffset() const;
1304 intptr_t ReaderSize() const;
1305 void SkipBytes(intptr_t skip);
1306 bool ReadBool();
1307 uint8_t ReadByte();
1308 uint32_t ReadUInt();
1309 uint32_t ReadUInt32();
1310 uint32_t PeekUInt();
1311 double ReadDouble();
1312 uint32_t PeekListLength();
1313 StringIndex ReadStringReference();
1315 StringIndex ReadNameAsStringIndex();
1319 const String& ReadNameAsFieldName();
1320 void SkipFlags();
1321 void SkipStringReference();
1322 void SkipConstantReference();
1325 void SkipDartType();
1326 void SkipOptionalDartType();
1327 void SkipInterfaceType(bool simple);
1328 void SkipFunctionType(bool simple);
1329 void SkipStatementList();
1330 void SkipListOfExpressions();
1332 void SkipListOfDartTypes();
1333 void SkipListOfStrings();
1337 void SkipInitializer();
1338 void SkipExpression();
1339 void SkipStatement();
1340 void SkipFunctionNode();
1341 void SkipName();
1342 void SkipArguments();
1344 void SkipLibraryCombinator();
1345 void SkipLibraryDependency();
1347 Tag ReadTag(uint8_t* payload = nullptr);
1348 uint8_t ReadFlags() { return reader_.ReadFlags(); }
1351
1352 intptr_t SourceTableSize();
1353 intptr_t GetOffsetForSourceInfo(intptr_t index);
1354 String& SourceTableUriFor(intptr_t index);
1355 const String& GetSourceFor(intptr_t index);
1356 TypedDataPtr GetLineStartsFor(intptr_t index);
1357 String& SourceTableImportUriFor(intptr_t index);
1358 TypedDataViewPtr GetConstantCoverageFor(intptr_t index);
1359
1363 // Some items like variables are specified in the kernel binary as
1364 // absolute offsets (as in, offsets within the whole kernel program)
1365 // of their declaration nodes. Hence, to cache and/or access them
1366 // uniquely from within a function's kernel data, we need to
1367 // add/subtract the offset of the kernel data in the over all
1368 // kernel program.
1370
1371 friend class ClassHelper;
1373 friend class ConstantReader;
1374 friend class ConstantHelper;
1375 friend class ConstructorHelper;
1377 friend class FieldHelper;
1380 friend class KernelLoader;
1382 friend class LibraryHelper;
1383 friend class MetadataHelper;
1385 friend class ProcedureHelper;
1387 friend class ScopeBuilder;
1390 friend class TypeTranslator;
1397 const Script& interesting_script);
1398
1399 private:
1401};
1402
1404 public:
1406 : klass(nullptr),
1407 member(nullptr),
1408 enclosing(nullptr),
1409 local_type_parameters(nullptr) {}
1410
1411 bool HasMember() { return member != nullptr; }
1412
1414 ASSERT(member != nullptr);
1415 UntaggedFunction::Kind function_kind = member->kind();
1416 return function_kind == UntaggedFunction::kRegularFunction ||
1417 function_kind == UntaggedFunction::kGetterFunction ||
1418 function_kind == UntaggedFunction::kSetterFunction ||
1419 function_kind == UntaggedFunction::kMethodExtractor ||
1420 function_kind == UntaggedFunction::kDynamicInvocationForwarder ||
1421 member->IsFactory();
1422 }
1423
1425 ASSERT(member != nullptr);
1426 return member->IsFactory();
1427 }
1428
1429 intptr_t MemberTypeParameterCount(Zone* zone);
1430
1432 ASSERT(klass != nullptr);
1433 return klass->NumTypeArguments();
1434 }
1435
1436 const char* ToCString() {
1437 return member != nullptr ? member->ToCString() : klass->ToCString();
1438 }
1439
1440 ScriptPtr ActiveScript() {
1441 if (member != nullptr && !member->IsNull()) {
1442 return member->script();
1443 }
1444 if (klass != nullptr && !klass->IsNull()) {
1445 return klass->script();
1446 }
1447 return Script::null();
1448 }
1449
1450 // The current enclosing class (or the library top-level class).
1451 const Class* klass;
1452
1454
1455 // The innermost enclosing signature. This is used for building types, as a
1456 // parent for function types.
1458
1460};
1461
1463 public:
1464 ActiveClassScope(ActiveClass* active_class, const Class* klass)
1465 : active_class_(active_class), saved_(*active_class) {
1466 active_class_->klass = klass;
1467 }
1468
1469 ~ActiveClassScope() { *active_class_ = saved_; }
1470
1471 private:
1472 ActiveClass* active_class_;
1473 ActiveClass saved_;
1474
1476};
1477
1479 public:
1480 ActiveMemberScope(ActiveClass* active_class, const Function* member)
1481 : active_class_(active_class), saved_(*active_class) {
1482 // The class is inherited.
1483 active_class_->member = member;
1484 }
1485
1486 ~ActiveMemberScope() { *active_class_ = saved_; }
1487
1488 private:
1489 ActiveClass* active_class_;
1490 ActiveClass saved_;
1491
1493};
1494
1496 public:
1498 const FunctionType* enclosing_signature)
1499 : active_class_(active_class), saved_(*active_class) {
1500 active_class_->enclosing = enclosing_signature;
1501 }
1502
1503 ~ActiveEnclosingFunctionScope() { *active_class_ = saved_; }
1504
1505 private:
1506 ActiveClass* active_class_;
1507 ActiveClass saved_;
1508
1510};
1511
1513 public:
1514 // Set the local type parameters of the ActiveClass to be exactly all type
1515 // parameters defined by 'innermost' and any enclosing *closures* (but not
1516 // enclosing methods/top-level functions/classes).
1517 //
1518 // Also, the enclosing signature is set to innermost's signature.
1520 const Function& innermost,
1521 const FunctionType* innermost_signature,
1522 Zone* Z);
1523
1524 // Append the list of the local type parameters to the list in ActiveClass.
1525 //
1526 // Also, the enclosing signature is set to 'signature'.
1528 const FunctionType* innermost_signature,
1529 Zone* Z);
1530
1532
1533 private:
1534 ActiveClass* active_class_;
1535 ActiveClass saved_;
1536 Zone* zone_;
1537
1539};
1540
1542 public:
1544 ConstantReader* constant_reader,
1545 ActiveClass* active_class,
1546 bool finalize = false,
1547 bool in_constant_context = false);
1548
1551
1552 const TypeArguments& BuildTypeArguments(intptr_t length);
1553
1555 const Class& receiver_class,
1556 intptr_t length);
1557
1558 void LoadAndSetupTypeParameters(ActiveClass* active_class,
1559 const Function& function,
1560 const Class& parameterized_class,
1561 const FunctionType& parameterized_signature,
1562 intptr_t type_parameter_count);
1563
1564 void LoadAndSetupBounds(ActiveClass* active_class,
1565 const Function& function,
1566 const Class& parameterized_class,
1567 const FunctionType& parameterized_signature,
1568 intptr_t type_parameter_count);
1569
1570 const Type& ReceiverType(const Class& klass);
1571
1572 void SetupFunctionParameters(const Class& klass,
1573 const Function& function,
1574 bool is_method,
1575 bool is_closure,
1576 FunctionNodeHelper* function_node_helper);
1577
1578 private:
1579 void SetupUnboxingInfoMetadata(const Function& function,
1580 intptr_t library_kernel_offset);
1581 void SetupUnboxingInfoMetadataForFieldAccessors(
1582 const Function& field_accessor,
1583 intptr_t library_kernel_offset);
1584
1585 void BuildTypeInternal();
1586 void BuildInterfaceType(bool simple);
1587 void BuildFunctionType(bool simple);
1588 void BuildRecordType();
1589 void BuildTypeParameterType();
1590 void BuildIntersectionType();
1591 void BuildExtensionType();
1592 void BuildFutureOrType();
1593
1594 ScriptPtr Script() {
1595 if (active_class_ != nullptr) {
1596 return active_class_->ActiveScript();
1597 }
1598 return Script::null();
1599 }
1600
1601 class TypeParameterScope {
1602 public:
1603 TypeParameterScope(TypeTranslator* translator, intptr_t parameter_count)
1604 : parameter_count_(parameter_count),
1605 outer_(translator->type_parameter_scope_),
1606 translator_(translator) {
1607 outer_parameter_count_ = 0;
1608 if (outer_ != nullptr) {
1609 outer_parameter_count_ =
1610 outer_->outer_parameter_count_ + outer_->parameter_count_;
1611 }
1612 translator_->type_parameter_scope_ = this;
1613 }
1614 ~TypeParameterScope() { translator_->type_parameter_scope_ = outer_; }
1615
1616 TypeParameterScope* outer() const { return outer_; }
1617 intptr_t parameter_count() const { return parameter_count_; }
1618 intptr_t outer_parameter_count() const { return outer_parameter_count_; }
1619
1620 private:
1621 intptr_t parameter_count_;
1622 intptr_t outer_parameter_count_;
1623 TypeParameterScope* outer_;
1624 TypeTranslator* translator_;
1625 };
1626
1627 KernelReaderHelper* helper_;
1628 ConstantReader* constant_reader_;
1629 TranslationHelper& translation_helper_;
1630 ActiveClass* const active_class_;
1631 TypeParameterScope* type_parameter_scope_;
1632 InferredTypeMetadataHelper inferred_type_metadata_helper_;
1633 UnboxingInfoMetadataHelper unboxing_info_metadata_helper_;
1634 Zone* zone_;
1635 AbstractType& result_;
1636 bool finalize_;
1637 const bool in_constant_context_;
1638
1639 friend class ScopeBuilder;
1640 friend class KernelLoader;
1641
1643};
1644
1645} // namespace kernel
1646} // namespace dart
1647
1648#endif // RUNTIME_VM_COMPILER_FRONTEND_KERNEL_TRANSLATION_HELPER_H_
static void info(const char *fmt,...) SK_PRINTF_LIKE(1
Definition DM.cpp:213
static bool skip(SkStream *stream, size_t amount)
#define UNREACHABLE()
Definition assert.h:248
#define Z
intptr_t NumTypeArguments() const
Definition object.cc:3690
ScriptPtr script() const
Definition object.h:1274
static CompileType FromAbstractType(const AbstractType &type, bool can_be_null, bool can_be_sentinel)
ScriptPtr script() const
Definition object.cc:10939
bool IsFactory() const
Definition object.h:3347
UntaggedFunction::Kind kind() const
Definition object.h:3329
static ObjectPtr null()
Definition object.h:433
ObjectPtr ptr() const
Definition object.h:332
virtual const char * ToCString() const
Definition object.h:366
bool IsNull() const
Definition object.h:363
static Object & Handle()
Definition object.h:407
static Object & ZoneHandle()
Definition object.h:419
static RecordShape ForUnnamed(intptr_t num_fields)
Definition object.h:11282
static TypePtr NullableIntType()
Definition object.cc:21890
static TypePtr IntType()
Definition object.cc:21886
ActiveClassScope(ActiveClass *active_class, const Class *klass)
const TypeArguments * local_type_parameters
intptr_t MemberTypeParameterCount(Zone *zone)
ActiveEnclosingFunctionScope(ActiveClass *active_class, const FunctionType *enclosing_signature)
ActiveMemberScope(ActiveClass *active_class, const Function *member)
CallSiteAttributesMetadata GetCallSiteAttributes(intptr_t node_offset)
ClassHelper(KernelReaderHelper *helper)
ConstructorHelper(KernelReaderHelper *helper)
DirectCallMetadata GetDirectTargetForPropertyGet(intptr_t node_offset)
DirectCallMetadata GetDirectTargetForFunctionInvocation(intptr_t node_offset)
DirectCallMetadata GetDirectTargetForMethodInvocation(intptr_t node_offset)
DirectCallMetadata GetDirectTargetForPropertySet(intptr_t node_offset)
FieldHelper(KernelReaderHelper *helper)
FunctionNodeHelper(KernelReaderHelper *helper)
InferredTypeMetadata GetInferredType(intptr_t node_offset, bool read_constant=true)
const String & GetSourceFor(intptr_t index)
friend ArrayPtr CollectConstConstructorCoverageFrom(const Script &interesting_script)
friend bool NeedsDynamicInvocationForwarder(const Function &function)
Definition kernel.cc:657
KernelReaderHelper(Zone *zone, TranslationHelper *translation_helper, const TypedDataBase &data, intptr_t data_program_offset)
virtual ~KernelReaderHelper()=default
Tag ReadTag(uint8_t *payload=nullptr)
virtual void set_current_script_id(intptr_t id)
virtual void ReportUnexpectedTag(const char *variant, Tag tag)
Tag PeekTag(uint8_t *payload=nullptr)
virtual void RecordTokenPosition(TokenPosition position)
TypedDataViewPtr GetConstantCoverageFor(intptr_t index)
TypedDataPtr GetLineStartsFor(intptr_t index)
LibraryDependencyHelper(KernelReaderHelper *helper)
LibraryHelper(KernelReaderHelper *helper)
NNBDCompiledMode GetNonNullableByDefaultCompiledMode() const
intptr_t FindMetadataMapping(intptr_t node_offset)
intptr_t GetNextMetadataPayloadOffset(intptr_t node_offset)
ProcedureAttributesMetadata GetProcedureAttributes(intptr_t node_offset)
ProcedureHelper(KernelReaderHelper *helper)
TableSelectorMetadata * GetTableSelectorMetadata(Zone *zone)
DISALLOW_COPY_AND_ASSIGN(TableSelectorMetadata)
GrowableArray< TableSelectorInfo > selectors
const String & DartProcedureName(NameIndex procedure)
Type & GetDeclarationType(const Class &klass)
void SetConstantsTable(const TypedDataView &constants_table)
FunctionPtr LookupStaticMethodByKernelProcedure(NameIndex procedure, bool required=true)
const TypedDataView & string_data() const
FunctionPtr LookupDynamicFunction(const Class &klass, const String &name)
const TypedDataView & metadata_mappings() const
const String & DartSetterName(NameIndex setter)
FieldPtr LookupFieldByKernelGetterOrSetter(NameIndex field, bool required=true)
intptr_t StringSize(StringIndex index) const
void SetCanonicalNames(const TypedData &canonical_names)
const TypedDataView & constants_table() const
intptr_t StringOffset(StringIndex index) const
void ReportError(const char *format,...) PRINTF_ATTRIBUTE(2
const String & DartClassName(NameIndex kernel_class)
const String & DartString(const char *content)
FunctionPtr LookupMethodByMember(NameIndex target, const String &method_name, bool required=true)
const String & DartConstructorName(NameIndex constructor)
NameIndex CanonicalNameParent(NameIndex name)
FieldPtr LookupFieldByKernelField(NameIndex field, bool required=true)
void SetMetadataMappings(const TypedDataView &metadata_mappings)
const KernelProgramInfo & GetKernelProgramInfo() const
void SetKernelProgramInfo(const KernelProgramInfo &info)
void InitFromKernelProgramInfo(const KernelProgramInfo &info)
ClassPtr LookupClassByKernelClassOrLibrary(NameIndex kernel_name, bool required=true)
uint8_t CharacterAt(StringIndex string_index, intptr_t index)
String & DartIdentifier(const Library &lib, StringIndex string_index)
const TypedData & canonical_names() const
const String & DartFactoryName(NameIndex factory)
void SetExpressionEvaluationClass(const Class &cls)
const String & DartMethodName(NameIndex method)
const TypedDataView & metadata_payloads() const
const String & DartSymbolPlain(const char *content) const
DART_NORETURN void LookupFailed(NameIndex name)
virtual LibraryPtr LookupLibraryByKernelLibrary(NameIndex library, bool required=true)
FunctionPtr LookupConstructorByKernelConstructor(NameIndex constructor, bool required=true)
const String & DartGetterName(NameIndex getter)
void SetupFieldAccessorFunction(const Class &klass, const Function &function, const AbstractType &field_type)
const String & DartSymbolObfuscate(const char *content) const
bool StringEquals(StringIndex string_index, const char *other)
StringIndex CanonicalNameString(NameIndex name)
void SetExpressionEvaluationRealClass(const Class &real_class)
void SetStringOffsets(const TypedData &string_offsets)
const String & DartFieldName(NameIndex field)
void SetConstants(const Array &constants)
void SetStringData(const TypedDataView &string_data)
ObjectPtr LookupMemberByMember(NameIndex kernel_name, bool required=true)
void SetMetadataPayloads(const TypedDataView &metadata_payloads)
void void void void void SetExpressionEvaluationFunction(const Function &function)
virtual ClassPtr LookupClassByKernelClass(NameIndex klass, bool required=true)
TypeParameterHelper(KernelReaderHelper *helper)
const TypeArguments & BuildTypeArguments(intptr_t length)
void SetupFunctionParameters(const Class &klass, const Function &function, bool is_method, bool is_closure, FunctionNodeHelper *function_node_helper)
const Type & ReceiverType(const Class &klass)
void LoadAndSetupTypeParameters(ActiveClass *active_class, const Function &function, const Class &parameterized_class, const FunctionType &parameterized_signature, intptr_t type_parameter_count)
const TypeArguments & BuildInstantiatedTypeArguments(const Class &receiver_class, intptr_t length)
void LoadAndSetupBounds(ActiveClass *active_class, const Function &function, const Class &parameterized_class, const FunctionType &parameterized_signature, intptr_t type_parameter_count)
UnboxingInfoMetadata * GetUnboxingInfoMetadata(intptr_t node_offset)
static constexpr uint8_t kMustUseStackCallingConventionFlag
static constexpr uint8_t kHasUnboxedParameterOrReturnValueFlag
static constexpr uint8_t kHasOverridesWithLessDirectParametersFlag
DISALLOW_COPY_AND_ASSIGN(UnboxingInfoMetadata)
GrowableArray< UnboxingType > unboxed_args_info
#define ASSERT(E)
VkInstance instance
Definition main.cc:48
FlutterSemanticsFlag flags
uint32_t uint32_t * format
uint32_t * target
Dart_NativeFunction function
Definition fuchsia.cc:51
size_t length
union flutter::testing::@2838::KeyboardChange::@76 content
const char *const name
Nullability
Definition object.h:1112
@ kDynamicCid
Definition class_id.h:253
unibrow::Mapping< unibrow::Ecma262Canonicalize > Canonicalize
static void USE(T &&)
Definition globals.h:618
NNBDCompiledMode
Definition object.h:1128
static int8_t data[kExtLength]
#define PRINTF_ATTRIBUTE(string_index, first_to_check)
Definition globals.h:697
#define DISALLOW_COPY_AND_ASSIGN(TypeName)
Definition globals.h:581
Point offset
DirectCallMetadata(const Function &target, bool check_receiver_for_null)
InferredTypeMetadata(intptr_t cid_, uint8_t flags_, const Object &constant_value_=Object::null_object())
CompileType ToCompileType(Zone *zone, const AbstractType *static_type=nullptr, bool can_be_sentinel=false) const