Chromium Code Reviews| Index: runtime/vm/raw_object.h |
| =================================================================== |
| --- runtime/vm/raw_object.h (revision 40213) |
| +++ runtime/vm/raw_object.h (working copy) |
| @@ -1097,12 +1097,24 @@ |
| private: |
| RAW_HEAP_OBJECT_IMPLEMENTATION(LocalVarDescriptors); |
| - RawArray* names_; // Array of [length_] variable names. |
| - int32_t length_; // Number of descriptors. |
| + int32_t num_entries_; // Number of descriptors. |
| - // Variable info with [length_] entries. |
| - VarInfo* data() { OPEN_ARRAY_START(VarInfo, int32_t); } |
| + RawObject** from() { |
| + return reinterpret_cast<RawObject**>(&ptr()->names()[0]); |
| + } |
| + RawString** names() { |
| + // Array of [num_entries_] variable names. |
| + OPEN_ARRAY_START(RawString*, RawString*); |
| + } |
|
siva
2014/09/12 22:08:39
For better readability I think it would make sense
hausner
2014/09/12 23:48:04
Added a function to return the address of name[i].
|
| + RawObject** to(intptr_t num_entries) { |
| + return reinterpret_cast<RawObject**>(&ptr()->names()[num_entries - 1]); |
|
siva
2014/09/12 22:08:39
return reinterpret_cast<RawObject**>(&nameAt(num_e
hausner
2014/09/12 23:48:04
You can't take the address of a return value.
|
| + } |
| + // Variable info with [num_entries_] entries. |
| + VarInfo* data() { |
| + return reinterpret_cast<VarInfo*>(&(names()[num_entries_])); |
| + } |
| + |
| friend class Object; |
| }; |