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/mips/assembler-mips.h" | 10 #include "src/mips/assembler-mips.h" |
(...skipping 1019 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1030 // Load the global object from the current context. | 1030 // Load the global object from the current context. |
1031 void LoadGlobalObject(Register dst) { | 1031 void LoadGlobalObject(Register dst) { |
1032 LoadNativeContextSlot(Context::EXTENSION_INDEX, dst); | 1032 LoadNativeContextSlot(Context::EXTENSION_INDEX, dst); |
1033 } | 1033 } |
1034 | 1034 |
1035 // Load the global proxy from the current context. | 1035 // Load the global proxy from the current context. |
1036 void LoadGlobalProxy(Register dst) { | 1036 void LoadGlobalProxy(Register dst) { |
1037 LoadNativeContextSlot(Context::GLOBAL_PROXY_INDEX, dst); | 1037 LoadNativeContextSlot(Context::GLOBAL_PROXY_INDEX, dst); |
1038 } | 1038 } |
1039 | 1039 |
1040 // Conditionally load the cached Array transitioned map of type | |
1041 // transitioned_kind from the native context if the map in register | |
1042 // map_in_out is the cached Array map in the native context of | |
1043 // expected_kind. | |
1044 void LoadTransitionedArrayMapConditional( | |
1045 ElementsKind expected_kind, | |
1046 ElementsKind transitioned_kind, | |
1047 Register map_in_out, | |
1048 Register scratch, | |
1049 Label* no_map_match); | |
1050 | |
1051 void LoadNativeContextSlot(int index, Register dst); | 1040 void LoadNativeContextSlot(int index, Register dst); |
1052 | 1041 |
1053 // Load the initial map from the global function. The registers | 1042 // Load the initial map from the global function. The registers |
1054 // function and map can be the same, function is then overwritten. | 1043 // function and map can be the same, function is then overwritten. |
1055 void LoadGlobalFunctionInitialMap(Register function, | 1044 void LoadGlobalFunctionInitialMap(Register function, |
1056 Register map, | 1045 Register map, |
1057 Register scratch); | 1046 Register scratch); |
1058 | 1047 |
1059 void InitializeRootRegister() { | 1048 void InitializeRootRegister() { |
1060 ExternalReference roots_array_start = | 1049 ExternalReference roots_array_start = |
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1151 | 1140 |
1152 void GetObjectType(Register function, | 1141 void GetObjectType(Register function, |
1153 Register map, | 1142 Register map, |
1154 Register type_reg); | 1143 Register type_reg); |
1155 | 1144 |
1156 void GetInstanceType(Register object_map, Register object_instance_type) { | 1145 void GetInstanceType(Register object_map, Register object_instance_type) { |
1157 lbu(object_instance_type, | 1146 lbu(object_instance_type, |
1158 FieldMemOperand(object_map, Map::kInstanceTypeOffset)); | 1147 FieldMemOperand(object_map, Map::kInstanceTypeOffset)); |
1159 } | 1148 } |
1160 | 1149 |
1161 // Check if a map for a JSObject indicates that the object can have both smi | |
1162 // and HeapObject elements. Jump to the specified label if it does not. | |
1163 void CheckFastObjectElements(Register map, | |
1164 Register scratch, | |
1165 Label* fail); | |
1166 | |
1167 // Check if a map for a JSObject indicates that the object has fast smi only | |
1168 // elements. Jump to the specified label if it does not. | |
1169 void CheckFastSmiElements(Register map, | |
1170 Register scratch, | |
1171 Label* fail); | |
1172 | |
1173 // Check to see if maybe_number can be stored as a double in | |
1174 // FastDoubleElements. If it can, store it at the index specified by key in | |
1175 // the FastDoubleElements array elements. Otherwise jump to fail. | |
1176 void StoreNumberToDoubleElements(Register value_reg, | |
1177 Register key_reg, | |
1178 Register elements_reg, | |
1179 Register scratch1, | |
1180 Register scratch2, | |
1181 Register scratch3, | |
1182 Label* fail, | |
1183 int elements_offset = 0); | |
1184 | |
1185 // Compare an object's map with the specified map and its transitioned | 1150 // Compare an object's map with the specified map and its transitioned |
1186 // elements maps if mode is ALLOW_ELEMENT_TRANSITION_MAPS. Jumps to | 1151 // elements maps if mode is ALLOW_ELEMENT_TRANSITION_MAPS. Jumps to |
1187 // "branch_to" if the result of the comparison is "cond". If multiple map | 1152 // "branch_to" if the result of the comparison is "cond". If multiple map |
1188 // compares are required, the compare sequences branches to early_success. | 1153 // compares are required, the compare sequences branches to early_success. |
1189 void CompareMapAndBranch(Register obj, | 1154 void CompareMapAndBranch(Register obj, |
1190 Register scratch, | 1155 Register scratch, |
1191 Handle<Map> map, | 1156 Handle<Map> map, |
1192 Label* early_success, | 1157 Label* early_success, |
1193 Condition cond, | 1158 Condition cond, |
1194 Label* branch_to); | 1159 Label* branch_to); |
(...skipping 355 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1550 And(scratch, value, Operand(kSmiTagMask)); | 1515 And(scratch, value, Operand(kSmiTagMask)); |
1551 } | 1516 } |
1552 inline void NonNegativeSmiTst(Register value, Register scratch) { | 1517 inline void NonNegativeSmiTst(Register value, Register scratch) { |
1553 And(scratch, value, Operand(kSmiTagMask | kSmiSignMask)); | 1518 And(scratch, value, Operand(kSmiTagMask | kSmiSignMask)); |
1554 } | 1519 } |
1555 | 1520 |
1556 // Untag the source value into destination and jump if source is a smi. | 1521 // Untag the source value into destination and jump if source is a smi. |
1557 // Souce and destination can be the same register. | 1522 // Souce and destination can be the same register. |
1558 void UntagAndJumpIfSmi(Register dst, Register src, Label* smi_case); | 1523 void UntagAndJumpIfSmi(Register dst, Register src, Label* smi_case); |
1559 | 1524 |
1560 // Untag the source value into destination and jump if source is not a smi. | |
1561 // Souce and destination can be the same register. | |
1562 void UntagAndJumpIfNotSmi(Register dst, Register src, Label* non_smi_case); | |
1563 | |
1564 // Jump the register contains a smi. | 1525 // Jump the register contains a smi. |
1565 void JumpIfSmi(Register value, | 1526 void JumpIfSmi(Register value, |
1566 Label* smi_label, | 1527 Label* smi_label, |
1567 Register scratch = at, | 1528 Register scratch = at, |
1568 BranchDelaySlot bd = PROTECT); | 1529 BranchDelaySlot bd = PROTECT); |
1569 | 1530 |
1570 // Jump if the register contains a non-smi. | 1531 // Jump if the register contains a non-smi. |
1571 void JumpIfNotSmi(Register value, | 1532 void JumpIfNotSmi(Register value, |
1572 Label* not_smi_label, | 1533 Label* not_smi_label, |
1573 Register scratch = at, | 1534 Register scratch = at, |
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1724 | 1685 |
1725 // AllocationMemento support. Arrays may have an associated AllocationMemento | 1686 // AllocationMemento support. Arrays may have an associated AllocationMemento |
1726 // object that can be checked for in order to pretransition to another type. | 1687 // object that can be checked for in order to pretransition to another type. |
1727 // On entry, receiver_reg should point to the array object. scratch_reg gets | 1688 // On entry, receiver_reg should point to the array object. scratch_reg gets |
1728 // clobbered. If no info is present jump to no_memento_found, otherwise fall | 1689 // clobbered. If no info is present jump to no_memento_found, otherwise fall |
1729 // through. | 1690 // through. |
1730 void TestJSArrayForAllocationMemento(Register receiver_reg, | 1691 void TestJSArrayForAllocationMemento(Register receiver_reg, |
1731 Register scratch_reg, | 1692 Register scratch_reg, |
1732 Label* no_memento_found); | 1693 Label* no_memento_found); |
1733 | 1694 |
1734 void JumpIfJSArrayHasAllocationMemento(Register receiver_reg, | |
1735 Register scratch_reg, | |
1736 Label* memento_found) { | |
1737 Label no_memento_found; | |
1738 TestJSArrayForAllocationMemento(receiver_reg, scratch_reg, | |
1739 &no_memento_found); | |
1740 Branch(memento_found); | |
1741 bind(&no_memento_found); | |
1742 } | |
1743 | |
1744 // Jumps to found label if a prototype map has dictionary elements. | |
1745 void JumpIfDictionaryInPrototypeChain(Register object, Register scratch0, | |
1746 Register scratch1, Label* found); | |
1747 | |
1748 bool IsDoubleZeroRegSet() { return has_double_zero_reg_set_; } | 1695 bool IsDoubleZeroRegSet() { return has_double_zero_reg_set_; } |
1749 | 1696 |
1750 private: | 1697 private: |
1751 void CallCFunctionHelper(Register function, | 1698 void CallCFunctionHelper(Register function, |
1752 int num_reg_arguments, | 1699 int num_reg_arguments, |
1753 int num_double_arguments); | 1700 int num_double_arguments); |
1754 | 1701 |
1755 inline Register GetRtAsRegisterHelper(const Operand& rt, Register scratch); | 1702 inline Register GetRtAsRegisterHelper(const Operand& rt, Register scratch); |
1756 inline int32_t GetOffset(int32_t offset, Label* L, OffsetSize bits); | 1703 inline int32_t GetOffset(int32_t offset, Label* L, OffsetSize bits); |
1757 void BranchShortHelperR6(int32_t offset, Label* L); | 1704 void BranchShortHelperR6(int32_t offset, Label* L); |
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1892 dd(GetLabelFunction(index)); | 1839 dd(GetLabelFunction(index)); |
1893 } | 1840 } |
1894 } | 1841 } |
1895 | 1842 |
1896 #define ACCESS_MASM(masm) masm-> | 1843 #define ACCESS_MASM(masm) masm-> |
1897 | 1844 |
1898 } // namespace internal | 1845 } // namespace internal |
1899 } // namespace v8 | 1846 } // namespace v8 |
1900 | 1847 |
1901 #endif // V8_MIPS_MACRO_ASSEMBLER_MIPS_H_ | 1848 #endif // V8_MIPS_MACRO_ASSEMBLER_MIPS_H_ |
OLD | NEW |