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

Side by Side Diff: test/cctest/compiler/call-tester.h

Issue 501323002: Replace our homegrown ARRAY_SIZE() with Chrome's arraysize(). (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 3 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright 2014 the V8 project authors. All rights reserved. 1 // Copyright 2014 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef V8_CCTEST_COMPILER_CALL_TESTER_H_ 5 #ifndef V8_CCTEST_COMPILER_CALL_TESTER_H_
6 #define V8_CCTEST_COMPILER_CALL_TESTER_H_ 6 #define V8_CCTEST_COMPILER_CALL_TESTER_H_
7 7
8 #include "src/v8.h" 8 #include "src/v8.h"
9 9
10 #include "src/simulator.h" 10 #include "src/simulator.h"
(...skipping 262 matching lines...) Expand 10 before | Expand all | Expand 10 after
273 void VerifyParameters3() {} 273 void VerifyParameters3() {}
274 274
275 template <typename P1, typename P2, typename P3, typename P4> 275 template <typename P1, typename P2, typename P3, typename P4>
276 void VerifyParameters4() {} 276 void VerifyParameters4() {}
277 #else 277 #else
278 void VerifyParameters0() { VerifyParameters(0, NULL); } 278 void VerifyParameters0() { VerifyParameters(0, NULL); }
279 279
280 template <typename P1> 280 template <typename P1>
281 void VerifyParameters1() { 281 void VerifyParameters1() {
282 MachineType parameters[] = {ReturnValueTraits<P1>::Representation()}; 282 MachineType parameters[] = {ReturnValueTraits<P1>::Representation()};
283 VerifyParameters(ARRAY_SIZE(parameters), parameters); 283 VerifyParameters(arraysize(parameters), parameters);
284 } 284 }
285 285
286 template <typename P1, typename P2> 286 template <typename P1, typename P2>
287 void VerifyParameters2() { 287 void VerifyParameters2() {
288 MachineType parameters[] = {ReturnValueTraits<P1>::Representation(), 288 MachineType parameters[] = {ReturnValueTraits<P1>::Representation(),
289 ReturnValueTraits<P2>::Representation()}; 289 ReturnValueTraits<P2>::Representation()};
290 VerifyParameters(ARRAY_SIZE(parameters), parameters); 290 VerifyParameters(arraysize(parameters), parameters);
291 } 291 }
292 292
293 template <typename P1, typename P2, typename P3> 293 template <typename P1, typename P2, typename P3>
294 void VerifyParameters3() { 294 void VerifyParameters3() {
295 MachineType parameters[] = {ReturnValueTraits<P1>::Representation(), 295 MachineType parameters[] = {ReturnValueTraits<P1>::Representation(),
296 ReturnValueTraits<P2>::Representation(), 296 ReturnValueTraits<P2>::Representation(),
297 ReturnValueTraits<P3>::Representation()}; 297 ReturnValueTraits<P3>::Representation()};
298 VerifyParameters(ARRAY_SIZE(parameters), parameters); 298 VerifyParameters(arraysize(parameters), parameters);
299 } 299 }
300 300
301 template <typename P1, typename P2, typename P3, typename P4> 301 template <typename P1, typename P2, typename P3, typename P4>
302 void VerifyParameters4() { 302 void VerifyParameters4() {
303 MachineType parameters[] = {ReturnValueTraits<P1>::Representation(), 303 MachineType parameters[] = {ReturnValueTraits<P1>::Representation(),
304 ReturnValueTraits<P2>::Representation(), 304 ReturnValueTraits<P2>::Representation(),
305 ReturnValueTraits<P3>::Representation(), 305 ReturnValueTraits<P3>::Representation(),
306 ReturnValueTraits<P4>::Representation()}; 306 ReturnValueTraits<P4>::Representation()};
307 VerifyParameters(ARRAY_SIZE(parameters), parameters); 307 VerifyParameters(arraysize(parameters), parameters);
308 } 308 }
309 #endif 309 #endif
310 310
311 // TODO(dcarney): replace Call() in CallHelper2 with these. 311 // TODO(dcarney): replace Call() in CallHelper2 with these.
312 template <typename R> 312 template <typename R>
313 R Call0() { 313 R Call0() {
314 typedef R V8_CDECL FType(); 314 typedef R V8_CDECL FType();
315 VerifyParameters0(); 315 VerifyParameters0();
316 return DoCall<R>(FUNCTION_CAST<FType*>(Generate())); 316 return DoCall<R>(FUNCTION_CAST<FType*>(Generate()));
317 } 317 }
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
378 378
379 private: 379 private:
380 CallHelper* helper() { return static_cast<C*>(this); } 380 CallHelper* helper() { return static_cast<C*>(this); }
381 }; 381 };
382 382
383 } // namespace compiler 383 } // namespace compiler
384 } // namespace internal 384 } // namespace internal
385 } // namespace v8 385 } // namespace v8
386 386
387 #endif // V8_CCTEST_COMPILER_CALL_TESTER_H_ 387 #endif // V8_CCTEST_COMPILER_CALL_TESTER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698