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

Side by Side Diff: src/lithium.h

Issue 6128007: Reuse the gap move resolver. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge/build/ia32
Patch Set: Created 9 years, 11 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 | Annotate | Revision Log
« no previous file with comments | « src/ia32/lithium-codegen-ia32.cc ('k') | src/lithium.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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_
OLDNEW
« no previous file with comments | « src/ia32/lithium-codegen-ia32.cc ('k') | src/lithium.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698