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

Unified Diff: runtime/vm/assembler_test.cc

Issue 1283733003: VM: Refactor assembler test that rely on the constant pool. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Added comments, fixed that pass in Thread Created 5 years, 4 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_arm64_test.cc ('k') | runtime/vm/assembler_x64_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/assembler_test.cc
diff --git a/runtime/vm/assembler_test.cc b/runtime/vm/assembler_test.cc
index 7e4439c1e56c7d1a5f53312d71b6abe42c947e3f..fbbd994698f6cff6c0756cf458f6ef43096b2191 100644
--- a/runtime/vm/assembler_test.cc
+++ b/runtime/vm/assembler_test.cc
@@ -14,20 +14,9 @@ namespace dart {
ASSEMBLER_TEST_EXTERN(StoreIntoObject);
ASSEMBLER_TEST_RUN(StoreIntoObject, test) {
-#if defined(USING_SIMULATOR)
-#define test_code(value, growable_array, thread) \
- Simulator::Current()->Call( \
- bit_cast<intptr_t, uword>(test->entry()), \
- reinterpret_cast<intptr_t>(value), \
- reinterpret_cast<intptr_t>(growable_array), \
- reinterpret_cast<intptr_t>(thread), \
- 0) /* unused parameter */
-#else
- typedef void (*StoreData)(RawObject* value,
- RawObject* growable_array,
- Thread* thread);
- StoreData test_code = reinterpret_cast<StoreData>(test->entry());
-#endif
+#define TEST_CODE(value, growable_array, thread) \
+ test->Invoke<void, RawObject*, RawObject*, Thread*>( \
+ value, growable_array, thread)
const Array& old_array = Array::Handle(Array::New(3, Heap::kOld));
const Array& new_array = Array::Handle(Array::New(3, Heap::kNew));
@@ -46,28 +35,28 @@ ASSEMBLER_TEST_RUN(StoreIntoObject, test) {
// Store Smis into the old object.
for (int i = -128; i < 128; i++) {
smi = Smi::New(i);
- test_code(smi.raw(), grow_old_array.raw(), thread);
+ TEST_CODE(smi.raw(), grow_old_array.raw(), thread);
EXPECT(reinterpret_cast<RawArray*>(smi.raw()) == grow_old_array.data());
EXPECT(!thread->StoreBufferContains(grow_old_array.raw()));
}
// Store an old object into the old object.
- test_code(old_array.raw(), grow_old_array.raw(), thread);
+ TEST_CODE(old_array.raw(), grow_old_array.raw(), thread);
EXPECT(old_array.raw() == grow_old_array.data());
EXPECT(!thread->StoreBufferContains(grow_old_array.raw()));
// Store a new object into the old object.
- test_code(new_array.raw(), grow_old_array.raw(), thread);
+ TEST_CODE(new_array.raw(), grow_old_array.raw(), thread);
EXPECT(new_array.raw() == grow_old_array.data());
EXPECT(thread->StoreBufferContains(grow_old_array.raw()));
// Store a new object into the new object.
- test_code(new_array.raw(), grow_new_array.raw(), thread);
+ TEST_CODE(new_array.raw(), grow_new_array.raw(), thread);
EXPECT(new_array.raw() == grow_new_array.data());
EXPECT(!thread->StoreBufferContains(grow_new_array.raw()));
// Store an old object into the new object.
- test_code(old_array.raw(), grow_new_array.raw(), thread);
+ TEST_CODE(old_array.raw(), grow_new_array.raw(), thread);
EXPECT(old_array.raw() == grow_new_array.data());
EXPECT(!thread->StoreBufferContains(grow_new_array.raw()));
}
« no previous file with comments | « runtime/vm/assembler_arm64_test.cc ('k') | runtime/vm/assembler_x64_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698