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