Chromium Code Reviews| 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 17 matching lines...) Expand all Loading... | |
| 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(PcDescriptors) \ | 34 V(PcDescriptors) \ |
| 35 V(Stackmap) \ | 35 V(Stackmap) \ |
| 36 V(LocalVarDescriptors) \ | 36 V(LocalVarDescriptors) \ |
| 37 V(ExceptionHandlers) \ | 37 V(ExceptionHandlers) \ |
| 38 V(DeoptInfo) \ | |
| 39 V(Context) \ | 38 V(Context) \ |
| 40 V(ContextScope) \ | 39 V(ContextScope) \ |
| 41 V(ICData) \ | 40 V(ICData) \ |
| 42 V(MegamorphicCache) \ | 41 V(MegamorphicCache) \ |
| 43 V(SubtypeTestCache) \ | 42 V(SubtypeTestCache) \ |
| 44 V(Error) \ | 43 V(Error) \ |
| 45 V(ApiError) \ | 44 V(ApiError) \ |
| 46 V(LanguageError) \ | 45 V(LanguageError) \ |
| 47 V(UnhandledException) \ | 46 V(UnhandledException) \ |
| 48 V(UnwindError) \ | 47 V(UnwindError) \ |
| (...skipping 1188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1237 RawArray* handled_types_data_; | 1236 RawArray* handled_types_data_; |
| 1238 | 1237 |
| 1239 // Exception handler info of length [num_entries_]. | 1238 // Exception handler info of length [num_entries_]. |
| 1240 const HandlerInfo* data() const { OPEN_ARRAY_START(HandlerInfo, intptr_t); } | 1239 const HandlerInfo* data() const { OPEN_ARRAY_START(HandlerInfo, intptr_t); } |
| 1241 HandlerInfo* data() { OPEN_ARRAY_START(HandlerInfo, intptr_t); } | 1240 HandlerInfo* data() { OPEN_ARRAY_START(HandlerInfo, intptr_t); } |
| 1242 | 1241 |
| 1243 friend class Object; | 1242 friend class Object; |
| 1244 }; | 1243 }; |
| 1245 | 1244 |
| 1246 | 1245 |
| 1247 // Contains an array of deoptimization commands, e.g., move a specific register | |
|
Ivan Posva
2015/04/08 07:12:13
Thanks!
| |
| 1248 // into a specific slot of unoptimized frame. | |
| 1249 class RawDeoptInfo : public RawObject { | |
| 1250 RAW_HEAP_OBJECT_IMPLEMENTATION(DeoptInfo); | |
| 1251 | |
| 1252 RawSmi* length_; // Number of deoptimization commands | |
| 1253 | |
| 1254 // Variable length data follows here. | |
| 1255 intptr_t* data() { OPEN_ARRAY_START(intptr_t, intptr_t); } | |
| 1256 const intptr_t* data() const { OPEN_ARRAY_START(intptr_t, intptr_t); } | |
| 1257 }; | |
| 1258 | |
| 1259 | |
| 1260 class RawContext : public RawObject { | 1246 class RawContext : public RawObject { |
| 1261 RAW_HEAP_OBJECT_IMPLEMENTATION(Context); | 1247 RAW_HEAP_OBJECT_IMPLEMENTATION(Context); |
| 1262 | 1248 |
| 1263 int32_t num_variables_; | 1249 int32_t num_variables_; |
| 1264 | 1250 |
| 1265 RawObject** from() { return reinterpret_cast<RawObject**>(&ptr()->parent_); } | 1251 RawObject** from() { return reinterpret_cast<RawObject**>(&ptr()->parent_); } |
| 1266 RawContext* parent_; | 1252 RawContext* parent_; |
| 1267 | 1253 |
| 1268 // Variable length data follows here. | 1254 // Variable length data follows here. |
| 1269 RawObject** data() { OPEN_ARRAY_START(RawObject*, RawObject*); } | 1255 RawObject** data() { OPEN_ARRAY_START(RawObject*, RawObject*); } |
| (...skipping 877 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2147 RawObject::IsOneByteStringClassId(index) || | 2133 RawObject::IsOneByteStringClassId(index) || |
| 2148 RawObject::IsTwoByteStringClassId(index) || | 2134 RawObject::IsTwoByteStringClassId(index) || |
| 2149 RawObject::IsTypedDataClassId(index) || | 2135 RawObject::IsTypedDataClassId(index) || |
| 2150 (index == kContextCid) || | 2136 (index == kContextCid) || |
| 2151 (index == kTypeArgumentsCid) || | 2137 (index == kTypeArgumentsCid) || |
| 2152 (index == kInstructionsCid) || | 2138 (index == kInstructionsCid) || |
| 2153 (index == kPcDescriptorsCid) || | 2139 (index == kPcDescriptorsCid) || |
| 2154 (index == kStackmapCid) || | 2140 (index == kStackmapCid) || |
| 2155 (index == kLocalVarDescriptorsCid) || | 2141 (index == kLocalVarDescriptorsCid) || |
| 2156 (index == kExceptionHandlersCid) || | 2142 (index == kExceptionHandlersCid) || |
| 2157 (index == kDeoptInfoCid) || | |
| 2158 (index == kCodeCid) || | 2143 (index == kCodeCid) || |
| 2159 (index == kContextScopeCid) || | 2144 (index == kContextScopeCid) || |
| 2160 (index == kInstanceCid) || | 2145 (index == kInstanceCid) || |
| 2161 (index == kJSRegExpCid); | 2146 (index == kJSRegExpCid); |
| 2162 } | 2147 } |
| 2163 | 2148 |
| 2164 | 2149 |
| 2165 // This is a set of classes that are not Dart classes whose representation | 2150 // This is a set of classes that are not Dart classes whose representation |
| 2166 // is defined by the VM but are used in the VM code by computing the | 2151 // is defined by the VM but are used in the VM code by computing the |
| 2167 // implicit field offsets of the various fields in the dart object. | 2152 // implicit field offsets of the various fields in the dart object. |
| 2168 inline bool RawObject::IsImplicitFieldClassId(intptr_t index) { | 2153 inline bool RawObject::IsImplicitFieldClassId(intptr_t index) { |
| 2169 return (IsTypedDataViewClassId(index) || index == kByteBufferCid); | 2154 return (IsTypedDataViewClassId(index) || index == kByteBufferCid); |
| 2170 } | 2155 } |
| 2171 | 2156 |
| 2172 | 2157 |
| 2173 inline intptr_t RawObject::NumberOfTypedDataClasses() { | 2158 inline intptr_t RawObject::NumberOfTypedDataClasses() { |
| 2174 // Make sure this is updated when new TypedData types are added. | 2159 // Make sure this is updated when new TypedData types are added. |
| 2175 COMPILE_ASSERT(kTypedDataInt8ArrayViewCid == kTypedDataInt8ArrayCid + 14); | 2160 COMPILE_ASSERT(kTypedDataInt8ArrayViewCid == kTypedDataInt8ArrayCid + 14); |
| 2176 COMPILE_ASSERT(kExternalTypedDataInt8ArrayCid == | 2161 COMPILE_ASSERT(kExternalTypedDataInt8ArrayCid == |
| 2177 kTypedDataInt8ArrayViewCid + 15); | 2162 kTypedDataInt8ArrayViewCid + 15); |
| 2178 COMPILE_ASSERT(kByteBufferCid == kExternalTypedDataInt8ArrayCid + 14); | 2163 COMPILE_ASSERT(kByteBufferCid == kExternalTypedDataInt8ArrayCid + 14); |
| 2179 COMPILE_ASSERT(kNullCid == kByteBufferCid + 1); | 2164 COMPILE_ASSERT(kNullCid == kByteBufferCid + 1); |
| 2180 return (kNullCid - kTypedDataInt8ArrayCid); | 2165 return (kNullCid - kTypedDataInt8ArrayCid); |
| 2181 } | 2166 } |
| 2182 | 2167 |
| 2183 } // namespace dart | 2168 } // namespace dart |
| 2184 | 2169 |
| 2185 #endif // VM_RAW_OBJECT_H_ | 2170 #endif // VM_RAW_OBJECT_H_ |
| OLD | NEW |