OLD | NEW |
1 // Copyright 2009 the V8 project authors. All rights reserved. | 1 // Copyright 2009 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 1574 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1585 cc = eq; | 1585 cc = eq; |
1586 __ pop(r0); | 1586 __ pop(r0); |
1587 __ pop(r1); | 1587 __ pop(r1); |
1588 break; | 1588 break; |
1589 case Token::LT: | 1589 case Token::LT: |
1590 cc = lt; | 1590 cc = lt; |
1591 __ pop(r0); | 1591 __ pop(r0); |
1592 __ pop(r1); | 1592 __ pop(r1); |
1593 break; | 1593 break; |
1594 case Token::GT: | 1594 case Token::GT: |
1595 // Reverse left and right sizes to obtain ECMA-262 conversion order. | 1595 // Reverse left and right sides to obtain ECMA-262 conversion order. |
1596 cc = lt; | 1596 cc = lt; |
1597 __ pop(r1); | 1597 __ pop(r1); |
1598 __ pop(r0); | 1598 __ pop(r0); |
1599 break; | 1599 break; |
1600 case Token::LTE: | 1600 case Token::LTE: |
1601 // Reverse left and right sizes to obtain ECMA-262 conversion order. | 1601 // Reverse left and right sides to obtain ECMA-262 conversion order. |
1602 cc = ge; | 1602 cc = ge; |
1603 __ pop(r1); | 1603 __ pop(r1); |
1604 __ pop(r0); | 1604 __ pop(r0); |
1605 break; | 1605 break; |
1606 case Token::GTE: | 1606 case Token::GTE: |
1607 cc = ge; | 1607 cc = ge; |
1608 __ pop(r0); | 1608 __ pop(r0); |
1609 __ pop(r1); | 1609 __ pop(r1); |
1610 break; | 1610 break; |
1611 case Token::IN: | 1611 case Token::IN: |
1612 case Token::INSTANCEOF: | 1612 case Token::INSTANCEOF: |
1613 default: | 1613 default: |
1614 UNREACHABLE(); | 1614 UNREACHABLE(); |
1615 } | 1615 } |
1616 | 1616 |
1617 // The comparison stub expects the smi vs. smi case to be handled | 1617 // The comparison stub expects the smi vs. smi case to be handled |
1618 // before it is called. | 1618 // before it is called. |
1619 Label slow_case; | 1619 Label slow_case; |
1620 __ orr(r2, r0, Operand(r1)); | 1620 __ orr(r2, r0, Operand(r1)); |
1621 __ tst(r2, Operand(kSmiTagMask)); | 1621 __ tst(r2, Operand(kSmiTagMask)); |
1622 __ b(ne, &slow_case); | 1622 __ b(ne, &slow_case); |
1623 __ cmp(r1, r0); | 1623 __ cmp(r1, r0); |
1624 __ b(cc, if_true); | 1624 __ b(cc, if_true); |
1625 __ jmp(if_false); | 1625 __ jmp(if_false); |
1626 | 1626 |
1627 __ bind(&slow_case); | 1627 __ bind(&slow_case); |
1628 CompareStub stub(cc, strict); | 1628 CompareStub stub(cc, strict); |
1629 __ CallStub(&stub); | 1629 __ CallStub(&stub); |
1630 __ tst(r0, r0); | 1630 __ cmp(r0, Operand(0)); |
1631 __ b(cc, if_true); | 1631 __ b(cc, if_true); |
1632 __ jmp(if_false); | 1632 __ jmp(if_false); |
1633 } | 1633 } |
1634 } | 1634 } |
1635 | 1635 |
1636 // Convert the result of the comparison into one expected for this | 1636 // Convert the result of the comparison into one expected for this |
1637 // expression's context. | 1637 // expression's context. |
1638 switch (expr->context()) { | 1638 switch (expr->context()) { |
1639 case Expression::kUninitialized: | 1639 case Expression::kUninitialized: |
1640 UNREACHABLE(); | 1640 UNREACHABLE(); |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1722 __ pop(result_register()); | 1722 __ pop(result_register()); |
1723 ASSERT_EQ(1, kSmiTagSize + kSmiShiftSize); | 1723 ASSERT_EQ(1, kSmiTagSize + kSmiShiftSize); |
1724 __ mov(r1, Operand(r1, ASR, 1)); // Un-smi-tag value. | 1724 __ mov(r1, Operand(r1, ASR, 1)); // Un-smi-tag value. |
1725 __ add(pc, r1, Operand(masm_->CodeObject())); | 1725 __ add(pc, r1, Operand(masm_->CodeObject())); |
1726 } | 1726 } |
1727 | 1727 |
1728 | 1728 |
1729 #undef __ | 1729 #undef __ |
1730 | 1730 |
1731 } } // namespace v8::internal | 1731 } } // namespace v8::internal |
OLD | NEW |