| Index: runtime/vm/object.h
|
| ===================================================================
|
| --- runtime/vm/object.h (revision 24061)
|
| +++ runtime/vm/object.h (working copy)
|
| @@ -169,6 +169,7 @@
|
| return raw()->ptr(); \
|
| } \
|
| SNAPSHOT_READER_SUPPORT(object) \
|
| + friend class Isolate; \
|
| friend class StackFrame; \
|
|
|
| // This macro is used to denote types that do not have a sub-type.
|
| @@ -190,6 +191,7 @@
|
| return raw()->ptr(); \
|
| } \
|
| SNAPSHOT_READER_SUPPORT(object) \
|
| + friend class Isolate; \
|
| friend class StackFrame; \
|
|
|
| class Object {
|
| @@ -591,6 +593,7 @@
|
| friend class TwoByteString;
|
| friend class ExternalOneByteString;
|
| friend class ExternalTwoByteString;
|
| + friend class Isolate;
|
|
|
| DISALLOW_ALLOCATION();
|
| DISALLOW_COPY_AND_ASSIGN(Object);
|
| @@ -2354,7 +2357,6 @@
|
| friend class Class;
|
| friend class Debugger;
|
| friend class DictionaryIterator;
|
| - friend class Isolate;
|
| friend class Namespace;
|
| friend class Object;
|
| };
|
| @@ -2390,7 +2392,6 @@
|
|
|
| FINAL_HEAP_OBJECT_IMPLEMENTATION(LibraryPrefix, Object);
|
| friend class Class;
|
| - friend class Isolate;
|
| };
|
|
|
|
|
| @@ -5808,20 +5809,22 @@
|
| }
|
|
|
|
|
| -void Object::SetRaw(RawObject* value) {
|
| +inline void Object::SetRaw(RawObject* value) {
|
| // NOTE: The assignment "raw_ = value" should be the first statement in
|
| // this function. Also do not use 'value' in this function after the
|
| // assignment (use 'raw_' instead).
|
| raw_ = value;
|
| - if ((reinterpret_cast<uword>(raw_) & kSmiTagMask) == kSmiTag) {
|
| - set_vtable(Smi::handle_vtable_);
|
| - return;
|
| - }
|
| - intptr_t cid = raw_->GetClassId();
|
| - if (cid >= kNumPredefinedCids) {
|
| + cpp_vtable vtable_ptr;
|
| + if ((reinterpret_cast<uword>(value) & kSmiTagMask) == kSmiTag) {
|
| + vtable_ptr = Smi::handle_vtable_;
|
| + } else {
|
| + intptr_t cid = value->GetClassId();
|
| + if (cid >= kNumPredefinedCids) {
|
| cid = kInstanceCid;
|
| + }
|
| + vtable_ptr = builtin_vtables_[cid];
|
| }
|
| - set_vtable(builtin_vtables_[cid]);
|
| + set_vtable(vtable_ptr);
|
| #if defined(DEBUG)
|
| if (FLAG_verify_handles) {
|
| Isolate* isolate = Isolate::Current();
|
|
|