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

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

Issue 1146173005: [test] Refactor call-tester to use c-signature.h. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 7 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 194af3889abf1de6f85b80d283b4be65772f9347..dc265ea5fa9da591b34449be9839dddf3e26f84f 100644
--- a/test/cctest/compiler/call-tester.h
+++ b/test/cctest/compiler/call-tester.h
@@ -122,55 +122,48 @@ struct ParameterTraits<uint32_t> {
template <typename R>
class CallHelper {
public:
- explicit CallHelper(Isolate* isolate, MachineSignature* machine_sig)
- : machine_sig_(machine_sig), isolate_(isolate) {
+ explicit CallHelper(Isolate* isolate, CSignature* csig)
+ : csig_(csig), isolate_(isolate) {
USE(isolate_);
}
virtual ~CallHelper() {}
R Call() {
typedef R V8_CDECL FType();
- VerifyParameters0();
+ csig_->VerifyParams();
return DoCall(FUNCTION_CAST<FType*>(Generate()));
}
template <typename P1>
R Call(P1 p1) {
typedef R V8_CDECL FType(P1);
- VerifyParameters1<P1>();
+ csig_->VerifyParams<P1>();
return DoCall(FUNCTION_CAST<FType*>(Generate()), p1);
}
template <typename P1, typename P2>
R Call(P1 p1, P2 p2) {
typedef R V8_CDECL FType(P1, P2);
- VerifyParameters2<P1, P2>();
+ csig_->VerifyParams<P1, P2>();
return DoCall(FUNCTION_CAST<FType*>(Generate()), p1, p2);
}
template <typename P1, typename P2, typename P3>
R Call(P1 p1, P2 p2, P3 p3) {
typedef R V8_CDECL FType(P1, P2, P3);
- VerifyParameters3<P1, P2, P3>();
+ csig_->VerifyParams<P1, P2, P3>();
return DoCall(FUNCTION_CAST<FType*>(Generate()), p1, p2, p3);
}
template <typename P1, typename P2, typename P3, typename P4>
R Call(P1 p1, P2 p2, P3 p3, P4 p4) {
typedef R V8_CDECL FType(P1, P2, P3, P4);
- VerifyParameters4<P1, P2, P3, P4>();
+ csig_->VerifyParams<P1, P2, P3, P4>();
return DoCall(FUNCTION_CAST<FType*>(Generate()), p1, p2, p3, p4);
}
protected:
- MachineSignature* machine_sig_;
-
- void VerifyParameters(size_t parameter_count, MachineType* parameter_types) {
- CHECK(machine_sig_->parameter_count() == parameter_count);
- for (size_t i = 0; i < parameter_count; i++) {
- CHECK_EQ(machine_sig_->GetParam(i), parameter_types[i]);
- }
- }
+ CSignature* csig_;
virtual byte* Generate() = 0;
@@ -308,50 +301,6 @@ class CallHelper {
}
#endif
-#ifndef DEBUG
- void VerifyParameters0() {}
-
- template <typename P1>
- void VerifyParameters1() {}
-
- template <typename P1, typename P2>
- void VerifyParameters2() {}
-
- template <typename P1, typename P2, typename P3>
- void VerifyParameters3() {}
-
- template <typename P1, typename P2, typename P3, typename P4>
- void VerifyParameters4() {}
-#else
- void VerifyParameters0() { VerifyParameters(0, NULL); }
-
- template <typename P1>
- void VerifyParameters1() {
- MachineType parameters[] = {MachineTypeForC<P1>()};
- VerifyParameters(arraysize(parameters), parameters);
- }
-
- template <typename P1, typename P2>
- void VerifyParameters2() {
- MachineType parameters[] = {MachineTypeForC<P1>(), MachineTypeForC<P2>()};
- VerifyParameters(arraysize(parameters), parameters);
- }
-
- template <typename P1, typename P2, typename P3>
- void VerifyParameters3() {
- MachineType parameters[] = {MachineTypeForC<P1>(), MachineTypeForC<P2>(),
- MachineTypeForC<P3>()};
- VerifyParameters(arraysize(parameters), parameters);
- }
-
- template <typename P1, typename P2, typename P3, typename P4>
- void VerifyParameters4() {
- MachineType parameters[] = {MachineTypeForC<P1>(), MachineTypeForC<P2>(),
- MachineTypeForC<P3>(), MachineTypeForC<P4>()};
- VerifyParameters(arraysize(parameters), parameters);
- }
-#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