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

Unified Diff: src/mips/lithium-gap-resolver-mips.h

Issue 7934002: MIPS: crankshaft implementation (Closed)
Patch Set: rebased on r9823. Created 9 years, 2 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/mips/lithium-codegen-mips.cc ('k') | src/mips/lithium-gap-resolver-mips.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_
« no previous file with comments | « src/mips/lithium-codegen-mips.cc ('k') | src/mips/lithium-gap-resolver-mips.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698