Chromium Code Reviews| 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 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 195 | 195 |
| 196 // Returns the name that is used to identify an object in the | 196 // Returns the name that is used to identify an object in the |
| 197 // namespace dictionary. | 197 // namespace dictionary. |
| 198 // Object::DictionaryName() returns String::null(). Only subclasses | 198 // Object::DictionaryName() returns String::null(). Only subclasses |
| 199 // of Object that need to be entered in the library and library prefix | 199 // of Object that need to be entered in the library and library prefix |
| 200 // namespaces need to provide an implementation. | 200 // namespaces need to provide an implementation. |
| 201 virtual RawString* DictionaryName() const; | 201 virtual RawString* DictionaryName() const; |
| 202 | 202 |
| 203 bool IsNew() const { return raw()->IsNewObject(); } | 203 bool IsNew() const { return raw()->IsNewObject(); } |
| 204 bool IsOld() const { return raw()->IsOldObject(); } | 204 bool IsOld() const { return raw()->IsOldObject(); } |
| 205 bool InVMHeap() const { | |
| 206 #if defined(DEBUG) | |
| 207 if (raw()->IsVMHeapObject()) { | |
| 208 Heap* vm_isolate_heap = Dart::vm_isolate()->heap(); | |
| 209 ASSERT(vm_isolate_heap->Contains(reinterpret_cast<uword>(raw_->ptr()))); | |
|
Ivan Posva
2013/01/04 06:42:07
...->Contains(RawObject::ToAddr(raw_))
siva
2013/01/04 18:36:10
Done.
| |
| 210 } | |
| 211 #endif | |
| 212 ASSERT(!Isolate::Current()->heap()->gc_in_progress()); | |
|
Ivan Posva
2013/01/04 06:42:07
Can you move this assertion into the RawObject cod
siva
2013/01/04 18:36:10
Done.
| |
| 213 return raw()->IsVMHeapObject(); | |
| 214 } | |
| 205 | 215 |
| 206 // Print the object on stdout for debugging. | 216 // Print the object on stdout for debugging. |
| 207 void Print() const; | 217 void Print() const; |
| 208 | 218 |
| 209 bool IsZoneHandle() const { | 219 bool IsZoneHandle() const { |
| 210 return VMHandles::IsZoneHandle(reinterpret_cast<uword>(this)); | 220 return VMHandles::IsZoneHandle(reinterpret_cast<uword>(this)); |
| 211 } | 221 } |
| 212 | 222 |
| 213 bool IsReadOnlyHandle() const; | 223 bool IsReadOnlyHandle() const; |
| 214 | 224 |
| (...skipping 6013 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 6228 | 6238 |
| 6229 | 6239 |
| 6230 RawObject* MegamorphicCache::GetTargetFunction(const Array& array, | 6240 RawObject* MegamorphicCache::GetTargetFunction(const Array& array, |
| 6231 intptr_t index) { | 6241 intptr_t index) { |
| 6232 return array.At((index * kEntryLength) + kTargetFunctionIndex); | 6242 return array.At((index * kEntryLength) + kTargetFunctionIndex); |
| 6233 } | 6243 } |
| 6234 | 6244 |
| 6235 } // namespace dart | 6245 } // namespace dart |
| 6236 | 6246 |
| 6237 #endif // VM_OBJECT_H_ | 6247 #endif // VM_OBJECT_H_ |
| OLD | NEW |