@@ -172,13 +172,13 @@ bool LGapResolver::CanReach(LGapNode* a, LGapNode* b) {
172172
173173
174174void LGapResolver::RegisterMove (LMoveOperands move) {
175- if (move.from ()->IsConstantOperand ()) {
175+ if (move.source ()->IsConstantOperand ()) {
176176 // Constant moves should be last in the machine code. Therefore add them
177177 // first to the result set.
178- AddResultMove (move.from (), move.to ());
178+ AddResultMove (move.source (), move.destination ());
179179 } else {
180- LGapNode* from = LookupNode (move.from ());
181- LGapNode* to = LookupNode (move.to ());
180+ LGapNode* from = LookupNode (move.source ());
181+ LGapNode* to = LookupNode (move.destination ());
182182 if (to->IsAssigned () && to->assigned_from () == from) {
183183 move.Eliminate ();
184184 return ;
@@ -341,6 +341,11 @@ bool LCodeGen::GenerateDeferredCode() {
341341 __ jmp (code->exit ());
342342 }
343343
344+ // Force constant pool emission at the end of deferred code to make
345+ // sure that no constant pools are emitted after the official end of
346+ // the instruction sequence.
347+ masm ()->CheckConstPool (true , false );
348+
344349 // Deferred code is the last part of the instruction sequence. Mark
345350 // the generated code as done unless we bailed out.
346351 if (!is_aborted ()) status_ = DONE ;
@@ -816,8 +821,8 @@ void LCodeGen::DoParallelMove(LParallelMove* move) {
816821 resolver_.Resolve (move->move_operands (), &marker_operand);
817822 for (int i = moves->length () - 1 ; i >= 0 ; --i) {
818823 LMoveOperands move = moves->at (i);
819- LOperand* from = move.from ();
820- LOperand* to = move.to ();
824+ LOperand* from = move.source ();
825+ LOperand* to = move.destination ();
821826 ASSERT (!from->IsDoubleRegister () ||
822827 !ToDoubleRegister (from).is (dbl_scratch));
823828 ASSERT (!to->IsDoubleRegister () || !ToDoubleRegister (to).is (dbl_scratch));
@@ -999,7 +1004,6 @@ void LCodeGen::DoUnknownOSRValue(LUnknownOSRValue* instr) {
9991004
10001005
10011006void LCodeGen::DoModI (LModI* instr) {
1002- Abort (" ModI not implemented" );
10031007 class DeferredModI : public LDeferredCode {
10041008 public:
10051009 DeferredModI (LCodeGen* codegen, LModI* instr)
@@ -1055,7 +1059,6 @@ void LCodeGen::DoModI(LModI* instr) {
10551059
10561060
10571061void LCodeGen::DoDivI (LDivI* instr) {
1058- Abort (" DivI not implemented" );
10591062 class DeferredDivI : public LDeferredCode {
10601063 public:
10611064 DeferredDivI (LCodeGen* codegen, LDivI* instr)
@@ -1293,7 +1296,10 @@ void LCodeGen::DoConstantI(LConstantI* instr) {
12931296
12941297
12951298void LCodeGen::DoConstantD (LConstantD* instr) {
1296- Abort (" DoConstantD unimplemented." );
1299+ ASSERT (instr->result ()->IsDoubleRegister ());
1300+ DwVfpRegister result = ToDoubleRegister (instr->result ());
1301+ double v = instr->value ();
1302+ __ vmov (result, v);
12971303}
12981304
12991305
@@ -2336,6 +2342,15 @@ void LCodeGen::DoMathFloor(LUnaryMathOperation* instr) {
23362342
23372343 // Move the result back to general purpose register r0.
23382344 __ vmov (result, single_scratch);
2345+
2346+ // Test for -0.
2347+ Label done;
2348+ __ cmp (result, Operand (0 ));
2349+ __ b (ne, &done);
2350+ __ vmov (scratch, input.high ());
2351+ __ tst (scratch, Operand (HeapNumber::kSignMask ));
2352+ DeoptimizeIf (ne, instr->environment ());
2353+ __ bind (&done);
23392354}
23402355
23412356
0 commit comments