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 #include <memory> | 8 #include <memory> |
9 | 9 |
10 #include "src/ast/prettyprinter.h" | 10 #include "src/ast/prettyprinter.h" |
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
150 #ifdef DEBUG | 150 #ifdef DEBUG |
151 if (info->parse_info() && FLAG_print_ast) { | 151 if (info->parse_info() && FLAG_print_ast) { |
152 OFStream os(stdout); | 152 OFStream os(stdout); |
153 os << "--- AST ---" << std::endl | 153 os << "--- AST ---" << std::endl |
154 << AstPrinter(info->isolate()).PrintProgram(info->literal()) << std::endl | 154 << AstPrinter(info->isolate()).PrintProgram(info->literal()) << std::endl |
155 << std::flush; | 155 << std::flush; |
156 } | 156 } |
157 #endif // DEBUG | 157 #endif // DEBUG |
158 | 158 |
159 BytecodeGenerator generator(info); | 159 BytecodeGenerator generator(info); |
160 Handle<BytecodeArray> bytecodes = generator.MakeBytecode(); | 160 Handle<BytecodeArray> bytecodes = generator.MakeBytecode(info->isolate()); |
161 | 161 |
162 if (generator.HasStackOverflow()) return false; | 162 if (generator.HasStackOverflow()) return false; |
163 | 163 |
164 if (FLAG_print_bytecode) { | 164 if (FLAG_print_bytecode) { |
165 OFStream os(stdout); | 165 OFStream os(stdout); |
166 bytecodes->Print(os); | 166 bytecodes->Print(os); |
167 os << std::flush; | 167 os << std::flush; |
168 } | 168 } |
169 | 169 |
170 info->SetBytecodeArray(bytecodes); | 170 info->SetBytecodeArray(bytecodes); |
(...skipping 2079 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2250 __ StoreObjectField(generator, JSGeneratorObject::kContinuationOffset, | 2250 __ StoreObjectField(generator, JSGeneratorObject::kContinuationOffset, |
2251 __ SmiTag(new_state)); | 2251 __ SmiTag(new_state)); |
2252 __ SetAccumulator(old_state); | 2252 __ SetAccumulator(old_state); |
2253 | 2253 |
2254 __ Dispatch(); | 2254 __ Dispatch(); |
2255 } | 2255 } |
2256 | 2256 |
2257 } // namespace interpreter | 2257 } // namespace interpreter |
2258 } // namespace internal | 2258 } // namespace internal |
2259 } // namespace v8 | 2259 } // namespace v8 |
OLD | NEW |