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

Unified Diff: runtime/vm/assembler_ia32_test.cc

Issue 10578046: - Inline the store buffer update into a stub instead of (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 | « runtime/vm/assembler_ia32.cc ('k') | runtime/vm/isolate.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/assembler_ia32_test.cc
===================================================================
--- runtime/vm/assembler_ia32_test.cc (revision 8921)
+++ runtime/vm/assembler_ia32_test.cc (working copy)
@@ -1837,6 +1837,60 @@
}
+ASSEMBLER_TEST_GENERATE(StoreIntoObject, assembler) {
+ __ pushl(CTX);
+ __ movl(CTX, Address(ESP, 2 * kWordSize));
+ __ movl(EAX, Address(ESP, 3 * kWordSize));
+ __ movl(ECX, Address(ESP, 4 * kWordSize));
+ __ StoreIntoObject(ECX,
+ FieldAddress(ECX, GrowableObjectArray::data_offset()),
+ EAX);
+ __ popl(CTX);
+ __ ret();
+}
+
+
+ASSEMBLER_TEST_RUN(StoreIntoObject, entry) {
+ typedef void (*StoreData)(RawContext* ctx,
+ RawObject* value,
+ RawObject* growable_array);
+ StoreData test_code = reinterpret_cast<StoreData>(entry);
+
+ const Array& old_array = Array::Handle(Array::New(3, Heap::kOld));
+ const Array& new_array = Array::Handle(Array::New(3, Heap::kNew));
+ const GrowableObjectArray& grow_array = GrowableObjectArray::Handle(
+ GrowableObjectArray::New(old_array, Heap::kOld));
+ const Smi& smi = Smi::Handle(Smi::New(7));
+ const Context& ctx = Context::Handle(Context::New(0));
+
+ EXPECT(old_array.raw() == grow_array.data());
+ EXPECT(!Isolate::Current()->store_buffer()->Contains(
+ reinterpret_cast<uword>(grow_array.raw()) +
+ GrowableObjectArray::data_offset() - kHeapObjectTag));
+
+ // Store Smi into the old object.
+ test_code(ctx.raw(), smi.raw(), grow_array.raw());
+ EXPECT(reinterpret_cast<RawArray*>(smi.raw()) == grow_array.data());
+ EXPECT(!Isolate::Current()->store_buffer()->Contains(
+ reinterpret_cast<uword>(grow_array.raw()) +
+ GrowableObjectArray::data_offset() - kHeapObjectTag));
+
+ // Store an old object into the old object.
+ test_code(ctx.raw(), old_array.raw(), grow_array.raw());
+ EXPECT(old_array.raw() == grow_array.data());
+ EXPECT(!Isolate::Current()->store_buffer()->Contains(
+ reinterpret_cast<uword>(grow_array.raw()) +
+ GrowableObjectArray::data_offset() - kHeapObjectTag));
+
+ // Store a new object into the old object.
+ test_code(ctx.raw(), new_array.raw(), grow_array.raw());
+ EXPECT(new_array.raw() == grow_array.data());
+ EXPECT(Isolate::Current()->store_buffer()->Contains(
+ reinterpret_cast<uword>(grow_array.raw()) +
+ GrowableObjectArray::data_offset() - kHeapObjectTag));
siva 2012/06/20 17:57:28 Should we also have a test for: // Store a new obj
Ivan Posva 2012/06/20 18:05:37 Done.
+}
+
+
} // namespace dart
#endif // defined TARGET_ARCH_IA32
« no previous file with comments | « runtime/vm/assembler_ia32.cc ('k') | runtime/vm/isolate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698