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> |
(...skipping 912 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
923 const int virtual_register_; | 923 const int virtual_register_; |
924 InstructionOperand output_; | 924 InstructionOperand output_; |
925 IntVector operands_; | 925 IntVector operands_; |
926 }; | 926 }; |
927 | 927 |
928 | 928 |
929 // Analogue of BasicBlock for Instructions instead of Nodes. | 929 // Analogue of BasicBlock for Instructions instead of Nodes. |
930 class InstructionBlock final : public ZoneObject { | 930 class InstructionBlock final : public ZoneObject { |
931 public: | 931 public: |
932 InstructionBlock(Zone* zone, RpoNumber rpo_number, RpoNumber loop_header, | 932 InstructionBlock(Zone* zone, RpoNumber rpo_number, RpoNumber loop_header, |
933 RpoNumber loop_end, bool deferred); | 933 RpoNumber loop_end, bool deferred, bool handler); |
934 | 934 |
935 // Instruction indexes (used by the register allocator). | 935 // Instruction indexes (used by the register allocator). |
936 int first_instruction_index() const { | 936 int first_instruction_index() const { |
937 DCHECK(code_start_ >= 0); | 937 DCHECK(code_start_ >= 0); |
938 DCHECK(code_end_ > 0); | 938 DCHECK(code_end_ > 0); |
939 DCHECK(code_end_ >= code_start_); | 939 DCHECK(code_end_ >= code_start_); |
940 return code_start_; | 940 return code_start_; |
941 } | 941 } |
942 int last_instruction_index() const { | 942 int last_instruction_index() const { |
943 DCHECK(code_start_ >= 0); | 943 DCHECK(code_start_ >= 0); |
944 DCHECK(code_end_ > 0); | 944 DCHECK(code_end_ > 0); |
945 DCHECK(code_end_ >= code_start_); | 945 DCHECK(code_end_ >= code_start_); |
946 return code_end_ - 1; | 946 return code_end_ - 1; |
947 } | 947 } |
948 | 948 |
949 int32_t code_start() const { return code_start_; } | 949 int32_t code_start() const { return code_start_; } |
950 void set_code_start(int32_t start) { code_start_ = start; } | 950 void set_code_start(int32_t start) { code_start_ = start; } |
951 | 951 |
952 int32_t code_end() const { return code_end_; } | 952 int32_t code_end() const { return code_end_; } |
953 void set_code_end(int32_t end) { code_end_ = end; } | 953 void set_code_end(int32_t end) { code_end_ = end; } |
954 | 954 |
955 bool IsDeferred() const { return deferred_; } | 955 bool IsDeferred() const { return deferred_; } |
| 956 bool IsHandler() const { return handler_; } |
956 | 957 |
957 RpoNumber ao_number() const { return ao_number_; } | 958 RpoNumber ao_number() const { return ao_number_; } |
958 RpoNumber rpo_number() const { return rpo_number_; } | 959 RpoNumber rpo_number() const { return rpo_number_; } |
959 RpoNumber loop_header() const { return loop_header_; } | 960 RpoNumber loop_header() const { return loop_header_; } |
960 RpoNumber loop_end() const { | 961 RpoNumber loop_end() const { |
961 DCHECK(IsLoopHeader()); | 962 DCHECK(IsLoopHeader()); |
962 return loop_end_; | 963 return loop_end_; |
963 } | 964 } |
964 inline bool IsLoopHeader() const { return loop_end_.IsValid(); } | 965 inline bool IsLoopHeader() const { return loop_end_.IsValid(); } |
965 | 966 |
(...skipping 27 matching lines...) Expand all Loading... |
993 Successors successors_; | 994 Successors successors_; |
994 Predecessors predecessors_; | 995 Predecessors predecessors_; |
995 PhiInstructions phis_; | 996 PhiInstructions phis_; |
996 RpoNumber ao_number_; // Assembly order number. | 997 RpoNumber ao_number_; // Assembly order number. |
997 const RpoNumber rpo_number_; | 998 const RpoNumber rpo_number_; |
998 const RpoNumber loop_header_; | 999 const RpoNumber loop_header_; |
999 const RpoNumber loop_end_; | 1000 const RpoNumber loop_end_; |
1000 int32_t code_start_; // start index of arch-specific code. | 1001 int32_t code_start_; // start index of arch-specific code. |
1001 int32_t code_end_; // end index of arch-specific code. | 1002 int32_t code_end_; // end index of arch-specific code. |
1002 const bool deferred_; // Block contains deferred code. | 1003 const bool deferred_; // Block contains deferred code. |
| 1004 const bool handler_; // Block is a handler entry point. |
1003 bool needs_frame_; | 1005 bool needs_frame_; |
1004 bool must_construct_frame_; | 1006 bool must_construct_frame_; |
1005 bool must_deconstruct_frame_; | 1007 bool must_deconstruct_frame_; |
1006 }; | 1008 }; |
1007 | 1009 |
1008 typedef ZoneDeque<Constant> ConstantDeque; | 1010 typedef ZoneDeque<Constant> ConstantDeque; |
1009 typedef std::map<int, Constant, std::less<int>, | 1011 typedef std::map<int, Constant, std::less<int>, |
1010 zone_allocator<std::pair<int, Constant> > > ConstantMap; | 1012 zone_allocator<std::pair<int, Constant> > > ConstantMap; |
1011 | 1013 |
1012 typedef ZoneDeque<Instruction*> InstructionDeque; | 1014 typedef ZoneDeque<Instruction*> InstructionDeque; |
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1199 | 1201 |
1200 | 1202 |
1201 std::ostream& operator<<(std::ostream& os, | 1203 std::ostream& operator<<(std::ostream& os, |
1202 const PrintableInstructionSequence& code); | 1204 const PrintableInstructionSequence& code); |
1203 | 1205 |
1204 } // namespace compiler | 1206 } // namespace compiler |
1205 } // namespace internal | 1207 } // namespace internal |
1206 } // namespace v8 | 1208 } // namespace v8 |
1207 | 1209 |
1208 #endif // V8_COMPILER_INSTRUCTION_H_ | 1210 #endif // V8_COMPILER_INSTRUCTION_H_ |
OLD | NEW |