| 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 #ifndef V8_INTERPRETER_INTERPRETER_H_ | 5 #ifndef V8_INTERPRETER_INTERPRETER_H_ |
| 6 #define V8_INTERPRETER_INTERPRETER_H_ | 6 #define V8_INTERPRETER_INTERPRETER_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 | 9 |
| 10 // Clients of this interface shouldn't depend on lots of interpreter internals. | 10 // Clients of this interface shouldn't depend on lots of interpreter internals. |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 58 Local<v8::Object> GetDispatchCountersObject(); | 58 Local<v8::Object> GetDispatchCountersObject(); |
| 59 | 59 |
| 60 Address dispatch_table_address() { | 60 Address dispatch_table_address() { |
| 61 return reinterpret_cast<Address>(&dispatch_table_[0]); | 61 return reinterpret_cast<Address>(&dispatch_table_[0]); |
| 62 } | 62 } |
| 63 | 63 |
| 64 Address bytecode_dispatch_counters_table() { | 64 Address bytecode_dispatch_counters_table() { |
| 65 return reinterpret_cast<Address>(bytecode_dispatch_counters_table_.get()); | 65 return reinterpret_cast<Address>(bytecode_dispatch_counters_table_.get()); |
| 66 } | 66 } |
| 67 | 67 |
| 68 // TODO(ignition): Tune code size multiplier. |
| 69 static const int kCodeSizeMultiplier = 32; |
| 70 |
| 68 private: | 71 private: |
| 69 // Bytecode handler generator functions. | 72 // Bytecode handler generator functions. |
| 70 #define DECLARE_BYTECODE_HANDLER_GENERATOR(Name, ...) \ | 73 #define DECLARE_BYTECODE_HANDLER_GENERATOR(Name, ...) \ |
| 71 void Do##Name(InterpreterAssembler* assembler); | 74 void Do##Name(InterpreterAssembler* assembler); |
| 72 BYTECODE_LIST(DECLARE_BYTECODE_HANDLER_GENERATOR) | 75 BYTECODE_LIST(DECLARE_BYTECODE_HANDLER_GENERATOR) |
| 73 #undef DECLARE_BYTECODE_HANDLER_GENERATOR | 76 #undef DECLARE_BYTECODE_HANDLER_GENERATOR |
| 74 | 77 |
| 75 // Generates code to perform the binary operation via |Generator|. | 78 // Generates code to perform the binary operation via |Generator|. |
| 76 template <class Generator> | 79 template <class Generator> |
| 77 void DoBinaryOp(InterpreterAssembler* assembler); | 80 void DoBinaryOp(InterpreterAssembler* assembler); |
| (...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 176 std::unique_ptr<uintptr_t[]> bytecode_dispatch_counters_table_; | 179 std::unique_ptr<uintptr_t[]> bytecode_dispatch_counters_table_; |
| 177 | 180 |
| 178 DISALLOW_COPY_AND_ASSIGN(Interpreter); | 181 DISALLOW_COPY_AND_ASSIGN(Interpreter); |
| 179 }; | 182 }; |
| 180 | 183 |
| 181 } // namespace interpreter | 184 } // namespace interpreter |
| 182 } // namespace internal | 185 } // namespace internal |
| 183 } // namespace v8 | 186 } // namespace v8 |
| 184 | 187 |
| 185 #endif // V8_INTERPRETER_INTERPRETER_H_ | 188 #endif // V8_INTERPRETER_INTERPRETER_H_ |
| OLD | NEW |