Chromium Code Reviews| Index: runtime/vm/raw_object.h |
| =================================================================== |
| --- runtime/vm/raw_object.h (revision 8858) |
| +++ runtime/vm/raw_object.h (working copy) |
| @@ -797,15 +797,24 @@ |
| class RawLocalVarDescriptors : public RawObject { |
| - RAW_HEAP_OBJECT_IMPLEMENTATION(LocalVarDescriptors); |
| + public: |
| + // Values for field VarInfo.kind. We don't use an enum type because |
| + // we want to ensure the field only takes up one byte. |
| + static const int8_t kStackVar = 1; |
| + static const int8_t kContextVar = 2; |
| + static const int8_t kContextLevel = 3; |
| + static const int8_t kContextChain = 4; |
|
regis
2012/06/19 18:14:41
It should not be a problem to use an enum. See enu
hausner
2012/06/19 18:49:41
Hmm. I started out with an enum and ran into some
|
| struct VarInfo { |
| intptr_t index; // Slot index on stack or in context. |
| - intptr_t scope_id; // Scope to which the variable belongs. |
| + int8_t kind; // Entry kind. |
| + int16_t scope_id; // Scope to which the variable belongs. |
| intptr_t begin_pos; // Token position of scope start. |
| intptr_t end_pos; // Token position of scope end. |
| }; |
| + private: |
| + RAW_HEAP_OBJECT_IMPLEMENTATION(LocalVarDescriptors); |
| intptr_t length_; // Number of descriptors. |
| RawArray* names_; // Array of [length_] variable names. |