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

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

Issue 1471073003: Make typing-asm match spec more closely around load/store, add more tests. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: fix Created 5 years 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
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 #ifdef DEBUG
18 #define CHECK_TYPE(type) \
19 if (!types[index].bounds.Narrows(type)) { \
20 fprintf(stderr, "Expected:\n"); \
21 fprintf(stderr, " lower: "); \
22 type.lower->Print(); \
23 fprintf(stderr, " upper: "); \
24 type.upper->Print(); \
25 fprintf(stderr, "Actual:\n"); \
26 fprintf(stderr, " lower: "); \
27 types[index].bounds.lower->Print(); \
28 fprintf(stderr, " upper: "); \
29 types[index].bounds.upper->Print(); \
30 } \
31 CHECK(types[index].bounds.Narrows(type));
32 #else
33 #define CHECK_TYPE(type) CHECK(types[index].bounds.Narrows(type));
34 #endif
35
17 #define CHECK_EXPR(ekind, type) \ 36 #define CHECK_EXPR(ekind, type) \
18 CHECK_LT(index, types.size()); \ 37 CHECK_LT(index, types.size()); \
19 CHECK(strcmp(#ekind, types[index].kind) == 0); \ 38 CHECK(strcmp(#ekind, types[index].kind) == 0); \
20 CHECK_EQ(depth, types[index].depth); \ 39 CHECK_EQ(depth, types[index].depth); \
21 CHECK(types[index].bounds.Narrows(type)); \ 40 CHECK_TYPE(type); \
22 for (int j = (++depth, ++index, 0); j < 1 ? 1 : (--depth, 0); ++j) 41 for (int j = (++depth, ++index, 0); j < 1 ? 1 : (--depth, 0); ++j)
23 42
24 #define CHECK_VAR(vname, type) \ 43 #define CHECK_VAR(vname, type) \
25 CHECK_EXPR(VariableProxy, type); \ 44 CHECK_EXPR(VariableProxy, type); \
26 CHECK_EQ(#vname, std::string(types[index - 1].name->raw_data(), \ 45 CHECK_EQ(#vname, std::string(types[index - 1].name->raw_data(), \
27 types[index - 1].name->raw_data() + \ 46 types[index - 1].name->raw_data() + \
28 types[index - 1].name->byte_length())); 47 types[index - 1].name->byte_length()));
29 48
30 #define CHECK_SKIP() \ 49 #define CHECK_SKIP() \
31 { \ 50 { \
32 ++index; \ 51 ++index; \
33 while (index < types.size() && types[index].depth > depth) { \ 52 while (index < types.size() && types[index].depth > depth) { \
34 ++index; \ 53 ++index; \
35 } \ 54 } \
36 } 55 }
37 56
38 #endif // V8_EXPRESSION_TYPE_COLLECTOR_MACROS_H_ 57 #endif // V8_EXPRESSION_TYPE_COLLECTOR_MACROS_H_
OLDNEW
« src/typing-asm.cc ('K') | « src/typing-asm.cc ('k') | test/cctest/test-asm-validator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698