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 1196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1207 RawSmi* context_index; | 1207 RawSmi* context_index; |
| 1208 RawSmi* context_level; | 1208 RawSmi* context_level; |
| 1209 }; | 1209 }; |
| 1210 | 1210 |
| 1211 int32_t num_variables_; | 1211 int32_t num_variables_; |
| 1212 | 1212 |
| 1213 RawObject** from() { | 1213 RawObject** from() { |
| 1214 return reinterpret_cast<RawObject**>(&ptr()->data()[0]); | 1214 return reinterpret_cast<RawObject**>(&ptr()->data()[0]); |
| 1215 } | 1215 } |
| 1216 // Variable length data follows here. | 1216 // Variable length data follows here. |
| 1217 RawObject** data() { OPEN_ARRAY_START(RawObject*, RawObject*); } | 1217 RawObject** data() { OPEN_ARRAY_START(RawObject*, RawObject*); } |
|
Ivan Posva
2014/10/29 05:17:27
Should we have the non-const data() accessor in th
koda
2014/10/29 20:10:27
Changed from/to to use VariableDescAddr.
PTAL
| |
| 1218 RawObject* const* data() const { OPEN_ARRAY_START(RawObject*, RawObject*); } | |
| 1219 const VariableDesc* VariableDescAddr(intptr_t index) const { | |
|
Ivan Posva
2014/10/29 05:17:27
Why did you have to move this functionality to Raw
koda
2014/10/29 20:10:27
I wanted to keep the tricky representation details
| |
| 1220 ASSERT((index >= 0) && (index < num_variables_)); | |
| 1221 // data() points to the first component of the first descriptor. | |
| 1222 return &(reinterpret_cast<const VariableDesc*>(data())[index]); | |
| 1223 } | |
| 1218 RawObject** to(intptr_t num_vars) { | 1224 RawObject** to(intptr_t num_vars) { |
| 1219 const intptr_t data_length = num_vars * (sizeof(VariableDesc)/kWordSize); | 1225 const intptr_t data_length = num_vars * (sizeof(VariableDesc)/kWordSize); |
| 1220 return reinterpret_cast<RawObject**>(&ptr()->data()[data_length - 1]); | 1226 return reinterpret_cast<RawObject**>(&ptr()->data()[data_length - 1]); |
| 1221 } | 1227 } |
| 1222 }; | 1228 }; |
| 1223 | 1229 |
| 1224 | 1230 |
| 1225 class RawICData : public RawObject { | 1231 class RawICData : public RawObject { |
| 1226 RAW_HEAP_OBJECT_IMPLEMENTATION(ICData); | 1232 RAW_HEAP_OBJECT_IMPLEMENTATION(ICData); |
| 1227 | 1233 |
| (...skipping 840 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2068 COMPILE_ASSERT(kExternalTypedDataInt8ArrayCid == | 2074 COMPILE_ASSERT(kExternalTypedDataInt8ArrayCid == |
| 2069 kTypedDataInt8ArrayViewCid + 15); | 2075 kTypedDataInt8ArrayViewCid + 15); |
| 2070 COMPILE_ASSERT(kByteBufferCid == kExternalTypedDataInt8ArrayCid + 14); | 2076 COMPILE_ASSERT(kByteBufferCid == kExternalTypedDataInt8ArrayCid + 14); |
| 2071 COMPILE_ASSERT(kNullCid == kByteBufferCid + 1); | 2077 COMPILE_ASSERT(kNullCid == kByteBufferCid + 1); |
| 2072 return (kNullCid - kTypedDataInt8ArrayCid); | 2078 return (kNullCid - kTypedDataInt8ArrayCid); |
| 2073 } | 2079 } |
| 2074 | 2080 |
| 2075 } // namespace dart | 2081 } // namespace dart |
| 2076 | 2082 |
| 2077 #endif // VM_RAW_OBJECT_H_ | 2083 #endif // VM_RAW_OBJECT_H_ |
| OLD | NEW |