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

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

Issue 1266713004: [Intepreter] Addition of BytecodeArrayBuilder and accumulator based bytecodes. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix MSVC/gcc-pedantic compilation. Created 5 years, 4 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.
11 // Do not include anything from src/interpreter here! 11 // Do not include anything from src/interpreter here!
12 #include "src/utils.h" 12 #include "src/utils.h"
13 13
14 namespace v8 { 14 namespace v8 {
15 namespace internal { 15 namespace internal {
16 namespace interpreter { 16 namespace interpreter {
17 17
18 // The list of operand types used by bytecodes. 18 // The list of operand types used by bytecodes.
19 #define OPERAND_TYPE_LIST(V) \ 19 #define OPERAND_TYPE_LIST(V) \
20 V(None) \ 20 V(None) \
21 V(Imm8) \ 21 V(Imm8) \
22 V(Reg) 22 V(Reg)
23 23
24 // The list of bytecodes which are interpreted by the interpreter. 24 // The list of bytecodes which are interpreted by the interpreter.
25 #define BYTECODE_LIST(V) \ 25 #define BYTECODE_LIST(V) \
26 V(LoadLiteral0, OperandType::kReg) \ 26 \
27 V(LoadSmi8, OperandType::kReg, OperandType::kImm8) \ 27 /* Loading the accumulator */ \
28 V(LdaZero, OperandType::kNone) \
29 V(LdaSmi8, OperandType::kImm8) \
30 V(LdaUndefined, OperandType::kNone) \
31 V(LdaNull, OperandType::kNone) \
32 V(LdaTheHole, OperandType::kNone) \
33 V(LdaTrue, OperandType::kNone) \
34 V(LdaFalse, OperandType::kNone) \
35 \
36 /* Register-accumulator transfers */ \
37 V(Ldar, OperandType::kReg) \
38 V(Star, OperandType::kReg) \
39 \
40 /* Binary Operators */ \
41 V(Add, OperandType::kReg) \
42 V(Sub, OperandType::kReg) \
43 V(Mul, OperandType::kReg) \
44 V(Div, OperandType::kReg) \
45 \
46 /* Control Flow */ \
28 V(Return, OperandType::kNone) 47 V(Return, OperandType::kNone)
29 48
30 49
31 // Enumeration of operand types used by bytecodes. 50 // Enumeration of operand types used by bytecodes.
32 enum class OperandType : uint8_t { 51 enum class OperandType : uint8_t {
33 #define DECLARE_OPERAND_TYPE(Name) k##Name, 52 #define DECLARE_OPERAND_TYPE(Name) k##Name,
34 OPERAND_TYPE_LIST(DECLARE_OPERAND_TYPE) 53 OPERAND_TYPE_LIST(DECLARE_OPERAND_TYPE)
35 #undef DECLARE_OPERAND_TYPE 54 #undef DECLARE_OPERAND_TYPE
36 #define COUNT_OPERAND_TYPES(x) +1 55 #define COUNT_OPERAND_TYPES(x) +1
37 // The COUNT_OPERAND macro will turn this into kLast = -1 +1 +1... which will 56 // The COUNT_OPERAND macro will turn this into kLast = -1 +1 +1... which will
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
84 DISALLOW_IMPLICIT_CONSTRUCTORS(Bytecodes); 103 DISALLOW_IMPLICIT_CONSTRUCTORS(Bytecodes);
85 }; 104 };
86 105
87 std::ostream& operator<<(std::ostream& os, const Bytecode& bytecode); 106 std::ostream& operator<<(std::ostream& os, const Bytecode& bytecode);
88 107
89 } // namespace interpreter 108 } // namespace interpreter
90 } // namespace internal 109 } // namespace internal
91 } // namespace v8 110 } // namespace v8
92 111
93 #endif // V8_INTERPRETER_BYTECODES_H_ 112 #endif // V8_INTERPRETER_BYTECODES_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698