| 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 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 69 // TODO(ignition): Tune code size multiplier. | 69 // TODO(ignition): Tune code size multiplier. |
| 70 static const int kCodeSizeMultiplier = 32; | 70 static const int kCodeSizeMultiplier = 32; |
| 71 | 71 |
| 72 private: | 72 private: |
| 73 // Bytecode handler generator functions. | 73 // Bytecode handler generator functions. |
| 74 #define DECLARE_BYTECODE_HANDLER_GENERATOR(Name, ...) \ | 74 #define DECLARE_BYTECODE_HANDLER_GENERATOR(Name, ...) \ |
| 75 void Do##Name(InterpreterAssembler* assembler); | 75 void Do##Name(InterpreterAssembler* assembler); |
| 76 BYTECODE_LIST(DECLARE_BYTECODE_HANDLER_GENERATOR) | 76 BYTECODE_LIST(DECLARE_BYTECODE_HANDLER_GENERATOR) |
| 77 #undef DECLARE_BYTECODE_HANDLER_GENERATOR | 77 #undef DECLARE_BYTECODE_HANDLER_GENERATOR |
| 78 | 78 |
| 79 typedef void (Interpreter::*BytecodeGeneratorFunc)(InterpreterAssembler*); |
| 80 |
| 81 // Generates handler for given |bytecode| and |operand_scale| using |
| 82 // |generator| and installs it into the dispatch table. |
| 83 void InstallBytecodeHandler(Zone* zone, Bytecode bytecode, |
| 84 OperandScale operand_scale, |
| 85 BytecodeGeneratorFunc generator); |
| 86 |
| 79 // Generates code to perform the binary operation via |Generator|. | 87 // Generates code to perform the binary operation via |Generator|. |
| 80 template <class Generator> | 88 template <class Generator> |
| 81 void DoBinaryOpWithFeedback(InterpreterAssembler* assembler); | 89 void DoBinaryOpWithFeedback(InterpreterAssembler* assembler); |
| 82 | 90 |
| 83 // Generates code to perform the comparison via |Generator| while gathering | 91 // Generates code to perform the comparison via |Generator| while gathering |
| 84 // type feedback. | 92 // type feedback. |
| 85 void DoCompareOpWithFeedback(Token::Value compare_op, | 93 void DoCompareOpWithFeedback(Token::Value compare_op, |
| 86 InterpreterAssembler* assembler); | 94 InterpreterAssembler* assembler); |
| 87 | 95 |
| 88 // Generates code to perform the bitwise binary operation corresponding to | 96 // Generates code to perform the bitwise binary operation corresponding to |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 176 std::unique_ptr<uintptr_t[]> bytecode_dispatch_counters_table_; | 184 std::unique_ptr<uintptr_t[]> bytecode_dispatch_counters_table_; |
| 177 | 185 |
| 178 DISALLOW_COPY_AND_ASSIGN(Interpreter); | 186 DISALLOW_COPY_AND_ASSIGN(Interpreter); |
| 179 }; | 187 }; |
| 180 | 188 |
| 181 } // namespace interpreter | 189 } // namespace interpreter |
| 182 } // namespace internal | 190 } // namespace internal |
| 183 } // namespace v8 | 191 } // namespace v8 |
| 184 | 192 |
| 185 #endif // V8_INTERPRETER_INTERPRETER_H_ | 193 #endif // V8_INTERPRETER_INTERPRETER_H_ |
| OLD | NEW |