| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 655 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 666 } else { | 666 } else { |
| 667 if (false_label_ != fall_through_) __ b(false_label_); | 667 if (false_label_ != fall_through_) __ b(false_label_); |
| 668 } | 668 } |
| 669 } | 669 } |
| 670 | 670 |
| 671 | 671 |
| 672 void FullCodeGenerator::DoTest(Expression* condition, | 672 void FullCodeGenerator::DoTest(Expression* condition, |
| 673 Label* if_true, | 673 Label* if_true, |
| 674 Label* if_false, | 674 Label* if_false, |
| 675 Label* fall_through) { | 675 Label* fall_through) { |
| 676 if (CpuFeatures::IsSupported(VFP2)) { | 676 ToBooleanStub stub(result_register()); |
| 677 ToBooleanStub stub(result_register()); | 677 __ CallStub(&stub); |
| 678 __ CallStub(&stub); | 678 __ tst(result_register(), result_register()); |
| 679 __ tst(result_register(), result_register()); | |
| 680 } else { | |
| 681 // Call the runtime to find the boolean value of the source and then | |
| 682 // translate it into control flow to the pair of labels. | |
| 683 __ push(result_register()); | |
| 684 __ CallRuntime(Runtime::kToBool, 1); | |
| 685 __ LoadRoot(ip, Heap::kFalseValueRootIndex); | |
| 686 __ cmp(r0, ip); | |
| 687 } | |
| 688 Split(ne, if_true, if_false, fall_through); | 679 Split(ne, if_true, if_false, fall_through); |
| 689 } | 680 } |
| 690 | 681 |
| 691 | 682 |
| 692 void FullCodeGenerator::Split(Condition cond, | 683 void FullCodeGenerator::Split(Condition cond, |
| 693 Label* if_true, | 684 Label* if_true, |
| 694 Label* if_false, | 685 Label* if_false, |
| 695 Label* fall_through) { | 686 Label* fall_through) { |
| 696 if (if_false == fall_through) { | 687 if (if_false == fall_through) { |
| 697 __ b(cond, if_true); | 688 __ b(cond, if_true); |
| (...skipping 3875 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4573 *context_length = 0; | 4564 *context_length = 0; |
| 4574 return previous_; | 4565 return previous_; |
| 4575 } | 4566 } |
| 4576 | 4567 |
| 4577 | 4568 |
| 4578 #undef __ | 4569 #undef __ |
| 4579 | 4570 |
| 4580 } } // namespace v8::internal | 4571 } } // namespace v8::internal |
| 4581 | 4572 |
| 4582 #endif // V8_TARGET_ARCH_ARM | 4573 #endif // V8_TARGET_ARCH_ARM |
| OLD | NEW |