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

Unified Diff: test/cctest/compiler/call-tester.h

Issue 1423133005: Implemented the BufferedRawMachineAssemblerTester. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fixed the test case parameter values. Created 5 years, 2 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 | « test/cctest/compiler/c-signature.h ('k') | test/cctest/compiler/codegen-tester.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/cctest/compiler/call-tester.h
diff --git a/test/cctest/compiler/call-tester.h b/test/cctest/compiler/call-tester.h
index 10f98db9ffd315d900760772ebf96893f936b79b..e60f7172fae24690f19a4402d4ccbafbf82fb4b2 100644
--- a/test/cctest/compiler/call-tester.h
+++ b/test/cctest/compiler/call-tester.h
@@ -159,6 +159,13 @@ class CallHelper {
return DoCall(FUNCTION_CAST<FType*>(Generate()), p1, p2, p3, p4);
}
+ template <typename P1, typename P2, typename P3, typename P4, typename P5>
+ R Call(P1 p1, P2 p2, P3 p3, P4 p4, P5 p5) {
+ typedef R V8_CDECL FType(P1, P2, P3, P4, P5);
+ csig_->VerifyParams<P1, P2, P3, P4, P5>();
+ return DoCall(FUNCTION_CAST<FType*>(Generate()), p1, p2, p3, p4, p5);
+ }
+
protected:
CSignature* csig_;
@@ -204,11 +211,20 @@ class CallHelper {
Simulator::CallArgument::End()};
return CastReturnValue<R>(CallSimulator(FUNCTION_ADDR(f), args));
}
+ template <typename F, typename P1, typename P2, typename P3, typename P4,
+ typename P5>
+ R DoCall(F* f, P1 p1, P2 p2, P3 p3, P4 p4, P5 p5) {
+ Simulator::CallArgument args[] = {
+ Simulator::CallArgument(p1), Simulator::CallArgument(p2),
+ Simulator::CallArgument(p3), Simulator::CallArgument(p4),
+ Simulator::CallArgument(p5), Simulator::CallArgument::End()};
+ return CastReturnValue<R>(CallSimulator(FUNCTION_ADDR(f), args));
+ }
#elif USE_SIMULATOR && (V8_TARGET_ARCH_MIPS64 || V8_TARGET_ARCH_PPC64)
uintptr_t CallSimulator(byte* f, int64_t p1 = 0, int64_t p2 = 0,
- int64_t p3 = 0, int64_t p4 = 0) {
+ int64_t p3 = 0, int64_t p4 = 0, int64_t p5 = 0) {
Simulator* simulator = Simulator::current(isolate_);
- return static_cast<uintptr_t>(simulator->Call(f, 4, p1, p2, p3, p4));
+ return static_cast<uintptr_t>(simulator->Call(f, 5, p1, p2, p3, p4, p5));
}
@@ -240,12 +256,20 @@ class CallHelper {
ParameterTraits<P2>::Cast(p2), ParameterTraits<P3>::Cast(p3),
ParameterTraits<P4>::Cast(p4)));
}
+ template <typename F, typename P1, typename P2, typename P3, typename P4,
+ typename P5>
+ R DoCall(F* f, P1 p1, P2 p2, P3 p3, P4 p4, P5 p5) {
+ return CastReturnValue<R>(CallSimulator(
+ FUNCTION_ADDR(f), ParameterTraits<P1>::Cast(p1),
+ ParameterTraits<P2>::Cast(p2), ParameterTraits<P3>::Cast(p3),
+ ParameterTraits<P4>::Cast(p4), ParameterTraits<P5>::Cast(p5)));
+ }
#elif USE_SIMULATOR && \
(V8_TARGET_ARCH_ARM || V8_TARGET_ARCH_MIPS || V8_TARGET_ARCH_PPC)
uintptr_t CallSimulator(byte* f, int32_t p1 = 0, int32_t p2 = 0,
- int32_t p3 = 0, int32_t p4 = 0) {
+ int32_t p3 = 0, int32_t p4 = 0, int32_t p5 = 0) {
Simulator* simulator = Simulator::current(isolate_);
- return static_cast<uintptr_t>(simulator->Call(f, 4, p1, p2, p3, p4));
+ return static_cast<uintptr_t>(simulator->Call(f, 5, p1, p2, p3, p4, p5));
}
template <typename F>
R DoCall(F* f) {
@@ -275,6 +299,14 @@ class CallHelper {
ParameterTraits<P2>::Cast(p2), ParameterTraits<P3>::Cast(p3),
ParameterTraits<P4>::Cast(p4)));
}
+ template <typename F, typename P1, typename P2, typename P3, typename P4,
+ typename P5>
+ R DoCall(F* f, P1 p1, P2 p2, P3 p3, P4 p4, P5 p5) {
+ return CastReturnValue<R>(CallSimulator(
+ FUNCTION_ADDR(f), ParameterTraits<P1>::Cast(p1),
+ ParameterTraits<P2>::Cast(p2), ParameterTraits<P3>::Cast(p3),
+ ParameterTraits<P4>::Cast(p4), ParameterTraits<P5>::Cast(p5)));
+ }
#else
template <typename F>
R DoCall(F* f) {
@@ -296,6 +328,11 @@ class CallHelper {
R DoCall(F* f, P1 p1, P2 p2, P3 p3, P4 p4) {
return f(p1, p2, p3, p4);
}
+ template <typename F, typename P1, typename P2, typename P3, typename P4,
+ typename P5>
+ R DoCall(F* f, P1 p1, P2 p2, P3 p3, P4 p4, P5 p5) {
+ return f(p1, p2, p3, p4, p5);
+ }
#endif
Isolate* isolate_;
« no previous file with comments | « test/cctest/compiler/c-signature.h ('k') | test/cctest/compiler/codegen-tester.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698