OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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_MIPS_MACRO_ASSEMBLER_MIPS_H_ | 5 #ifndef V8_MIPS_MACRO_ASSEMBLER_MIPS_H_ |
6 #define V8_MIPS_MACRO_ASSEMBLER_MIPS_H_ | 6 #define V8_MIPS_MACRO_ASSEMBLER_MIPS_H_ |
7 | 7 |
8 #include "src/assembler.h" | 8 #include "src/assembler.h" |
9 #include "src/globals.h" | 9 #include "src/globals.h" |
10 #include "src/mips64/assembler-mips64.h" | 10 #include "src/mips64/assembler-mips64.h" |
(...skipping 1077 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1088 // Load the global object from the current context. | 1088 // Load the global object from the current context. |
1089 void LoadGlobalObject(Register dst) { | 1089 void LoadGlobalObject(Register dst) { |
1090 LoadNativeContextSlot(Context::EXTENSION_INDEX, dst); | 1090 LoadNativeContextSlot(Context::EXTENSION_INDEX, dst); |
1091 } | 1091 } |
1092 | 1092 |
1093 // Load the global proxy from the current context. | 1093 // Load the global proxy from the current context. |
1094 void LoadGlobalProxy(Register dst) { | 1094 void LoadGlobalProxy(Register dst) { |
1095 LoadNativeContextSlot(Context::GLOBAL_PROXY_INDEX, dst); | 1095 LoadNativeContextSlot(Context::GLOBAL_PROXY_INDEX, dst); |
1096 } | 1096 } |
1097 | 1097 |
1098 // Conditionally load the cached Array transitioned map of type | |
1099 // transitioned_kind from the native context if the map in register | |
1100 // map_in_out is the cached Array map in the native context of | |
1101 // expected_kind. | |
1102 void LoadTransitionedArrayMapConditional( | |
1103 ElementsKind expected_kind, | |
1104 ElementsKind transitioned_kind, | |
1105 Register map_in_out, | |
1106 Register scratch, | |
1107 Label* no_map_match); | |
1108 | |
1109 void LoadNativeContextSlot(int index, Register dst); | 1098 void LoadNativeContextSlot(int index, Register dst); |
1110 | 1099 |
1111 // Load the initial map from the global function. The registers | 1100 // Load the initial map from the global function. The registers |
1112 // function and map can be the same, function is then overwritten. | 1101 // function and map can be the same, function is then overwritten. |
1113 void LoadGlobalFunctionInitialMap(Register function, | 1102 void LoadGlobalFunctionInitialMap(Register function, |
1114 Register map, | 1103 Register map, |
1115 Register scratch); | 1104 Register scratch); |
1116 | 1105 |
1117 void InitializeRootRegister() { | 1106 void InitializeRootRegister() { |
1118 ExternalReference roots_array_start = | 1107 ExternalReference roots_array_start = |
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1210 | 1199 |
1211 void GetObjectType(Register function, | 1200 void GetObjectType(Register function, |
1212 Register map, | 1201 Register map, |
1213 Register type_reg); | 1202 Register type_reg); |
1214 | 1203 |
1215 void GetInstanceType(Register object_map, Register object_instance_type) { | 1204 void GetInstanceType(Register object_map, Register object_instance_type) { |
1216 lbu(object_instance_type, | 1205 lbu(object_instance_type, |
1217 FieldMemOperand(object_map, Map::kInstanceTypeOffset)); | 1206 FieldMemOperand(object_map, Map::kInstanceTypeOffset)); |
1218 } | 1207 } |
1219 | 1208 |
1220 // Check if a map for a JSObject indicates that the object can have both smi | |
1221 // and HeapObject elements. Jump to the specified label if it does not. | |
1222 void CheckFastObjectElements(Register map, | |
1223 Register scratch, | |
1224 Label* fail); | |
1225 | |
1226 // Check if a map for a JSObject indicates that the object has fast smi only | |
1227 // elements. Jump to the specified label if it does not. | |
1228 void CheckFastSmiElements(Register map, | |
1229 Register scratch, | |
1230 Label* fail); | |
1231 | |
1232 // Check to see if maybe_number can be stored as a double in | |
1233 // FastDoubleElements. If it can, store it at the index specified by key in | |
1234 // the FastDoubleElements array elements. Otherwise jump to fail. | |
1235 void StoreNumberToDoubleElements(Register value_reg, | |
1236 Register key_reg, | |
1237 Register elements_reg, | |
1238 Register scratch1, | |
1239 Register scratch2, | |
1240 Label* fail, | |
1241 int elements_offset = 0); | |
1242 | |
1243 // Compare an object's map with the specified map and its transitioned | 1209 // Compare an object's map with the specified map and its transitioned |
1244 // elements maps if mode is ALLOW_ELEMENT_TRANSITION_MAPS. Jumps to | 1210 // elements maps if mode is ALLOW_ELEMENT_TRANSITION_MAPS. Jumps to |
1245 // "branch_to" if the result of the comparison is "cond". If multiple map | 1211 // "branch_to" if the result of the comparison is "cond". If multiple map |
1246 // compares are required, the compare sequences branches to early_success. | 1212 // compares are required, the compare sequences branches to early_success. |
1247 void CompareMapAndBranch(Register obj, | 1213 void CompareMapAndBranch(Register obj, |
1248 Register scratch, | 1214 Register scratch, |
1249 Handle<Map> map, | 1215 Handle<Map> map, |
1250 Label* early_success, | 1216 Label* early_success, |
1251 Condition cond, | 1217 Condition cond, |
1252 Label* branch_to); | 1218 Label* branch_to); |
(...skipping 446 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1699 And(scratch, value, Operand(kSmiTagMask)); | 1665 And(scratch, value, Operand(kSmiTagMask)); |
1700 } | 1666 } |
1701 inline void NonNegativeSmiTst(Register value, Register scratch) { | 1667 inline void NonNegativeSmiTst(Register value, Register scratch) { |
1702 And(scratch, value, Operand(kSmiTagMask | kSmiSignMask)); | 1668 And(scratch, value, Operand(kSmiTagMask | kSmiSignMask)); |
1703 } | 1669 } |
1704 | 1670 |
1705 // Untag the source value into destination and jump if source is a smi. | 1671 // Untag the source value into destination and jump if source is a smi. |
1706 // Source and destination can be the same register. | 1672 // Source and destination can be the same register. |
1707 void UntagAndJumpIfSmi(Register dst, Register src, Label* smi_case); | 1673 void UntagAndJumpIfSmi(Register dst, Register src, Label* smi_case); |
1708 | 1674 |
1709 // Untag the source value into destination and jump if source is not a smi. | |
1710 // Source and destination can be the same register. | |
1711 void UntagAndJumpIfNotSmi(Register dst, Register src, Label* non_smi_case); | |
1712 | |
1713 // Jump the register contains a smi. | 1675 // Jump the register contains a smi. |
1714 void JumpIfSmi(Register value, | 1676 void JumpIfSmi(Register value, |
1715 Label* smi_label, | 1677 Label* smi_label, |
1716 Register scratch = at, | 1678 Register scratch = at, |
1717 BranchDelaySlot bd = PROTECT); | 1679 BranchDelaySlot bd = PROTECT); |
1718 | 1680 |
1719 // Jump if the register contains a non-smi. | 1681 // Jump if the register contains a non-smi. |
1720 void JumpIfNotSmi(Register value, | 1682 void JumpIfNotSmi(Register value, |
1721 Label* not_smi_label, | 1683 Label* not_smi_label, |
1722 Register scratch = at, | 1684 Register scratch = at, |
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1864 | 1826 |
1865 // AllocationMemento support. Arrays may have an associated AllocationMemento | 1827 // AllocationMemento support. Arrays may have an associated AllocationMemento |
1866 // object that can be checked for in order to pretransition to another type. | 1828 // object that can be checked for in order to pretransition to another type. |
1867 // On entry, receiver_reg should point to the array object. scratch_reg gets | 1829 // On entry, receiver_reg should point to the array object. scratch_reg gets |
1868 // clobbered. If no info is present jump to no_memento_found, otherwise fall | 1830 // clobbered. If no info is present jump to no_memento_found, otherwise fall |
1869 // through. | 1831 // through. |
1870 void TestJSArrayForAllocationMemento(Register receiver_reg, | 1832 void TestJSArrayForAllocationMemento(Register receiver_reg, |
1871 Register scratch_reg, | 1833 Register scratch_reg, |
1872 Label* no_memento_found); | 1834 Label* no_memento_found); |
1873 | 1835 |
1874 void JumpIfJSArrayHasAllocationMemento(Register receiver_reg, | |
1875 Register scratch_reg, | |
1876 Label* memento_found) { | |
1877 Label no_memento_found; | |
1878 TestJSArrayForAllocationMemento(receiver_reg, scratch_reg, | |
1879 &no_memento_found); | |
1880 Branch(memento_found); | |
1881 bind(&no_memento_found); | |
1882 } | |
1883 | |
1884 // Jumps to found label if a prototype map has dictionary elements. | |
1885 void JumpIfDictionaryInPrototypeChain(Register object, Register scratch0, | |
1886 Register scratch1, Label* found); | |
1887 | |
1888 bool IsDoubleZeroRegSet() { return has_double_zero_reg_set_; } | 1836 bool IsDoubleZeroRegSet() { return has_double_zero_reg_set_; } |
1889 | 1837 |
1890 private: | 1838 private: |
1891 void CallCFunctionHelper(Register function, | 1839 void CallCFunctionHelper(Register function, |
1892 int num_reg_arguments, | 1840 int num_reg_arguments, |
1893 int num_double_arguments); | 1841 int num_double_arguments); |
1894 | 1842 |
1895 inline Register GetRtAsRegisterHelper(const Operand& rt, Register scratch); | 1843 inline Register GetRtAsRegisterHelper(const Operand& rt, Register scratch); |
1896 inline int32_t GetOffset(int32_t offset, Label* L, OffsetSize bits); | 1844 inline int32_t GetOffset(int32_t offset, Label* L, OffsetSize bits); |
1897 void BranchShortHelperR6(int32_t offset, Label* L); | 1845 void BranchShortHelperR6(int32_t offset, Label* L); |
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2040 dd(GetLabelFunction(index)); | 1988 dd(GetLabelFunction(index)); |
2041 } | 1989 } |
2042 } | 1990 } |
2043 | 1991 |
2044 #define ACCESS_MASM(masm) masm-> | 1992 #define ACCESS_MASM(masm) masm-> |
2045 | 1993 |
2046 } // namespace internal | 1994 } // namespace internal |
2047 } // namespace v8 | 1995 } // namespace v8 |
2048 | 1996 |
2049 #endif // V8_MIPS_MACRO_ASSEMBLER_MIPS_H_ | 1997 #endif // V8_MIPS_MACRO_ASSEMBLER_MIPS_H_ |
OLD | NEW |