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

Unified Diff: src/a64/lithium-codegen-a64.cc

Issue 150513002: A64: Todos - peek/poke and branch generator (Closed) Base URL: https://v8.googlecode.com/svn/branches/experimental/a64
Patch Set: Created 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/a64/lithium-codegen-a64.h ('k') | src/a64/macro-assembler-a64.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/a64/lithium-codegen-a64.cc
diff --git a/src/a64/lithium-codegen-a64.cc b/src/a64/lithium-codegen-a64.cc
index 56b29ceb09e0d5d9622517e584476bdc2a57e702..50dca3a7d620a569e9ad133a8523d6491828f5e7 100644
--- a/src/a64/lithium-codegen-a64.cc
+++ b/src/a64/lithium-codegen-a64.cc
@@ -196,6 +196,25 @@ class BranchIfNonZeroNumber : public BranchGenerator {
};
+// Test the input and branch if it is a heap number.
+class BranchIfHeapNumber : public BranchGenerator {
+ public:
+ BranchIfHeapNumber(LCodeGen* codegen, const Register& value)
+ : BranchGenerator(codegen), value_(value) { }
+
+ virtual void Emit(Label* label) const {
+ __ JumpIfHeapNumber(value_, label);
+ }
+
+ virtual void EmitInverted(Label* label) const {
+ __ JumpIfNotHeapNumber(value_, label);
+ }
+
+ private:
+ const Register& value_;
+};
+
+
void LCodeGen::WriteTranslation(LEnvironment* environment,
Translation* translation) {
if (environment == NULL) return;
@@ -603,8 +622,7 @@ bool LCodeGen::GeneratePrologue() {
int count = 0;
while (!iterator.Done()) {
FPRegister value = FPRegister::FromAllocationIndex(iterator.Current());
- // TODO(jbramley): Make Poke support FPRegisters.
- __ Str(value, MemOperand(__ StackPointer(), count * kDoubleSize));
+ __ Poke(value, count * kDoubleSize);
iterator.Advance();
count++;
}
@@ -1222,6 +1240,14 @@ void LCodeGen::EmitBranchIfNonZeroNumber(InstrType instr,
}
+template<class InstrType>
+void LCodeGen::EmitBranchIfHeapNumber(InstrType instr,
+ const Register& value) {
+ BranchIfHeapNumber branch(this, value);
+ EmitBranchGeneric(instr, branch);
+}
+
+
void LCodeGen::DoGap(LGap* gap) {
for (int i = LGap::FIRST_INNER_POSITION;
i <= LGap::LAST_INNER_POSITION;
@@ -2896,9 +2922,8 @@ void LCodeGen::DoIsNumberAndBranch(LIsNumberAndBranch* instr) {
__ B(instr->TrueLabel(chunk_));
}
__ JumpIfSmi(value, instr->TrueLabel(chunk_));
- // TODO(jbramley): Add an EmitBranch helper for this.
- __ JumpForHeapNumber(value, NoReg,
- instr->TrueLabel(chunk_), instr->FalseLabel(chunk_));
+
+ EmitBranchIfHeapNumber(instr, value);
}
}
@@ -4396,8 +4421,7 @@ void LCodeGen::DoReturn(LReturn* instr) {
int count = 0;
while (!iterator.Done()) {
FPRegister value = FPRegister::FromAllocationIndex(iterator.Current());
- // TODO(jbramley): Make Peek support FPRegisters.
- __ Ldr(value, MemOperand(__ StackPointer(), count * kDoubleSize));
+ __ Peek(value, count * kDoubleSize);
iterator.Advance();
count++;
}
« no previous file with comments | « src/a64/lithium-codegen-a64.h ('k') | src/a64/macro-assembler-a64.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698