/** * Marks the producing offsets of the given traced reference value. */ private void markEscapingReferenceValues(ReferenceValue referenceValue) { TracedReferenceValue tracedReferenceValue = (TracedReferenceValue)referenceValue; InstructionOffsetValue instructionOffsetValue = tracedReferenceValue.getTraceValue().instructionOffsetValue(); int parameterCount = instructionOffsetValue.instructionOffsetCount(); for (int index = 0; index < parameterCount; index++) { if (!instructionOffsetValue.isMethodParameter(index)) { instanceEscaping[instructionOffsetValue.instructionOffset(index)] = true; } } }
/** * Marks the producing offsets of the given traced reference value. */ private void markModifiedReferenceValues(ReferenceValue referenceValue) { TracedReferenceValue tracedReferenceValue = (TracedReferenceValue)referenceValue; InstructionOffsetValue instructionOffsetValue = tracedReferenceValue.getTraceValue().instructionOffsetValue(); int parameterCount = instructionOffsetValue.instructionOffsetCount(); for (int index = 0; index < parameterCount; index++) { if (!instructionOffsetValue.isMethodParameter(index)) { instanceModified[instructionOffsetValue.instructionOffset(index)] = true; } } }
/** * Marks the producing offsets of the given traced reference value. */ private void markEscapingReferenceValues(ReferenceValue referenceValue) { TracedReferenceValue tracedReferenceValue = (TracedReferenceValue)referenceValue; InstructionOffsetValue instructionOffsetValue = tracedReferenceValue.getTraceValue().instructionOffsetValue(); int parameterCount = instructionOffsetValue.instructionOffsetCount(); for (int index = 0; index < parameterCount; index++) { if (!instructionOffsetValue.isMethodParameter(index)) { instanceEscaping[instructionOffsetValue.instructionOffset(index)] = true; } } }
/** * Marks the producing offsets of the given traced reference value. */ private void markModifiedReferenceValues(ReferenceValue referenceValue) { TracedReferenceValue tracedReferenceValue = (TracedReferenceValue)referenceValue; InstructionOffsetValue instructionOffsetValue = tracedReferenceValue.getTraceValue().instructionOffsetValue(); int parameterCount = instructionOffsetValue.instructionOffsetCount(); for (int index = 0; index < parameterCount; index++) { if (!instructionOffsetValue.isMethodParameter(index)) { instanceModified[instructionOffsetValue.instructionOffset(index)] = true; } } }
/** * Marks the producing offsets of the given traced reference value. */ private void markReturnedReferenceValues(ReferenceValue referenceValue) { TracedReferenceValue tracedReferenceValue = (TracedReferenceValue)referenceValue; InstructionOffsetValue instructionOffsetValue = tracedReferenceValue.getTraceValue().instructionOffsetValue(); int parameterCount = instructionOffsetValue.instructionOffsetCount(); for (int index = 0; index < parameterCount; index++) { if (!instructionOffsetValue.isMethodParameter(index)) { instanceReturned[instructionOffsetValue.instructionOffset(index)] = true; } } }
/** * Marks the producing offsets of the given traced reference value. */ private void markEscapingReferenceValues(ReferenceValue referenceValue) { TracedReferenceValue tracedReferenceValue = (TracedReferenceValue)referenceValue; InstructionOffsetValue instructionOffsetValue = tracedReferenceValue.getTraceValue().instructionOffsetValue(); int parameterCount = instructionOffsetValue.instructionOffsetCount(); for (int index = 0; index < parameterCount; index++) { if (!instructionOffsetValue.isMethodParameter(index)) { instanceEscaping[instructionOffsetValue.instructionOffset(index)] = true; } } }
/** * Marks the producing offsets of the given traced reference value. */ private void markReturnedReferenceValues(ReferenceValue referenceValue) { TracedReferenceValue tracedReferenceValue = (TracedReferenceValue)referenceValue; InstructionOffsetValue instructionOffsetValue = tracedReferenceValue.getTraceValue().instructionOffsetValue(); int parameterCount = instructionOffsetValue.instructionOffsetCount(); for (int index = 0; index < parameterCount; index++) { if (!instructionOffsetValue.isMethodParameter(index)) { instanceReturned[instructionOffsetValue.instructionOffset(index)] = true; } } }
/** * Marks the producing offsets of the given traced reference value. */ private void markModifiedReferenceValues(ReferenceValue referenceValue) { TracedReferenceValue tracedReferenceValue = (TracedReferenceValue)referenceValue; InstructionOffsetValue instructionOffsetValue = tracedReferenceValue.getTraceValue().instructionOffsetValue(); int parameterCount = instructionOffsetValue.instructionOffsetCount(); for (int index = 0; index < parameterCount; index++) { if (!instructionOffsetValue.isMethodParameter(index)) { instanceModified[instructionOffsetValue.instructionOffset(index)] = true; } } }
/** * Marks the producing offsets of the given traced reference value. */ private void markReturnedReferenceValues(ReferenceValue referenceValue) { TracedReferenceValue tracedReferenceValue = (TracedReferenceValue)referenceValue; InstructionOffsetValue instructionOffsetValue = tracedReferenceValue.getTraceValue().instructionOffsetValue(); int parameterCount = instructionOffsetValue.instructionOffsetCount(); for (int index = 0; index < parameterCount; index++) { if (!instructionOffsetValue.isMethodParameter(index)) { instanceReturned[instructionOffsetValue.instructionOffset(index)] = true; } } }
/** * Marks the producing parameters (and the classes) of the given * reference value. */ private void markEscapingParameters(Method method, ReferenceValue referenceValue) { TracedReferenceValue tracedReferenceValue = (TracedReferenceValue)referenceValue; InstructionOffsetValue producers = tracedReferenceValue.getTraceValue().instructionOffsetValue(); int producerCount = producers.instructionOffsetCount(); for (int index = 0; index < producerCount; index++) { if (producers.isMethodParameter(index)) { // We know exactly which parameter is escaping. markParameterEscaping(method, producers.methodParameter(index)); } } }
/** * Marks the producing parameters (and the classes) of the given * reference value. */ private void markEscapingParameters(Method method, ReferenceValue referenceValue) { TracedReferenceValue tracedReferenceValue = (TracedReferenceValue)referenceValue; InstructionOffsetValue producers = tracedReferenceValue.getTraceValue().instructionOffsetValue(); int producerCount = producers.instructionOffsetCount(); for (int index = 0; index < producerCount; index++) { if (producers.isMethodParameter(index)) { // We know exactly which parameter is escaping. markParameterEscaping(method, producers.methodParameter(index)); } } }
/** * Marks the producing parameters (and the classes) of the given * reference value. */ private void markEscapingParameters(Method method, ReferenceValue referenceValue) { TracedReferenceValue tracedReferenceValue = (TracedReferenceValue)referenceValue; InstructionOffsetValue producers = tracedReferenceValue.getTraceValue().instructionOffsetValue(); int producerCount = producers.instructionOffsetCount(); for (int index = 0; index < producerCount; index++) { if (producers.isMethodParameter(index)) { // We know exactly which parameter is escaping. markParameterEscaping(method, producers.methodParameter(index)); } } }
/** * Returns whether the producing reference value is escaping or has escaped. */ private boolean hasEscaped(ReferenceValue referenceValue) { TracedReferenceValue tracedReferenceValue = (TracedReferenceValue)referenceValue; InstructionOffsetValue instructionOffsetValue = tracedReferenceValue.getTraceValue().instructionOffsetValue(); int count = instructionOffsetValue.instructionOffsetCount(); for (int index = 0; index < count; index++) { if (instructionOffsetValue.isMethodParameter(index) ? hasParameterEscaped(referencingMethod, instructionOffsetValue.methodParameter(index)) : referenceEscapeChecker.isInstanceEscaping(instructionOffsetValue.instructionOffset(index))) { return true; } } return false; }
/** * Returns whether the producing reference value is escaping or has escaped. */ private boolean hasEscaped(ReferenceValue referenceValue) { TracedReferenceValue tracedReferenceValue = (TracedReferenceValue)referenceValue; InstructionOffsetValue instructionOffsetValue = tracedReferenceValue.getTraceValue().instructionOffsetValue(); int count = instructionOffsetValue.instructionOffsetCount(); for (int index = 0; index < count; index++) { if (instructionOffsetValue.isMethodParameter(index) ? hasParameterEscaped(referencingMethod, instructionOffsetValue.methodParameter(index)) : referenceEscapeChecker.isInstanceEscaping(instructionOffsetValue.instructionOffset(index))) { return true; } } return false; }
/** * Returns whether the producing reference value is escaping or has escaped. */ private boolean hasEscaped(ReferenceValue referenceValue) { TracedReferenceValue tracedReferenceValue = (TracedReferenceValue)referenceValue; InstructionOffsetValue instructionOffsetValue = tracedReferenceValue.getTraceValue().instructionOffsetValue(); int count = instructionOffsetValue.instructionOffsetCount(); for (int index = 0; index < count; index++) { if (instructionOffsetValue.isMethodParameter(index) ? hasParameterEscaped(referencingMethod, instructionOffsetValue.methodParameter(index)) : referenceEscapeChecker.isInstanceEscaping(instructionOffsetValue.instructionOffset(index))) { return true; } } return false; }
/** * Marks the producing instructions of the variable consumer at the given * offset. * @param consumerOffset the offset of the variable consumer. * @param variableIndex the index of the variable that is loaded. */ private void markVariableProducers(int consumerOffset, int variableIndex) { InstructionOffsetValue producerOffsets = partialEvaluator.getVariablesBefore(consumerOffset).getProducerValue(variableIndex).instructionOffsetValue(); if (producerOffsets != null) { int offsetCount = producerOffsets.instructionOffsetCount(); for (int offsetIndex = 0; offsetIndex < offsetCount; offsetIndex++) { if (!producerOffsets.isMethodParameter(offsetIndex) && !producerOffsets.isExceptionHandler(offsetIndex)) { // Make sure the variable and the instruction are marked // at the producing offset. int offset = producerOffsets.instructionOffset(offsetIndex); markInstruction(offset); } } } }
/** * Marks the producing parameters of the given reference value. */ private void markModifiedParameters(Method method, ReferenceValue referenceValue) { TracedReferenceValue tracedReferenceValue = (TracedReferenceValue)referenceValue; InstructionOffsetValue producers = tracedReferenceValue.getTraceValue().instructionOffsetValue(); int producerCount = producers.instructionOffsetCount(); for (int index = 0; index < producerCount; index++) { if (producers.isMethodParameter(index)) { // We know exactly which parameter is being modified. markParameterModified(method, producers.methodParameter(index)); } else if (!producers.isNewinstance(index) && !producers.isExceptionHandler(index)) { // If some unknown instance is modified, any escaping parameters // may be modified. markModifiedParameters(method, getEscapingParameters(method)); markAnythingModified(method); } } }
/** * Marks the producing parameters of the given reference value. */ private void markModifiedParameters(Method method, ReferenceValue referenceValue) { TracedReferenceValue tracedReferenceValue = (TracedReferenceValue)referenceValue; InstructionOffsetValue producers = tracedReferenceValue.getTraceValue().instructionOffsetValue(); int producerCount = producers.instructionOffsetCount(); for (int index = 0; index < producerCount; index++) { if (producers.isMethodParameter(index)) { // We know exactly which parameter is being modified. markParameterModified(method, producers.methodParameter(index)); } else if (!producers.isNewinstance(index) && !producers.isExceptionHandler(index)) { // If some unknown instance is modified, any escaping parameters // may be modified. markModifiedParameters(method, getEscapingParameters(method)); markAnythingModified(method); } } }
/** * Marks the producing parameters of the given reference value. */ private void markModifiedParameters(Method method, ReferenceValue referenceValue) { TracedReferenceValue tracedReferenceValue = (TracedReferenceValue)referenceValue; InstructionOffsetValue producers = tracedReferenceValue.getTraceValue().instructionOffsetValue(); int producerCount = producers.instructionOffsetCount(); for (int index = 0; index < producerCount; index++) { if (producers.isMethodParameter(index)) { // We know exactly which parameter is being modified. markParameterModified(method, producers.methodParameter(index)); } else if (!producers.isNewinstance(index) && !producers.isExceptionHandler(index)) { // If some unknown instance is modified, any escaping parameters // may be modified. markModifiedParameters(method, getEscapingParameters(method)); markAnythingModified(method); } } }
/** * Marks the method and the producing parameters of the given reference * value. */ private void markReturnedParameters(Method method, ReferenceValue referenceValue) { TracedReferenceValue tracedReferenceValue = (TracedReferenceValue)referenceValue; InstructionOffsetValue producers = tracedReferenceValue.getTraceValue().instructionOffsetValue(); int producerCount = producers.instructionOffsetCount(); for (int index = 0; index < producerCount; index++) { if (producers.isMethodParameter(index)) { // We know exactly which parameter is returned. markParameterReturned(method, producers.methodParameter(index)); } else if (producers.isFieldValue(index)) { markReturnsExternalValues(method); } else if (producers.isNewinstance(index) || producers.isExceptionHandler(index)) { markReturnsNewInstances(method); } } }