| 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 // Clients of this interface shouldn't depend on lots of interpreter internals. | 8 // Clients of this interface shouldn't depend on lots of interpreter internals. |
| 9 // Do not include anything from src/interpreter other than | 9 // Do not include anything from src/interpreter other than |
| 10 // src/interpreter/bytecodes.h here! | 10 // src/interpreter/bytecodes.h here! |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 63 return reinterpret_cast<Address>(bytecode_dispatch_counters_table_.get()); | 63 return reinterpret_cast<Address>(bytecode_dispatch_counters_table_.get()); |
| 64 } | 64 } |
| 65 | 65 |
| 66 private: | 66 private: |
| 67 // Bytecode handler generator functions. | 67 // Bytecode handler generator functions. |
| 68 #define DECLARE_BYTECODE_HANDLER_GENERATOR(Name, ...) \ | 68 #define DECLARE_BYTECODE_HANDLER_GENERATOR(Name, ...) \ |
| 69 void Do##Name(InterpreterAssembler* assembler); | 69 void Do##Name(InterpreterAssembler* assembler); |
| 70 BYTECODE_LIST(DECLARE_BYTECODE_HANDLER_GENERATOR) | 70 BYTECODE_LIST(DECLARE_BYTECODE_HANDLER_GENERATOR) |
| 71 #undef DECLARE_BYTECODE_HANDLER_GENERATOR | 71 #undef DECLARE_BYTECODE_HANDLER_GENERATOR |
| 72 | 72 |
| 73 // Generates code to perform the binary operations via |callable|. | 73 // Generates code to perform the binary operation via |callable|. |
| 74 void DoBinaryOp(Callable callable, InterpreterAssembler* assembler); | 74 void DoBinaryOp(Callable callable, InterpreterAssembler* assembler); |
| 75 | 75 |
| 76 // Generates code to perform the binary operations via |function_id|. | 76 // Generates code to perform the binary operation via |function_id|. |
| 77 void DoBinaryOp(Runtime::FunctionId function_id, | 77 void DoBinaryOp(Runtime::FunctionId function_id, |
| 78 InterpreterAssembler* assembler); | 78 InterpreterAssembler* assembler); |
| 79 | 79 |
| 80 // Generates code to perform the binary operations via |Generator|. | 80 // Generates code to perform the binary operation via |Generator|. |
| 81 template <class Generator> | 81 template <class Generator> |
| 82 void DoBinaryOp(InterpreterAssembler* assembler); | 82 void DoBinaryOp(InterpreterAssembler* assembler); |
| 83 | 83 |
| 84 // Generates code to perform the count operations via |callable|. | 84 // Generates code to perform the unary operation via |Generator|. |
| 85 void DoCountOp(Callable callable, InterpreterAssembler* assembler); | 85 template <class Generator> |
| 86 void DoUnaryOp(InterpreterAssembler* assembler); |
| 86 | 87 |
| 87 // Generates code to perform the comparison operation associated with | 88 // Generates code to perform the comparison operation associated with |
| 88 // |compare_op|. | 89 // |compare_op|. |
| 89 void DoCompareOp(Token::Value compare_op, InterpreterAssembler* assembler); | 90 void DoCompareOp(Token::Value compare_op, InterpreterAssembler* assembler); |
| 90 | 91 |
| 91 // Generates code to load a constant from the constant pool. | 92 // Generates code to load a constant from the constant pool. |
| 92 void DoLoadConstant(InterpreterAssembler* assembler); | 93 void DoLoadConstant(InterpreterAssembler* assembler); |
| 93 | 94 |
| 94 // Generates code to perform a global load via |ic|. | 95 // Generates code to perform a global load via |ic|. |
| 95 void DoLoadGlobal(Callable ic, InterpreterAssembler* assembler); | 96 void DoLoadGlobal(Callable ic, InterpreterAssembler* assembler); |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 159 v8::base::SmartArrayPointer<uintptr_t> bytecode_dispatch_counters_table_; | 160 v8::base::SmartArrayPointer<uintptr_t> bytecode_dispatch_counters_table_; |
| 160 | 161 |
| 161 DISALLOW_COPY_AND_ASSIGN(Interpreter); | 162 DISALLOW_COPY_AND_ASSIGN(Interpreter); |
| 162 }; | 163 }; |
| 163 | 164 |
| 164 } // namespace interpreter | 165 } // namespace interpreter |
| 165 } // namespace internal | 166 } // namespace internal |
| 166 } // namespace v8 | 167 } // namespace v8 |
| 167 | 168 |
| 168 #endif // V8_INTERPRETER_INTERPRETER_H_ | 169 #endif // V8_INTERPRETER_INTERPRETER_H_ |
| OLD | NEW |