| OLD | NEW |
| 1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 the V8 project authors. All rights reserved. |
| 2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
| 3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
| 4 // met: | 4 // met: |
| 5 // | 5 // |
| 6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
| 7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
| 8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
| 9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
| 10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
| (...skipping 547 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 558 } else { | 558 } else { |
| 559 if (false_label_ != fall_through_) __ b(false_label_); | 559 if (false_label_ != fall_through_) __ b(false_label_); |
| 560 } | 560 } |
| 561 } | 561 } |
| 562 | 562 |
| 563 | 563 |
| 564 void FullCodeGenerator::DoTest(Label* if_true, | 564 void FullCodeGenerator::DoTest(Label* if_true, |
| 565 Label* if_false, | 565 Label* if_false, |
| 566 Label* fall_through) { | 566 Label* fall_through) { |
| 567 if (CpuFeatures::IsSupported(VFP3)) { | 567 if (CpuFeatures::IsSupported(VFP3)) { |
| 568 CpuFeatures::Scope scope(VFP3); | |
| 569 // Emit the inlined tests assumed by the stub. | |
| 570 __ LoadRoot(ip, Heap::kUndefinedValueRootIndex); | |
| 571 __ cmp(result_register(), ip); | |
| 572 __ b(eq, if_false); | |
| 573 __ LoadRoot(ip, Heap::kTrueValueRootIndex); | |
| 574 __ cmp(result_register(), ip); | |
| 575 __ b(eq, if_true); | |
| 576 __ LoadRoot(ip, Heap::kFalseValueRootIndex); | |
| 577 __ cmp(result_register(), ip); | |
| 578 __ b(eq, if_false); | |
| 579 STATIC_ASSERT(kSmiTag == 0); | |
| 580 __ tst(result_register(), result_register()); | |
| 581 __ b(eq, if_false); | |
| 582 __ JumpIfSmi(result_register(), if_true); | |
| 583 | |
| 584 // Call the ToBoolean stub for all other cases. | |
| 585 ToBooleanStub stub(result_register()); | 568 ToBooleanStub stub(result_register()); |
| 586 __ CallStub(&stub); | 569 __ CallStub(&stub); |
| 587 __ tst(result_register(), result_register()); | 570 __ tst(result_register(), result_register()); |
| 588 } else { | 571 } else { |
| 589 // Call the runtime to find the boolean value of the source and then | 572 // Call the runtime to find the boolean value of the source and then |
| 590 // translate it into control flow to the pair of labels. | 573 // translate it into control flow to the pair of labels. |
| 591 __ push(result_register()); | 574 __ push(result_register()); |
| 592 __ CallRuntime(Runtime::kToBool, 1); | 575 __ CallRuntime(Runtime::kToBool, 1); |
| 593 __ LoadRoot(ip, Heap::kFalseValueRootIndex); | 576 __ LoadRoot(ip, Heap::kFalseValueRootIndex); |
| 594 __ cmp(r0, ip); | 577 __ cmp(r0, ip); |
| 595 } | 578 } |
| 596 | |
| 597 // The stub returns nonzero for true. | |
| 598 Split(ne, if_true, if_false, fall_through); | 579 Split(ne, if_true, if_false, fall_through); |
| 599 } | 580 } |
| 600 | 581 |
| 601 | 582 |
| 602 void FullCodeGenerator::Split(Condition cond, | 583 void FullCodeGenerator::Split(Condition cond, |
| 603 Label* if_true, | 584 Label* if_true, |
| 604 Label* if_false, | 585 Label* if_false, |
| 605 Label* fall_through) { | 586 Label* fall_through) { |
| 606 if (if_false == fall_through) { | 587 if (if_false == fall_through) { |
| 607 __ b(cond, if_true); | 588 __ b(cond, if_true); |
| (...skipping 3781 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4389 __ mov(r1, Operand(r1, ASR, 1)); // Un-smi-tag value. | 4370 __ mov(r1, Operand(r1, ASR, 1)); // Un-smi-tag value. |
| 4390 __ add(pc, r1, Operand(masm_->CodeObject())); | 4371 __ add(pc, r1, Operand(masm_->CodeObject())); |
| 4391 } | 4372 } |
| 4392 | 4373 |
| 4393 | 4374 |
| 4394 #undef __ | 4375 #undef __ |
| 4395 | 4376 |
| 4396 } } // namespace v8::internal | 4377 } } // namespace v8::internal |
| 4397 | 4378 |
| 4398 #endif // V8_TARGET_ARCH_ARM | 4379 #endif // V8_TARGET_ARCH_ARM |
| OLD | NEW |