Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1692)

Side by Side Diff: src/interpreter/bytecodes.h

Issue 1343363002: [Interpreter] Basic flow control. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Clarify comment and diff reduction. Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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_BYTECODES_H_ 5 #ifndef V8_INTERPRETER_BYTECODES_H_
6 #define V8_INTERPRETER_BYTECODES_H_ 6 #define V8_INTERPRETER_BYTECODES_H_
7 7
8 #include <iosfwd> 8 #include <iosfwd>
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 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
51 /* Binary Operators */ \ 51 /* Binary Operators */ \
52 V(Add, OperandType::kReg) \ 52 V(Add, OperandType::kReg) \
53 V(Sub, OperandType::kReg) \ 53 V(Sub, OperandType::kReg) \
54 V(Mul, OperandType::kReg) \ 54 V(Mul, OperandType::kReg) \
55 V(Div, OperandType::kReg) \ 55 V(Div, OperandType::kReg) \
56 V(Mod, OperandType::kReg) \ 56 V(Mod, OperandType::kReg) \
57 \ 57 \
58 /* Call operations. */ \ 58 /* Call operations. */ \
59 V(Call, OperandType::kReg, OperandType::kReg, OperandType::kCount) \ 59 V(Call, OperandType::kReg, OperandType::kReg, OperandType::kCount) \
60 \ 60 \
61 /* Test Operators */ \
62 V(TestEqual, OperandType::kReg) \
63 V(TestNotEqual, OperandType::kReg) \
64 V(TestEqualStrict, OperandType::kReg) \
65 V(TestNotEqualStrict, OperandType::kReg) \
66 V(TestLessThan, OperandType::kReg) \
67 V(TestGreaterThan, OperandType::kReg) \
68 V(TestLessThanEqual, OperandType::kReg) \
69 V(TestGreaterThanEqual, OperandType::kReg) \
70 V(TestInstanceOf, OperandType::kReg) \
71 V(TestIn, OperandType::kReg) \
72 \
61 /* Control Flow */ \ 73 /* Control Flow */ \
74 V(JumpSmi8, OperandType::kImm8) \
rmcilroy 2015/09/18 10:42:23 This is not really a Smi, it is just an imm8. How
oth 2015/09/23 10:46:56 Done.
75 V(JumpConstant, OperandType::kIdx) \
76 V(JumpIfTrueSmi8, OperandType::kImm8) \
rmcilroy 2015/09/18 10:42:24 As discussed, you aren't using JumpIfTrue yet exce
oth 2015/09/23 10:46:56 do...while() is a prime candidate for JumpIfTrue.
77 V(JumpIfTrueConstant, OperandType::kIdx) \
78 V(JumpIfFalseSmi8, OperandType::kImm8) \
79 V(JumpIfFalseConstant, OperandType::kIdx) \
rmcilroy 2015/09/18 10:42:23 optional super nit - I would prefer ordered by ope
oth 2015/09/23 10:46:56 The current ordering groups by functionality like
62 V(Return, OperandType::kNone) 80 V(Return, OperandType::kNone)
63 81
64 82
65 // Enumeration of operand types used by bytecodes. 83 // Enumeration of operand types used by bytecodes.
66 enum class OperandType : uint8_t { 84 enum class OperandType : uint8_t {
67 #define DECLARE_OPERAND_TYPE(Name) k##Name, 85 #define DECLARE_OPERAND_TYPE(Name) k##Name,
68 OPERAND_TYPE_LIST(DECLARE_OPERAND_TYPE) 86 OPERAND_TYPE_LIST(DECLARE_OPERAND_TYPE)
69 #undef DECLARE_OPERAND_TYPE 87 #undef DECLARE_OPERAND_TYPE
70 #define COUNT_OPERAND_TYPES(x) +1 88 #define COUNT_OPERAND_TYPES(x) +1
71 // The COUNT_OPERAND macro will turn this into kLast = -1 +1 +1... which will 89 // The COUNT_OPERAND macro will turn this into kLast = -1 +1 +1... which will
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
163 }; 181 };
164 182
165 std::ostream& operator<<(std::ostream& os, const Bytecode& bytecode); 183 std::ostream& operator<<(std::ostream& os, const Bytecode& bytecode);
166 std::ostream& operator<<(std::ostream& os, const OperandType& operand_type); 184 std::ostream& operator<<(std::ostream& os, const OperandType& operand_type);
167 185
168 } // namespace interpreter 186 } // namespace interpreter
169 } // namespace internal 187 } // namespace internal
170 } // namespace v8 188 } // namespace v8
171 189
172 #endif // V8_INTERPRETER_BYTECODES_H_ 190 #endif // V8_INTERPRETER_BYTECODES_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698