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

Unified Diff: runtime/vm/object.h

Issue 10541061: - Simplify logic when setting up handle content. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/object.h
===================================================================
--- runtime/vm/object.h (revision 8388)
+++ runtime/vm/object.h (working copy)
@@ -4902,7 +4902,11 @@
if ((reinterpret_cast<uword>(raw_) & kSmiTagMask) == kSmiTag) {
set_vtable(Smi::handle_vtable_);
return;
+ } else if (raw_ == null_) {
+ set_vtable(handle_vtable_);
+ return;
}
+
#if defined(DEBUG)
Isolate* isolate = Isolate::Current();
Heap* isolate_heap = isolate->heap();
@@ -4910,23 +4914,19 @@
ASSERT(isolate_heap->Contains(reinterpret_cast<uword>(raw_->ptr())) ||
vm_isolate_heap->Contains(reinterpret_cast<uword>(raw_->ptr())));
#endif
- if (raw_ == null_) {
- set_vtable(handle_vtable_);
- } else {
- intptr_t cid = raw_->GetClassId();
- if (cid < kNumPredefinedKinds) {
+ intptr_t cid = raw_->GetClassId();
+ if (cid < kNumPredefinedKinds) {
#if defined(DEBUG)
- ASSERT(builtin_vtables_[cid] ==
- isolate->class_table()->At(cid)->ptr()->handle_vtable_);
+ ASSERT(builtin_vtables_[cid] ==
+ isolate->class_table()->At(cid)->ptr()->handle_vtable_);
#endif
- set_vtable(builtin_vtables_[cid]);
- } else {
+ set_vtable(builtin_vtables_[cid]);
+ } else {
#if !defined(DEBUG)
- Isolate* isolate = Isolate::Current();
+ Isolate* isolate = Isolate::Current();
#endif
- RawClass* raw_class = isolate->class_table()->At(cid);
- set_vtable(raw_class->ptr()->handle_vtable_);
- }
+ RawClass* raw_class = isolate->class_table()->At(cid);
+ set_vtable(raw_class->ptr()->handle_vtable_);
}
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698