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 871 matching lines...) Loading... |
882 typedef ZoneDeque<PointerMap*> PointerMapDeque; | 882 typedef ZoneDeque<PointerMap*> PointerMapDeque; |
883 typedef ZoneVector<FrameStateDescriptor*> DeoptimizationVector; | 883 typedef ZoneVector<FrameStateDescriptor*> DeoptimizationVector; |
884 typedef ZoneVector<InstructionBlock*> InstructionBlocks; | 884 typedef ZoneVector<InstructionBlock*> InstructionBlocks; |
885 | 885 |
886 struct PrintableInstructionSequence; | 886 struct PrintableInstructionSequence; |
887 | 887 |
888 | 888 |
889 // Represents architecture-specific generated code before, during, and after | 889 // Represents architecture-specific generated code before, during, and after |
890 // register allocation. | 890 // register allocation. |
891 // TODO(titzer): s/IsDouble/IsFloat64/ | 891 // TODO(titzer): s/IsDouble/IsFloat64/ |
892 class InstructionSequence FINAL { | 892 class InstructionSequence FINAL : public ZoneObject { |
893 public: | 893 public: |
894 static InstructionBlocks* InstructionBlocksFor(Zone* zone, | 894 static InstructionBlocks* InstructionBlocksFor(Zone* zone, |
895 const Schedule* schedule); | 895 const Schedule* schedule); |
896 | 896 |
897 InstructionSequence(Zone* zone, InstructionBlocks* instruction_blocks); | 897 InstructionSequence(Zone* zone, InstructionBlocks* instruction_blocks); |
898 | 898 |
899 int NextVirtualRegister() { return next_virtual_register_++; } | 899 int NextVirtualRegister() { return next_virtual_register_++; } |
900 int VirtualRegisterCount() const { return next_virtual_register_; } | 900 int VirtualRegisterCount() const { return next_virtual_register_; } |
901 | 901 |
902 const InstructionBlocks& instruction_blocks() const { | 902 const InstructionBlocks& instruction_blocks() const { |
(...skipping 105 matching lines...) Loading... |
1008 InstructionBlocks* const instruction_blocks_; | 1008 InstructionBlocks* const instruction_blocks_; |
1009 IntVector block_starts_; | 1009 IntVector block_starts_; |
1010 ConstantMap constants_; | 1010 ConstantMap constants_; |
1011 ConstantDeque immediates_; | 1011 ConstantDeque immediates_; |
1012 InstructionDeque instructions_; | 1012 InstructionDeque instructions_; |
1013 int next_virtual_register_; | 1013 int next_virtual_register_; |
1014 PointerMapDeque pointer_maps_; | 1014 PointerMapDeque pointer_maps_; |
1015 VirtualRegisterSet doubles_; | 1015 VirtualRegisterSet doubles_; |
1016 VirtualRegisterSet references_; | 1016 VirtualRegisterSet references_; |
1017 DeoptimizationVector deoptimization_entries_; | 1017 DeoptimizationVector deoptimization_entries_; |
| 1018 |
| 1019 DISALLOW_COPY_AND_ASSIGN(InstructionSequence); |
1018 }; | 1020 }; |
1019 | 1021 |
1020 | 1022 |
1021 struct PrintableInstructionSequence { | 1023 struct PrintableInstructionSequence { |
1022 const RegisterConfiguration* register_configuration_; | 1024 const RegisterConfiguration* register_configuration_; |
1023 const InstructionSequence* sequence_; | 1025 const InstructionSequence* sequence_; |
1024 }; | 1026 }; |
1025 | 1027 |
1026 | 1028 |
1027 std::ostream& operator<<(std::ostream& os, | 1029 std::ostream& operator<<(std::ostream& os, |
1028 const PrintableInstructionSequence& code); | 1030 const PrintableInstructionSequence& code); |
1029 | 1031 |
1030 } // namespace compiler | 1032 } // namespace compiler |
1031 } // namespace internal | 1033 } // namespace internal |
1032 } // namespace v8 | 1034 } // namespace v8 |
1033 | 1035 |
1034 #endif // V8_COMPILER_INSTRUCTION_H_ | 1036 #endif // V8_COMPILER_INSTRUCTION_H_ |
OLD | NEW |