Index: test/cctest/interpreter/bytecode-expectations.h |
diff --git a/test/cctest/interpreter/bytecode-expectations.h b/test/cctest/interpreter/bytecode-expectations.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..19ce04fe0bfed023d3e4d07454e36538380dffe2 |
--- /dev/null |
+++ b/test/cctest/interpreter/bytecode-expectations.h |
@@ -0,0 +1,45 @@ |
+// Copyright 2016 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 INTERPRETER_BYTECODE_EXPECTATIONS_H_ |
rmcilroy
2016/02/12 15:29:05
V8_INTERPRETER_BYTECODE_EXPECTATIONS_PRINTER_H_ (a
Stefano Sanfilippo
2016/02/12 18:29:40
Done.
|
+#define INTERPRETER_BYTECODE_EXPECTATIONS_H_ |
+ |
+#include <iostream> |
+#include <string> |
+ |
+namespace v8 { |
+ |
+class Isolate; |
+ |
+namespace internal { |
+namespace interpreter { |
+ |
+enum ConstantPoolType { |
rmcilroy
2016/02/12 15:29:05
Pull into BytecodeExpectationsPrinter as an inner
Stefano Sanfilippo
2016/02/12 18:29:40
Done.
|
+ kConstantPoolTypeUnknown, |
+ kConstantPoolTypeString, |
+ kConstantPoolTypeInteger, |
+ kConstantPoolTypeDouble, |
+ kConstantPoolTypeMixed, |
+}; |
+ |
+class ExpectationPrinter final { |
rmcilroy
2016/02/12 15:29:05
Please rename file to bytecode-expectations-printe
Stefano Sanfilippo
2016/02/12 18:29:40
Done.
|
+ public: |
+ ExpectationPrinter(v8::Isolate* i, ConstantPoolType t) |
+ : isolate_(i), const_pool_type_(t) {} |
+ |
+ void PrintExpectation(std::ostream& stream, const std::string& snippet); |
+ |
+ void SetConstantPoolType(ConstantPoolType t) { const_pool_type_ = t; } |
rmcilroy
2016/02/12 15:29:05
set_constant_pool_type for a setter
Stefano Sanfilippo
2016/02/12 18:29:40
Done.
|
+ ConstantPoolType GetConstantPoolType() const { return const_pool_type_; } |
rmcilroy
2016/02/12 15:29:05
constant_pool_type for a getter (drop the Get)
Stefano Sanfilippo
2016/02/12 18:29:40
Done.
|
+ |
+ private: |
+ v8::Isolate* isolate_; |
+ ConstantPoolType const_pool_type_; |
+}; |
+ |
+} // namespace interpreter |
+} // namespace internal |
+} // namespace v8 |
+ |
+#endif |
rmcilroy
2016/02/12 15:29:05
#endif // V8_INTERPRETER_BYTECODE_EXPECTATIONS_PRI
Stefano Sanfilippo
2016/02/12 18:29:40
Done.
|