| OLD | NEW |
| 1 // Copyright (c) 1994-2006 Sun Microsystems Inc. | 1 // Copyright (c) 1994-2006 Sun Microsystems Inc. |
| 2 // All Rights Reserved. | 2 // All Rights Reserved. |
| 3 // | 3 // |
| 4 // Redistribution and use in source and binary forms, with or without | 4 // Redistribution and use in source and binary forms, with or without |
| 5 // modification, are permitted provided that the following conditions are | 5 // modification, are permitted provided that the following conditions are |
| 6 // met: | 6 // met: |
| 7 // | 7 // |
| 8 // - Redistributions of source code must retain the above copyright notice, | 8 // - Redistributions of source code must retain the above copyright notice, |
| 9 // this list of conditions and the following disclaimer. | 9 // this list of conditions and the following disclaimer. |
| 10 // | 10 // |
| (...skipping 1796 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1807 } | 1807 } |
| 1808 | 1808 |
| 1809 | 1809 |
| 1810 // Emit and return position of pool. Zero implies no constant pool. | 1810 // Emit and return position of pool. Zero implies no constant pool. |
| 1811 int ConstantPoolBuilder::Emit(Assembler* assm) { | 1811 int ConstantPoolBuilder::Emit(Assembler* assm) { |
| 1812 bool emitted = emitted_label_.is_bound(); | 1812 bool emitted = emitted_label_.is_bound(); |
| 1813 bool empty = IsEmpty(); | 1813 bool empty = IsEmpty(); |
| 1814 | 1814 |
| 1815 if (!emitted) { | 1815 if (!emitted) { |
| 1816 // Mark start of constant pool. Align if necessary. | 1816 // Mark start of constant pool. Align if necessary. |
| 1817 if (!empty) assm->Align(kDoubleSize); | 1817 if (!empty) assm->DataAlign(kDoubleSize); |
| 1818 assm->bind(&emitted_label_); | 1818 assm->bind(&emitted_label_); |
| 1819 if (!empty) { | 1819 if (!empty) { |
| 1820 // Emit in groups based on access and type. | 1820 // Emit in groups based on access and type. |
| 1821 // Emit doubles first for alignment purposes. | 1821 // Emit doubles first for alignment purposes. |
| 1822 EmitGroup(assm, ConstantPoolEntry::REGULAR, ConstantPoolEntry::DOUBLE); | 1822 EmitGroup(assm, ConstantPoolEntry::REGULAR, ConstantPoolEntry::DOUBLE); |
| 1823 EmitGroup(assm, ConstantPoolEntry::REGULAR, ConstantPoolEntry::INTPTR); | 1823 EmitGroup(assm, ConstantPoolEntry::REGULAR, ConstantPoolEntry::INTPTR); |
| 1824 if (info_[ConstantPoolEntry::DOUBLE].overflow()) { | 1824 if (info_[ConstantPoolEntry::DOUBLE].overflow()) { |
| 1825 assm->Align(kDoubleSize); | 1825 assm->DataAlign(kDoubleSize); |
| 1826 EmitGroup(assm, ConstantPoolEntry::OVERFLOWED, | 1826 EmitGroup(assm, ConstantPoolEntry::OVERFLOWED, |
| 1827 ConstantPoolEntry::DOUBLE); | 1827 ConstantPoolEntry::DOUBLE); |
| 1828 } | 1828 } |
| 1829 if (info_[ConstantPoolEntry::INTPTR].overflow()) { | 1829 if (info_[ConstantPoolEntry::INTPTR].overflow()) { |
| 1830 EmitGroup(assm, ConstantPoolEntry::OVERFLOWED, | 1830 EmitGroup(assm, ConstantPoolEntry::OVERFLOWED, |
| 1831 ConstantPoolEntry::INTPTR); | 1831 ConstantPoolEntry::INTPTR); |
| 1832 } | 1832 } |
| 1833 } | 1833 } |
| 1834 } | 1834 } |
| 1835 | 1835 |
| (...skipping 28 matching lines...) Expand all Loading... |
| 1864 EnsureSpace ensure_space(this); | 1864 EnsureSpace ensure_space(this); |
| 1865 RecordRelocInfo(RelocInfo::JS_RETURN); | 1865 RecordRelocInfo(RelocInfo::JS_RETURN); |
| 1866 } | 1866 } |
| 1867 | 1867 |
| 1868 | 1868 |
| 1869 void Assembler::RecordDebugBreakSlot() { | 1869 void Assembler::RecordDebugBreakSlot() { |
| 1870 positions_recorder()->WriteRecordedPositions(); | 1870 positions_recorder()->WriteRecordedPositions(); |
| 1871 EnsureSpace ensure_space(this); | 1871 EnsureSpace ensure_space(this); |
| 1872 RecordRelocInfo(RelocInfo::DEBUG_BREAK_SLOT); | 1872 RecordRelocInfo(RelocInfo::DEBUG_BREAK_SLOT); |
| 1873 } | 1873 } |
| 1874 |
| 1875 |
| 1876 void Assembler::DataAlign(int m) { |
| 1877 DCHECK(m >= 2 && base::bits::IsPowerOfTwo32(m)); |
| 1878 while ((pc_offset() & (m - 1)) != 0) { |
| 1879 db(0); |
| 1880 } |
| 1881 } |
| 1874 } // namespace internal | 1882 } // namespace internal |
| 1875 } // namespace v8 | 1883 } // namespace v8 |
| OLD | NEW |