This class may be removed in the future. Consider the replacements in JEP 193 'Variable Handles': http://openjdk.java.net/jeps/193
@Override public boolean hasNext() { while (offset < map.partitionCount) { long locationAddress = map.unsafe.getAddress(map.partitionAddress + (offset * map.addressSize)); if (locationAddress == 0) { offset++; continue; } break; } return offset < map.partitionCount; }
public static long aget(long addr) { return INSTANCE.getAddress(addr); }
@Override public boolean hasNext() { while (offset < map.partitionCount) { long locationAddress = map.unsafe.getAddress(map.partitionAddress + (offset * map.addressSize)); if (locationAddress == 0) { offset++; continue; } break; } return offset < map.partitionCount; }
public static final long getAddress(long address) { return UNSAFE.getAddress(address); }
@Override public long getAddress(Unsafe unsafe, long address) { return unsafe.getAddress(address); }
private static final long pg_AvailableChunks_pop(long addressPage) { //long availableChunks = addressPage+ZMPAGE_AVAILABLECHUNKS_OFFSET; long head = UNSAFE.getAddress(addressPage); if (head != NULL_ADDRESS) { UNSAFE.putAddress(addressPage, UNSAFE.getAddress(head)); long numAvailableChunks = addressPage+ZMPAGE_NUMAVAILABLECHUNKS_OFFSET; UNSAFE.putInt(numAvailableChunks, UNSAFE.getInt(numAvailableChunks) - 1); }//meet a full zmalloc page when head ==0L return head; }
public static long jvm7_32_sizeOf(Object object){ // This is getting the size out of the class header (at offset 12) return unsafe.getAddress(normalize(unsafe.getInt(object, 4L)) + 12L); }
public static long jvm7_32_sizeOf(Object object) { // This is getting the size out of the class header (at offset 12) return unsafe.getAddress(normalize(unsafe.getInt(object, 4L)) + 12L); }
private static final void pg_AvailableChunks_push(long addressPage, long addressChunk) { //availableChunks = addressPage long head = UNSAFE.getAddress(addressPage); UNSAFE.putAddress(addressPage, addressChunk); UNSAFE.putAddress(addressChunk, head); long numAvailableChunks = addressPage+ZMPAGE_NUMAVAILABLECHUNKS_OFFSET; UNSAFE.putInt(numAvailableChunks, UNSAFE.getInt(numAvailableChunks) + 1); }
@Override public Customer getCustomer() throws RetrieveDurableEntityError { if (null == m_customer_680E5D) { long phandler = m_unsafe_0DCC8A.getAddress(m_holder_A8BF22.get() + 16); if (0L != phandler) { m_customer_680E5D = org.apache.mnemonic.examples.CustomerFactory.restore(m_allocator_42A80A, null, null, phandler, m_autoreclaim_FA3692, m_reclaimcontext_D713D9); } } return m_customer_680E5D; }
@Override public DurableSinglyLinkedList<Product> getItems() throws RetrieveDurableEntityError { if (null == m_items_2E6397) { long phandler = m_unsafe_0DCC8A.getAddress(m_holder_A8BF22.get() + 24); if (0L != phandler) { m_items_2E6397 = org.apache.mnemonic.collections.DurableSinglyLinkedListFactory.restore(m_allocator_42A80A, m_node_efproxies, m_node_gftypes, phandler, m_autoreclaim_FA3692, m_reclaimcontext_D713D9); } } return m_items_2E6397; }
@Override public TreeNode<E> getLeft() { if (null == m_left_491DCA) { long phandler = m_unsafe_EE978A.getAddress(m_holder_E5EEE3.get() + 8); if (0L != phandler) { m_left_491DCA = org.apache.mnemonic.collections.TreeNodeFactory.restore(m_allocator_873DA6, m_node_efproxies, m_node_gftypes, phandler, m_autoreclaim_3AECF4, m_reclaimcontext_11DAB9); } } return m_left_491DCA; }
@Override public TreeNode<E> getRight() { if (null == m_right_EE76A8) { long phandler = m_unsafe_EE978A.getAddress(m_holder_E5EEE3.get() + 16); if (0L != phandler) { m_right_EE76A8 = org.apache.mnemonic.collections.TreeNodeFactory.restore(m_allocator_873DA6, m_node_efproxies, m_node_gftypes, phandler, m_autoreclaim_3AECF4, m_reclaimcontext_11DAB9); } } return m_right_EE76A8; }
@Override public SinglyLinkedNode<E> getNext() { if (null == m_next_AE9475) { long phandler = m_unsafe_14FE52.getAddress(m_holder_2B4355.get() + 8); if (0L != phandler) { m_next_AE9475 = org.apache.mnemonic.collections.SinglyLinkedNodeFactory.restore(m_allocator_506034, m_node_efproxies, m_node_gftypes, phandler, m_autoreclaim_8BE701, m_reclaimcontext_24E34B); } } return m_next_AE9475; }
@Override public TreeNode<E> getParent() { if (null == m_parent_CA94DC) { long phandler = m_unsafe_EE978A.getAddress(m_holder_E5EEE3.get() + 24); if (0L != phandler) { m_parent_CA94DC = org.apache.mnemonic.collections.TreeNodeFactory.restore(m_allocator_873DA6, m_node_efproxies, m_node_gftypes, phandler, m_autoreclaim_3AECF4, m_reclaimcontext_11DAB9); } } return m_parent_CA94DC; }
@Override public String getId() throws RetrieveDurableEntityError { if (null == m_id_367F9B) { long phandler = m_unsafe_0DCC8A.getAddress(m_holder_A8BF22.get() + 0); if (0L != phandler) { m_id_367F9B = m_allocator_42A80A.retrieveBuffer(phandler, m_autoreclaim_FA3692, m_reclaimcontext_D713D9); if (null == m_id_367F9B) { throw new RetrieveDurableEntityError("Retrieve String Buffer Failure."); } } } return null == m_id_367F9B ? null : m_id_367F9B.get().asCharBuffer().toString(); }
@Override public String getName() throws RetrieveDurableEntityError { if (null == m_name_9807CF) { long phandler = m_unsafe_760FBE.getAddress(m_holder_68BA57.get() + 0); if (0L != phandler) { m_name_9807CF = m_allocator_77CA34.retrieveBuffer(phandler, m_autoreclaim_7E4A25, m_reclaimcontext_B5B531); if (null == m_name_9807CF) { throw new RetrieveDurableEntityError("Retrieve String Buffer Failure."); } } } return null == m_name_9807CF ? null : m_name_9807CF.get().asCharBuffer().toString(); }
@Override public String getStr() throws RetrieveDurableEntityError { if (null == m_str_A55313) { long phandler = m_unsafe_AE4FB2.getAddress(m_holder_5BC267.get() + 0); if (0L != phandler) { m_str_A55313 = m_allocator_CF10A9.retrieveBuffer(phandler, m_autoreclaim_8F4B75, m_reclaimcontext_998750); if (null == m_str_A55313) { throw new RetrieveDurableEntityError("Retrieve String Buffer Failure."); } } } return null == m_str_A55313 ? null : m_str_A55313.get().asCharBuffer().toString(); }
@Override @Operation(opcode = Opcode.READ_POINTER) public <T extends WordBase> T readWord(WordBase offset, LocationIdentity locationIdentity) { return box(UNSAFE.getAddress(add((Word) offset).unbox())); }
@Override @Operation(opcode = Opcode.READ_POINTER) public <T extends WordBase> T readWord(WordBase offset) { return box(UNSAFE.getAddress(add((Word) offset).unbox())); }