/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/**
* Represents methods with method bodies.
* That is, non-native non-abstract methods.
* Private to MethodImpl.
*/
/*
* A subset of the line number info that is softly cached
*/
static private class SoftLocationXRefs {
/*
* Note: these do not necessarily correspond to
* the line numbers of the first and last elements
* in the lineLocations list. Use these only for bounds
* checking and with lineMapper.
*/
final int lowestLine;
final int highestLine;
SoftLocationXRefs(String stratumID, Map<Integer, List<Location>> lineMapper, List<Location> lineLocations,
int lowestLine, int highestLine) {
this.lineLocations =
this.lowestLine = lowestLine;
this.highestLine = highestLine;
}
}
private boolean absentVariableInformation = false;
long ref,
// The generic signature is set when this is created
}
}
return location;
}
throws AbsentInformationException {
if (sourceName == null) {
return list;
} else {
/* needs sourceName filteration */
}
}
return locs;
}
}
throws AbsentInformationException {
throw new AbsentInformationException();
}
return Collections.unmodifiableList(
}
int lineNumber)
throws AbsentInformationException {
throw new AbsentInformationException();
}
/*
* Find the locations which match the line number
* passed in.
*/
}
return Collections.unmodifiableList(
}
if (firstIndex == -1) {
}
/*
* Check for invalid code index.
*/
return null;
}
}
long codeIndex) {
if (firstIndex == -1) {
}
/*
* Check for invalid code index.
*/
throw new InternalError(
"Location with invalid code index");
}
/*
* Check for absent line numbers.
*/
}
/*
* Treat code before the beginning of the first line table
* entry as part of the first line. javac will generate
* code like this for some local classes. This "prolog"
* code contains assignments from locals in the enclosing
* scope to synthetic fields in the local class. Same for
* other language prolog code.
*/
break;
}
}
}
return getVariables();
}
}
}
return retList;
}
if (variable.isArgument()) {
}
}
return retList;
}
public byte[] bytecodes() {
bytecodesRef.get();
try {
} catch (JDWPException exc) {
throw exc.toJDIException();
}
}
/*
* Arrays are always modifiable, so it is a little unsafe
* to return the cached bytecodes directly; instead, we
* make a clone at the cost of using more memory.
*/
}
if (argSlotCount == -1) {
getVariables();
}
return argSlotCount;
}
return getBaseLocations();
}
return info;
}
int lowestLine = -1;
int highestLine = -1;
if (lineStratum == null) {
// location not mapped in this stratum
continue;
}
// remove unmapped and dup lines
if ((lineNumber != -1) &&
if (lineNumber > highestLine) {
}
}
new StratumLineInfo(stratumID,
lineStratum.sourcePath()));
// Add to the location list
// Add to the line -> locations map
if (mappedLocs == null) {
}
}
}
return info;
}
return info;
}
try {
} catch (JDWPException exc) {
/*
* Note: the absent info error shouldn't happen here
* because the first and last index are always available.
*/
throw exc.toJDIException();
}
int lowestLine = -1;
int highestLine = -1;
for (int i = 0; i < count; i++) {
/*
* Some compilers will point multiple consecutive
* lines at the same location. We need to choose
* one of them so that we can consistently map back
* and forth between line and location. So we choose
* to record only the last line entry at a particular
* location.
*/
if (lineNumber > highestLine) {
}
}
// Add to the location list
// Add to the line -> locations map
if (mappedLocs == null) {
}
}
}
/*
* firstIndex, lastIndex, and startLocation need to be
* retrieved only once since they are strongly referenced.
*/
/*
* The startLocation is the first one in the
* location list if we have one;
* otherwise, we construct a location for a
* method start with no line info
*/
if (count > 0) {
} else {
}
}
return info;
}
try {
} catch (JDWPException exc) {
absentVariableInformation = true;
throw new AbsentInformationException();
} else {
throw exc.toJDIException();
}
}
// Get the number of slots used by argument variables
for (int i=0; i<count; i++) {
/*
* Skip "this*" entries because they are never real
* variables from the JLS perspective.
*/
new LocationImpl(virtualMachine(), this,
new LocalVariableImpl(virtualMachine(), this,
// Add to the variable list
}
}
return variables;
}
if (!vm.canGet1_5LanguageFeatures()) {
return getVariables1_4();
}
try {
} catch (JDWPException exc) {
absentVariableInformation = true;
throw new AbsentInformationException();
} else {
throw exc.toJDIException();
}
}
// Get the number of slots used by argument variables
for (int i=0; i<count; i++) {
/*
* Skip "this*" entries because they are never real
* variables from the JLS perspective.
*/
new LocationImpl(virtualMachine(), this,
new LocalVariableImpl(virtualMachine(), this,
// Add to the variable list
}
}
return variables;
}
if (absentVariableInformation) {
throw new AbsentInformationException();
}
variablesRef.get();
return variables;
}
variables = getVariables1();
return variables;
}
}