| syntax = "proto3"; |
| |
| option go_package = "dart2js_info"; |
| |
| package dart2js_info.proto; |
| |
| message DependencyInfoPB { |
| /** The dependency element's serialized_id, references as FunctionInfo or FieldInfo. */ |
| string target_id = 1; |
| |
| /** Either a selector mask indicating how this is used, or 'inlined'. */ |
| string mask = 2; |
| } |
| |
| /** The entire information produced when compiling a program. */ |
| message AllInfoPB { |
| /** Summary information about the program. */ |
| ProgramInfoPB program = 1; |
| |
| /** All the recorded information about elements processed by the compiler. */ |
| map<string, InfoPB> all_infos = 2; |
| |
| /** Details about all deferred imports and what files would be loaded when the import is resolved. */ |
| repeated LibraryDeferredImportsPB deferred_imports = 3; |
| } |
| |
| /* |
| * Common interface to many pieces of information generated by the dart2js |
| * compiler that are directly associated with an element (compilation unit, |
| * library, class, function, or field). |
| */ |
| message InfoPB { |
| /** Name of the element associated with this info. */ |
| string name = 1; |
| |
| /** An id to uniquely identify this info among infos of the same kind. */ |
| int32 id = 2; |
| |
| /** A globally unique id which combines kind and id together. */ |
| string serialized_id = 3; |
| |
| /** Id used by the compiler when instrumenting code for code coverage. */ |
| string coverage_id = 4; |
| |
| /** Bytes used in the generated code for the corresponding element. */ |
| int32 size = 5; |
| |
| /** The serialized_id of the enclosing element. */ |
| string parent_id = 6; |
| |
| /** How does this function or field depend on others. */ |
| repeated DependencyInfoPB uses = 7; |
| |
| /** The serialized_id of the output unit the element is generated into. */ |
| string output_unit_id = 8; |
| |
| /** Reserved tags for future common fields. */ |
| reserved 9 to 99; |
| |
| /** The concrete info type. */ |
| oneof concrete { |
| /** Information about a library element. */ |
| LibraryInfoPB library_info = 100; |
| |
| /** Information about a class element. */ |
| ClassInfoPB class_info = 101; |
| |
| /** Information about a function element. */ |
| FunctionInfoPB function_info = 102; |
| |
| /** Information about a field element. */ |
| FieldInfoPB field_info = 103; |
| |
| /** Information about a constant element. */ |
| ConstantInfoPB constant_info = 104; |
| |
| /** Information about an output unit element. */ |
| OutputUnitInfoPB output_unit_info = 105; |
| |
| /** Information about a typedef element. */ |
| TypedefInfoPB typedef_info = 106; |
| |
| /** Information about a closure element. */ |
| ClosureInfoPB closure_info = 107; |
| |
| /** Information about a class type element. */ |
| ClassTypeInfoPB class_type_info = 108; |
| } |
| } |
| |
| /** General metadata about the dart2js invocation. */ |
| message ProgramInfoPB { |
| /** serialized_id for the entrypoint FunctionInfo. */ |
| string entrypoint_id = 1; |
| |
| /** The overall size of the dart2js binary. */ |
| int32 size = 2; |
| |
| /** The version of dart2js used to compile the program. */ |
| string dart2js_version = 3; |
| |
| /** The time at which the compilation was performed in microseconds since epoch. */ |
| int64 compilation_moment = 4; |
| |
| /** The amount of time spent compiling the program in microseconds. */ |
| int64 compilation_duration = 5; |
| |
| /** The amount of time spent converting the info to protobuf in microseconds. */ |
| int64 to_proto_duration = 6; |
| |
| /** The amount of time spent writing out the serialized info in microseconds. */ |
| int64 dump_info_duration = 7; |
| |
| /** true if noSuchMethod is used. */ |
| bool no_such_method_enabled = 8; |
| |
| /** True if Object.runtimeType is used. */ |
| bool is_runtime_type_used = 9; |
| |
| /** True if dart:isolate library is used. */ |
| bool is_isolate_used = 10; |
| |
| /** True if Function.apply is used. */ |
| bool is_function_apply_used = 11; |
| |
| /** True if dart:mirrors features are used. */ |
| bool is_mirrors_used = 12; |
| |
| /** Whether the resulting dart2js binary is minified. */ |
| bool minified = 13; |
| } |
| |
| /** Info associated with a library element. */ |
| message LibraryInfoPB { |
| /** The canonical uri that identifies the library. */ |
| string uri = 1; |
| |
| /** The serialized_ids of all FunctionInfo, FieldInfo, ClassInfo and TypedefInfo elements that are defined in the library. */ |
| repeated string children_ids = 2; |
| } |
| |
| /** |
| * Information about an output unit. Normally there is just one for the entire |
| * program unless the application uses deferred imports, in which case there |
| * would be an additional output unit per deferred chunk. |
| */ |
| message OutputUnitInfoPB { |
| /** The deferred imports that will load this output unit. */ |
| repeated string imports = 1; |
| } |
| |
| /** Information about a class element. */ |
| message ClassInfoPB { |
| /** Whether the class is abstract. */ |
| bool is_abstract = 1; |
| |
| /** The serialized_ids of all FunctionInfo and FieldInfo elements defined in the class. */ |
| repeated string children_ids = 2; |
| } |
| |
| /** Information about a class type element. */ |
| message ClassTypeInfoPB {} |
| |
| /** Information about a constant value. */ |
| message ConstantInfoPB { |
| /** The actual generated code for the constant. */ |
| string code = 1; |
| } |
| |
| /** Information about a field element. */ |
| message FieldInfoPB { |
| /** The type of the field. */ |
| string type = 1; |
| |
| /** The type inferred by dart2js's whole program analysis. */ |
| string inferred_type = 2; |
| |
| /** The serialized_ids of all ClosureInfo elements nested in the field initializer. */ |
| repeated string children_ids = 3; |
| |
| /** The actual generated code for the field. */ |
| string code = 4; |
| |
| /** Whether the field is a const declaration. */ |
| bool is_const = 5; |
| |
| /** When isConst is true, the serialized_id of the ConstantInfo initializer expression. */ |
| string initializer_id = 6; |
| } |
| |
| /** Information about a typedef declaration. */ |
| message TypedefInfoPB { |
| /** The declared type. */ |
| string type = 1; |
| } |
| |
| /** Available function modifiers. */ |
| message FunctionModifiersPB { |
| /** Whether the function is declared as static. */ |
| bool is_static = 1; |
| |
| /** Whether the function is declared as const. */ |
| bool is_const = 2; |
| |
| /** Whether the function is a factory constructor. */ |
| bool is_factory = 3; |
| |
| /** Whether the function is declared as extern. */ |
| bool is_external = 4; |
| } |
| |
| /** Information about a function parameter. */ |
| message ParameterInfoPB { |
| string name = 1; |
| string type = 2; |
| string declared_type = 3; |
| } |
| |
| /** Information about a function or method. */ |
| message FunctionInfoPB { |
| /** Modifiers applied to the function. */ |
| FunctionModifiersPB function_modifiers = 1; |
| |
| /** serialized_ids of any ClosureInfo elements declared in the function. */ |
| repeated string children_ids = 2; |
| |
| /** The declared return type. */ |
| string return_type = 3; |
| |
| /** The inferred return type. */ |
| string inferred_return_type = 4; |
| |
| /** Name and type information for each parameter. */ |
| repeated ParameterInfoPB parameters = 5; |
| |
| /** Side-effects of the function. */ |
| string side_effects = 6; |
| |
| /** How many function calls were inlined into the function. */ |
| int32 inlined_count = 7; |
| |
| /** The actual generated code. */ |
| string code = 8; |
| |
| /** Measurements collected for this function. */ |
| reserved 9; |
| } |
| |
| /** Information about a closure, also known as a local function. */ |
| message ClosureInfoPB { |
| /** serialized_id of the FunctionInfo wrapped by this closure. */ |
| string function_id = 1; |
| } |
| |
| message DeferredImportPB { |
| /** The prefix assigned to the deferred import. */ |
| string prefix = 1; |
| |
| /** The list of filenames loaded by the import. */ |
| repeated string files = 2; |
| } |
| |
| /** Information about deferred imports within a dart library. */ |
| message LibraryDeferredImportsPB { |
| /** The uri of the library which makes the deferred import. */ |
| string library_uri = 1; |
| |
| /** The name of the library, or "<unnamed>" if it is unnamed. */ |
| string library_name = 2; |
| |
| /** The individual deferred imports within the library. */ |
| repeated DeferredImportPB imports = 3; |
| } |