packedSwitchMap = new SparseIntArray(0); sparseSwitchMap = new SparseIntArray(0); instructionOffsetMap = new InstructionOffsetMap(instructions); if (packedSwitchMap.get(targetOffset, -1) != -1) { Instruction payloadInstruction = findSwitchPayload(targetOffset, Opcode.PACKED_SWITCH_PAYLOAD); endOffset += payloadInstruction.getCodeUnits(); packedSwitchMap.append(targetOffset, codeOffset); if (sparseSwitchMap.get(targetOffset, -1) != -1) { Instruction payloadInstruction = findSwitchPayload(targetOffset, Opcode.SPARSE_SWITCH_PAYLOAD); endOffset += payloadInstruction.getCodeUnits(); sparseSwitchMap.append(targetOffset, codeOffset);
public int getPackedSwitchBaseAddress(int packedSwitchPayloadCodeOffset) { return packedSwitchMap.get(packedSwitchPayloadCodeOffset, -1); }
methodParameters = ImmutableList.copyOf(method.getParameters()); packedSwitchMap = new SparseIntArray(0); sparseSwitchMap = new SparseIntArray(0); instructionOffsetMap = new InstructionOffsetMap(instructions); packedSwitchMap.append(targetOffset, codeOffset); sparseSwitchMap.append(targetOffset, codeOffset);
/** * Removes the mapping from the specified key, if there was any. */ public void delete(int key) { int i = binarySearch(mKeys, 0, mSize, key); if (i >= 0) { removeAt(i); } }
/** * Gets the int mapped from the specified key, or the specified value * if no such mapping has been made. */ public int get(int key, int valueIfKeyNotFound) { int i = binarySearch(mKeys, 0, mSize, key); if (i < 0) { return valueIfKeyNotFound; } else { return mValues[i]; } }
/** * Puts a key/value pair into the array, optimizing for the case where * the key is greater than all existing keys in the array. */ public void append(int key, int value) { if (mSize != 0 && key <= mKeys[mSize - 1]) { put(key, value); return; } int pos = mSize; if (pos >= mKeys.length) { int n = Math.max(pos + 1, mKeys.length * 2); int[] nkeys = new int[n]; int[] nvalues = new int[n]; // Log.e("SparseIntArray", "grow " + mKeys.length + " to " + n); System.arraycopy(mKeys, 0, nkeys, 0, mKeys.length); System.arraycopy(mValues, 0, nvalues, 0, mValues.length); mKeys = nkeys; mValues = nvalues; } mKeys[pos] = key; mValues[pos] = value; mSize = pos + 1; }
public int getSparseSwitchBaseAddress(int sparseSwitchPayloadCodeOffset) { return sparseSwitchMap.get(sparseSwitchPayloadCodeOffset, -1); }
/** * Removes the mapping from the specified key, if there was any. */ public void delete(int key) { int i = binarySearch(mKeys, 0, mSize, key); if (i >= 0) { removeAt(i); } }
/** * Returns the index for which {@link #keyAt} would return the * specified key, or a negative number if the specified * key is not mapped. */ public int indexOfKey(int key) { return binarySearch(mKeys, 0, mSize, key); }
/** * Puts a key/value pair into the array, optimizing for the case where * the key is greater than all existing keys in the array. */ public void append(int key, int value) { if (mSize != 0 && key <= mKeys[mSize - 1]) { put(key, value); return; } int pos = mSize; if (pos >= mKeys.length) { int n = Math.max(pos + 1, mKeys.length * 2); int[] nkeys = new int[n]; int[] nvalues = new int[n]; // Log.e("SparseIntArray", "grow " + mKeys.length + " to " + n); System.arraycopy(mKeys, 0, nkeys, 0, mKeys.length); System.arraycopy(mValues, 0, nvalues, 0, mValues.length); mKeys = nkeys; mValues = nvalues; } mKeys[pos] = key; mValues[pos] = value; mSize = pos + 1; }
packedSwitchMap = new SparseIntArray(0); sparseSwitchMap = new SparseIntArray(0); instructionOffsetMap = new InstructionOffsetMap(instructions); if (packedSwitchMap.get(targetOffset, -1) != -1) { Instruction payloadInstruction = findSwitchPayload(targetOffset, Opcode.PACKED_SWITCH_PAYLOAD); endOffset += payloadInstruction.getCodeUnits(); packedSwitchMap.append(targetOffset, codeOffset); if (sparseSwitchMap.get(targetOffset, -1) != -1) { Instruction payloadInstruction = findSwitchPayload(targetOffset, Opcode.SPARSE_SWITCH_PAYLOAD); endOffset += payloadInstruction.getCodeUnits(); sparseSwitchMap.append(targetOffset, codeOffset);
/** * Gets the int mapped from the specified key, or <code>0</code> * if no such mapping has been made. */ public int get(int key) { return get(key, 0); }
/** * Removes the mapping from the specified key, if there was any. */ public void delete(int key) { int i = binarySearch(mKeys, 0, mSize, key); if (i >= 0) { removeAt(i); } }
/** * Returns the index for which {@link #keyAt} would return the * specified key, or a negative number if the specified * key is not mapped. */ public int indexOfKey(int key) { return binarySearch(mKeys, 0, mSize, key); }
/** * Puts a key/value pair into the array, optimizing for the case where * the key is greater than all existing keys in the array. */ public void append(int key, int value) { if (mSize != 0 && key <= mKeys[mSize - 1]) { put(key, value); return; } int pos = mSize; if (pos >= mKeys.length) { int n = Math.max(pos + 1, mKeys.length * 2); int[] nkeys = new int[n]; int[] nvalues = new int[n]; // Log.e("SparseIntArray", "grow " + mKeys.length + " to " + n); System.arraycopy(mKeys, 0, nkeys, 0, mKeys.length); System.arraycopy(mValues, 0, nvalues, 0, mValues.length); mKeys = nkeys; mValues = nvalues; } mKeys[pos] = key; mValues[pos] = value; mSize = pos + 1; }
packedSwitchMap = new SparseIntArray(0); sparseSwitchMap = new SparseIntArray(0); instructionOffsetMap = new InstructionOffsetMap(instructions); if (packedSwitchMap.get(targetOffset, -1) != -1) { Instruction payloadInstruction = findSwitchPayload(targetOffset, Opcode.PACKED_SWITCH_PAYLOAD); endOffset += payloadInstruction.getCodeUnits(); packedSwitchMap.append(targetOffset, codeOffset); if (sparseSwitchMap.get(targetOffset, -1) != -1) { Instruction payloadInstruction = findSwitchPayload(targetOffset, Opcode.SPARSE_SWITCH_PAYLOAD); endOffset += payloadInstruction.getCodeUnits(); sparseSwitchMap.append(targetOffset, codeOffset);
/** * Gets the int mapped from the specified key, or <code>0</code> * if no such mapping has been made. */ public int get(int key) { return get(key, 0); }
/** * Gets the int mapped from the specified key, or the specified value * if no such mapping has been made. */ public int get(int key, int valueIfKeyNotFound) { int i = binarySearch(mKeys, 0, mSize, key); if (i < 0) { return valueIfKeyNotFound; } else { return mValues[i]; } }
/** * Gets the int mapped from the specified key, or <code>0</code> * if no such mapping has been made. */ public int get(int key) { return get(key, 0); }
/** * Returns the index for which {@link #keyAt} would return the * specified key, or a negative number if the specified * key is not mapped. */ public int indexOfKey(int key) { return binarySearch(mKeys, 0, mSize, key); }