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

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

Issue 268673003: ARM64: Optimize generated code for gaps (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: reset scratch register value when acquired Created 6 years, 6 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/arm64/delayed-masm-arm64-inl.h ('k') | src/arm64/lithium-gap-resolver-arm64.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/arm64/lithium-gap-resolver-arm64.h
diff --git a/src/arm64/lithium-gap-resolver-arm64.h b/src/arm64/lithium-gap-resolver-arm64.h
index 55d4ecbf9d210865d074abd64d7e315bd3643937..7d00485bf478f9c687832d97153ba5d4d3080ea3 100644
--- a/src/arm64/lithium-gap-resolver-arm64.h
+++ b/src/arm64/lithium-gap-resolver-arm64.h
@@ -8,6 +8,7 @@
#include "src/v8.h"
#include "src/lithium.h"
+#include "src/arm64/delayed-masm-arm64.h"
namespace v8 {
namespace internal {
@@ -15,6 +16,21 @@ namespace internal {
class LCodeGen;
class LGapResolver;
+class DelayedGapMasm : public DelayedMasm {
+ public:
+ DelayedGapMasm(LCodeGen* owner, MacroAssembler* masm)
+ : DelayedMasm(owner, masm, root) {
+ // We use the root register as an extra scratch register.
+ // The root register has two advantages:
+ // - It is not in crankshaft allocatable registers list, so it can't
+ // interfere with the allocatable registers.
+ // - We don't need to push it on the stack, as we can reload it with its
+ // value once we have finish.
+ }
+ void EndDelayedUse();
+};
+
+
class LGapResolver BASE_EMBEDDED {
public:
explicit LGapResolver(LCodeGen* owner);
@@ -43,12 +59,32 @@ class LGapResolver BASE_EMBEDDED {
void EmitMove(int index);
// Emit a move from one stack slot to another.
- void EmitStackSlotMove(int index);
+ void EmitStackSlotMove(int index) {
+ masm_.StackSlotMove(moves_[index].source(), moves_[index].destination());
+ }
// Verify the move list before performing moves.
void Verify();
+ // Registers used to solve cycles.
+ const Register& SavedValueRegister() {
+ ASSERT(!masm_.ScratchRegister().IsAllocatable());
+ return masm_.ScratchRegister();
+ }
+ // The scratch register is used to break cycles and to store constant.
+ // These two methods switch from one mode to the other.
+ void AcquireSavedValueRegister() { masm_.AcquireScratchRegister(); }
+ void ReleaseSavedValueRegister() { masm_.ReleaseScratchRegister(); }
+ const FPRegister& SavedFPValueRegister() {
+ // We use the Crankshaft floating-point scratch register to break a cycle
+ // involving double values as the MacroAssembler will not need it for the
+ // operations performed by the gap resolver.
+ ASSERT(!crankshaft_fp_scratch.IsAllocatable());
+ return crankshaft_fp_scratch;
+ }
+
LCodeGen* cgen_;
+ DelayedGapMasm masm_;
// List of moves not yet resolved.
ZoneList<LMoveOperands> moves_;
@@ -56,10 +92,6 @@ class LGapResolver BASE_EMBEDDED {
int root_index_;
bool in_cycle_;
LOperand* saved_destination_;
-
- // We use the root register as a scratch in a few places. When that happens,
- // this flag is set to indicate that it needs to be restored.
- bool need_to_restore_root_;
};
} } // namespace v8::internal
« no previous file with comments | « src/arm64/delayed-masm-arm64-inl.h ('k') | src/arm64/lithium-gap-resolver-arm64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698