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

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

Issue 1288773007: Adding visitors to regurgitate expression types or reset them. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: back to macros Created 5 years, 4 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/expression-type-collector.cc ('k') | test/cctest/test-ast-expression-visitor.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/cctest/expression-type-collector-macros.h
diff --git a/test/cctest/expression-type-collector-macros.h b/test/cctest/expression-type-collector-macros.h
new file mode 100644
index 0000000000000000000000000000000000000000..2dcc1dcae73ca67332ecf789ea9487aff7b4d371
--- /dev/null
+++ b/test/cctest/expression-type-collector-macros.h
@@ -0,0 +1,36 @@
+// Copyright 2015 the V8 project authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef V8_EXPRESSION_TYPE_COLLECTOR_MACROS_H_
+#define V8_EXPRESSION_TYPE_COLLECTOR_MACROS_H_
+
+#define CHECK_TYPES_BEGIN \
+ { \
+ size_t index = 0; \
+ int depth = 0;
+
+#define CHECK_TYPES_END \
+ CHECK_EQ(index, types.size()); \
+ }
+
+#define DEFAULT_TYPE Bounds::Unbounded(handles.main_zone())
+#define INT32_TYPE \
+ Bounds(Type::Signed32(handles.main_zone()), \
+ Type::Signed32(handles.main_zone()))
+
+#define CHECK_EXPR(ekind, type) \
+ CHECK_LT(index, types.size()); \
+ CHECK(strcmp(#ekind, types[index].kind) == 0); \
+ CHECK_EQ(depth, types[index].depth); \
+ CHECK(type.lower->Is(types[index].bounds.lower)); \
+ CHECK(type.upper->Is(types[index].bounds.upper)); \
+ for (int j = (++depth, ++index, 0); j < 1 ? 1 : (--depth, 0); ++j)
+
+#define CHECK_VAR(vname, type) \
+ CHECK_EXPR(VariableProxy, type); \
+ CHECK_EQ(#vname, std::string(types[index - 1].name->raw_data(), \
+ types[index - 1].name->raw_data() + \
+ types[index - 1].name->byte_length()));
+
+#endif // V8_EXPRESSION_TYPE_COLLECTOR_MACROS_H_
« no previous file with comments | « test/cctest/expression-type-collector.cc ('k') | test/cctest/test-ast-expression-visitor.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698