Commit 99cfa5f6 authored by neis's avatar neis Committed by Commit bot

[interpreter] Remove redundant flag from bytecode cctest suite.

This removes the execute_ flag, which was always the negation of top_level_.

R=rmcilroy@chromium.org
BUG=

Review-Url: https://codereview.chromium.org/2390163003
Cr-Commit-Position: refs/heads/master@{#39961}
parent efcb1ff4
......@@ -328,11 +328,13 @@ void BytecodeExpectationsPrinter::PrintExpectation(
v8::Local<v8::Script> script = Compile(source_code.c_str());
if (execute_) Run(script);
i::Handle<i::BytecodeArray> bytecode_array =
top_level_ ? GetBytecodeArrayForScript(script)
: GetBytecodeArrayForGlobal(test_function_name_.c_str());
i::Handle<i::BytecodeArray> bytecode_array;
if (top_level_) {
bytecode_array = GetBytecodeArrayForScript(script);
} else {
Run(script);
bytecode_array = GetBytecodeArrayForGlobal(test_function_name_.c_str());
}
stream << "---\n";
PrintCodeSnippet(stream, snippet);
......
......@@ -28,7 +28,6 @@ class BytecodeExpectationsPrinter final {
public:
explicit BytecodeExpectationsPrinter(v8::Isolate* i)
: isolate_(i),
execute_(true),
wrap_(true),
top_level_(false),
test_function_name_(kDefaultTopFunctionName) {}
......@@ -36,9 +35,6 @@ class BytecodeExpectationsPrinter final {
void PrintExpectation(std::ostream& stream, // NOLINT
const std::string& snippet) const;
void set_execute(bool execute) { execute_ = execute; }
bool execute() const { return execute_; }
void set_wrap(bool wrap) { wrap_ = wrap; }
bool wrap() const { return wrap_; }
......@@ -96,7 +92,6 @@ class BytecodeExpectationsPrinter final {
}
v8::Isolate* isolate_;
bool execute_;
bool wrap_;
bool top_level_;
std::string test_function_name_;
......
......@@ -3,7 +3,6 @@
#
---
execute: yes
wrap: yes
---
......
......@@ -3,7 +3,6 @@
#
---
execute: yes
wrap: yes
---
......
......@@ -3,7 +3,6 @@
#
---
execute: yes
wrap: yes
---
......
......@@ -3,7 +3,6 @@
#
---
execute: yes
wrap: yes
---
......
......@@ -3,7 +3,6 @@
#
---
execute: yes
wrap: no
test function name: f
......
......@@ -3,7 +3,6 @@
#
---
execute: yes
wrap: yes
---
......
......@@ -3,7 +3,6 @@
#
---
execute: yes
wrap: no
test function name: f
......
......@@ -3,7 +3,6 @@
#
---
execute: yes
wrap: no
test function name: f
......
......@@ -3,7 +3,6 @@
#
---
execute: yes
wrap: no
test function name: test
......
......@@ -3,7 +3,6 @@
#
---
execute: yes
wrap: yes
---
......
......@@ -3,7 +3,6 @@
#
---
execute: yes
wrap: yes
---
......
......@@ -3,7 +3,6 @@
#
---
execute: yes
wrap: yes
---
......
......@@ -3,7 +3,6 @@
#
---
execute: yes
wrap: no
test function name: f
......
......@@ -3,7 +3,6 @@
#
---
execute: yes
wrap: yes
---
......
......@@ -3,7 +3,6 @@
#
---
execute: yes
wrap: yes
---
......
......@@ -3,7 +3,6 @@
#
---
execute: yes
wrap: no
test function name: f
......
......@@ -3,7 +3,6 @@
#
---
execute: yes
wrap: no
test function name: f
......
......@@ -3,7 +3,6 @@
#
---
execute: yes
wrap: yes
---
......
......@@ -3,7 +3,6 @@
#
---
execute: no
wrap: no
top level: yes
......
......@@ -3,7 +3,6 @@
#
---
execute: yes
wrap: yes
---
......
......@@ -3,7 +3,6 @@
#
---
execute: yes
wrap: no
test function name: f
......
......@@ -3,7 +3,6 @@
#
---
execute: yes
wrap: yes
---
......
......@@ -3,7 +3,6 @@
#
---
execute: yes
wrap: yes
do expressions: yes
......
......@@ -3,7 +3,6 @@
#
---
execute: yes
wrap: yes
---
......
......@@ -3,7 +3,6 @@
#
---
execute: yes
wrap: yes
---
......
......@@ -3,7 +3,6 @@
#
---
execute: yes
wrap: yes
---
......
......@@ -3,7 +3,6 @@
#
---
execute: yes
wrap: yes
---
......
......@@ -3,7 +3,6 @@
#
---
execute: yes
wrap: no
test function name: f
......
......@@ -3,7 +3,6 @@
#
---
execute: yes
wrap: no
test function name: f
......
......@@ -3,7 +3,6 @@
#
---
execute: yes
wrap: no
test function name: f
......
......@@ -3,7 +3,6 @@
#
---
execute: yes
wrap: no
test function name: f
......
......@@ -3,7 +3,6 @@
#
---
execute: yes
wrap: no
test function name: f
......
......@@ -3,7 +3,6 @@
#
---
execute: yes
wrap: yes
---
......
......@@ -3,7 +3,6 @@
#
---
execute: yes
wrap: yes
---
......
......@@ -3,7 +3,6 @@
#
---
execute: yes
wrap: no
test function name: f
......
......@@ -3,7 +3,6 @@
#
---
execute: yes
wrap: yes
test function name: f
......
......@@ -3,7 +3,6 @@
#
---
execute: yes
wrap: no
test function name: f
......
......@@ -3,7 +3,6 @@
#
---
execute: yes
wrap: no
test function name: f
......
......@@ -3,7 +3,6 @@
#
---
execute: yes
wrap: yes
---
......
......@@ -3,7 +3,6 @@
#
---
execute: yes
wrap: yes
---
......
......@@ -3,7 +3,6 @@
#
---
execute: yes
wrap: no
test function name: f
......
......@@ -3,7 +3,6 @@
#
---
execute: yes
wrap: no
test function name: f
......
......@@ -3,7 +3,6 @@
#
---
execute: yes
wrap: no
test function name: f
......
......@@ -3,7 +3,6 @@
#
---
execute: yes
wrap: no
test function name: f
......
......@@ -3,7 +3,6 @@
#
---
execute: yes
wrap: no
test function name: f
......
......@@ -3,7 +3,6 @@
#
---
execute: yes
wrap: yes
---
......
......@@ -3,7 +3,6 @@
#
---
execute: yes
wrap: no
test function name: f
......
......@@ -3,7 +3,6 @@
#
---
execute: yes
wrap: yes
---
......
......@@ -3,7 +3,6 @@
#
---
execute: yes
wrap: yes
---
......
......@@ -3,7 +3,6 @@
#
---
execute: yes
wrap: no
test function name: f
......
......@@ -3,7 +3,6 @@
#
---
execute: yes
wrap: yes
---
......
......@@ -3,7 +3,6 @@
#
---
execute: no
wrap: no
top level: yes
......
......@@ -3,7 +3,6 @@
#
---
execute: yes
wrap: yes
---
......
......@@ -3,7 +3,6 @@
#
---
execute: yes
wrap: yes
---
......
......@@ -3,7 +3,6 @@
#
---
execute: yes
wrap: no
test function name: f
......
......@@ -3,7 +3,6 @@
#
---
execute: yes
wrap: yes
---
......
......@@ -3,7 +3,6 @@
#
---
execute: yes
wrap: yes
---
......
......@@ -3,7 +3,6 @@
#
---
execute: yes
wrap: yes
---
......
......@@ -40,7 +40,6 @@ class ProgramOptions final {
read_from_stdin_(false),
rebaseline_(false),
wrap_(true),
execute_(true),
top_level_(false),
do_expressions_(false),
verbose_(false) {}
......@@ -58,7 +57,6 @@ class ProgramOptions final {
}
bool rebaseline() const { return rebaseline_; }
bool wrap() const { return wrap_; }
bool execute() const { return execute_; }
bool top_level() const { return top_level_; }
bool do_expressions() const { return do_expressions_; }
bool verbose() const { return verbose_; }
......@@ -74,7 +72,6 @@ class ProgramOptions final {
bool read_from_stdin_;
bool rebaseline_;
bool wrap_;
bool execute_;
bool top_level_;
bool do_expressions_;
bool verbose_;
......@@ -159,8 +156,6 @@ ProgramOptions ProgramOptions::FromCommandLine(int argc, char** argv) {
options.rebaseline_ = true;
} else if (strcmp(argv[i], "--no-wrap") == 0) {
options.wrap_ = false;
} else if (strcmp(argv[i], "--no-execute") == 0) {
options.execute_ = false;
} else if (strcmp(argv[i], "--top-level") == 0) {
options.top_level_ = true;
} else if (strcmp(argv[i], "--do-expressions") == 0) {
......@@ -251,9 +246,7 @@ void ProgramOptions::UpdateFromHeader(std::istream& stream) {
}
while (std::getline(stream, line)) {
if (line.compare(0, 9, "execute: ") == 0) {
execute_ = ParseBoolean(line.c_str() + 9);
} else if (line.compare(0, 6, "wrap: ") == 0) {
if (line.compare(0, 6, "wrap: ") == 0) {
wrap_ = ParseBoolean(line.c_str() + 6);
} else if (line.compare(0, 20, "test function name: ") == 0) {
test_function_name_ = line.c_str() + 20;
......@@ -274,7 +267,6 @@ void ProgramOptions::UpdateFromHeader(std::istream& stream) {
void ProgramOptions::PrintHeader(std::ostream& stream) const { // NOLINT
stream << "---"
<< "\nexecute: " << BooleanToString(execute_)
<< "\nwrap: " << BooleanToString(wrap_);
if (!test_function_name_.empty()) {
......@@ -380,7 +372,6 @@ void GenerateExpectationsFile(std::ostream& stream, // NOLINT
BytecodeExpectationsPrinter printer(platform.isolate());
printer.set_wrap(options.wrap());
printer.set_execute(options.execute());
printer.set_top_level(options.top_level());
if (!options.test_function_name().empty()) {
printer.set_test_function_name(options.test_function_name());
......@@ -434,7 +425,6 @@ void PrintUsage(const char* exec_path) {
" --stdin Read from standard input instead of file.\n"
" --rebaseline Rebaseline input snippet file.\n"
" --no-wrap Do not wrap the snippet in a function.\n"
" --no-execute Do not execute after compilation.\n"
" --test-function-name=foo "
"Specify the name of the test function.\n"
" --top-level Process top level code, not the top-level function.\n"
......@@ -446,9 +436,9 @@ void PrintUsage(const char* exec_path) {
" Specify the type of the entries in the constant pool "
"(default: mixed).\n"
"\n"
"When using --rebaseline, flags --no-wrap, --no-execute, "
"--test-function-name\nand --pool-type will be overridden by the "
"options specified in the input file\nheader.\n\n"
"When using --rebaseline, flags --no-wrap, --test-function-name \n"
"and --pool-type will be overridden by the options specified in \n"
"the input file header.\n\n"
"Each raw JavaScript file is interpreted as a single snippet.\n\n"
"This tool is intended as a help in writing tests.\n"
"Please, DO NOT blindly copy and paste the output "
......
......@@ -709,7 +709,6 @@ TEST(DeclareGlobals) {
BytecodeExpectationsPrinter printer(CcTest::isolate());
printer.set_wrap(false);
printer.set_test_function_name("f");
printer.set_execute(false);
printer.set_top_level(true);
const char* snippets[] = {
......@@ -1203,7 +1202,6 @@ TEST(TopLevelObjectLiterals) {
BytecodeExpectationsPrinter printer(CcTest::isolate());
printer.set_wrap(false);
printer.set_test_function_name("f");
printer.set_execute(false);
printer.set_top_level(true);
const char* snippets[] = {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment