OLD | NEW |
1 // Copyright 2015 the V8 project authors. All rights reserved. | 1 // Copyright 2015 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "src/interpreter/interpreter.h" | 5 #include "src/interpreter/interpreter.h" |
6 | 6 |
7 #include <fstream> | 7 #include <fstream> |
8 | 8 |
9 #include "src/ast/prettyprinter.h" | 9 #include "src/ast/prettyprinter.h" |
10 #include "src/code-factory.h" | 10 #include "src/code-factory.h" |
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
142 } | 142 } |
143 | 143 |
144 if (info->parse_info() && FLAG_print_ast) { | 144 if (info->parse_info() && FLAG_print_ast) { |
145 OFStream os(stdout); | 145 OFStream os(stdout); |
146 os << "--- AST ---" << std::endl | 146 os << "--- AST ---" << std::endl |
147 << AstPrinter(info->isolate()).PrintProgram(info->literal()) << std::endl | 147 << AstPrinter(info->isolate()).PrintProgram(info->literal()) << std::endl |
148 << std::flush; | 148 << std::flush; |
149 } | 149 } |
150 #endif // DEBUG | 150 #endif // DEBUG |
151 | 151 |
152 BytecodeGenerator generator(info->isolate(), info->zone()); | 152 BytecodeGenerator generator(info); |
153 Handle<BytecodeArray> bytecodes = generator.MakeBytecode(info); | 153 Handle<BytecodeArray> bytecodes = generator.MakeBytecode(); |
154 | 154 |
155 if (generator.HasStackOverflow()) return false; | 155 if (generator.HasStackOverflow()) return false; |
156 | 156 |
157 if (FLAG_print_bytecode) { | 157 if (FLAG_print_bytecode) { |
158 OFStream os(stdout); | 158 OFStream os(stdout); |
159 bytecodes->Print(os); | 159 bytecodes->Print(os); |
160 os << std::flush; | 160 os << std::flush; |
161 } | 161 } |
162 | 162 |
163 info->SetBytecodeArray(bytecodes); | 163 info->SetBytecodeArray(bytecodes); |
(...skipping 1517 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1681 // Illegal | 1681 // Illegal |
1682 // | 1682 // |
1683 // An invalid bytecode aborting execution if dispatched. | 1683 // An invalid bytecode aborting execution if dispatched. |
1684 void Interpreter::DoIllegal(InterpreterAssembler* assembler) { | 1684 void Interpreter::DoIllegal(InterpreterAssembler* assembler) { |
1685 __ Abort(kInvalidBytecode); | 1685 __ Abort(kInvalidBytecode); |
1686 } | 1686 } |
1687 | 1687 |
1688 } // namespace interpreter | 1688 } // namespace interpreter |
1689 } // namespace internal | 1689 } // namespace internal |
1690 } // namespace v8 | 1690 } // namespace v8 |
OLD | NEW |