OLD | NEW |
1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 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_COMPILER_INSTRUCTION_H_ | 5 #ifndef V8_COMPILER_INSTRUCTION_H_ |
6 #define V8_COMPILER_INSTRUCTION_H_ | 6 #define V8_COMPILER_INSTRUCTION_H_ |
7 | 7 |
8 #include <deque> | 8 #include <deque> |
9 #include <iosfwd> | 9 #include <iosfwd> |
10 #include <map> | 10 #include <map> |
11 #include <set> | 11 #include <set> |
12 | 12 |
13 #include "src/compiler/common-operator.h" | 13 #include "src/compiler/common-operator.h" |
14 #include "src/compiler/frame.h" | 14 #include "src/compiler/frame.h" |
15 #include "src/compiler/instruction-codes.h" | 15 #include "src/compiler/instruction-codes.h" |
16 #include "src/compiler/opcodes.h" | 16 #include "src/compiler/opcodes.h" |
17 #include "src/compiler/schedule.h" | 17 #include "src/compiler/schedule.h" |
18 #include "src/compiler/source-position.h" | 18 #include "src/compiler/source-position.h" |
19 // TODO(titzer): don't include the macro-assembler? | |
20 #include "src/macro-assembler.h" | |
21 #include "src/zone-allocator.h" | 19 #include "src/zone-allocator.h" |
22 | 20 |
23 namespace v8 { | 21 namespace v8 { |
24 namespace internal { | 22 namespace internal { |
25 namespace compiler { | 23 namespace compiler { |
26 | 24 |
27 // Forward declarations. | 25 // Forward declarations. |
28 class Linkage; | 26 class Linkage; |
29 | 27 |
30 // A couple of reserved opcodes are used for internal use. | 28 // A couple of reserved opcodes are used for internal use. |
31 const InstructionCode kGapInstruction = -1; | 29 const InstructionCode kGapInstruction = -1; |
32 const InstructionCode kBlockStartInstruction = -2; | 30 const InstructionCode kBlockStartInstruction = -2; |
33 const InstructionCode kSourcePositionInstruction = -3; | 31 const InstructionCode kSourcePositionInstruction = -3; |
34 | 32 |
| 33 // Platform independent maxes. |
| 34 static const int kMaxGeneralRegisters = 32; |
| 35 static const int kMaxDoubleRegisters = 32; |
35 | 36 |
36 #define INSTRUCTION_OPERAND_LIST(V) \ | 37 |
37 V(Constant, CONSTANT, 0) \ | 38 #define INSTRUCTION_OPERAND_LIST(V) \ |
38 V(Immediate, IMMEDIATE, 0) \ | 39 V(Constant, CONSTANT, 0) \ |
39 V(StackSlot, STACK_SLOT, 128) \ | 40 V(Immediate, IMMEDIATE, 0) \ |
40 V(DoubleStackSlot, DOUBLE_STACK_SLOT, 128) \ | 41 V(StackSlot, STACK_SLOT, 128) \ |
41 V(Register, REGISTER, Register::kNumRegisters) \ | 42 V(DoubleStackSlot, DOUBLE_STACK_SLOT, 128) \ |
42 V(DoubleRegister, DOUBLE_REGISTER, DoubleRegister::kMaxNumRegisters) | 43 V(Register, REGISTER, kMaxGeneralRegisters) \ |
| 44 V(DoubleRegister, DOUBLE_REGISTER, kMaxDoubleRegisters) |
43 | 45 |
44 class InstructionOperand : public ZoneObject { | 46 class InstructionOperand : public ZoneObject { |
45 public: | 47 public: |
46 enum Kind { | 48 enum Kind { |
47 INVALID, | 49 INVALID, |
48 UNALLOCATED, | 50 UNALLOCATED, |
49 CONSTANT, | 51 CONSTANT, |
50 IMMEDIATE, | 52 IMMEDIATE, |
51 STACK_SLOT, | 53 STACK_SLOT, |
52 DOUBLE_STACK_SLOT, | 54 DOUBLE_STACK_SLOT, |
(...skipping 927 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
980 DeoptimizationVector deoptimization_entries_; | 982 DeoptimizationVector deoptimization_entries_; |
981 }; | 983 }; |
982 | 984 |
983 std::ostream& operator<<(std::ostream& os, const InstructionSequence& code); | 985 std::ostream& operator<<(std::ostream& os, const InstructionSequence& code); |
984 | 986 |
985 } // namespace compiler | 987 } // namespace compiler |
986 } // namespace internal | 988 } // namespace internal |
987 } // namespace v8 | 989 } // namespace v8 |
988 | 990 |
989 #endif // V8_COMPILER_INSTRUCTION_H_ | 991 #endif // V8_COMPILER_INSTRUCTION_H_ |
OLD | NEW |