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 1592 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1603 | 1603 |
1604 // Do tail-call to runtime routine. | 1604 // Do tail-call to runtime routine. |
1605 ExternalReference ref = miss_mode == MISS_FORCE_GENERIC | 1605 ExternalReference ref = miss_mode == MISS_FORCE_GENERIC |
1606 ? ExternalReference(IC_Utility(kKeyedStoreIC_MissForceGeneric), | 1606 ? ExternalReference(IC_Utility(kKeyedStoreIC_MissForceGeneric), |
1607 masm->isolate()) | 1607 masm->isolate()) |
1608 : ExternalReference(IC_Utility(kKeyedStoreIC_Miss), masm->isolate()); | 1608 : ExternalReference(IC_Utility(kKeyedStoreIC_Miss), masm->isolate()); |
1609 __ TailCallExternalReference(ref, 3, 1); | 1609 __ TailCallExternalReference(ref, 3, 1); |
1610 } | 1610 } |
1611 | 1611 |
1612 | 1612 |
| 1613 void KeyedStoreIC::GenerateTransitionElementsSmiToDouble(MacroAssembler* masm) { |
| 1614 // ----------- S t a t e ------------- |
| 1615 // -- rbx : target map |
| 1616 // -- rdx : receiver |
| 1617 // -- rsp[0] : return address |
| 1618 // ----------------------------------- |
| 1619 // Must return the modified receiver in eax. |
| 1620 if (!FLAG_trace_elements_transitions) { |
| 1621 Label fail; |
| 1622 AllocationSiteMode mode = AllocationSite::GetMode(FAST_SMI_ELEMENTS, |
| 1623 FAST_DOUBLE_ELEMENTS); |
| 1624 ElementsTransitionGenerator::GenerateSmiToDouble(masm, mode, &fail); |
| 1625 __ movq(rax, rdx); |
| 1626 __ Ret(); |
| 1627 __ bind(&fail); |
| 1628 } |
| 1629 |
| 1630 __ pop(rbx); |
| 1631 __ push(rdx); |
| 1632 __ push(rbx); // return address |
| 1633 __ TailCallRuntime(Runtime::kTransitionElementsSmiToDouble, 1, 1); |
| 1634 } |
| 1635 |
| 1636 |
| 1637 void KeyedStoreIC::GenerateTransitionElementsDoubleToObject( |
| 1638 MacroAssembler* masm) { |
| 1639 // ----------- S t a t e ------------- |
| 1640 // -- rbx : target map |
| 1641 // -- rdx : receiver |
| 1642 // -- rsp[0] : return address |
| 1643 // ----------------------------------- |
| 1644 // Must return the modified receiver in eax. |
| 1645 if (!FLAG_trace_elements_transitions) { |
| 1646 Label fail; |
| 1647 AllocationSiteMode mode = AllocationSite::GetMode(FAST_DOUBLE_ELEMENTS, |
| 1648 FAST_ELEMENTS); |
| 1649 ElementsTransitionGenerator::GenerateDoubleToObject(masm, mode, &fail); |
| 1650 __ movq(rax, rdx); |
| 1651 __ Ret(); |
| 1652 __ bind(&fail); |
| 1653 } |
| 1654 |
| 1655 __ pop(rbx); |
| 1656 __ push(rdx); |
| 1657 __ push(rbx); // return address |
| 1658 __ TailCallRuntime(Runtime::kTransitionElementsDoubleToObject, 1, 1); |
| 1659 } |
| 1660 |
| 1661 |
1613 #undef __ | 1662 #undef __ |
1614 | 1663 |
1615 | 1664 |
1616 Condition CompareIC::ComputeCondition(Token::Value op) { | 1665 Condition CompareIC::ComputeCondition(Token::Value op) { |
1617 switch (op) { | 1666 switch (op) { |
1618 case Token::EQ_STRICT: | 1667 case Token::EQ_STRICT: |
1619 case Token::EQ: | 1668 case Token::EQ: |
1620 return equal; | 1669 return equal; |
1621 case Token::LT: | 1670 case Token::LT: |
1622 return less; | 1671 return less; |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1677 Condition cc = (check == ENABLE_INLINED_SMI_CHECK) | 1726 Condition cc = (check == ENABLE_INLINED_SMI_CHECK) |
1678 ? (*jmp_address == Assembler::kJncShortOpcode ? not_zero : zero) | 1727 ? (*jmp_address == Assembler::kJncShortOpcode ? not_zero : zero) |
1679 : (*jmp_address == Assembler::kJnzShortOpcode ? not_carry : carry); | 1728 : (*jmp_address == Assembler::kJnzShortOpcode ? not_carry : carry); |
1680 *jmp_address = static_cast<byte>(Assembler::kJccShortPrefix | cc); | 1729 *jmp_address = static_cast<byte>(Assembler::kJccShortPrefix | cc); |
1681 } | 1730 } |
1682 | 1731 |
1683 | 1732 |
1684 } } // namespace v8::internal | 1733 } } // namespace v8::internal |
1685 | 1734 |
1686 #endif // V8_TARGET_ARCH_X64 | 1735 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |