| OLD | NEW |
| 1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef V8_S390_MACRO_ASSEMBLER_S390_H_ | 5 #ifndef V8_S390_MACRO_ASSEMBLER_S390_H_ |
| 6 #define V8_S390_MACRO_ASSEMBLER_S390_H_ | 6 #define V8_S390_MACRO_ASSEMBLER_S390_H_ |
| 7 | 7 |
| 8 #include "src/assembler.h" | 8 #include "src/assembler.h" |
| 9 #include "src/bailout-reason.h" | 9 #include "src/bailout-reason.h" |
| 10 #include "src/frames.h" | 10 #include "src/frames.h" |
| (...skipping 766 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 777 // Load the global object from the current context. | 777 // Load the global object from the current context. |
| 778 void LoadGlobalObject(Register dst) { | 778 void LoadGlobalObject(Register dst) { |
| 779 LoadNativeContextSlot(Context::EXTENSION_INDEX, dst); | 779 LoadNativeContextSlot(Context::EXTENSION_INDEX, dst); |
| 780 } | 780 } |
| 781 | 781 |
| 782 // Load the global proxy from the current context. | 782 // Load the global proxy from the current context. |
| 783 void LoadGlobalProxy(Register dst) { | 783 void LoadGlobalProxy(Register dst) { |
| 784 LoadNativeContextSlot(Context::GLOBAL_PROXY_INDEX, dst); | 784 LoadNativeContextSlot(Context::GLOBAL_PROXY_INDEX, dst); |
| 785 } | 785 } |
| 786 | 786 |
| 787 // Conditionally load the cached Array transitioned map of type | |
| 788 // transitioned_kind from the native context if the map in register | |
| 789 // map_in_out is the cached Array map in the native context of | |
| 790 // expected_kind. | |
| 791 void LoadTransitionedArrayMapConditional(ElementsKind expected_kind, | |
| 792 ElementsKind transitioned_kind, | |
| 793 Register map_in_out, | |
| 794 Register scratch, | |
| 795 Label* no_map_match); | |
| 796 | |
| 797 void LoadNativeContextSlot(int index, Register dst); | 787 void LoadNativeContextSlot(int index, Register dst); |
| 798 | 788 |
| 799 // Load the initial map from the global function. The registers | 789 // Load the initial map from the global function. The registers |
| 800 // function and map can be the same, function is then overwritten. | 790 // function and map can be the same, function is then overwritten. |
| 801 void LoadGlobalFunctionInitialMap(Register function, Register map, | 791 void LoadGlobalFunctionInitialMap(Register function, Register map, |
| 802 Register scratch); | 792 Register scratch); |
| 803 | 793 |
| 804 void InitializeRootRegister() { | 794 void InitializeRootRegister() { |
| 805 ExternalReference roots_array_start = | 795 ExternalReference roots_array_start = |
| 806 ExternalReference::roots_array_start(isolate()); | 796 ExternalReference::roots_array_start(isolate()); |
| (...skipping 257 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1064 // other registers. | 1054 // other registers. |
| 1065 // Type_reg can be no_reg. In that case ip is used. | 1055 // Type_reg can be no_reg. In that case ip is used. |
| 1066 void CompareObjectType(Register heap_object, Register map, Register type_reg, | 1056 void CompareObjectType(Register heap_object, Register map, Register type_reg, |
| 1067 InstanceType type); | 1057 InstanceType type); |
| 1068 | 1058 |
| 1069 // Compare instance type in a map. map contains a valid map object whose | 1059 // Compare instance type in a map. map contains a valid map object whose |
| 1070 // object type should be compared with the given type. This both | 1060 // object type should be compared with the given type. This both |
| 1071 // sets the flags and leaves the object type in the type_reg register. | 1061 // sets the flags and leaves the object type in the type_reg register. |
| 1072 void CompareInstanceType(Register map, Register type_reg, InstanceType type); | 1062 void CompareInstanceType(Register map, Register type_reg, InstanceType type); |
| 1073 | 1063 |
| 1074 // Check if a map for a JSObject indicates that the object can have both smi | |
| 1075 // and HeapObject elements. Jump to the specified label if it does not. | |
| 1076 void CheckFastObjectElements(Register map, Register scratch, Label* fail); | |
| 1077 | |
| 1078 // Check if a map for a JSObject indicates that the object has fast smi only | |
| 1079 // elements. Jump to the specified label if it does not. | |
| 1080 void CheckFastSmiElements(Register map, Register scratch, Label* fail); | |
| 1081 | |
| 1082 // Check to see if maybe_number can be stored as a double in | |
| 1083 // FastDoubleElements. If it can, store it at the index specified by key in | |
| 1084 // the FastDoubleElements array elements. Otherwise jump to fail. | |
| 1085 void StoreNumberToDoubleElements(Register value_reg, Register key_reg, | |
| 1086 Register elements_reg, Register scratch1, | |
| 1087 DoubleRegister double_scratch, Label* fail, | |
| 1088 int elements_offset = 0); | |
| 1089 | |
| 1090 // Compare an object's map with the specified map and its transitioned | 1064 // Compare an object's map with the specified map and its transitioned |
| 1091 // elements maps if mode is ALLOW_ELEMENT_TRANSITION_MAPS. Condition flags are | 1065 // elements maps if mode is ALLOW_ELEMENT_TRANSITION_MAPS. Condition flags are |
| 1092 // set with result of map compare. If multiple map compares are required, the | 1066 // set with result of map compare. If multiple map compares are required, the |
| 1093 // compare sequences branches to early_success. | 1067 // compare sequences branches to early_success. |
| 1094 void CompareMap(Register obj, Register scratch, Handle<Map> map, | 1068 void CompareMap(Register obj, Register scratch, Handle<Map> map, |
| 1095 Label* early_success); | 1069 Label* early_success); |
| 1096 | 1070 |
| 1097 // As above, but the map of the object is already loaded into the register | 1071 // As above, but the map of the object is already loaded into the register |
| 1098 // which is preserved by the code generated. | 1072 // which is preserved by the code generated. |
| 1099 void CompareMap(Register obj_map, Handle<Map> map, Label* early_success); | 1073 void CompareMap(Register obj_map, Handle<Map> map, Label* early_success); |
| (...skipping 469 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1569 risbg(dst, src, Operand(32 - elementSizeLog2), | 1543 risbg(dst, src, Operand(32 - elementSizeLog2), |
| 1570 Operand(63 - elementSizeLog2), Operand(elementSizeLog2), | 1544 Operand(63 - elementSizeLog2), Operand(elementSizeLog2), |
| 1571 true); | 1545 true); |
| 1572 } | 1546 } |
| 1573 } | 1547 } |
| 1574 | 1548 |
| 1575 // Untag the source value into destination and jump if source is a smi. | 1549 // Untag the source value into destination and jump if source is a smi. |
| 1576 // Souce and destination can be the same register. | 1550 // Souce and destination can be the same register. |
| 1577 void UntagAndJumpIfSmi(Register dst, Register src, Label* smi_case); | 1551 void UntagAndJumpIfSmi(Register dst, Register src, Label* smi_case); |
| 1578 | 1552 |
| 1579 // Untag the source value into destination and jump if source is not a smi. | |
| 1580 // Souce and destination can be the same register. | |
| 1581 void UntagAndJumpIfNotSmi(Register dst, Register src, Label* non_smi_case); | |
| 1582 | |
| 1583 inline void TestIfSmi(Register value) { tmll(value, Operand(1)); } | 1553 inline void TestIfSmi(Register value) { tmll(value, Operand(1)); } |
| 1584 | 1554 |
| 1585 inline void TestIfPositiveSmi(Register value, Register scratch) { | 1555 inline void TestIfPositiveSmi(Register value, Register scratch) { |
| 1586 STATIC_ASSERT((kSmiTagMask | kSmiSignMask) == | 1556 STATIC_ASSERT((kSmiTagMask | kSmiSignMask) == |
| 1587 (intptr_t)(1UL << (kBitsPerPointer - 1) | 1)); | 1557 (intptr_t)(1UL << (kBitsPerPointer - 1) | 1)); |
| 1588 mov(scratch, Operand(kIntptrSignBit | kSmiTagMask)); | 1558 mov(scratch, Operand(kIntptrSignBit | kSmiTagMask)); |
| 1589 AndP(scratch, value); | 1559 AndP(scratch, value); |
| 1590 } | 1560 } |
| 1591 | 1561 |
| 1592 // Jump the register contains a smi. | 1562 // Jump the register contains a smi. |
| (...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1765 // AllocationMemento object that can be checked for in order to pretransition | 1735 // AllocationMemento object that can be checked for in order to pretransition |
| 1766 // to another type. | 1736 // to another type. |
| 1767 // On entry, receiver_reg should point to the array object. | 1737 // On entry, receiver_reg should point to the array object. |
| 1768 // scratch_reg gets clobbered. | 1738 // scratch_reg gets clobbered. |
| 1769 // If allocation info is present, condition flags are set to eq. | 1739 // If allocation info is present, condition flags are set to eq. |
| 1770 void TestJSArrayForAllocationMemento(Register receiver_reg, | 1740 void TestJSArrayForAllocationMemento(Register receiver_reg, |
| 1771 Register scratch_reg, | 1741 Register scratch_reg, |
| 1772 Register scratch2_reg, | 1742 Register scratch2_reg, |
| 1773 Label* no_memento_found); | 1743 Label* no_memento_found); |
| 1774 | 1744 |
| 1775 void JumpIfJSArrayHasAllocationMemento(Register receiver_reg, | |
| 1776 Register scratch_reg, | |
| 1777 Register scratch2_reg, | |
| 1778 Label* memento_found) { | |
| 1779 Label no_memento_found; | |
| 1780 TestJSArrayForAllocationMemento(receiver_reg, scratch_reg, scratch2_reg, | |
| 1781 &no_memento_found); | |
| 1782 beq(memento_found); | |
| 1783 bind(&no_memento_found); | |
| 1784 } | |
| 1785 | |
| 1786 // Jumps to found label if a prototype map has dictionary elements. | |
| 1787 void JumpIfDictionaryInPrototypeChain(Register object, Register scratch0, | |
| 1788 Register scratch1, Label* found); | |
| 1789 | |
| 1790 private: | 1745 private: |
| 1791 static const int kSmiShift = kSmiTagSize + kSmiShiftSize; | 1746 static const int kSmiShift = kSmiTagSize + kSmiShiftSize; |
| 1792 | 1747 |
| 1793 void CallCFunctionHelper(Register function, int num_reg_arguments, | 1748 void CallCFunctionHelper(Register function, int num_reg_arguments, |
| 1794 int num_double_arguments); | 1749 int num_double_arguments); |
| 1795 | 1750 |
| 1796 void Jump(intptr_t target, RelocInfo::Mode rmode, Condition cond = al, | 1751 void Jump(intptr_t target, RelocInfo::Mode rmode, Condition cond = al, |
| 1797 CRegister cr = cr7); | 1752 CRegister cr = cr7); |
| 1798 | 1753 |
| 1799 // Helper functions for generating invokes. | 1754 // Helper functions for generating invokes. |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1868 inline MemOperand NativeContextMemOperand() { | 1823 inline MemOperand NativeContextMemOperand() { |
| 1869 return ContextMemOperand(cp, Context::NATIVE_CONTEXT_INDEX); | 1824 return ContextMemOperand(cp, Context::NATIVE_CONTEXT_INDEX); |
| 1870 } | 1825 } |
| 1871 | 1826 |
| 1872 #define ACCESS_MASM(masm) masm-> | 1827 #define ACCESS_MASM(masm) masm-> |
| 1873 | 1828 |
| 1874 } // namespace internal | 1829 } // namespace internal |
| 1875 } // namespace v8 | 1830 } // namespace v8 |
| 1876 | 1831 |
| 1877 #endif // V8_S390_MACRO_ASSEMBLER_S390_H_ | 1832 #endif // V8_S390_MACRO_ASSEMBLER_S390_H_ |
| OLD | NEW |