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

Side by Side Diff: test/cctest/expression-type-collector-macros.h

Issue 1319983004: Refactor type collector testing macros. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: fix Created 5 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
« no previous file with comments | « no previous file | test/cctest/test-ast-expression-visitor.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 the V8 project authors. All rights reserved. 1 // Copyright 2015 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_EXPRESSION_TYPE_COLLECTOR_MACROS_H_ 5 #ifndef V8_EXPRESSION_TYPE_COLLECTOR_MACROS_H_
6 #define V8_EXPRESSION_TYPE_COLLECTOR_MACROS_H_ 6 #define V8_EXPRESSION_TYPE_COLLECTOR_MACROS_H_
7 7
8 #define CHECK_TYPES_BEGIN \ 8 #define CHECK_TYPES_BEGIN \
9 { \ 9 { \
10 size_t index = 0; \ 10 size_t index = 0; \
11 int depth = 0; 11 int depth = 0;
12 12
13 #define CHECK_TYPES_END \ 13 #define CHECK_TYPES_END \
14 CHECK_EQ(index, types.size()); \ 14 CHECK_EQ(index, types.size()); \
15 } 15 }
16 16
17 #define DEFAULT_TYPE Bounds::Unbounded(handles.main_zone()) 17 #define DEFAULT_TYPE Bounds::Unbounded(zone)
titzer 2015/08/31 09:54:42 I think the zone would be unnecessary if we had a
bradn 2015/08/31 18:05:28 Done in other CL
18 #define INT32_TYPE \
19 Bounds(Type::Signed32(handles.main_zone()), \
20 Type::Signed32(handles.main_zone()))
21 18
22 #define CHECK_EXPR(ekind, type) \ 19
23 CHECK_LT(index, types.size()); \ 20 #define CHECK_EXPR(ekind, type) \
24 CHECK(strcmp(#ekind, types[index].kind) == 0); \ 21 CHECK_LT(index, types.size()); \
25 CHECK_EQ(depth, types[index].depth); \ 22 CHECK(strcmp(#ekind, types[index].kind) == 0); \
26 CHECK(type.lower->Is(types[index].bounds.lower)); \ 23 CHECK_EQ(depth, types[index].depth); \
27 CHECK(type.upper->Is(types[index].bounds.upper)); \ 24 CHECK(types[index].bounds.Narrows(type)); \
28 for (int j = (++depth, ++index, 0); j < 1 ? 1 : (--depth, 0); ++j) 25 for (int j = (++depth, ++index, 0); j < 1 ? 1 : (--depth, 0); ++j)
29 26
30 #define CHECK_VAR(vname, type) \ 27 #define CHECK_VAR(vname, type) \
31 CHECK_EXPR(VariableProxy, type); \ 28 CHECK_EXPR(VariableProxy, type); \
32 CHECK_EQ(#vname, std::string(types[index - 1].name->raw_data(), \ 29 CHECK_EQ(#vname, std::string(types[index - 1].name->raw_data(), \
33 types[index - 1].name->raw_data() + \ 30 types[index - 1].name->raw_data() + \
34 types[index - 1].name->byte_length())); 31 types[index - 1].name->byte_length()));
35 32
33 #define CHECK_SKIP() \
34 { \
35 ++index; \
36 while (index < types.size() && types[index].depth > depth) { \
37 ++index; \
38 } \
39 }
40
36 #endif // V8_EXPRESSION_TYPE_COLLECTOR_MACROS_H_ 41 #endif // V8_EXPRESSION_TYPE_COLLECTOR_MACROS_H_
OLDNEW
« no previous file with comments | « no previous file | test/cctest/test-ast-expression-visitor.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698