| 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 1079 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1090 int32_t index() const { | 1090 int32_t index() const { |
| 1091 return IndexBits::decode(index_kind) - kIndexBias; | 1091 return IndexBits::decode(index_kind) - kIndexBias; |
| 1092 } | 1092 } |
| 1093 void set_index(int32_t index) { | 1093 void set_index(int32_t index) { |
| 1094 index_kind = IndexBits::update(index + kIndexBias, index_kind); | 1094 index_kind = IndexBits::update(index + kIndexBias, index_kind); |
| 1095 } | 1095 } |
| 1096 }; | 1096 }; |
| 1097 | 1097 |
| 1098 private: | 1098 private: |
| 1099 RAW_HEAP_OBJECT_IMPLEMENTATION(LocalVarDescriptors); | 1099 RAW_HEAP_OBJECT_IMPLEMENTATION(LocalVarDescriptors); |
| 1100 int32_t num_entries_; // Number of descriptors. | 1100 RawArray* names_; // Array of [length_] variable names. |
| 1101 int32_t length_; // Number of descriptors. |
| 1101 | 1102 |
| 1102 RawObject** from() { | 1103 // Variable info with [length_] entries. |
| 1103 return reinterpret_cast<RawObject**>(&ptr()->names()[0]); | 1104 VarInfo* data() { OPEN_ARRAY_START(VarInfo, int32_t); } |
| 1104 } | |
| 1105 RawString** names() { | |
| 1106 // Array of [num_entries_] variable names. | |
| 1107 OPEN_ARRAY_START(RawString*, RawString*); | |
| 1108 } | |
| 1109 RawString** nameAddrAt(intptr_t i) { | |
| 1110 return &(ptr()->names()[i]); | |
| 1111 } | |
| 1112 | |
| 1113 RawObject** to(intptr_t num_entries) { | |
| 1114 return reinterpret_cast<RawObject**>(nameAddrAt(num_entries - 1)); | |
| 1115 } | |
| 1116 | |
| 1117 // Variable info with [num_entries_] entries. | |
| 1118 VarInfo* data() { | |
| 1119 return reinterpret_cast<VarInfo*>(nameAddrAt(ptr()->num_entries_)); | |
| 1120 } | |
| 1121 | 1105 |
| 1122 friend class Object; | 1106 friend class Object; |
| 1123 }; | 1107 }; |
| 1124 | 1108 |
| 1125 | 1109 |
| 1126 class RawExceptionHandlers : public RawObject { | 1110 class RawExceptionHandlers : public RawObject { |
| 1127 public: | 1111 public: |
| 1128 // The index into the ExceptionHandlers table corresponds to | 1112 // The index into the ExceptionHandlers table corresponds to |
| 1129 // the try_index of the handler. | 1113 // the try_index of the handler. |
| 1130 struct HandlerInfo { | 1114 struct HandlerInfo { |
| (...skipping 921 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2052 COMPILE_ASSERT(kExternalTypedDataInt8ArrayCid == | 2036 COMPILE_ASSERT(kExternalTypedDataInt8ArrayCid == |
| 2053 kTypedDataInt8ArrayViewCid + 15); | 2037 kTypedDataInt8ArrayViewCid + 15); |
| 2054 COMPILE_ASSERT(kByteBufferCid == kExternalTypedDataInt8ArrayCid + 14); | 2038 COMPILE_ASSERT(kByteBufferCid == kExternalTypedDataInt8ArrayCid + 14); |
| 2055 COMPILE_ASSERT(kNullCid == kByteBufferCid + 1); | 2039 COMPILE_ASSERT(kNullCid == kByteBufferCid + 1); |
| 2056 return (kNullCid - kTypedDataInt8ArrayCid); | 2040 return (kNullCid - kTypedDataInt8ArrayCid); |
| 2057 } | 2041 } |
| 2058 | 2042 |
| 2059 } // namespace dart | 2043 } // namespace dart |
| 2060 | 2044 |
| 2061 #endif // VM_RAW_OBJECT_H_ | 2045 #endif // VM_RAW_OBJECT_H_ |
| OLD | NEW |