| 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 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 42 } | 42 } |
| 43 BYTECODE_LIST(GENERATE_CODE) | 43 BYTECODE_LIST(GENERATE_CODE) |
| 44 #undef GENERATE_CODE | 44 #undef GENERATE_CODE |
| 45 } | 45 } |
| 46 | 46 |
| 47 void Interpreter::IterateDispatchTable(ObjectVisitor* v) { | 47 void Interpreter::IterateDispatchTable(ObjectVisitor* v) { |
| 48 v->VisitPointers(&dispatch_table_[0], | 48 v->VisitPointers(&dispatch_table_[0], |
| 49 &dispatch_table_[0] + kDispatchTableSize); | 49 &dispatch_table_[0] + kDispatchTableSize); |
| 50 } | 50 } |
| 51 | 51 |
| 52 // static |
| 53 int Interpreter::InterruptBudget() { |
| 54 // TODO(ignition): Tune code size multiplier. |
| 55 const int kCodeSizeMultiplier = 32; |
| 56 return FLAG_interrupt_budget * kCodeSizeMultiplier; |
| 57 } |
| 58 |
| 52 bool Interpreter::MakeBytecode(CompilationInfo* info) { | 59 bool Interpreter::MakeBytecode(CompilationInfo* info) { |
| 53 if (FLAG_print_bytecode || FLAG_print_source || FLAG_print_ast) { | 60 if (FLAG_print_bytecode || FLAG_print_source || FLAG_print_ast) { |
| 54 OFStream os(stdout); | 61 OFStream os(stdout); |
| 55 base::SmartArrayPointer<char> name = info->GetDebugName(); | 62 base::SmartArrayPointer<char> name = info->GetDebugName(); |
| 56 os << "[generating bytecode for function: " << info->GetDebugName().get() | 63 os << "[generating bytecode for function: " << info->GetDebugName().get() |
| 57 << "]" << std::endl | 64 << "]" << std::endl |
| 58 << std::flush; | 65 << std::flush; |
| 59 } | 66 } |
| 60 | 67 |
| 61 #ifdef DEBUG | 68 #ifdef DEBUG |
| (...skipping 1749 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1811 Node* index = __ LoadRegister(index_reg); | 1818 Node* index = __ LoadRegister(index_reg); |
| 1812 Node* context = __ GetContext(); | 1819 Node* context = __ GetContext(); |
| 1813 Node* result = __ CallRuntime(Runtime::kForInStep, context, index); | 1820 Node* result = __ CallRuntime(Runtime::kForInStep, context, index); |
| 1814 __ SetAccumulator(result); | 1821 __ SetAccumulator(result); |
| 1815 __ Dispatch(); | 1822 __ Dispatch(); |
| 1816 } | 1823 } |
| 1817 | 1824 |
| 1818 } // namespace interpreter | 1825 } // namespace interpreter |
| 1819 } // namespace internal | 1826 } // namespace internal |
| 1820 } // namespace v8 | 1827 } // namespace v8 |
| OLD | NEW |