Index: test/cctest/interpreter/bytecode-expectations-printer.h |
diff --git a/test/cctest/interpreter/bytecode-expectations-printer.h b/test/cctest/interpreter/bytecode-expectations-printer.h |
index 62ff63eb6a76afb1b1d28a49b7d2ed4644031c2b..fac7f83215466eceac31461c9caa5df8e92be55d 100644 |
--- a/test/cctest/interpreter/bytecode-expectations-printer.h |
+++ b/test/cctest/interpreter/bytecode-expectations-printer.h |
@@ -7,6 +7,7 @@ |
#include <iostream> |
#include <string> |
+#include <vector> |
#include "src/interpreter/bytecodes.h" |
#include "src/objects.h" |
@@ -32,22 +33,48 @@ class BytecodeExpectationsPrinter final { |
BytecodeExpectationsPrinter(v8::Isolate* i, |
ConstantPoolType t = ConstantPoolType::kMixed) |
- : isolate_(i), const_pool_type_(t) {} |
+ : isolate_(i), |
+ const_pool_type_(t), |
+ execute_(true), |
+ wrap_(true), |
+ top_function_name_(kDefaultTopFunctionName) {} |
- void PrintExpectation(std::ostream& stream, // NOLINT |
- const std::string& snippet) const; |
+ void PrintExpectationsArray(std::ostream& stream, // NOLINT |
+ const std::vector<std::string>& snippet_list); |
+ |
+ void set_constant_pool_type(ConstantPoolType const_pool_type) { |
+ const_pool_type_ = const_pool_type; |
+ } |
+ ConstantPoolType const_pool_type() const { return const_pool_type_; } |
+ |
+ void set_execute(bool execute) { execute_ = execute; } |
+ bool execute() const { return execute_; } |
+ |
+ void set_wrap(bool wrap) { wrap_ = wrap; } |
+ bool wrap() const { return wrap_; } |
- void set_constant_pool_type(ConstantPoolType t) { const_pool_type_ = t; } |
- ConstantPoolType constant_pool_type() const { return const_pool_type_; } |
+ void set_top_function_name(const std::string& top_function_name) { |
+ top_function_name_ = top_function_name; |
+ } |
+ void reset_top_function_name() { |
+ set_top_function_name(kDefaultTopFunctionName); |
+ } |
+ std::string top_function_name() const { return top_function_name_; } |
private: |
+ void PrintOptionsHeader(std::ostream& stream); // NOLINT |
rmcilroy
2016/02/17 15:24:08
const
Stefano Sanfilippo
2016/02/17 16:40:50
Done.
|
+ void PrintExpectation(std::ostream& stream, // NOLINT |
+ const std::string& snippet) const; |
+ |
void PrintEscapedString(std::ostream& stream, // NOLINT |
const std::string& string) const; |
void PrintBytecodeOperand(std::ostream& stream, // NOLINT |
const BytecodeArrayIterator& bytecode_iter, |
- const Bytecode& bytecode, int op_index) const; |
+ const Bytecode& bytecode, int op_index, |
+ int parameter_count) const; |
void PrintBytecode(std::ostream& stream, // NOLINT |
- const BytecodeArrayIterator& bytecode_iter) const; |
+ const BytecodeArrayIterator& bytecode_iter, |
+ int parameter_count) const; |
void PrintV8String(std::ostream& stream, // NOLINT |
i::String* string) const; |
void PrintConstant(std::ostream& stream, // NOLINT |
@@ -61,14 +88,16 @@ class BytecodeExpectationsPrinter final { |
void PrintCodeSnippet(std::ostream& stream, // NOLINT |
const std::string& body) const; |
void PrintBytecodeArray(std::ostream& stream, // NOLINT |
- const std::string& body, |
i::Handle<i::BytecodeArray> bytecode_array) const; |
+ void PrintHandlers(std::ostream& stream, // NOLINT |
+ i::Handle<i::BytecodeArray> bytecode_array) const; |
v8::Local<v8::String> V8StringFromUTF8(const char* data) const; |
std::string WrapCodeInFunction(const char* function_name, |
const std::string& function_body) const; |
- v8::Local<v8::Value> CompileAndRun(const char* program) const; |
+ v8::Local<v8::Script> Compile(const char* program) const; |
+ void Run(v8::Local<v8::Script> script) const; |
i::Handle<i::BytecodeArray> GetBytecodeArrayForGlobal( |
const char* global_name) const; |
@@ -78,6 +107,11 @@ class BytecodeExpectationsPrinter final { |
v8::Isolate* isolate_; |
ConstantPoolType const_pool_type_; |
+ bool execute_; |
+ bool wrap_; |
+ std::string top_function_name_; |
+ |
+ static const char* const kDefaultTopFunctionName; |
}; |
} // namespace interpreter |