Chromium Code Reviews| Index: runtime/vm/unit_test.h |
| diff --git a/runtime/vm/unit_test.h b/runtime/vm/unit_test.h |
| index 60f405715e92ce1f89c97679a05636e5408fe086..da6a11f1dc93c802f1059cd24e4a56e399bc2bc6 100644 |
| --- a/runtime/vm/unit_test.h |
| +++ b/runtime/vm/unit_test.h |
| @@ -430,6 +430,27 @@ 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 Array& argdesc = Array::Handle(ArgumentsDescriptor::New(2)); |
| + const Array& arguments = Array::Handle(Array::New(2)); |
|
Vyacheslav Egorov (Google)
2016/05/03 21:39:02
This is unsafe. Can't use RawObject* arguments acr
zra
2016/05/03 21:58:32
Done.
|
| + arguments.SetAt(0, Object::Handle(reinterpret_cast<RawObject*>(arg1))); |
| + arguments.SetAt(1, Object::Handle(reinterpret_cast<RawObject*>(arg2))); |
| + Simulator::Current()->Call( |
| + code(), |
| + argdesc, |
| + arguments, |
| + reinterpret_cast<Thread*>(arg3)); |
| + } |
| #else |
| template<typename ResultType> ResultType InvokeWithCodeAndThread() { |
| Thread* thread = Thread::Current(); |