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/compiler/interpreter-assembler.h" | 10 #include "src/compiler/interpreter-assembler.h" |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
80 | 80 |
81 if (info->parse_info() && FLAG_print_ast) { | 81 if (info->parse_info() && FLAG_print_ast) { |
82 OFStream os(stdout); | 82 OFStream os(stdout); |
83 os << "--- AST ---" << std::endl | 83 os << "--- AST ---" << std::endl |
84 << AstPrinter(info->isolate()).PrintProgram(info->literal()) << std::endl | 84 << AstPrinter(info->isolate()).PrintProgram(info->literal()) << std::endl |
85 << std::flush; | 85 << std::flush; |
86 } | 86 } |
87 #endif // DEBUG | 87 #endif // DEBUG |
88 | 88 |
89 BytecodeGenerator generator(info->isolate(), info->zone()); | 89 BytecodeGenerator generator(info->isolate(), info->zone()); |
90 info->EnsureFeedbackMetadata(); | 90 info->EnsureFeedbackVector(); |
91 Handle<BytecodeArray> bytecodes = generator.MakeBytecode(info); | 91 Handle<BytecodeArray> bytecodes = generator.MakeBytecode(info); |
92 if (FLAG_print_bytecode) { | 92 if (FLAG_print_bytecode) { |
93 OFStream os(stdout); | 93 OFStream os(stdout); |
94 bytecodes->Print(os); | 94 bytecodes->Print(os); |
95 os << std::flush; | 95 os << std::flush; |
96 } | 96 } |
97 | 97 |
98 info->SetBytecodeArray(bytecodes); | 98 info->SetBytecodeArray(bytecodes); |
99 info->SetCode(info->isolate()->builtins()->InterpreterEntryTrampoline()); | 99 info->SetCode(info->isolate()->builtins()->InterpreterEntryTrampoline()); |
100 return true; | 100 return true; |
(...skipping 1809 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1910 Node* index_reg = __ BytecodeOperandReg(0); | 1910 Node* index_reg = __ BytecodeOperandReg(0); |
1911 Node* index = __ LoadRegister(index_reg); | 1911 Node* index = __ LoadRegister(index_reg); |
1912 Node* result = __ CallRuntime(Runtime::kForInStep, index); | 1912 Node* result = __ CallRuntime(Runtime::kForInStep, index); |
1913 __ SetAccumulator(result); | 1913 __ SetAccumulator(result); |
1914 __ Dispatch(); | 1914 __ Dispatch(); |
1915 } | 1915 } |
1916 | 1916 |
1917 } // namespace interpreter | 1917 } // namespace interpreter |
1918 } // namespace internal | 1918 } // namespace internal |
1919 } // namespace v8 | 1919 } // namespace v8 |
OLD | NEW |