Index: src/mips/lithium-gap-resolver-mips.h |
diff --git a/src/mips/lithium-codegen-mips.h b/src/mips/lithium-gap-resolver-mips.h |
similarity index 56% |
copy from src/mips/lithium-codegen-mips.h |
copy to src/mips/lithium-gap-resolver-mips.h |
index 2aec68456d164a92e964c639b6af9185272443f3..48da9a6fc69884dc6cc65c52865ab2c112ca5131 100644 |
--- a/src/mips/lithium-codegen-mips.h |
+++ b/src/mips/lithium-gap-resolver-mips.h |
@@ -25,41 +25,60 @@ |
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
-#ifndef V8_MIPS_LITHIUM_CODEGEN_MIPS_H_ |
-#define V8_MIPS_LITHIUM_CODEGEN_MIPS_H_ |
+#ifndef V8_MIPS_LITHIUM_GAP_RESOLVER_MIPS_H_ |
+#define V8_MIPS_LITHIUM_GAP_RESOLVER_MIPS_H_ |
-#include "mips/lithium-mips.h" |
+#include "v8.h" |
-#include "deoptimizer.h" |
-#include "safepoint-table.h" |
-#include "scopes.h" |
- |
-// Note: this file was taken from the X64 version. ARM has a partially working |
-// lithium implementation, but for now it is not ported to mips. |
+#include "lithium.h" |
namespace v8 { |
namespace internal { |
-// Forward declarations. |
-class LDeferredCode; |
+class LCodeGen; |
+class LGapResolver; |
-class LCodeGen BASE_EMBEDDED { |
+class LGapResolver BASE_EMBEDDED { |
public: |
- LCodeGen(LChunk* chunk, MacroAssembler* assembler, CompilationInfo* info) { } |
- |
- // Try to generate code for the entire chunk, but it may fail if the |
- // chunk contains constructs we cannot handle. Returns true if the |
- // code generation attempt succeeded. |
- bool GenerateCode() { |
- UNIMPLEMENTED(); |
- return false; |
- } |
- |
- // Finish the code by setting stack height, safepoint, and bailout |
- // information on it. |
- void FinishCode(Handle<Code> code) { UNIMPLEMENTED(); } |
+ |
+ explicit LGapResolver(LCodeGen* owner); |
+ |
+ // Resolve a set of parallel moves, emitting assembler instructions. |
+ void Resolve(LParallelMove* parallel_move); |
+ |
+ private: |
+ // Build the initial list of moves. |
+ void BuildInitialMoveList(LParallelMove* parallel_move); |
+ |
+ // Perform the move at the moves_ index in question (possibly requiring |
+ // other moves to satisfy dependencies). |
+ void PerformMove(int index); |
+ |
+ // If a cycle is found in the series of moves, save the blocking value to |
+ // a scratch register. The cycle must be found by hitting the root of the |
+ // depth-first search. |
+ void BreakCycle(int index); |
+ |
+ // After a cycle has been resolved, restore the value from the scratch |
+ // register to its proper destination. |
+ void RestoreValue(); |
+ |
+ // Emit a move and remove it from the move graph. |
+ void EmitMove(int index); |
+ |
+ // Verify the move list before performing moves. |
+ void Verify(); |
+ |
+ LCodeGen* cgen_; |
+ |
+ // List of moves not yet resolved. |
+ ZoneList<LMoveOperands> moves_; |
+ |
+ int root_index_; |
+ bool in_cycle_; |
+ LOperand* saved_destination_; |
}; |
} } // namespace v8::internal |
-#endif // V8_MIPS_LITHIUM_CODEGEN_MIPS_H_ |
+#endif // V8_MIPS_LITHIUM_GAP_RESOLVER_MIPS_H_ |