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

Unified Diff: runtime/vm/unit_test.h

Issue 1948803002: Adds DBC StoreIntoObject test (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 8 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_test.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/unit_test.h
diff --git a/runtime/vm/unit_test.h b/runtime/vm/unit_test.h
index 60f405715e92ce1f89c97679a05636e5408fe086..a8224c58c15bb4c51492513d343ef2a1572715d7 100644
--- a/runtime/vm/unit_test.h
+++ b/runtime/vm/unit_test.h
@@ -430,6 +430,29 @@ class AssemblerTest {
reinterpret_cast<intptr_t>(arg3),
0, fp_return, fp_args);
}
+#elif defined(USING_SIMULATOR) && defined(TARGET_ARCH_DBC)
+ template<typename ResultType,
+ typename Arg1Type,
+ typename Arg2Type,
+ typename Arg3Type>
+ ResultType Invoke(Arg1Type arg1, Arg2Type arg2, Arg3Type arg3) {
+ // TODO(fschneider): Support double arguments for simulator calls.
+ COMPILE_ASSERT(is_void<ResultType>::value);
+ COMPILE_ASSERT(!is_double<Arg1Type>::value);
+ COMPILE_ASSERT(!is_double<Arg2Type>::value);
+ COMPILE_ASSERT(!is_double<Arg3Type>::value);
+ const Object& arg1obj = Object::Handle(reinterpret_cast<RawObject*>(arg1));
+ const Object& arg2obj = Object::Handle(reinterpret_cast<RawObject*>(arg2));
+ const Array& argdesc = Array::Handle(ArgumentsDescriptor::New(2));
+ const Array& arguments = Array::Handle(Array::New(2));
+ arguments.SetAt(0, arg1obj);
+ arguments.SetAt(1, arg2obj);
+ Simulator::Current()->Call(
+ code(),
+ argdesc,
+ arguments,
+ reinterpret_cast<Thread*>(arg3));
+ }
#else
template<typename ResultType> ResultType InvokeWithCodeAndThread() {
Thread* thread = Thread::Current();
« no previous file with comments | « runtime/vm/assembler_test.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698