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 "src/ast/prettyprinter.h" | 7 #include "src/ast/prettyprinter.h" |
8 #include "src/code-factory.h" | 8 #include "src/code-factory.h" |
9 #include "src/compiler.h" | 9 #include "src/compiler.h" |
10 #include "src/factory.h" | 10 #include "src/factory.h" |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
85 | 85 |
86 if (info->parse_info() && FLAG_print_ast) { | 86 if (info->parse_info() && FLAG_print_ast) { |
87 OFStream os(stdout); | 87 OFStream os(stdout); |
88 os << "--- AST ---" << std::endl | 88 os << "--- AST ---" << std::endl |
89 << AstPrinter(info->isolate()).PrintProgram(info->literal()) << std::endl | 89 << AstPrinter(info->isolate()).PrintProgram(info->literal()) << std::endl |
90 << std::flush; | 90 << std::flush; |
91 } | 91 } |
92 #endif // DEBUG | 92 #endif // DEBUG |
93 | 93 |
94 BytecodeGenerator generator(info->isolate(), info->zone()); | 94 BytecodeGenerator generator(info->isolate(), info->zone()); |
95 info->EnsureFeedbackVector(); | |
96 Handle<BytecodeArray> bytecodes = generator.MakeBytecode(info); | 95 Handle<BytecodeArray> bytecodes = generator.MakeBytecode(info); |
97 | 96 |
98 if (generator.HasStackOverflow()) return false; | 97 if (generator.HasStackOverflow()) return false; |
99 | 98 |
100 if (FLAG_print_bytecode) { | 99 if (FLAG_print_bytecode) { |
101 OFStream os(stdout); | 100 OFStream os(stdout); |
102 bytecodes->Print(os); | 101 bytecodes->Print(os); |
103 os << std::flush; | 102 os << std::flush; |
104 } | 103 } |
105 | 104 |
(...skipping 1814 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1920 Node* index = __ LoadRegister(index_reg); | 1919 Node* index = __ LoadRegister(index_reg); |
1921 Node* one = __ SmiConstant(Smi::FromInt(1)); | 1920 Node* one = __ SmiConstant(Smi::FromInt(1)); |
1922 Node* result = __ SmiAdd(index, one); | 1921 Node* result = __ SmiAdd(index, one); |
1923 __ SetAccumulator(result); | 1922 __ SetAccumulator(result); |
1924 __ Dispatch(); | 1923 __ Dispatch(); |
1925 } | 1924 } |
1926 | 1925 |
1927 } // namespace interpreter | 1926 } // namespace interpreter |
1928 } // namespace internal | 1927 } // namespace internal |
1929 } // namespace v8 | 1928 } // namespace v8 |
OLD | NEW |