Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(35)

Side by Side Diff: runtime/vm/kernel_reader.h

Issue 2995423002: Allow the VM to read Kernel files with external libraries (Closed)
Patch Set: Created 3 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « runtime/vm/kernel_binary_flowgraph.cc ('k') | runtime/vm/kernel_reader.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 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. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #ifndef RUNTIME_VM_KERNEL_READER_H_ 5 #ifndef RUNTIME_VM_KERNEL_READER_H_
6 #define RUNTIME_VM_KERNEL_READER_H_ 6 #define RUNTIME_VM_KERNEL_READER_H_
7 7
8 #if !defined(DART_PRECOMPILED_RUNTIME) 8 #if !defined(DART_PRECOMPILED_RUNTIME)
9 #include <map> 9 #include <map>
10 10
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
87 } 87 }
88 88
89 NameIndex library_canonical_name(intptr_t index) { 89 NameIndex library_canonical_name(intptr_t index) {
90 kernel::Reader reader(program_->kernel_data(), 90 kernel::Reader reader(program_->kernel_data(),
91 program_->kernel_data_size()); 91 program_->kernel_data_size());
92 reader.set_offset(reader.size() - 4 - 92 reader.set_offset(reader.size() - 4 -
93 (program_->library_count() - index) * 4); 93 (program_->library_count() - index) * 4);
94 reader.set_offset(reader.ReadUInt32()); 94 reader.set_offset(reader.ReadUInt32());
95 95
96 // Start reading library. 96 // Start reading library.
97 reader.ReadFlags(); // read flags. 97 reader.ReadFlags();
98 return reader.ReadCanonicalNameReference(); 98 return reader.ReadCanonicalNameReference();
99 } 99 }
100 100
101 uint8_t CharacterAt(StringIndex string_index, intptr_t index); 101 uint8_t CharacterAt(StringIndex string_index, intptr_t index);
102 102
103 static bool FieldHasFunctionLiteralInitializer(const Field& field, 103 static bool FieldHasFunctionLiteralInitializer(const Field& field,
104 TokenPosition* start, 104 TokenPosition* start,
105 TokenPosition* end); 105 TokenPosition* end);
106 106
107 private: 107 private:
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
155 155
156 GrowableArray<const Function*> functions_; 156 GrowableArray<const Function*> functions_;
157 GrowableArray<const Field*> fields_; 157 GrowableArray<const Field*> fields_;
158 }; 158 };
159 159
160 } // namespace kernel 160 } // namespace kernel
161 } // namespace dart 161 } // namespace dart
162 162
163 #endif // !defined(DART_PRECOMPILED_RUNTIME) 163 #endif // !defined(DART_PRECOMPILED_RUNTIME)
164 #endif // RUNTIME_VM_KERNEL_READER_H_ 164 #endif // RUNTIME_VM_KERNEL_READER_H_
OLDNEW
« no previous file with comments | « runtime/vm/kernel_binary_flowgraph.cc ('k') | runtime/vm/kernel_reader.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698