OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef V8_EXPRESSION_TYPE_COLLECTOR_MACROS_H_ |
| 6 #define V8_EXPRESSION_TYPE_COLLECTOR_MACROS_H_ |
| 7 |
| 8 #define CHECK_TYPES_BEGIN \ |
| 9 { \ |
| 10 size_t index = 0; \ |
| 11 int depth = 0; |
| 12 |
| 13 #define CHECK_TYPES_END \ |
| 14 CHECK_EQ(index, types.size()); \ |
| 15 } |
| 16 |
| 17 #define DEFAULT_TYPE Bounds::Unbounded(handles.main_zone()) |
| 18 #define INT32_TYPE \ |
| 19 Bounds(Type::Signed32(handles.main_zone()), \ |
| 20 Type::Signed32(handles.main_zone())) |
| 21 |
| 22 #define CHECK_EXPR(ekind, type) \ |
| 23 CHECK_LT(index, types.size()); \ |
| 24 CHECK(strcmp(#ekind, types[index].kind) == 0); \ |
| 25 CHECK_EQ(depth, types[index].depth); \ |
| 26 CHECK(type.lower->Is(types[index].bounds.lower)); \ |
| 27 CHECK(type.upper->Is(types[index].bounds.upper)); \ |
| 28 for (int j = (++depth, ++index, 0); j < 1 ? 1 : (--depth, 0); ++j) |
| 29 |
| 30 #define CHECK_VAR(vname, type) \ |
| 31 CHECK_EXPR(VariableProxy, type); \ |
| 32 CHECK_EQ(#vname, std::string(types[index - 1].name->raw_data(), \ |
| 33 types[index - 1].name->raw_data() + \ |
| 34 types[index - 1].name->byte_length())); |
| 35 |
| 36 #endif // V8_EXPRESSION_TYPE_COLLECTOR_MACROS_H_ |
OLD | NEW |