OLD | NEW |
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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 VM_RAW_OBJECT_H_ | 5 #ifndef VM_RAW_OBJECT_H_ |
6 #define VM_RAW_OBJECT_H_ | 6 #define VM_RAW_OBJECT_H_ |
7 | 7 |
8 #include "platform/assert.h" | 8 #include "platform/assert.h" |
9 #include "vm/atomic.h" | 9 #include "vm/atomic.h" |
10 #include "vm/globals.h" | 10 #include "vm/globals.h" |
(...skipping 15 matching lines...) Expand all Loading... |
26 V(Field) \ | 26 V(Field) \ |
27 V(LiteralToken) \ | 27 V(LiteralToken) \ |
28 V(TokenStream) \ | 28 V(TokenStream) \ |
29 V(Script) \ | 29 V(Script) \ |
30 V(Library) \ | 30 V(Library) \ |
31 V(Namespace) \ | 31 V(Namespace) \ |
32 V(Code) \ | 32 V(Code) \ |
33 V(Instructions) \ | 33 V(Instructions) \ |
34 V(ObjectPool) \ | 34 V(ObjectPool) \ |
35 V(PcDescriptors) \ | 35 V(PcDescriptors) \ |
| 36 V(CodeSourceMap) \ |
36 V(Stackmap) \ | 37 V(Stackmap) \ |
37 V(LocalVarDescriptors) \ | 38 V(LocalVarDescriptors) \ |
38 V(ExceptionHandlers) \ | 39 V(ExceptionHandlers) \ |
39 V(Context) \ | 40 V(Context) \ |
40 V(ContextScope) \ | 41 V(ContextScope) \ |
41 V(ICData) \ | 42 V(ICData) \ |
42 V(MegamorphicCache) \ | 43 V(MegamorphicCache) \ |
43 V(SubtypeTestCache) \ | 44 V(SubtypeTestCache) \ |
44 V(Error) \ | 45 V(Error) \ |
45 V(ApiError) \ | 46 V(ApiError) \ |
(...skipping 1002 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1048 } | 1049 } |
1049 RawInstructions* active_instructions_; | 1050 RawInstructions* active_instructions_; |
1050 RawInstructions* instructions_; | 1051 RawInstructions* instructions_; |
1051 RawObjectPool* object_pool_; | 1052 RawObjectPool* object_pool_; |
1052 // If owner_ is Function::null() the owner is a regular stub. | 1053 // If owner_ is Function::null() the owner is a regular stub. |
1053 // If owner_ is a Class the owner is the allocation stub for that class. | 1054 // If owner_ is a Class the owner is the allocation stub for that class. |
1054 // Else, owner_ is a regular Dart Function. | 1055 // Else, owner_ is a regular Dart Function. |
1055 RawObject* owner_; // Function, Null, or a Class. | 1056 RawObject* owner_; // Function, Null, or a Class. |
1056 RawExceptionHandlers* exception_handlers_; | 1057 RawExceptionHandlers* exception_handlers_; |
1057 RawPcDescriptors* pc_descriptors_; | 1058 RawPcDescriptors* pc_descriptors_; |
| 1059 RawCodeSourceMap* code_source_map_; |
1058 RawArray* stackmaps_; | 1060 RawArray* stackmaps_; |
1059 RawObject** to_snapshot() { | 1061 RawObject** to_snapshot() { |
1060 return reinterpret_cast<RawObject**>(&ptr()->stackmaps_); | 1062 return reinterpret_cast<RawObject**>(&ptr()->stackmaps_); |
1061 } | 1063 } |
1062 RawArray* deopt_info_array_; | 1064 RawArray* deopt_info_array_; |
1063 RawArray* static_calls_target_table_; // (code-offset, function, code). | 1065 RawArray* static_calls_target_table_; // (code-offset, function, code). |
1064 RawLocalVarDescriptors* var_descriptors_; | 1066 RawLocalVarDescriptors* var_descriptors_; |
1065 RawArray* inlined_metadata_; | 1067 RawArray* inlined_metadata_; |
1066 RawArray* comments_; | 1068 RawArray* comments_; |
1067 // If return_address_metadata_ is a Smi, it is the offset to the prologue. | 1069 // If return_address_metadata_ is a Smi, it is the offset to the prologue. |
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1195 | 1197 |
1196 // Variable length data follows here. | 1198 // Variable length data follows here. |
1197 uint8_t* data() { OPEN_ARRAY_START(uint8_t, intptr_t); } | 1199 uint8_t* data() { OPEN_ARRAY_START(uint8_t, intptr_t); } |
1198 const uint8_t* data() const { OPEN_ARRAY_START(uint8_t, intptr_t); } | 1200 const uint8_t* data() const { OPEN_ARRAY_START(uint8_t, intptr_t); } |
1199 | 1201 |
1200 friend class Object; | 1202 friend class Object; |
1201 friend class SnapshotReader; | 1203 friend class SnapshotReader; |
1202 }; | 1204 }; |
1203 | 1205 |
1204 | 1206 |
| 1207 // CodeSourceMap stores a mapping between code PC ranges and source token |
| 1208 // positions. |
| 1209 class RawCodeSourceMap : public RawObject { |
| 1210 private: |
| 1211 RAW_HEAP_OBJECT_IMPLEMENTATION(CodeSourceMap); |
| 1212 |
| 1213 int32_t length_; // Number of entries. |
| 1214 |
| 1215 // Variable length data follows here. |
| 1216 uint8_t* data() { OPEN_ARRAY_START(uint8_t, intptr_t); } |
| 1217 const uint8_t* data() const { OPEN_ARRAY_START(uint8_t, intptr_t); } |
| 1218 |
| 1219 friend class Object; |
| 1220 friend class SnapshotReader; |
| 1221 }; |
| 1222 |
| 1223 |
1205 // Stackmap is an immutable representation of the layout of the stack at a | 1224 // Stackmap is an immutable representation of the layout of the stack at a |
1206 // PC. The stack map representation consists of a bit map which marks each | 1225 // PC. The stack map representation consists of a bit map which marks each |
1207 // live object index starting from the base of the frame. | 1226 // live object index starting from the base of the frame. |
1208 // | 1227 // |
1209 // The bit map representation is optimized for dense and small bit maps, without | 1228 // The bit map representation is optimized for dense and small bit maps, without |
1210 // any upper bound. | 1229 // any upper bound. |
1211 class RawStackmap : public RawObject { | 1230 class RawStackmap : public RawObject { |
1212 RAW_HEAP_OBJECT_IMPLEMENTATION(Stackmap); | 1231 RAW_HEAP_OBJECT_IMPLEMENTATION(Stackmap); |
1213 | 1232 |
1214 // Regarding changing this to a bitfield: ARM64 requires register_bit_count_ | 1233 // Regarding changing this to a bitfield: ARM64 requires register_bit_count_ |
(...skipping 1064 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2279 return (index == kArrayCid) || | 2298 return (index == kArrayCid) || |
2280 (index == kImmutableArrayCid) || | 2299 (index == kImmutableArrayCid) || |
2281 RawObject::IsOneByteStringClassId(index) || | 2300 RawObject::IsOneByteStringClassId(index) || |
2282 RawObject::IsTwoByteStringClassId(index) || | 2301 RawObject::IsTwoByteStringClassId(index) || |
2283 RawObject::IsTypedDataClassId(index) || | 2302 RawObject::IsTypedDataClassId(index) || |
2284 (index == kContextCid) || | 2303 (index == kContextCid) || |
2285 (index == kTypeArgumentsCid) || | 2304 (index == kTypeArgumentsCid) || |
2286 (index == kInstructionsCid) || | 2305 (index == kInstructionsCid) || |
2287 (index == kObjectPoolCid) || | 2306 (index == kObjectPoolCid) || |
2288 (index == kPcDescriptorsCid) || | 2307 (index == kPcDescriptorsCid) || |
| 2308 (index == kCodeSourceMapCid) || |
2289 (index == kStackmapCid) || | 2309 (index == kStackmapCid) || |
2290 (index == kLocalVarDescriptorsCid) || | 2310 (index == kLocalVarDescriptorsCid) || |
2291 (index == kExceptionHandlersCid) || | 2311 (index == kExceptionHandlersCid) || |
2292 (index == kCodeCid) || | 2312 (index == kCodeCid) || |
2293 (index == kContextScopeCid) || | 2313 (index == kContextScopeCid) || |
2294 (index == kInstanceCid) || | 2314 (index == kInstanceCid) || |
2295 (index == kJSRegExpCid); | 2315 (index == kJSRegExpCid); |
2296 } | 2316 } |
2297 | 2317 |
2298 | 2318 |
(...skipping 11 matching lines...) Expand all Loading... |
2310 COMPILE_ASSERT(kExternalTypedDataInt8ArrayCid == | 2330 COMPILE_ASSERT(kExternalTypedDataInt8ArrayCid == |
2311 kTypedDataInt8ArrayViewCid + 15); | 2331 kTypedDataInt8ArrayViewCid + 15); |
2312 COMPILE_ASSERT(kByteBufferCid == kExternalTypedDataInt8ArrayCid + 14); | 2332 COMPILE_ASSERT(kByteBufferCid == kExternalTypedDataInt8ArrayCid + 14); |
2313 COMPILE_ASSERT(kNullCid == kByteBufferCid + 1); | 2333 COMPILE_ASSERT(kNullCid == kByteBufferCid + 1); |
2314 return (kNullCid - kTypedDataInt8ArrayCid); | 2334 return (kNullCid - kTypedDataInt8ArrayCid); |
2315 } | 2335 } |
2316 | 2336 |
2317 } // namespace dart | 2337 } // namespace dart |
2318 | 2338 |
2319 #endif // VM_RAW_OBJECT_H_ | 2339 #endif // VM_RAW_OBJECT_H_ |
OLD | NEW |