This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| private void writeObject(java.io.ObjectOutputStream s) | |
| throws java.io.IOException{ | |
| // Write out element count, and any hidden stuff | |
| int expectedModCount = modCount; | |
| s.defaultWriteObject(); | |
| // Write out array length | |
| s.writeInt(elementData.length); | |
| // Write out all elements in the proper order. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public List<E> subList(int fromIndex, int toIndex) { | |
| subListRangeCheck(fromIndex, toIndex, size); | |
| return new SubList(this, 0, fromIndex, toIndex); | |
| } | |
| static void subListRangeCheck(int fromIndex, int toIndex, int size) { | |
| if (fromIndex < 0) | |
| throw new IndexOutOfBoundsException("fromIndex = " + fromIndex); | |
| if (toIndex > size) | |
| throw new IndexOutOfBoundsException("toIndex = " + toIndex); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| private class ListItr extends Itr implements ListIterator<E> { | |
| ListItr(int index) { | |
| super(); | |
| cursor = index; | |
| } | |
| public boolean hasPrevious() { | |
| return cursor != 0; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| private class Itr implements Iterator<E> { | |
| int cursor; // index of next element to return | |
| int lastRet = -1; // index of last element returned; -1 if no such | |
| int expectedModCount = modCount; | |
| public boolean hasNext() { | |
| return cursor != size; | |
| } | |
| @SuppressWarnings("unchecked") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| private boolean batchRemove(Collection<?> c, boolean complement) { | |
| final Object[] elementData = this.elementData; | |
| int r = 0, w = 0; | |
| boolean modified = false; | |
| try { | |
| for (; r < size; r++) | |
| if (c.contains(elementData[r]) == complement) | |
| elementData[w++] = elementData[r]; | |
| } finally { | |
| // Preserve behavioral compatibility with AbstractCollection, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| _Copy_conjoint_jints_atomic: | |
| _Copy_arrayof_conjoint_jints: | |
| pushl %esi | |
| movl 4+12(%esp),%ecx # count | |
| pushl %edi | |
| movl 8+ 4(%esp),%esi # from | |
| movl 8+ 8(%esp),%edi # to | |
| cmpl %esi,%edi | |
| leal -4(%esi,%ecx,4),%eax # from + count*4 - 4 | |
| jbe ci_CopyRight |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| static void pd_conjoint_words(HeapWord* from, HeapWord* to, size_t count) { | |
| (void)memmove(to, from, count * HeapWordSize); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| static void pd_conjoint_bytes(void* from, void* to, size_t count) { | |
| #ifdef AMD64 | |
| (void)memmove(to, from, count); | |
| #else | |
| // Includes a zero-count check. | |
| intx temp; | |
| __asm__ volatile(" testl %6,%6 ;" | |
| ... Assembly here ... | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public void ensureCapacity(int minCapacity) { | |
| if (minCapacity > 0) | |
| ensureCapacityInternal(minCapacity); | |
| } | |
| private void ensureCapacityInternal(int minCapacity) { | |
| modCount++; | |
| if (minCapacity - elementData.length > 0) | |
| grow(minCapacity); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| E elementData(int index) { | |
| return (E) elementData[index]; | |
| } | |
| public E get(int index) { | |
| rangeCheck(index); | |
| return elementData(index); | |
| } | |