| OLD | NEW |
| 1 // Copyright 2010 the V8 project authors. All rights reserved. | 1 // Copyright 2010 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 2755 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2766 | 2766 |
| 2767 // Inline number comparison. | 2767 // Inline number comparison. |
| 2768 if (inline_number_compare) { | 2768 if (inline_number_compare) { |
| 2769 GenerateInlineNumberComparison(&left_side, &right_side, cc, dest); | 2769 GenerateInlineNumberComparison(&left_side, &right_side, cc, dest); |
| 2770 } | 2770 } |
| 2771 | 2771 |
| 2772 // End of in-line compare, call out to the compare stub. Don't include | 2772 // End of in-line compare, call out to the compare stub. Don't include |
| 2773 // number comparison in the stub if it was inlined. | 2773 // number comparison in the stub if it was inlined. |
| 2774 CompareStub stub(cc, strict, nan_info, !inline_number_compare); | 2774 CompareStub stub(cc, strict, nan_info, !inline_number_compare); |
| 2775 Result answer = frame_->CallStub(&stub, &left_side, &right_side); | 2775 Result answer = frame_->CallStub(&stub, &left_side, &right_side); |
| 2776 if (cc == equal) { | 2776 __ test(answer.reg(), Operand(answer.reg())); |
| 2777 __ test(answer.reg(), Operand(answer.reg())); | |
| 2778 } else { | |
| 2779 __ cmp(answer.reg(), 0); | |
| 2780 } | |
| 2781 answer.Unuse(); | 2777 answer.Unuse(); |
| 2782 dest->Split(cc); | 2778 dest->Split(cc); |
| 2783 } else { | 2779 } else { |
| 2784 // Here we split control flow to the stub call and inlined cases | 2780 // Here we split control flow to the stub call and inlined cases |
| 2785 // before finally splitting it to the control destination. We use | 2781 // before finally splitting it to the control destination. We use |
| 2786 // a jump target and branching to duplicate the virtual frame at | 2782 // a jump target and branching to duplicate the virtual frame at |
| 2787 // the first split. We manually handle the off-frame references | 2783 // the first split. We manually handle the off-frame references |
| 2788 // by reconstituting them on the non-fall-through path. | 2784 // by reconstituting them on the non-fall-through path. |
| 2789 JumpTarget is_smi; | 2785 JumpTarget is_smi; |
| 2790 Register left_reg = left_side.reg(); | 2786 Register left_reg = left_side.reg(); |
| (...skipping 10129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 12920 | 12916 |
| 12921 // Call the runtime; it returns -1 (less), 0 (equal), or 1 (greater) | 12917 // Call the runtime; it returns -1 (less), 0 (equal), or 1 (greater) |
| 12922 // tagged as a small integer. | 12918 // tagged as a small integer. |
| 12923 __ bind(&runtime); | 12919 __ bind(&runtime); |
| 12924 __ TailCallRuntime(Runtime::kStringCompare, 2, 1); | 12920 __ TailCallRuntime(Runtime::kStringCompare, 2, 1); |
| 12925 } | 12921 } |
| 12926 | 12922 |
| 12927 #undef __ | 12923 #undef __ |
| 12928 | 12924 |
| 12929 } } // namespace v8::internal | 12925 } } // namespace v8::internal |
| OLD | NEW |