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 30 matching lines...) Expand all Loading... | |
| 41 ASSERT(IsNull() || Is##object()); \ | 41 ASSERT(IsNull() || Is##object()); \ |
| 42 } \ | 42 } \ |
| 43 static object& Handle(Isolate* islt, Raw##object* raw_ptr) { \ | 43 static object& Handle(Isolate* islt, Raw##object* raw_ptr) { \ |
| 44 object* obj = reinterpret_cast<object*>(VMHandles::AllocateHandle(islt)); \ | 44 object* obj = reinterpret_cast<object*>(VMHandles::AllocateHandle(islt)); \ |
| 45 initializeHandle(obj, raw_ptr); \ | 45 initializeHandle(obj, raw_ptr); \ |
| 46 return *obj; \ | 46 return *obj; \ |
| 47 } \ | 47 } \ |
| 48 static object& Handle() { \ | 48 static object& Handle() { \ |
| 49 return Handle(Isolate::Current(), object::null()); \ | 49 return Handle(Isolate::Current(), object::null()); \ |
| 50 } \ | 50 } \ |
| 51 static object& Handle(Isolate* islt) { \ | |
|
siva
2012/04/03 23:56:59
isolate instead of islt?
turnidge
2012/04/04 00:00:51
Done. Also updated nearby instances of the same t
| |
| 52 return Handle(islt, object::null()); \ | |
| 53 } \ | |
| 51 static object& Handle(Raw##object* raw_ptr) { \ | 54 static object& Handle(Raw##object* raw_ptr) { \ |
| 52 return Handle(Isolate::Current(), raw_ptr); \ | 55 return Handle(Isolate::Current(), raw_ptr); \ |
| 53 } \ | 56 } \ |
| 54 static object& CheckedHandle(Isolate* islt, RawObject* raw_ptr) { \ | 57 static object& CheckedHandle(Isolate* islt, RawObject* raw_ptr) { \ |
| 55 object* obj = reinterpret_cast<object*>(VMHandles::AllocateHandle(islt)); \ | 58 object* obj = reinterpret_cast<object*>(VMHandles::AllocateHandle(islt)); \ |
| 56 initializeHandle(obj, raw_ptr); \ | 59 initializeHandle(obj, raw_ptr); \ |
| 57 if (!obj->Is##object()) { \ | 60 if (!obj->Is##object()) { \ |
| 58 FATAL("Handle check failed."); \ | 61 FATAL("Handle check failed."); \ |
| 59 } \ | 62 } \ |
| 60 return *obj; \ | 63 return *obj; \ |
| (...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 226 static Object& Handle(Isolate* isolate, RawObject* raw_ptr) { | 229 static Object& Handle(Isolate* isolate, RawObject* raw_ptr) { |
| 227 Object* obj = reinterpret_cast<Object*>(VMHandles::AllocateHandle(isolate)); | 230 Object* obj = reinterpret_cast<Object*>(VMHandles::AllocateHandle(isolate)); |
| 228 obj->SetRaw(raw_ptr); | 231 obj->SetRaw(raw_ptr); |
| 229 return *obj; | 232 return *obj; |
| 230 } | 233 } |
| 231 | 234 |
| 232 static Object& Handle() { | 235 static Object& Handle() { |
| 233 return Handle(Isolate::Current(), null_); | 236 return Handle(Isolate::Current(), null_); |
| 234 } | 237 } |
| 235 | 238 |
| 239 static Object& Handle(Isolate* isolate) { | |
| 240 return Handle(isolate, null_); | |
| 241 } | |
| 242 | |
| 236 static Object& Handle(RawObject* raw_ptr) { | 243 static Object& Handle(RawObject* raw_ptr) { |
| 237 return Handle(Isolate::Current(), raw_ptr); | 244 return Handle(Isolate::Current(), raw_ptr); |
| 238 } | 245 } |
| 239 | 246 |
| 240 static Object& ZoneHandle(Isolate* isolate, RawObject* raw_ptr) { | 247 static Object& ZoneHandle(Isolate* isolate, RawObject* raw_ptr) { |
| 241 Object* obj = reinterpret_cast<Object*>( | 248 Object* obj = reinterpret_cast<Object*>( |
| 242 VMHandles::AllocateZoneHandle(isolate)); | 249 VMHandles::AllocateZoneHandle(isolate)); |
| 243 obj->SetRaw(raw_ptr); | 250 obj->SetRaw(raw_ptr); |
| 244 return *obj; | 251 return *obj; |
| 245 } | 252 } |
| (...skipping 3705 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3951 } | 3958 } |
| 3952 | 3959 |
| 3953 | 3960 |
| 3954 intptr_t Stackmap::SizeInBits() const { | 3961 intptr_t Stackmap::SizeInBits() const { |
| 3955 return (Smi::Value(raw_ptr()->bitmap_size_in_bytes_) * kBitsPerByte); | 3962 return (Smi::Value(raw_ptr()->bitmap_size_in_bytes_) * kBitsPerByte); |
| 3956 } | 3963 } |
| 3957 | 3964 |
| 3958 } // namespace dart | 3965 } // namespace dart |
| 3959 | 3966 |
| 3960 #endif // VM_OBJECT_H_ | 3967 #endif // VM_OBJECT_H_ |
| OLD | NEW |