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 1066 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1077 Entry* first_entry() { return &ptr()->data()[0]; } | 1077 Entry* first_entry() { return &ptr()->data()[0]; } |
1078 | 1078 |
1079 friend class Object; | 1079 friend class Object; |
1080 friend class SnapshotReader; | 1080 friend class SnapshotReader; |
1081 }; | 1081 }; |
1082 | 1082 |
1083 | 1083 |
1084 class RawInstructions : public RawObject { | 1084 class RawInstructions : public RawObject { |
1085 RAW_HEAP_OBJECT_IMPLEMENTATION(Instructions); | 1085 RAW_HEAP_OBJECT_IMPLEMENTATION(Instructions); |
1086 | 1086 |
| 1087 RawObject** from() { |
| 1088 return reinterpret_cast<RawObject**>(&ptr()->code_); |
| 1089 } |
| 1090 RawCode* code_; |
| 1091 RawObject** to() { |
| 1092 return reinterpret_cast<RawObject**>(&ptr()->code_); |
| 1093 } |
| 1094 |
1087 int32_t size_; | 1095 int32_t size_; |
1088 | 1096 |
1089 // Variable length data follows here. | 1097 // Variable length data follows here. |
1090 uint8_t* data() { OPEN_ARRAY_START(uint8_t, uint8_t); } | 1098 uint8_t* data() { OPEN_ARRAY_START(uint8_t, uint8_t); } |
1091 | 1099 |
1092 // Private helper function used while visiting stack frames. The | 1100 // Private helper function used while visiting stack frames. The |
1093 // code which iterates over dart frames is also called during GC and | 1101 // code which iterates over dart frames is also called during GC and |
1094 // is not allowed to create handles. | 1102 // is not allowed to create handles. |
1095 static bool ContainsPC(RawInstructions* raw_instr, uword pc); | 1103 static bool ContainsPC(RawInstructions* raw_instr, uword pc); |
1096 | 1104 |
(...skipping 1132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2229 COMPILE_ASSERT(kExternalTypedDataInt8ArrayCid == | 2237 COMPILE_ASSERT(kExternalTypedDataInt8ArrayCid == |
2230 kTypedDataInt8ArrayViewCid + 15); | 2238 kTypedDataInt8ArrayViewCid + 15); |
2231 COMPILE_ASSERT(kByteBufferCid == kExternalTypedDataInt8ArrayCid + 14); | 2239 COMPILE_ASSERT(kByteBufferCid == kExternalTypedDataInt8ArrayCid + 14); |
2232 COMPILE_ASSERT(kNullCid == kByteBufferCid + 1); | 2240 COMPILE_ASSERT(kNullCid == kByteBufferCid + 1); |
2233 return (kNullCid - kTypedDataInt8ArrayCid); | 2241 return (kNullCid - kTypedDataInt8ArrayCid); |
2234 } | 2242 } |
2235 | 2243 |
2236 } // namespace dart | 2244 } // namespace dart |
2237 | 2245 |
2238 #endif // VM_RAW_OBJECT_H_ | 2246 #endif // VM_RAW_OBJECT_H_ |
OLD | NEW |