OLD | NEW |
1 // Copyright 2016 the V8 project authors. All rights reserved. | 1 // Copyright 2016 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_BYTECODE_PEEPHOLE_TABLE_H_ | 5 #ifndef V8_INTERPRETER_BYTECODE_PEEPHOLE_TABLE_H_ |
6 #define V8_INTERPRETER_BYTECODE_PEEPHOLE_TABLE_H_ | 6 #define V8_INTERPRETER_BYTECODE_PEEPHOLE_TABLE_H_ |
7 | 7 |
8 #include "src/interpreter/bytecodes.h" | 8 #include "src/interpreter/bytecodes.h" |
9 | 9 |
10 namespace v8 { | 10 namespace v8 { |
11 namespace internal { | 11 namespace internal { |
12 namespace interpreter { | 12 namespace interpreter { |
13 | 13 |
14 #define PEEPHOLE_NON_JUMP_ACTION_LIST(V) \ | 14 #define PEEPHOLE_NON_JUMP_ACTION_LIST(V) \ |
15 V(DefaultAction) \ | 15 V(DefaultAction) \ |
16 V(UpdateLastAction) \ | 16 V(UpdateLastAction) \ |
17 V(UpdateLastIfSourceInfoPresentAction) \ | 17 V(UpdateLastIfSourceInfoPresentAction) \ |
18 V(ElideCurrentAction) \ | 18 V(ElideCurrentAction) \ |
19 V(ElideCurrentIfOperand0MatchesAction) \ | 19 V(ElideCurrentIfOperand0MatchesAction) \ |
20 V(ElideLastAction) \ | 20 V(ElideLastAction) \ |
21 V(ChangeBytecodeAction) \ | 21 V(ChangeBytecodeAction) \ |
22 V(TransformLdaSmiBinaryOpToBinaryOpWithSmiAction) \ | 22 V(TransformLdaSmiBinaryOpToBinaryOpWithSmiAction) \ |
23 V(TransformLdaZeroBinaryOpToBinaryOpWithZeroAction) | 23 V(TransformLdaZeroBinaryOpToBinaryOpWithZeroAction) |
24 | 24 |
25 #define PEEPHOLE_JUMP_ACTION_LIST(V) \ | 25 #define PEEPHOLE_JUMP_ACTION_LIST(V) \ |
26 V(DefaultJumpAction) \ | 26 V(DefaultJumpAction) \ |
27 V(UpdateLastJumpAction) \ | 27 V(UpdateLastJumpAction) \ |
28 V(ChangeJumpBytecodeAction) \ | |
29 V(ElideLastBeforeJumpAction) | 28 V(ElideLastBeforeJumpAction) |
30 | 29 |
31 #define PEEPHOLE_ACTION_LIST(V) \ | 30 #define PEEPHOLE_ACTION_LIST(V) \ |
32 PEEPHOLE_NON_JUMP_ACTION_LIST(V) \ | 31 PEEPHOLE_NON_JUMP_ACTION_LIST(V) \ |
33 PEEPHOLE_JUMP_ACTION_LIST(V) | 32 PEEPHOLE_JUMP_ACTION_LIST(V) |
34 | 33 |
35 // Actions to take when a pair of bytes is encountered. A handler | 34 // Actions to take when a pair of bytes is encountered. A handler |
36 // exists for each action. | 35 // exists for each action. |
37 enum class PeepholeAction : uint8_t { | 36 enum class PeepholeAction : uint8_t { |
38 #define DECLARE_PEEPHOLE_ACTION(Action) k##Action, | 37 #define DECLARE_PEEPHOLE_ACTION(Action) k##Action, |
(...skipping 23 matching lines...) Expand all Loading... |
62 | 61 |
63 static const PeepholeActionAndData row_data_[][kNumberOfBytecodes]; | 62 static const PeepholeActionAndData row_data_[][kNumberOfBytecodes]; |
64 static const PeepholeActionAndData* const row_[kNumberOfBytecodes]; | 63 static const PeepholeActionAndData* const row_[kNumberOfBytecodes]; |
65 }; | 64 }; |
66 | 65 |
67 } // namespace interpreter | 66 } // namespace interpreter |
68 } // namespace internal | 67 } // namespace internal |
69 } // namespace v8 | 68 } // namespace v8 |
70 | 69 |
71 #endif // V8_INTERPRETER_BYTECODE_PEEPHOLE_TABLE_H_ | 70 #endif // V8_INTERPRETER_BYTECODE_PEEPHOLE_TABLE_H_ |
OLD | NEW |