| OLD | NEW |
| 1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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_ARM64_MACRO_ASSEMBLER_ARM64_H_ | 5 #ifndef V8_ARM64_MACRO_ASSEMBLER_ARM64_H_ |
| 6 #define V8_ARM64_MACRO_ASSEMBLER_ARM64_H_ | 6 #define V8_ARM64_MACRO_ASSEMBLER_ARM64_H_ |
| 7 | 7 |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "src/arm64/assembler-arm64.h" | 10 #include "src/arm64/assembler-arm64.h" |
| (...skipping 976 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 987 Register value2, | 987 Register value2, |
| 988 Label* not_smi_label); | 988 Label* not_smi_label); |
| 989 | 989 |
| 990 // Abort execution if argument is a smi, enabled via --debug-code. | 990 // Abort execution if argument is a smi, enabled via --debug-code. |
| 991 void AssertNotSmi(Register object, BailoutReason reason = kOperandIsASmi); | 991 void AssertNotSmi(Register object, BailoutReason reason = kOperandIsASmi); |
| 992 void AssertSmi(Register object, BailoutReason reason = kOperandIsNotASmi); | 992 void AssertSmi(Register object, BailoutReason reason = kOperandIsNotASmi); |
| 993 | 993 |
| 994 inline void ObjectTag(Register tagged_obj, Register obj); | 994 inline void ObjectTag(Register tagged_obj, Register obj); |
| 995 inline void ObjectUntag(Register untagged_obj, Register obj); | 995 inline void ObjectUntag(Register untagged_obj, Register obj); |
| 996 | 996 |
| 997 // Abort execution if argument is not a name, enabled via --debug-code. | |
| 998 void AssertName(Register object); | |
| 999 | |
| 1000 // Abort execution if argument is not a JSFunction, enabled via --debug-code. | 997 // Abort execution if argument is not a JSFunction, enabled via --debug-code. |
| 1001 void AssertFunction(Register object); | 998 void AssertFunction(Register object); |
| 1002 | 999 |
| 1003 // Abort execution if argument is not a JSGeneratorObject, | 1000 // Abort execution if argument is not a JSGeneratorObject, |
| 1004 // enabled via --debug-code. | 1001 // enabled via --debug-code. |
| 1005 void AssertGeneratorObject(Register object); | 1002 void AssertGeneratorObject(Register object); |
| 1006 | 1003 |
| 1007 // Abort execution if argument is not a JSBoundFunction, | 1004 // Abort execution if argument is not a JSBoundFunction, |
| 1008 // enabled via --debug-code. | 1005 // enabled via --debug-code. |
| 1009 void AssertBoundFunction(Register object); | 1006 void AssertBoundFunction(Register object); |
| 1010 | 1007 |
| 1011 // Abort execution if argument is not a JSReceiver, enabled via --debug-code. | |
| 1012 void AssertReceiver(Register object); | |
| 1013 | |
| 1014 // Abort execution if argument is not undefined or an AllocationSite, enabled | 1008 // Abort execution if argument is not undefined or an AllocationSite, enabled |
| 1015 // via --debug-code. | 1009 // via --debug-code. |
| 1016 void AssertUndefinedOrAllocationSite(Register object, Register scratch); | 1010 void AssertUndefinedOrAllocationSite(Register object, Register scratch); |
| 1017 | 1011 |
| 1018 // Abort execution if argument is not a string, enabled via --debug-code. | |
| 1019 void AssertString(Register object); | |
| 1020 | |
| 1021 // Abort execution if argument is not a positive or zero integer, enabled via | 1012 // Abort execution if argument is not a positive or zero integer, enabled via |
| 1022 // --debug-code. | 1013 // --debug-code. |
| 1023 void AssertPositiveOrZero(Register value); | 1014 void AssertPositiveOrZero(Register value); |
| 1024 | 1015 |
| 1025 // Abort execution if argument is not a number (heap number or smi). | |
| 1026 void AssertNumber(Register value); | |
| 1027 void AssertNotNumber(Register value); | |
| 1028 | |
| 1029 void JumpIfHeapNumber(Register object, Label* on_heap_number, | 1016 void JumpIfHeapNumber(Register object, Label* on_heap_number, |
| 1030 SmiCheckType smi_check_type = DONT_DO_SMI_CHECK); | 1017 SmiCheckType smi_check_type = DONT_DO_SMI_CHECK); |
| 1031 void JumpIfNotHeapNumber(Register object, Label* on_not_heap_number, | 1018 void JumpIfNotHeapNumber(Register object, Label* on_not_heap_number, |
| 1032 SmiCheckType smi_check_type = DONT_DO_SMI_CHECK); | 1019 SmiCheckType smi_check_type = DONT_DO_SMI_CHECK); |
| 1033 | 1020 |
| 1034 // Sets the vs flag if the input is -0.0. | 1021 // Sets the vs flag if the input is -0.0. |
| 1035 void TestForMinusZero(DoubleRegister input); | 1022 void TestForMinusZero(DoubleRegister input); |
| 1036 | 1023 |
| 1037 // Jump to label if the input double register contains -0.0. | 1024 // Jump to label if the input double register contains -0.0. |
| 1038 void JumpIfMinusZero(DoubleRegister input, Label* on_negative_zero); | 1025 void JumpIfMinusZero(DoubleRegister input, Label* on_negative_zero); |
| (...skipping 384 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1423 Label* fail, | 1410 Label* fail, |
| 1424 SmiCheckType smi_check_type); | 1411 SmiCheckType smi_check_type); |
| 1425 | 1412 |
| 1426 // As above, but the map of the object is already loaded into obj_map, and is | 1413 // As above, but the map of the object is already loaded into obj_map, and is |
| 1427 // preserved. | 1414 // preserved. |
| 1428 void CheckMap(Register obj_map, | 1415 void CheckMap(Register obj_map, |
| 1429 Handle<Map> map, | 1416 Handle<Map> map, |
| 1430 Label* fail, | 1417 Label* fail, |
| 1431 SmiCheckType smi_check_type); | 1418 SmiCheckType smi_check_type); |
| 1432 | 1419 |
| 1433 // Check if the map of an object is equal to a specified weak map and branch | |
| 1434 // to a specified target if equal. Skip the smi check if not required | |
| 1435 // (object is known to be a heap object) | |
| 1436 void DispatchWeakMap(Register obj, Register scratch1, Register scratch2, | |
| 1437 Handle<WeakCell> cell, Handle<Code> success, | |
| 1438 SmiCheckType smi_check_type); | |
| 1439 | |
| 1440 // Compare the given value and the value of weak cell. | |
| 1441 void CmpWeakValue(Register value, Handle<WeakCell> cell, Register scratch); | |
| 1442 | |
| 1443 void GetWeakValue(Register value, Handle<WeakCell> cell); | 1420 void GetWeakValue(Register value, Handle<WeakCell> cell); |
| 1444 | 1421 |
| 1445 // Load the value of the weak cell in the value register. Branch to the given | 1422 // Load the value of the weak cell in the value register. Branch to the given |
| 1446 // miss label if the weak cell was cleared. | 1423 // miss label if the weak cell was cleared. |
| 1447 void LoadWeakValue(Register value, Handle<WeakCell> cell, Label* miss); | 1424 void LoadWeakValue(Register value, Handle<WeakCell> cell, Label* miss); |
| 1448 | 1425 |
| 1449 // Test the bitfield of the heap object map with mask and set the condition | 1426 // Test the bitfield of the heap object map with mask and set the condition |
| 1450 // flags. The object register is preserved. | 1427 // flags. The object register is preserved. |
| 1451 void TestMapBitfield(Register object, uint64_t mask); | 1428 void TestMapBitfield(Register object, uint64_t mask); |
| 1452 | 1429 |
| (...skipping 10 matching lines...) Expand all Loading... |
| 1463 // Compare the object in a register to a value and jump if they are equal. | 1440 // Compare the object in a register to a value and jump if they are equal. |
| 1464 void JumpIfRoot(const Register& obj, | 1441 void JumpIfRoot(const Register& obj, |
| 1465 Heap::RootListIndex index, | 1442 Heap::RootListIndex index, |
| 1466 Label* if_equal); | 1443 Label* if_equal); |
| 1467 | 1444 |
| 1468 // Compare the object in a register to a value and jump if they are not equal. | 1445 // Compare the object in a register to a value and jump if they are not equal. |
| 1469 void JumpIfNotRoot(const Register& obj, | 1446 void JumpIfNotRoot(const Register& obj, |
| 1470 Heap::RootListIndex index, | 1447 Heap::RootListIndex index, |
| 1471 Label* if_not_equal); | 1448 Label* if_not_equal); |
| 1472 | 1449 |
| 1473 // Load and check the instance type of an object for being a unique name. | |
| 1474 // Loads the type into the second argument register. | |
| 1475 // The object and type arguments can be the same register; in that case it | |
| 1476 // will be overwritten with the type. | |
| 1477 // Fall-through if the object was a string and jump on fail otherwise. | |
| 1478 inline void IsObjectNameType(Register object, Register type, Label* fail); | |
| 1479 | |
| 1480 // Load and check the instance type of an object for being a string. | 1450 // Load and check the instance type of an object for being a string. |
| 1481 // Loads the type into the second argument register. | 1451 // Loads the type into the second argument register. |
| 1482 // The object and type arguments can be the same register; in that case it | 1452 // The object and type arguments can be the same register; in that case it |
| 1483 // will be overwritten with the type. | 1453 // will be overwritten with the type. |
| 1484 // Jumps to not_string or string appropriate. If the appropriate label is | 1454 // Jumps to not_string or string appropriate. If the appropriate label is |
| 1485 // NULL, fall through. | 1455 // NULL, fall through. |
| 1486 inline void IsObjectJSStringType(Register object, Register type, | 1456 inline void IsObjectJSStringType(Register object, Register type, |
| 1487 Label* not_string, Label* string = NULL); | 1457 Label* not_string, Label* string = NULL); |
| 1488 | 1458 |
| 1489 // Compare the contents of a register with an operand, and branch to true, | 1459 // Compare the contents of a register with an operand, and branch to true, |
| (...skipping 292 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1782 // Debugging. | 1752 // Debugging. |
| 1783 | 1753 |
| 1784 // Calls Abort(msg) if the condition cond is not satisfied. | 1754 // Calls Abort(msg) if the condition cond is not satisfied. |
| 1785 // Use --debug_code to enable. | 1755 // Use --debug_code to enable. |
| 1786 void Assert(Condition cond, BailoutReason reason); | 1756 void Assert(Condition cond, BailoutReason reason); |
| 1787 void AssertRegisterIsClear(Register reg, BailoutReason reason); | 1757 void AssertRegisterIsClear(Register reg, BailoutReason reason); |
| 1788 void AssertRegisterIsRoot( | 1758 void AssertRegisterIsRoot( |
| 1789 Register reg, | 1759 Register reg, |
| 1790 Heap::RootListIndex index, | 1760 Heap::RootListIndex index, |
| 1791 BailoutReason reason = kRegisterDidNotMatchExpectedRoot); | 1761 BailoutReason reason = kRegisterDidNotMatchExpectedRoot); |
| 1792 void AssertFastElements(Register elements); | |
| 1793 | 1762 |
| 1794 // Abort if the specified register contains the invalid color bit pattern. | 1763 // Abort if the specified register contains the invalid color bit pattern. |
| 1795 // The pattern must be in bits [1:0] of 'reg' register. | 1764 // The pattern must be in bits [1:0] of 'reg' register. |
| 1796 // | 1765 // |
| 1797 // If emit_debug_code() is false, this emits no code. | 1766 // If emit_debug_code() is false, this emits no code. |
| 1798 void AssertHasValidColor(const Register& reg); | 1767 void AssertHasValidColor(const Register& reg); |
| 1799 | 1768 |
| 1800 // Abort if 'object' register doesn't point to a string object. | 1769 // Abort if 'object' register doesn't point to a string object. |
| 1801 // | 1770 // |
| 1802 // If emit_debug_code() is false, this emits no code. | 1771 // If emit_debug_code() is false, this emits no code. |
| (...skipping 350 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2153 class RegisterBits : public BitField<unsigned, 0, 5> {}; | 2122 class RegisterBits : public BitField<unsigned, 0, 5> {}; |
| 2154 class DeltaBits : public BitField<uint32_t, 5, 32-5> {}; | 2123 class DeltaBits : public BitField<uint32_t, 5, 32-5> {}; |
| 2155 }; | 2124 }; |
| 2156 | 2125 |
| 2157 } // namespace internal | 2126 } // namespace internal |
| 2158 } // namespace v8 | 2127 } // namespace v8 |
| 2159 | 2128 |
| 2160 #define ACCESS_MASM(masm) masm-> | 2129 #define ACCESS_MASM(masm) masm-> |
| 2161 | 2130 |
| 2162 #endif // V8_ARM64_MACRO_ASSEMBLER_ARM64_H_ | 2131 #endif // V8_ARM64_MACRO_ASSEMBLER_ARM64_H_ |
| OLD | NEW |