| 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++;
|
| }
|
|
|