Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(324)

Unified Diff: runtime/vm/object.h

Issue 16174008: - Create isolate specific resuable handles and use them in the hot lookup paths. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: runtime/vm/object.h
===================================================================
--- runtime/vm/object.h (revision 24200)
+++ 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;
};
@@ -5812,20 +5813,22 @@
}
-void Object::SetRaw(RawObject* value) {
+inline void Object::SetRaw(RawObject* value) {
Ivan Posva 2013/06/22 01:01:36 DART_FORCE_INLINE would be a good alternative here
siva 2013/07/18 20:39:23 Done.
// 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_;
Ivan Posva 2013/06/22 01:01:36 --verify_handles will fail below when being passed
siva 2013/07/18 20:39:23 Reverted this change as DART_FORCE_INLINE should m
+ } 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();
« runtime/vm/isolate.h ('K') | « runtime/vm/isolate.cc ('k') | runtime/vm/object.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698