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

Unified Diff: runtime/vm/assembler_x64.cc

Issue 23454032: - Tighten assertions in the X64 assembler related to object pool usage. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 3 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 | runtime/vm/dart_api_impl_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/assembler_x64.cc
===================================================================
--- runtime/vm/assembler_x64.cc (revision 27443)
+++ runtime/vm/assembler_x64.cc (working copy)
@@ -2207,14 +2207,19 @@
bool Assembler::CanLoadFromObjectPool(const Object& object) {
- return !object.IsSmi() && // Not a Smi
+ // TODO(zra, kmillikin): Move the use of large Smis into the constant pool.
+ if (object.IsSmi()) {
+ return false;
+ }
+ ASSERT(object.IsNotTemporaryScopedHandle());
+ ASSERT(object.IsOld());
+ return (Isolate::Current() != Dart::vm_isolate()) &&
// Not in the VMHeap, OR is one of the VMHeap objects we put in every
// object pool.
+ // TODO(zra): Evaluate putting all VM heap objects into the pool.
(!object.InVMHeap() || (object.raw() == Object::null()) ||
(object.raw() == Bool::True().raw()) ||
- (object.raw() == Bool::False().raw())) &&
- object.IsNotTemporaryScopedHandle() &&
- object.IsOld();
+ (object.raw() == Bool::False().raw()));
}
@@ -2232,6 +2237,9 @@
Array::element_offset(FindObject(object, kNotPatchable));
LoadWordFromPoolOffset(dst, pp, offset - kHeapObjectTag);
} else {
+ ASSERT((Isolate::Current() == Dart::vm_isolate()) ||
+ object.IsSmi() ||
+ object.InVMHeap());
movq(dst, Immediate(reinterpret_cast<int64_t>(object.raw())));
}
}
« no previous file with comments | « no previous file | runtime/vm/dart_api_impl_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698