| 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 2138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2149 | 2149 |
| 2150 HEAP_OBJECT_IMPLEMENTATION(Code, Object); | 2150 HEAP_OBJECT_IMPLEMENTATION(Code, Object); |
| 2151 friend class Class; | 2151 friend class Class; |
| 2152 }; | 2152 }; |
| 2153 | 2153 |
| 2154 | 2154 |
| 2155 class Context : public Object { | 2155 class Context : public Object { |
| 2156 public: | 2156 public: |
| 2157 RawContext* parent() const { return raw_ptr()->parent_; } | 2157 RawContext* parent() const { return raw_ptr()->parent_; } |
| 2158 void set_parent(const Context& parent) const { | 2158 void set_parent(const Context& parent) const { |
| 2159 ASSERT(parent.isolate() == Isolate::Current()); | 2159 ASSERT(parent.IsNull() || parent.isolate() == Isolate::Current()); |
| 2160 StorePointer(&raw_ptr()->parent_, parent.raw()); | 2160 StorePointer(&raw_ptr()->parent_, parent.raw()); |
| 2161 } | 2161 } |
| 2162 static intptr_t parent_offset() { return OFFSET_OF(RawContext, parent_); } | 2162 static intptr_t parent_offset() { return OFFSET_OF(RawContext, parent_); } |
| 2163 | 2163 |
| 2164 Isolate* isolate() const { return raw_ptr()->isolate_; } | 2164 Isolate* isolate() const { return raw_ptr()->isolate_; } |
| 2165 static intptr_t isolate_offset() { return OFFSET_OF(RawContext, isolate_); } | 2165 static intptr_t isolate_offset() { return OFFSET_OF(RawContext, isolate_); } |
| 2166 | 2166 |
| 2167 intptr_t num_variables() const { return raw_ptr()->num_variables_; } | 2167 intptr_t num_variables() const { return raw_ptr()->num_variables_; } |
| 2168 static intptr_t num_variables_offset() { | 2168 static intptr_t num_variables_offset() { |
| 2169 return OFFSET_OF(RawContext, num_variables_); | 2169 return OFFSET_OF(RawContext, num_variables_); |
| (...skipping 1660 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3830 } | 3830 } |
| 3831 | 3831 |
| 3832 | 3832 |
| 3833 void Context::SetAt(intptr_t index, const Instance& value) const { | 3833 void Context::SetAt(intptr_t index, const Instance& value) const { |
| 3834 StorePointer(InstanceAddr(index), value.raw()); | 3834 StorePointer(InstanceAddr(index), value.raw()); |
| 3835 } | 3835 } |
| 3836 | 3836 |
| 3837 } // namespace dart | 3837 } // namespace dart |
| 3838 | 3838 |
| 3839 #endif // VM_OBJECT_H_ | 3839 #endif // VM_OBJECT_H_ |
| OLD | NEW |