5#ifndef RUNTIME_VM_KERNEL_H_
6#define RUNTIME_VM_KERNEL_H_
26 operator int()
const {
return value_; }
34#if !defined(DART_PRECOMPILED_RUNTIME)
45struct ProcedureAttributesMetadata;
46class TableSelectorMetadata;
47class UnboxingInfoMetadata;
51 StringIndex() : value_(-1) {}
52 explicit StringIndex(
int value) : value_(
value) {}
54 operator int()
const {
return value_; }
60enum LogicalOperator { kAnd, kOr };
67 static std::unique_ptr<Program> ReadFrom(Reader* reader,
68 const char**
error =
nullptr);
70 static std::unique_ptr<Program>
ReadFromFile(
const char* script_uri,
71 const char**
error =
nullptr);
72 static std::unique_ptr<Program> ReadFromBuffer(
const uint8_t*
buffer,
73 intptr_t buffer_length,
74 const char**
error =
nullptr);
75 static std::unique_ptr<Program> ReadFromTypedData(
76 const ExternalTypedData& typed_data,
77 const char**
error =
nullptr);
79 bool is_single_program() {
return single_program_; }
80 NameIndex main_method() {
return main_method_reference_; }
81 intptr_t source_table_offset()
const {
return source_table_offset_; }
82 intptr_t string_table_offset()
const {
return string_table_offset_; }
83 intptr_t name_table_offset()
const {
return name_table_offset_; }
84 intptr_t metadata_payloads_offset()
const {
85 return metadata_payloads_offset_;
87 intptr_t metadata_mappings_offset()
const {
88 return metadata_mappings_offset_;
90 intptr_t constant_table_offset() {
return constant_table_offset_; }
91 intptr_t component_index_offset() {
return component_index_offset_; }
92 intptr_t library_count() {
return library_count_; }
95 const TypedDataBase&
binary() {
return *binary_; }
98 explicit Program(
const TypedDataBase* binary) : binary_(
binary) {}
100 bool single_program_;
101 NameIndex main_method_reference_;
102 intptr_t library_count_;
105 intptr_t source_table_offset_;
108 intptr_t constant_table_offset_;
111 intptr_t component_index_offset_;
114 intptr_t name_table_offset_;
117 intptr_t metadata_payloads_offset_;
120 intptr_t metadata_mappings_offset_;
123 intptr_t string_table_offset_;
125 const TypedDataBase* binary_ =
nullptr;
130class KernelLineStartsReader {
135 ~KernelLineStartsReader() {
delete helper_; }
137 uint32_t At(intptr_t index)
const {
138 return helper_->At(line_starts_data_, index);
141 uint32_t MaxPosition()
const;
149 intptr_t* col =
nullptr)
const;
155 intptr_t line_number,
160 class KernelLineStartsHelper {
162 KernelLineStartsHelper() {}
163 virtual ~KernelLineStartsHelper() {}
170 class KernelUint16LineStartsHelper :
public KernelLineStartsHelper {
172 KernelUint16LineStartsHelper() {}
179 class KernelUint32LineStartsHelper :
public KernelLineStartsHelper {
181 KernelUint32LineStartsHelper() {}
189 KernelLineStartsHelper* helper_;
194ObjectPtr EvaluateStaticConstFieldInitializer(
const Field& field);
195ObjectPtr EvaluateMetadata(
const Library& library,
196 intptr_t kernel_offset,
197 bool is_annotations_offset);
198ObjectPtr BuildParameterDescriptor(
const Function&
function);
205void ReadParameterCovariance(
const Function&
function,
206 BitVector* is_covariant,
207 BitVector* is_generic_covariant_impl);
213bool NeedsDynamicInvocationForwarder(
const Function&
function);
215ProcedureAttributesMetadata ProcedureAttributesOf(
const Function&
function,
218ProcedureAttributesMetadata ProcedureAttributesOf(
const Field& field,
221UnboxingInfoMetadata* UnboxingInfoMetadataOf(
const Function&
function,
224TableSelectorMetadata* TableSelectorMetadataForProgram(
225 const KernelProgramInfo&
info,
static void info(const char *fmt,...) SK_PRINTF_LIKE(1
Type::kYUV Type::kRGBA() int(0.7 *637)
static constexpr int kInvalidName
#define DART_WARN_UNUSED_RESULT
static const uint8_t buffer[]
const uint8_t uint32_t uint32_t GError ** error
Dart_NativeFunction function
void ReadFromFile(char *path, char **buffer_pointer)
static int8_t data[kExtLength]