| 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 296 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 307 | 307 |
| 308 // Returns the name that is used to identify an object in the | 308 // Returns the name that is used to identify an object in the |
| 309 // namespace dictionary. | 309 // namespace dictionary. |
| 310 // Object::DictionaryName() returns String::null(). Only subclasses | 310 // Object::DictionaryName() returns String::null(). Only subclasses |
| 311 // of Object that need to be entered in the library and library prefix | 311 // of Object that need to be entered in the library and library prefix |
| 312 // namespaces need to provide an implementation. | 312 // namespaces need to provide an implementation. |
| 313 virtual RawString* DictionaryName() const; | 313 virtual RawString* DictionaryName() const; |
| 314 | 314 |
| 315 bool IsNew() const { return raw()->IsNewObject(); } | 315 bool IsNew() const { return raw()->IsNewObject(); } |
| 316 bool IsOld() const { return raw()->IsOldObject(); } | 316 bool IsOld() const { return raw()->IsOldObject(); } |
| 317 bool InVMHeap() const { | |
| 318 #if defined(DEBUG) | 317 #if defined(DEBUG) |
| 319 if (raw()->IsVMHeapObject()) { | 318 bool InVMHeap() const; |
| 320 Heap* vm_isolate_heap = Dart::vm_isolate()->heap(); | 319 #else |
| 321 ASSERT(vm_isolate_heap->Contains(RawObject::ToAddr(raw()))); | 320 bool InVMHeap() const { return raw()->IsVMHeapObject(); } |
| 322 } | 321 #endif // DEBUG |
| 323 #endif | |
| 324 return raw()->IsVMHeapObject(); | |
| 325 } | |
| 326 | 322 |
| 327 // Print the object on stdout for debugging. | 323 // Print the object on stdout for debugging. |
| 328 void Print() const; | 324 void Print() const; |
| 329 | 325 |
| 330 bool IsZoneHandle() const { | 326 bool IsZoneHandle() const { |
| 331 return VMHandles::IsZoneHandle(reinterpret_cast<uword>(this)); | 327 return VMHandles::IsZoneHandle(reinterpret_cast<uword>(this)); |
| 332 } | 328 } |
| 333 | 329 |
| 334 bool IsReadOnlyHandle() const; | 330 bool IsReadOnlyHandle() const; |
| 335 | 331 |
| (...skipping 8092 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 8428 | 8424 |
| 8429 | 8425 |
| 8430 RawObject* MegamorphicCache::GetTargetFunction(const Array& array, | 8426 RawObject* MegamorphicCache::GetTargetFunction(const Array& array, |
| 8431 intptr_t index) { | 8427 intptr_t index) { |
| 8432 return array.At((index * kEntryLength) + kTargetFunctionIndex); | 8428 return array.At((index * kEntryLength) + kTargetFunctionIndex); |
| 8433 } | 8429 } |
| 8434 | 8430 |
| 8435 } // namespace dart | 8431 } // namespace dart |
| 8436 | 8432 |
| 8437 #endif // VM_OBJECT_H_ | 8433 #endif // VM_OBJECT_H_ |
| OLD | NEW |