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 1548 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1559 Label* fall_through); | 1559 Label* fall_through); |
1560 | 1560 |
1561 // Test the bits of register defined by bit_pattern, and branch to | 1561 // Test the bits of register defined by bit_pattern, and branch to |
1562 // if_any_set, if_all_clear or fall_through accordingly. | 1562 // if_any_set, if_all_clear or fall_through accordingly. |
1563 void TestAndSplit(const Register& reg, | 1563 void TestAndSplit(const Register& reg, |
1564 uint64_t bit_pattern, | 1564 uint64_t bit_pattern, |
1565 Label* if_all_clear, | 1565 Label* if_all_clear, |
1566 Label* if_any_set, | 1566 Label* if_any_set, |
1567 Label* fall_through); | 1567 Label* fall_through); |
1568 | 1568 |
1569 // Check if a map for a JSObject indicates that the object can have both smi | |
1570 // and HeapObject elements. Jump to the specified label if it does not. | |
1571 void CheckFastObjectElements(Register map, Register scratch, Label* fail); | |
1572 | |
1573 // Check to see if number can be stored as a double in FastDoubleElements. | |
1574 // If it can, store it at the index specified by key_reg in the array, | |
1575 // otherwise jump to fail. | |
1576 void StoreNumberToDoubleElements(Register value_reg, | |
1577 Register key_reg, | |
1578 Register elements_reg, | |
1579 Register scratch1, | |
1580 FPRegister fpscratch1, | |
1581 Label* fail, | |
1582 int elements_offset = 0); | |
1583 | |
1584 // --------------------------------------------------------------------------- | 1569 // --------------------------------------------------------------------------- |
1585 // Inline caching support. | 1570 // Inline caching support. |
1586 | 1571 |
1587 void EmitSeqStringSetCharCheck(Register string, | 1572 void EmitSeqStringSetCharCheck(Register string, |
1588 Register index, | 1573 Register index, |
1589 SeqStringSetCharCheckIndexType index_type, | 1574 SeqStringSetCharCheckIndexType index_type, |
1590 Register scratch, | 1575 Register scratch, |
1591 uint32_t encoding_mask); | 1576 uint32_t encoding_mask); |
1592 | 1577 |
1593 // Hash the interger value in 'key' register. | 1578 // Hash the interger value in 'key' register. |
(...skipping 23 matching lines...) Expand all Loading... |
1617 // AllocationMemento object that can be checked for in order to pretransition | 1602 // AllocationMemento object that can be checked for in order to pretransition |
1618 // to another type. | 1603 // to another type. |
1619 // On entry, receiver should point to the array object. | 1604 // On entry, receiver should point to the array object. |
1620 // If allocation info is present, the Z flag is set (so that the eq | 1605 // If allocation info is present, the Z flag is set (so that the eq |
1621 // condition will pass). | 1606 // condition will pass). |
1622 void TestJSArrayForAllocationMemento(Register receiver, | 1607 void TestJSArrayForAllocationMemento(Register receiver, |
1623 Register scratch1, | 1608 Register scratch1, |
1624 Register scratch2, | 1609 Register scratch2, |
1625 Label* no_memento_found); | 1610 Label* no_memento_found); |
1626 | 1611 |
1627 void JumpIfJSArrayHasAllocationMemento(Register receiver, | |
1628 Register scratch1, | |
1629 Register scratch2, | |
1630 Label* memento_found) { | |
1631 Label no_memento_found; | |
1632 TestJSArrayForAllocationMemento(receiver, scratch1, scratch2, | |
1633 &no_memento_found); | |
1634 B(eq, memento_found); | |
1635 Bind(&no_memento_found); | |
1636 } | |
1637 | |
1638 // The stack pointer has to switch between csp and jssp when setting up and | 1612 // The stack pointer has to switch between csp and jssp when setting up and |
1639 // destroying the exit frame. Hence preserving/restoring the registers is | 1613 // destroying the exit frame. Hence preserving/restoring the registers is |
1640 // slightly more complicated than simple push/pop operations. | 1614 // slightly more complicated than simple push/pop operations. |
1641 void ExitFramePreserveFPRegs(); | 1615 void ExitFramePreserveFPRegs(); |
1642 void ExitFrameRestoreFPRegs(); | 1616 void ExitFrameRestoreFPRegs(); |
1643 | 1617 |
1644 // Generates function and stub prologue code. | 1618 // Generates function and stub prologue code. |
1645 void StubPrologue(StackFrame::Type type, int frame_slots); | 1619 void StubPrologue(StackFrame::Type type, int frame_slots); |
1646 void Prologue(bool code_pre_aging); | 1620 void Prologue(bool code_pre_aging); |
1647 | 1621 |
(...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1895 // If emit_debug_code() is false, this emits no code. | 1869 // If emit_debug_code() is false, this emits no code. |
1896 void AssertIsString(const Register& object); | 1870 void AssertIsString(const Register& object); |
1897 | 1871 |
1898 // Like Assert(), but always enabled. | 1872 // Like Assert(), but always enabled. |
1899 void Check(Condition cond, BailoutReason reason); | 1873 void Check(Condition cond, BailoutReason reason); |
1900 void CheckRegisterIsClear(Register reg, BailoutReason reason); | 1874 void CheckRegisterIsClear(Register reg, BailoutReason reason); |
1901 | 1875 |
1902 // Print a message to stderr and abort execution. | 1876 // Print a message to stderr and abort execution. |
1903 void Abort(BailoutReason reason); | 1877 void Abort(BailoutReason reason); |
1904 | 1878 |
1905 // Conditionally load the cached Array transitioned map of type | |
1906 // transitioned_kind from the native context if the map in register | |
1907 // map_in_out is the cached Array map in the native context of | |
1908 // expected_kind. | |
1909 void LoadTransitionedArrayMapConditional( | |
1910 ElementsKind expected_kind, | |
1911 ElementsKind transitioned_kind, | |
1912 Register map_in_out, | |
1913 Register scratch1, | |
1914 Register scratch2, | |
1915 Label* no_map_match); | |
1916 | |
1917 void LoadNativeContextSlot(int index, Register dst); | 1879 void LoadNativeContextSlot(int index, Register dst); |
1918 | 1880 |
1919 // Load the initial map from the global function. The registers function and | 1881 // Load the initial map from the global function. The registers function and |
1920 // map can be the same, function is then overwritten. | 1882 // map can be the same, function is then overwritten. |
1921 void LoadGlobalFunctionInitialMap(Register function, | 1883 void LoadGlobalFunctionInitialMap(Register function, |
1922 Register map, | 1884 Register map, |
1923 Register scratch); | 1885 Register scratch); |
1924 | 1886 |
1925 CPURegList* TmpList() { return &tmp_list_; } | 1887 CPURegList* TmpList() { return &tmp_list_; } |
1926 CPURegList* FPTmpList() { return &fptmp_list_; } | 1888 CPURegList* FPTmpList() { return &fptmp_list_; } |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1995 static void EmitCodeAgeSequence(Assembler* assm, Code* stub); | 1957 static void EmitCodeAgeSequence(Assembler* assm, Code* stub); |
1996 | 1958 |
1997 // Call EmitCodeAgeSequence from a MacroAssembler context. | 1959 // Call EmitCodeAgeSequence from a MacroAssembler context. |
1998 void EmitCodeAgeSequence(Code* stub); | 1960 void EmitCodeAgeSequence(Code* stub); |
1999 | 1961 |
2000 // Return true if the sequence is a young sequence geneated by | 1962 // Return true if the sequence is a young sequence geneated by |
2001 // EmitFrameSetupForCodeAgePatching. Otherwise, this method asserts that the | 1963 // EmitFrameSetupForCodeAgePatching. Otherwise, this method asserts that the |
2002 // sequence is a code age sequence (emitted by EmitCodeAgeSequence). | 1964 // sequence is a code age sequence (emitted by EmitCodeAgeSequence). |
2003 static bool IsYoungSequence(Isolate* isolate, byte* sequence); | 1965 static bool IsYoungSequence(Isolate* isolate, byte* sequence); |
2004 | 1966 |
2005 // Jumps to found label if a prototype map has dictionary elements. | |
2006 void JumpIfDictionaryInPrototypeChain(Register object, Register scratch0, | |
2007 Register scratch1, Label* found); | |
2008 | |
2009 // Perform necessary maintenance operations before a push or after a pop. | 1967 // Perform necessary maintenance operations before a push or after a pop. |
2010 // | 1968 // |
2011 // Note that size is specified in bytes. | 1969 // Note that size is specified in bytes. |
2012 void PushPreamble(Operand total_size); | 1970 void PushPreamble(Operand total_size); |
2013 void PopPostamble(Operand total_size); | 1971 void PopPostamble(Operand total_size); |
2014 | 1972 |
2015 void PushPreamble(int count, int size) { PushPreamble(count * size); } | 1973 void PushPreamble(int count, int size) { PushPreamble(count * size); } |
2016 void PopPostamble(int count, int size) { PopPostamble(count * size); } | 1974 void PopPostamble(int count, int size) { PopPostamble(count * size); } |
2017 | 1975 |
2018 private: | 1976 private: |
(...skipping 252 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2271 class RegisterBits : public BitField<unsigned, 0, 5> {}; | 2229 class RegisterBits : public BitField<unsigned, 0, 5> {}; |
2272 class DeltaBits : public BitField<uint32_t, 5, 32-5> {}; | 2230 class DeltaBits : public BitField<uint32_t, 5, 32-5> {}; |
2273 }; | 2231 }; |
2274 | 2232 |
2275 } // namespace internal | 2233 } // namespace internal |
2276 } // namespace v8 | 2234 } // namespace v8 |
2277 | 2235 |
2278 #define ACCESS_MASM(masm) masm-> | 2236 #define ACCESS_MASM(masm) masm-> |
2279 | 2237 |
2280 #endif // V8_ARM64_MACRO_ASSEMBLER_ARM64_H_ | 2238 #endif // V8_ARM64_MACRO_ASSEMBLER_ARM64_H_ |
OLD | NEW |