| 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_OBJECT_H_ | 5 #ifndef VM_OBJECT_H_ |
| 6 #define VM_OBJECT_H_ | 6 #define VM_OBJECT_H_ |
| 7 | 7 |
| 8 #include "include/dart_api.h" | 8 #include "include/dart_api.h" |
| 9 #include "platform/assert.h" | 9 #include "platform/assert.h" |
| 10 #include "platform/utils.h" | 10 #include "platform/utils.h" |
| (...skipping 3268 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3279 } | 3279 } |
| 3280 | 3280 |
| 3281 RawExceptionHandlers* exception_handlers() const { | 3281 RawExceptionHandlers* exception_handlers() const { |
| 3282 return raw_ptr()->exception_handlers_; | 3282 return raw_ptr()->exception_handlers_; |
| 3283 } | 3283 } |
| 3284 void set_exception_handlers(const ExceptionHandlers& handlers) const { | 3284 void set_exception_handlers(const ExceptionHandlers& handlers) const { |
| 3285 ASSERT(handlers.IsOld()); | 3285 ASSERT(handlers.IsOld()); |
| 3286 StorePointer(&raw_ptr()->exception_handlers_, handlers.raw()); | 3286 StorePointer(&raw_ptr()->exception_handlers_, handlers.raw()); |
| 3287 } | 3287 } |
| 3288 | 3288 |
| 3289 // TODO(turnidge): Consider dropping this function and making |
| 3290 // everybody use owner(). Currently this function is misused - even |
| 3291 // while generating the snapshot. |
| 3289 RawFunction* function() const { | 3292 RawFunction* function() const { |
| 3290 return reinterpret_cast<RawFunction*>(raw_ptr()->owner_); | 3293 return reinterpret_cast<RawFunction*>(raw_ptr()->owner_); |
| 3291 } | 3294 } |
| 3292 | 3295 |
| 3293 RawObject* owner() const { | 3296 RawObject* owner() const { |
| 3294 return raw_ptr()->owner_; | 3297 return raw_ptr()->owner_; |
| 3295 } | 3298 } |
| 3296 | 3299 |
| 3297 void set_owner(const Function& function) const { | 3300 void set_owner(const Function& function) const { |
| 3298 ASSERT(function.IsOld()); | 3301 ASSERT(function.IsOld()); |
| (...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3450 intptr_t num_variables() const { return raw_ptr()->num_variables_; } | 3453 intptr_t num_variables() const { return raw_ptr()->num_variables_; } |
| 3451 static intptr_t num_variables_offset() { | 3454 static intptr_t num_variables_offset() { |
| 3452 return OFFSET_OF(RawContext, num_variables_); | 3455 return OFFSET_OF(RawContext, num_variables_); |
| 3453 } | 3456 } |
| 3454 | 3457 |
| 3455 RawInstance* At(intptr_t context_index) const { | 3458 RawInstance* At(intptr_t context_index) const { |
| 3456 return *InstanceAddr(context_index); | 3459 return *InstanceAddr(context_index); |
| 3457 } | 3460 } |
| 3458 inline void SetAt(intptr_t context_index, const Instance& value) const; | 3461 inline void SetAt(intptr_t context_index, const Instance& value) const; |
| 3459 | 3462 |
| 3463 void Dump(int indent = 0) const; |
| 3464 |
| 3460 static const intptr_t kBytesPerElement = kWordSize; | 3465 static const intptr_t kBytesPerElement = kWordSize; |
| 3461 static const intptr_t kMaxElements = kSmiMax / kBytesPerElement; | 3466 static const intptr_t kMaxElements = kSmiMax / kBytesPerElement; |
| 3462 | 3467 |
| 3463 static intptr_t variable_offset(intptr_t context_index) { | 3468 static intptr_t variable_offset(intptr_t context_index) { |
| 3464 return OFFSET_OF(RawContext, data_[context_index]); | 3469 return OFFSET_OF(RawContext, data_[context_index]); |
| 3465 } | 3470 } |
| 3466 | 3471 |
| 3467 static intptr_t InstanceSize() { | 3472 static intptr_t InstanceSize() { |
| 3468 ASSERT(sizeof(RawContext) == OFFSET_OF(RawContext, data_)); | 3473 ASSERT(sizeof(RawContext) == OFFSET_OF(RawContext, data_)); |
| 3469 return 0; | 3474 return 0; |
| (...skipping 3305 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6775 | 6780 |
| 6776 | 6781 |
| 6777 RawObject* MegamorphicCache::GetTargetFunction(const Array& array, | 6782 RawObject* MegamorphicCache::GetTargetFunction(const Array& array, |
| 6778 intptr_t index) { | 6783 intptr_t index) { |
| 6779 return array.At((index * kEntryLength) + kTargetFunctionIndex); | 6784 return array.At((index * kEntryLength) + kTargetFunctionIndex); |
| 6780 } | 6785 } |
| 6781 | 6786 |
| 6782 } // namespace dart | 6787 } // namespace dart |
| 6783 | 6788 |
| 6784 #endif // VM_OBJECT_H_ | 6789 #endif // VM_OBJECT_H_ |
| OLD | NEW |