OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 19 matching lines...) Expand all Loading... |
30 | 30 |
31 #include "lithium-allocator.h" | 31 #include "lithium-allocator.h" |
32 | 32 |
33 namespace v8 { | 33 namespace v8 { |
34 namespace internal { | 34 namespace internal { |
35 | 35 |
36 class LGapNode; | 36 class LGapNode; |
37 | 37 |
38 class LGapResolver BASE_EMBEDDED { | 38 class LGapResolver BASE_EMBEDDED { |
39 public: | 39 public: |
40 LGapResolver(const ZoneList<LMoveOperands>* moves, LOperand* marker_operand); | 40 LGapResolver(); |
41 const ZoneList<LMoveOperands>* ResolveInReverseOrder(); | 41 const ZoneList<LMoveOperands>* Resolve(const ZoneList<LMoveOperands>* moves, |
| 42 LOperand* marker_operand); |
42 | 43 |
43 private: | 44 private: |
44 LGapNode* LookupNode(LOperand* operand); | 45 LGapNode* LookupNode(LOperand* operand); |
45 bool CanReach(LGapNode* a, LGapNode* b, int visited_id); | 46 bool CanReach(LGapNode* a, LGapNode* b, int visited_id); |
46 bool CanReach(LGapNode* a, LGapNode* b); | 47 bool CanReach(LGapNode* a, LGapNode* b); |
47 void RegisterMove(LMoveOperands move); | 48 void RegisterMove(LMoveOperands move); |
48 void AddResultMove(LOperand* from, LOperand* to); | 49 void AddResultMove(LOperand* from, LOperand* to); |
49 void AddResultMove(LGapNode* from, LGapNode* to); | 50 void AddResultMove(LGapNode* from, LGapNode* to); |
50 void ResolveCycle(LGapNode* start); | 51 void ResolveCycle(LGapNode* start, LOperand* marker_operand); |
51 | 52 |
52 ZoneList<LGapNode*> nodes_; | 53 ZoneList<LGapNode*> nodes_; |
53 ZoneList<LGapNode*> identified_cycles_; | 54 ZoneList<LGapNode*> identified_cycles_; |
54 ZoneList<LMoveOperands> result_; | 55 ZoneList<LMoveOperands> result_; |
55 LOperand* marker_operand_; | |
56 int next_visited_id_; | 56 int next_visited_id_; |
57 int bailout_after_ast_id_; | |
58 }; | 57 }; |
59 | 58 |
60 | 59 |
61 class LParallelMove : public ZoneObject { | 60 class LParallelMove : public ZoneObject { |
62 public: | 61 public: |
63 LParallelMove() : move_operands_(4) { } | 62 LParallelMove() : move_operands_(4) { } |
64 | 63 |
65 void AddMove(LOperand* from, LOperand* to) { | 64 void AddMove(LOperand* from, LOperand* to) { |
66 move_operands_.Add(LMoveOperands(from, to)); | 65 move_operands_.Add(LMoveOperands(from, to)); |
67 } | 66 } |
68 | 67 |
69 bool IsRedundant() const; | 68 bool IsRedundant() const; |
70 | 69 |
71 const ZoneList<LMoveOperands>* move_operands() const { | 70 const ZoneList<LMoveOperands>* move_operands() const { |
72 return &move_operands_; | 71 return &move_operands_; |
73 } | 72 } |
74 | 73 |
75 void PrintDataTo(StringStream* stream) const; | 74 void PrintDataTo(StringStream* stream) const; |
76 | 75 |
77 private: | 76 private: |
78 ZoneList<LMoveOperands> move_operands_; | 77 ZoneList<LMoveOperands> move_operands_; |
79 }; | 78 }; |
80 | 79 |
81 | 80 |
82 } } // namespace v8::internal | 81 } } // namespace v8::internal |
83 | 82 |
84 #endif // V8_LITHIUM_H_ | 83 #endif // V8_LITHIUM_H_ |
OLD | NEW |