| OLD | NEW |
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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_DEFERRED_OBJECTS_H_ | 5 #ifndef VM_DEFERRED_OBJECTS_H_ |
| 6 #define VM_DEFERRED_OBJECTS_H_ | 6 #define VM_DEFERRED_OBJECTS_H_ |
| 7 | 7 |
| 8 #include "platform/globals.h" | 8 #include "platform/globals.h" |
| 9 | 9 |
| 10 namespace dart { | 10 namespace dart { |
| (...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 157 | 157 |
| 158 RawInstance* object(); | 158 RawInstance* object(); |
| 159 | 159 |
| 160 private: | 160 private: |
| 161 enum { | 161 enum { |
| 162 kClassIndex = 0, | 162 kClassIndex = 0, |
| 163 kFieldsStartIndex = kClassIndex + 1 | 163 kFieldsStartIndex = kClassIndex + 1 |
| 164 }; | 164 }; |
| 165 | 165 |
| 166 enum { | 166 enum { |
| 167 kFieldIndex = 0, | 167 kOffsetIndex = 0, |
| 168 kValueIndex, | 168 kValueIndex, |
| 169 kFieldEntrySize, | 169 kFieldEntrySize, |
| 170 }; | 170 }; |
| 171 | 171 |
| 172 // Materializes the object. Returns amount of values that were consumed | 172 // Materializes the object. Returns amount of values that were consumed |
| 173 // and should be removed from the expression stack at the very end of | 173 // and should be removed from the expression stack at the very end of |
| 174 // deoptimization. | 174 // deoptimization. |
| 175 void Materialize(); | 175 void Materialize(); |
| 176 | 176 |
| 177 RawObject* GetClass() const { | 177 RawObject* GetClass() const { |
| 178 return args_[kClassIndex]; | 178 return args_[kClassIndex]; |
| 179 } | 179 } |
| 180 | 180 |
| 181 RawObject* GetField(intptr_t index) const { | 181 RawObject* GetFieldOffset(intptr_t index) const { |
| 182 return args_[kFieldsStartIndex + kFieldEntrySize * index + kFieldIndex]; | 182 return args_[kFieldsStartIndex + kFieldEntrySize * index + kOffsetIndex]; |
| 183 } | 183 } |
| 184 | 184 |
| 185 RawObject* GetValue(intptr_t index) const { | 185 RawObject* GetValue(intptr_t index) const { |
| 186 return args_[kFieldsStartIndex + kFieldEntrySize * index + kValueIndex]; | 186 return args_[kFieldsStartIndex + kFieldEntrySize * index + kValueIndex]; |
| 187 } | 187 } |
| 188 | 188 |
| 189 // Amount of fields that have to be initialized. | 189 // Amount of fields that have to be initialized. |
| 190 const intptr_t field_count_; | 190 const intptr_t field_count_; |
| 191 | 191 |
| 192 // Pointer to the first materialization argument on the stack. | 192 // Pointer to the first materialization argument on the stack. |
| 193 // The first argument is Class of the instance to materialize followed by | 193 // The first argument is Class of the instance to materialize followed by |
| 194 // Field, value pairs. | 194 // Field, value pairs. |
| 195 RawObject** args_; | 195 RawObject** args_; |
| 196 | 196 |
| 197 // Object materialized from this description. | 197 // Object materialized from this description. |
| 198 const Instance* object_; | 198 const Instance* object_; |
| 199 | 199 |
| 200 DISALLOW_COPY_AND_ASSIGN(DeferredObject); | 200 DISALLOW_COPY_AND_ASSIGN(DeferredObject); |
| 201 }; | 201 }; |
| 202 | 202 |
| 203 } // namespace dart | 203 } // namespace dart |
| 204 | 204 |
| 205 #endif // VM_DEFERRED_OBJECTS_H_ | 205 #endif // VM_DEFERRED_OBJECTS_H_ |
| OLD | NEW |