mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-27 14:54:52 +02:00
8191324: SA cleanup -- part 2
Avoid redefinition of hotspot constants and ia64 code vestiges removal Reviewed-by: sspitsyn, dholmes, coleenp
This commit is contained in:
parent
3ef7804e6d
commit
42d3f8d610
19 changed files with 115 additions and 578 deletions
|
@ -245,6 +245,7 @@ class PerfData : public CHeapObj<mtInternal> {
|
||||||
|
|
||||||
friend class StatSampler; // for access to protected void sample()
|
friend class StatSampler; // for access to protected void sample()
|
||||||
friend class PerfDataManager; // for access to protected destructor
|
friend class PerfDataManager; // for access to protected destructor
|
||||||
|
friend class VMStructs;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
|
|
|
@ -1534,6 +1534,7 @@ typedef PaddedEnd<ObjectMonitor> PaddedObjectMonitor;
|
||||||
declare_toplevel_type(PerfDataPrologue*) \
|
declare_toplevel_type(PerfDataPrologue*) \
|
||||||
declare_toplevel_type(PerfDataEntry) \
|
declare_toplevel_type(PerfDataEntry) \
|
||||||
declare_toplevel_type(PerfMemory) \
|
declare_toplevel_type(PerfMemory) \
|
||||||
|
declare_type(PerfData, CHeapObj<mtInternal>) \
|
||||||
\
|
\
|
||||||
/*********************************/ \
|
/*********************************/ \
|
||||||
/* SymbolTable, SystemDictionary */ \
|
/* SymbolTable, SystemDictionary */ \
|
||||||
|
@ -2481,6 +2482,12 @@ typedef PaddedEnd<ObjectMonitor> PaddedObjectMonitor;
|
||||||
declare_constant(InstanceKlass::inner_class_access_flags_offset) \
|
declare_constant(InstanceKlass::inner_class_access_flags_offset) \
|
||||||
declare_constant(InstanceKlass::inner_class_next_offset) \
|
declare_constant(InstanceKlass::inner_class_next_offset) \
|
||||||
\
|
\
|
||||||
|
/*****************************************************/ \
|
||||||
|
/* InstanceKlass EnclosingMethodAttributeOffset enum */ \
|
||||||
|
/*****************************************************/ \
|
||||||
|
\
|
||||||
|
declare_constant(InstanceKlass::enclosing_method_attribute_size) \
|
||||||
|
\
|
||||||
/*********************************/ \
|
/*********************************/ \
|
||||||
/* InstanceKlass ClassState enum */ \
|
/* InstanceKlass ClassState enum */ \
|
||||||
/*********************************/ \
|
/*********************************/ \
|
||||||
|
@ -2734,6 +2741,21 @@ typedef PaddedEnd<ObjectMonitor> PaddedObjectMonitor;
|
||||||
declare_c2_preprocessor_constant("SAVED_ON_ENTRY_REG_COUNT", SAVED_ON_ENTRY_REG_COUNT) \
|
declare_c2_preprocessor_constant("SAVED_ON_ENTRY_REG_COUNT", SAVED_ON_ENTRY_REG_COUNT) \
|
||||||
declare_c2_preprocessor_constant("C_SAVED_ON_ENTRY_REG_COUNT", C_SAVED_ON_ENTRY_REG_COUNT) \
|
declare_c2_preprocessor_constant("C_SAVED_ON_ENTRY_REG_COUNT", C_SAVED_ON_ENTRY_REG_COUNT) \
|
||||||
\
|
\
|
||||||
|
/************/ \
|
||||||
|
/* PerfData */ \
|
||||||
|
/************/ \
|
||||||
|
\
|
||||||
|
/***********************/ \
|
||||||
|
/* PerfData Units enum */ \
|
||||||
|
/***********************/ \
|
||||||
|
\
|
||||||
|
declare_constant(PerfData::U_None) \
|
||||||
|
declare_constant(PerfData::U_Bytes) \
|
||||||
|
declare_constant(PerfData::U_Ticks) \
|
||||||
|
declare_constant(PerfData::U_Events) \
|
||||||
|
declare_constant(PerfData::U_String) \
|
||||||
|
declare_constant(PerfData::U_Hertz) \
|
||||||
|
\
|
||||||
/****************/ \
|
/****************/ \
|
||||||
/* JVMCI */ \
|
/* JVMCI */ \
|
||||||
/****************/ \
|
/****************/ \
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2002, 2007, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 2002, 2017, Oracle and/or its affiliates. All rights reserved.
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
|
@ -298,9 +298,6 @@ JNIEXPORT jlongArray JNICALL Java_sun_jvm_hotspot_debugger_bsd_BsdDebuggerLocal_
|
||||||
#ifdef i386
|
#ifdef i386
|
||||||
#define NPRGREG sun_jvm_hotspot_debugger_x86_X86ThreadContext_NPRGREG
|
#define NPRGREG sun_jvm_hotspot_debugger_x86_X86ThreadContext_NPRGREG
|
||||||
#endif
|
#endif
|
||||||
#ifdef ia64
|
|
||||||
#define NPRGREG IA64_REG_COUNT
|
|
||||||
#endif
|
|
||||||
#ifdef amd64
|
#ifdef amd64
|
||||||
#define NPRGREG sun_jvm_hotspot_debugger_amd64_AMD64ThreadContext_NPRGREG
|
#define NPRGREG sun_jvm_hotspot_debugger_amd64_AMD64ThreadContext_NPRGREG
|
||||||
#endif
|
#endif
|
||||||
|
@ -335,14 +332,6 @@ JNIEXPORT jlongArray JNICALL Java_sun_jvm_hotspot_debugger_bsd_BsdDebuggerLocal_
|
||||||
|
|
||||||
#endif /* i386 */
|
#endif /* i386 */
|
||||||
|
|
||||||
#if ia64
|
|
||||||
regs = (*env)->GetLongArrayElements(env, array, &isCopy);
|
|
||||||
int i;
|
|
||||||
for (i = 0; i < NPRGREG; i++ ) {
|
|
||||||
regs[i] = 0xDEADDEAD;
|
|
||||||
}
|
|
||||||
#endif /* ia64 */
|
|
||||||
|
|
||||||
#ifdef amd64
|
#ifdef amd64
|
||||||
#define REG_INDEX(reg) sun_jvm_hotspot_debugger_amd64_AMD64ThreadContext_##reg
|
#define REG_INDEX(reg) sun_jvm_hotspot_debugger_amd64_AMD64ThreadContext_##reg
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
|
@ -35,7 +35,6 @@ import sun.jvm.hotspot.debugger.MachineDescription;
|
||||||
import sun.jvm.hotspot.debugger.MachineDescriptionAMD64;
|
import sun.jvm.hotspot.debugger.MachineDescriptionAMD64;
|
||||||
import sun.jvm.hotspot.debugger.MachineDescriptionPPC64;
|
import sun.jvm.hotspot.debugger.MachineDescriptionPPC64;
|
||||||
import sun.jvm.hotspot.debugger.MachineDescriptionAArch64;
|
import sun.jvm.hotspot.debugger.MachineDescriptionAArch64;
|
||||||
import sun.jvm.hotspot.debugger.MachineDescriptionIA64;
|
|
||||||
import sun.jvm.hotspot.debugger.MachineDescriptionIntelX86;
|
import sun.jvm.hotspot.debugger.MachineDescriptionIntelX86;
|
||||||
import sun.jvm.hotspot.debugger.MachineDescriptionSPARC32Bit;
|
import sun.jvm.hotspot.debugger.MachineDescriptionSPARC32Bit;
|
||||||
import sun.jvm.hotspot.debugger.MachineDescriptionSPARC64Bit;
|
import sun.jvm.hotspot.debugger.MachineDescriptionSPARC64Bit;
|
||||||
|
@ -556,10 +555,8 @@ public class HotSpotAgent {
|
||||||
machDesc = new MachineDescriptionIntelX86();
|
machDesc = new MachineDescriptionIntelX86();
|
||||||
} else if (cpu.equals("amd64")) {
|
} else if (cpu.equals("amd64")) {
|
||||||
machDesc = new MachineDescriptionAMD64();
|
machDesc = new MachineDescriptionAMD64();
|
||||||
} else if (cpu.equals("ia64")) {
|
|
||||||
machDesc = new MachineDescriptionIA64();
|
|
||||||
} else {
|
} else {
|
||||||
throw new DebuggerException("Win32 supported under x86, amd64 and ia64 only");
|
throw new DebuggerException("Win32 supported under x86 and amd64 only");
|
||||||
}
|
}
|
||||||
|
|
||||||
// Note we do not use a cache for the local debugger in server
|
// Note we do not use a cache for the local debugger in server
|
||||||
|
@ -586,8 +583,6 @@ public class HotSpotAgent {
|
||||||
|
|
||||||
if (cpu.equals("x86")) {
|
if (cpu.equals("x86")) {
|
||||||
machDesc = new MachineDescriptionIntelX86();
|
machDesc = new MachineDescriptionIntelX86();
|
||||||
} else if (cpu.equals("ia64")) {
|
|
||||||
machDesc = new MachineDescriptionIA64();
|
|
||||||
} else if (cpu.equals("amd64")) {
|
} else if (cpu.equals("amd64")) {
|
||||||
machDesc = new MachineDescriptionAMD64();
|
machDesc = new MachineDescriptionAMD64();
|
||||||
} else if (cpu.equals("ppc64")) {
|
} else if (cpu.equals("ppc64")) {
|
||||||
|
|
|
@ -1,39 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (c) 2003, 2008, Oracle and/or its affiliates. All rights reserved.
|
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
|
||||||
*
|
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
|
||||||
* under the terms of the GNU General Public License version 2 only, as
|
|
||||||
* published by the Free Software Foundation.
|
|
||||||
*
|
|
||||||
* 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.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
package sun.jvm.hotspot.debugger;
|
|
||||||
|
|
||||||
public class MachineDescriptionIA64 extends MachineDescriptionTwosComplement implements MachineDescription {
|
|
||||||
public long getAddressSize() {
|
|
||||||
return 8;
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean isLP64() {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean isBigEndian() {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 2002, 2017, Oracle and/or its affiliates. All rights reserved.
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
|
@ -216,11 +216,7 @@ public class BsdDebuggerLocal extends DebuggerBase implements BsdDebugger {
|
||||||
// the UI. This is a cache of 4096 4K pages, or 16 MB. The page
|
// the UI. This is a cache of 4096 4K pages, or 16 MB. The page
|
||||||
// size must be adjusted to be the hardware's page size.
|
// size must be adjusted to be the hardware's page size.
|
||||||
// (FIXME: should pick this up from the debugger.)
|
// (FIXME: should pick this up from the debugger.)
|
||||||
if (getCPU().equals("ia64")) {
|
initCache(4096, parseCacheNumPagesProperty(4096));
|
||||||
initCache(16384, parseCacheNumPagesProperty(1024));
|
|
||||||
} else {
|
|
||||||
initCache(4096, parseCacheNumPagesProperty(4096));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
isDarwin = getOS().equals("darwin");
|
isDarwin = getOS().equals("darwin");
|
||||||
|
@ -575,11 +571,6 @@ public class BsdDebuggerLocal extends DebuggerBase implements BsdDebugger {
|
||||||
|
|
||||||
public CDebugger getCDebugger() {
|
public CDebugger getCDebugger() {
|
||||||
if (cdbg == null) {
|
if (cdbg == null) {
|
||||||
String cpu = getCPU();
|
|
||||||
if (cpu.equals("ia64") ) {
|
|
||||||
// IA-64 is not supported because of stack-walking issues
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
cdbg = new BsdCDebugger(this);
|
cdbg = new BsdCDebugger(this);
|
||||||
}
|
}
|
||||||
return cdbg;
|
return cdbg;
|
||||||
|
|
|
@ -1,187 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved.
|
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
|
||||||
*
|
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
|
||||||
* under the terms of the GNU General Public License version 2 only, as
|
|
||||||
* published by the Free Software Foundation.
|
|
||||||
*
|
|
||||||
* 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.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
package sun.jvm.hotspot.debugger.ia64;
|
|
||||||
|
|
||||||
import sun.jvm.hotspot.debugger.*;
|
|
||||||
import sun.jvm.hotspot.debugger.cdbg.*;
|
|
||||||
|
|
||||||
/** Specifies the thread context on ia64 platform; only a sub-portion
|
|
||||||
of the context is guaranteed to be present on all operating
|
|
||||||
systems. */
|
|
||||||
|
|
||||||
public abstract class IA64ThreadContext implements ThreadContext {
|
|
||||||
// Refer to winnt.h CONTEXT structure - Nov 2001 edition Platform SDK
|
|
||||||
// only a relevant subset of CONTEXT structure is used here.
|
|
||||||
// For eg. floating point registers are ignored.
|
|
||||||
|
|
||||||
// NOTE: the indices for the various registers must be maintained as
|
|
||||||
// listed across various operating systems. However, only a
|
|
||||||
// subset of the registers' values are guaranteed to be present
|
|
||||||
|
|
||||||
// global registers r0-r31
|
|
||||||
public static final int GR0 = 0;
|
|
||||||
public static final int GR1 = 1;
|
|
||||||
public static final int GR2 = 2;
|
|
||||||
public static final int GR3 = 3;
|
|
||||||
public static final int GR4 = 4;
|
|
||||||
public static final int GR5 = 5;
|
|
||||||
public static final int GR6 = 6;
|
|
||||||
public static final int GR7 = 7;
|
|
||||||
public static final int GR8 = 8;
|
|
||||||
public static final int GR9 = 9;
|
|
||||||
public static final int GR10 = 10;
|
|
||||||
public static final int GR11 = 11;
|
|
||||||
public static final int GR12 = 12;
|
|
||||||
public static final int SP = GR12;
|
|
||||||
public static final int GR13 = 13;
|
|
||||||
public static final int GR14 = 14;
|
|
||||||
public static final int GR15 = 15;
|
|
||||||
public static final int GR16 = 16;
|
|
||||||
public static final int GR17 = 17;
|
|
||||||
public static final int GR18 = 18;
|
|
||||||
public static final int GR19 = 19;
|
|
||||||
public static final int GR20 = 20;
|
|
||||||
public static final int GR21 = 21;
|
|
||||||
public static final int GR22 = 22;
|
|
||||||
public static final int GR23 = 23;
|
|
||||||
public static final int GR24 = 24;
|
|
||||||
public static final int GR25 = 25;
|
|
||||||
public static final int GR26 = 26;
|
|
||||||
public static final int GR27 = 27;
|
|
||||||
public static final int GR28 = 28;
|
|
||||||
public static final int GR29 = 29;
|
|
||||||
public static final int GR30 = 30;
|
|
||||||
public static final int GR31 = 31;
|
|
||||||
|
|
||||||
// Nat bits for r1-r31
|
|
||||||
public static final int INT_NATS = 32;
|
|
||||||
|
|
||||||
// predicates
|
|
||||||
public static final int PREDS = 33;
|
|
||||||
|
|
||||||
// branch registers
|
|
||||||
public static final int BR0 = 34;
|
|
||||||
public static final int BR_RP = BR0;
|
|
||||||
public static final int BR1 = 35;
|
|
||||||
public static final int BR2 = 36;
|
|
||||||
public static final int BR3 = 37;
|
|
||||||
public static final int BR4 = 38;
|
|
||||||
public static final int BR5 = 39;
|
|
||||||
public static final int BR6 = 40;
|
|
||||||
public static final int BR7 = 41;
|
|
||||||
|
|
||||||
// application registers
|
|
||||||
public static final int AP_UNAT = 42; // User Nat Collection register
|
|
||||||
public static final int AP_LC = 43; // Loop counter register
|
|
||||||
public static final int AP_EC = 43; // Epilog counter register
|
|
||||||
public static final int AP_CCV = 45; // CMPXCHG value register
|
|
||||||
public static final int AP_DCR = 46; // Default control register
|
|
||||||
|
|
||||||
// register stack info
|
|
||||||
public static final int RS_PFS = 47; // Previous function state
|
|
||||||
public static final int AP_PFS = RS_PFS;
|
|
||||||
public static final int RS_BSP = 48; // Backing store pointer
|
|
||||||
public static final int AR_BSP = RS_BSP;
|
|
||||||
public static final int RS_BSPSTORE = 49;
|
|
||||||
public static final int AP_BSPSTORE = RS_BSPSTORE;
|
|
||||||
public static final int RS_RSC = 50; // RSE configuration
|
|
||||||
public static final int AP_RSC = RS_RSC;
|
|
||||||
public static final int RS_RNAT = 51; // RSE Nat collection register
|
|
||||||
public static final int AP_RNAT = RS_RNAT;
|
|
||||||
|
|
||||||
// trap status register
|
|
||||||
public static final int ST_IPSR = 52; // Interuption Processor Status
|
|
||||||
public static final int ST_IIP = 53; // Interruption IP
|
|
||||||
public static final int ST_IFS = 54; // Interruption Function State
|
|
||||||
|
|
||||||
// debug registers
|
|
||||||
public static final int DB_I0 = 55;
|
|
||||||
public static final int DB_I1 = 56;
|
|
||||||
public static final int DB_I2 = 57;
|
|
||||||
public static final int DB_I3 = 58;
|
|
||||||
public static final int DB_I4 = 59;
|
|
||||||
public static final int DB_I5 = 60;
|
|
||||||
public static final int DB_I6 = 61;
|
|
||||||
public static final int DB_I7 = 62;
|
|
||||||
|
|
||||||
public static final int DB_D0 = 63;
|
|
||||||
public static final int DB_D1 = 64;
|
|
||||||
public static final int DB_D2 = 65;
|
|
||||||
public static final int DB_D3 = 66;
|
|
||||||
public static final int DB_D4 = 67;
|
|
||||||
public static final int DB_D5 = 68;
|
|
||||||
public static final int DB_D6 = 69;
|
|
||||||
public static final int DB_D7 = 70;
|
|
||||||
|
|
||||||
public static final int NPRGREG = 71;
|
|
||||||
|
|
||||||
private static final String[] regNames = {
|
|
||||||
"GR0", "GR1", "GR2", "GR3", "GR4", "GR5", "GR6", "GR7", "GR8",
|
|
||||||
"GR9", "GR10", "GR11", "GR12", "GR13", "GR14", "GR15", "GR16",
|
|
||||||
"GR17","GR18", "GR19", "GR20", "GR21", "GR22", "GR23", "GR24",
|
|
||||||
"GR25","GR26", "GR27", "GR28", "GR29", "GR30", "GR31",
|
|
||||||
"INT_NATS", "PREDS",
|
|
||||||
"BR0", "BR1", "BR2", "BR3", "BR4", "BR5", "BR6", "BR7",
|
|
||||||
"AP_UNAT", "AP_LC", "AP_EC", "AP_CCV", "AP_DCR",
|
|
||||||
"RS_FPS", "RS_BSP", "RS_BSPSTORE", "RS_RSC", "RS_RNAT",
|
|
||||||
"ST_IPSR", "ST_IIP", "ST_IFS",
|
|
||||||
"DB_I0", "DB_I1", "DB_I2", "DB_I3", "DB_I4", "DB_I5", "DB_I6", "DB_I7",
|
|
||||||
"DB_D0", "DB_D1", "DB_D2", "DB_D3", "DB_D4", "DB_D5", "DB_D6", "DB_D7"
|
|
||||||
};
|
|
||||||
|
|
||||||
private long[] data;
|
|
||||||
|
|
||||||
public IA64ThreadContext() {
|
|
||||||
data = new long[NPRGREG];
|
|
||||||
}
|
|
||||||
|
|
||||||
public int getNumRegisters() {
|
|
||||||
return NPRGREG;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getRegisterName(int index) {
|
|
||||||
return regNames[index];
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setRegister(int index, long value) {
|
|
||||||
data[index] = value;
|
|
||||||
}
|
|
||||||
|
|
||||||
public long getRegister(int index) {
|
|
||||||
return data[index];
|
|
||||||
}
|
|
||||||
|
|
||||||
public CFrame getTopFrame(Debugger dbg) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
/** This can't be implemented in this class since we would have to
|
|
||||||
tie the implementation to, for example, the debugging system */
|
|
||||||
public abstract void setRegisterAsAddress(int index, Address value);
|
|
||||||
|
|
||||||
/** This can't be implemented in this class since we would have to
|
|
||||||
tie the implementation to, for example, the debugging system */
|
|
||||||
public abstract Address getRegisterAsAddress(int index);
|
|
||||||
}
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 2002, 2017, Oracle and/or its affiliates. All rights reserved.
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
|
@ -210,11 +210,7 @@ public class LinuxDebuggerLocal extends DebuggerBase implements LinuxDebugger {
|
||||||
// the UI. This is a cache of 4096 4K pages, or 16 MB. The page
|
// the UI. This is a cache of 4096 4K pages, or 16 MB. The page
|
||||||
// size must be adjusted to be the hardware's page size.
|
// size must be adjusted to be the hardware's page size.
|
||||||
// (FIXME: should pick this up from the debugger.)
|
// (FIXME: should pick this up from the debugger.)
|
||||||
if (getCPU().equals("ia64")) {
|
initCache(4096, parseCacheNumPagesProperty(4096));
|
||||||
initCache(16384, parseCacheNumPagesProperty(1024));
|
|
||||||
} else {
|
|
||||||
initCache(4096, parseCacheNumPagesProperty(4096));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
workerThread = new LinuxDebuggerLocalWorkerThread(this);
|
workerThread = new LinuxDebuggerLocalWorkerThread(this);
|
||||||
|
@ -560,11 +556,6 @@ public class LinuxDebuggerLocal extends DebuggerBase implements LinuxDebugger {
|
||||||
|
|
||||||
public CDebugger getCDebugger() {
|
public CDebugger getCDebugger() {
|
||||||
if (cdbg == null) {
|
if (cdbg == null) {
|
||||||
String cpu = getCPU();
|
|
||||||
if (cpu.equals("ia64") ) {
|
|
||||||
// IA-64 is not supported because of stack-walking issues
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
cdbg = new LinuxCDebugger(this);
|
cdbg = new LinuxCDebugger(this);
|
||||||
}
|
}
|
||||||
return cdbg;
|
return cdbg;
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2002, 2012, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 2002, 2017, Oracle and/or its affiliates. All rights reserved.
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
|
@ -27,7 +27,6 @@ package sun.jvm.hotspot.debugger.linux;
|
||||||
import java.lang.reflect.*;
|
import java.lang.reflect.*;
|
||||||
import sun.jvm.hotspot.debugger.*;
|
import sun.jvm.hotspot.debugger.*;
|
||||||
import sun.jvm.hotspot.debugger.linux.amd64.*;
|
import sun.jvm.hotspot.debugger.linux.amd64.*;
|
||||||
import sun.jvm.hotspot.debugger.linux.ia64.*;
|
|
||||||
import sun.jvm.hotspot.debugger.linux.x86.*;
|
import sun.jvm.hotspot.debugger.linux.x86.*;
|
||||||
import sun.jvm.hotspot.debugger.linux.ppc64.*;
|
import sun.jvm.hotspot.debugger.linux.ppc64.*;
|
||||||
import sun.jvm.hotspot.debugger.linux.sparc.*;
|
import sun.jvm.hotspot.debugger.linux.sparc.*;
|
||||||
|
@ -39,8 +38,6 @@ class LinuxThreadContextFactory {
|
||||||
return new LinuxX86ThreadContext(dbg);
|
return new LinuxX86ThreadContext(dbg);
|
||||||
} else if (cpu.equals("amd64")) {
|
} else if (cpu.equals("amd64")) {
|
||||||
return new LinuxAMD64ThreadContext(dbg);
|
return new LinuxAMD64ThreadContext(dbg);
|
||||||
} else if (cpu.equals("ia64")) {
|
|
||||||
return new LinuxIA64ThreadContext(dbg);
|
|
||||||
} else if (cpu.equals("sparc")) {
|
} else if (cpu.equals("sparc")) {
|
||||||
return new LinuxSPARCThreadContext(dbg);
|
return new LinuxSPARCThreadContext(dbg);
|
||||||
} else if (cpu.equals("ppc64")) {
|
} else if (cpu.equals("ppc64")) {
|
||||||
|
|
|
@ -1,46 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved.
|
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
|
||||||
*
|
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
|
||||||
* under the terms of the GNU General Public License version 2 only, as
|
|
||||||
* published by the Free Software Foundation.
|
|
||||||
*
|
|
||||||
* 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.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
package sun.jvm.hotspot.debugger.linux.ia64;
|
|
||||||
|
|
||||||
import sun.jvm.hotspot.debugger.*;
|
|
||||||
import sun.jvm.hotspot.debugger.ia64.*;
|
|
||||||
import sun.jvm.hotspot.debugger.linux.*;
|
|
||||||
|
|
||||||
public class LinuxIA64ThreadContext extends IA64ThreadContext {
|
|
||||||
private LinuxDebugger debugger;
|
|
||||||
|
|
||||||
public LinuxIA64ThreadContext(LinuxDebugger debugger) {
|
|
||||||
super();
|
|
||||||
this.debugger = debugger;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setRegisterAsAddress(int index, Address value) {
|
|
||||||
setRegister(index, debugger.getAddressValue(value));
|
|
||||||
}
|
|
||||||
|
|
||||||
public Address getRegisterAsAddress(int index) {
|
|
||||||
return debugger.newAddress(getRegister(index));
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 2002, 2017, Oracle and/or its affiliates. All rights reserved.
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
|
@ -30,10 +30,8 @@ import java.util.*;
|
||||||
import sun.jvm.hotspot.debugger.*;
|
import sun.jvm.hotspot.debugger.*;
|
||||||
import sun.jvm.hotspot.debugger.amd64.*;
|
import sun.jvm.hotspot.debugger.amd64.*;
|
||||||
import sun.jvm.hotspot.debugger.x86.*;
|
import sun.jvm.hotspot.debugger.x86.*;
|
||||||
import sun.jvm.hotspot.debugger.ia64.*;
|
|
||||||
import sun.jvm.hotspot.debugger.windbg.amd64.*;
|
import sun.jvm.hotspot.debugger.windbg.amd64.*;
|
||||||
import sun.jvm.hotspot.debugger.windbg.x86.*;
|
import sun.jvm.hotspot.debugger.windbg.x86.*;
|
||||||
import sun.jvm.hotspot.debugger.windbg.ia64.*;
|
|
||||||
import sun.jvm.hotspot.debugger.win32.coff.*;
|
import sun.jvm.hotspot.debugger.win32.coff.*;
|
||||||
import sun.jvm.hotspot.debugger.cdbg.*;
|
import sun.jvm.hotspot.debugger.cdbg.*;
|
||||||
import sun.jvm.hotspot.debugger.cdbg.basic.BasicDebugEvent;
|
import sun.jvm.hotspot.debugger.cdbg.basic.BasicDebugEvent;
|
||||||
|
@ -115,8 +113,6 @@ public class WindbgDebuggerLocal extends DebuggerBase implements WindbgDebugger
|
||||||
threadFactory = new WindbgX86ThreadFactory(this);
|
threadFactory = new WindbgX86ThreadFactory(this);
|
||||||
} else if (cpu.equals("amd64")) {
|
} else if (cpu.equals("amd64")) {
|
||||||
threadFactory = new WindbgAMD64ThreadFactory(this);
|
threadFactory = new WindbgAMD64ThreadFactory(this);
|
||||||
} else if (cpu.equals("ia64")) {
|
|
||||||
threadFactory = new WindbgIA64ThreadFactory(this);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (useCache) {
|
if (useCache) {
|
||||||
|
@ -231,11 +227,7 @@ public class WindbgDebuggerLocal extends DebuggerBase implements WindbgDebugger
|
||||||
|
|
||||||
public CDebugger getCDebugger() throws DebuggerException {
|
public CDebugger getCDebugger() throws DebuggerException {
|
||||||
if (cdbg == null) {
|
if (cdbg == null) {
|
||||||
// FIXME: CDebugger is not yet supported for IA64 because
|
cdbg = new WindbgCDebugger(this);
|
||||||
// of native stack walking issues.
|
|
||||||
if (! getCPU().equals("ia64")) {
|
|
||||||
cdbg = new WindbgCDebugger(this);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return cdbg;
|
return cdbg;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,103 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved.
|
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
|
||||||
*
|
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
|
||||||
* under the terms of the GNU General Public License version 2 only, as
|
|
||||||
* published by the Free Software Foundation.
|
|
||||||
*
|
|
||||||
* 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.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
package sun.jvm.hotspot.debugger.windbg.ia64;
|
|
||||||
|
|
||||||
import sun.jvm.hotspot.debugger.*;
|
|
||||||
import sun.jvm.hotspot.debugger.ia64.*;
|
|
||||||
import sun.jvm.hotspot.debugger.windbg.*;
|
|
||||||
|
|
||||||
class WindbgIA64Thread implements ThreadProxy {
|
|
||||||
private WindbgDebugger debugger;
|
|
||||||
private long sysId;
|
|
||||||
private boolean gotID;
|
|
||||||
private long id;
|
|
||||||
|
|
||||||
/** The address argument must be the address of the HANDLE of the
|
|
||||||
desired thread in the target process. */
|
|
||||||
WindbgIA64Thread(WindbgDebugger debugger, Address addr) {
|
|
||||||
this.debugger = debugger;
|
|
||||||
// FIXME: size of data fetched here should be configurable.
|
|
||||||
// However, making it so would produce a dependency on the "types"
|
|
||||||
// package from the debugger package, which is not desired.
|
|
||||||
|
|
||||||
// another hack here is that we use sys thread id instead of handle.
|
|
||||||
// windbg can't get details based on handles it seems.
|
|
||||||
// I assume that osThread_win32 thread struct has _thread_id (which
|
|
||||||
// sys thread id) just after handle field.
|
|
||||||
|
|
||||||
this.sysId = (int) addr.addOffsetTo(debugger.getAddressSize()).getCIntegerAt(0, 4, true);
|
|
||||||
gotID = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
WindbgIA64Thread(WindbgDebugger debugger, long sysId) {
|
|
||||||
this.debugger = debugger;
|
|
||||||
this.sysId = sysId;
|
|
||||||
gotID = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
public ThreadContext getContext() throws IllegalThreadStateException {
|
|
||||||
long[] data = debugger.getThreadIntegerRegisterSet(getThreadID());
|
|
||||||
WindbgIA64ThreadContext context = new WindbgIA64ThreadContext(debugger);
|
|
||||||
for (int i = 0; i < data.length; i++) {
|
|
||||||
context.setRegister(i, data[i]);
|
|
||||||
}
|
|
||||||
return context;
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean canSetContext() throws DebuggerException {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setContext(ThreadContext thrCtx)
|
|
||||||
throws IllegalThreadStateException, DebuggerException {
|
|
||||||
throw new DebuggerException("Unimplemented");
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean equals(Object obj) {
|
|
||||||
if ((obj == null) || !(obj instanceof WindbgIA64Thread)) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
return (((WindbgIA64Thread) obj).getThreadID() == getThreadID());
|
|
||||||
}
|
|
||||||
|
|
||||||
public int hashCode() {
|
|
||||||
return (int) getThreadID();
|
|
||||||
}
|
|
||||||
|
|
||||||
public String toString() {
|
|
||||||
return Long.toString(getThreadID());
|
|
||||||
}
|
|
||||||
|
|
||||||
/** Retrieves the thread ID of this thread by examining the Thread
|
|
||||||
Information Block. */
|
|
||||||
private long getThreadID() {
|
|
||||||
if (!gotID) {
|
|
||||||
id = debugger.getThreadIdFromSysId(sysId);
|
|
||||||
}
|
|
||||||
|
|
||||||
return id;
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,46 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved.
|
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
|
||||||
*
|
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
|
||||||
* under the terms of the GNU General Public License version 2 only, as
|
|
||||||
* published by the Free Software Foundation.
|
|
||||||
*
|
|
||||||
* 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.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
package sun.jvm.hotspot.debugger.windbg.ia64;
|
|
||||||
|
|
||||||
import sun.jvm.hotspot.debugger.*;
|
|
||||||
import sun.jvm.hotspot.debugger.ia64.*;
|
|
||||||
import sun.jvm.hotspot.debugger.windbg.*;
|
|
||||||
|
|
||||||
class WindbgIA64ThreadContext extends IA64ThreadContext {
|
|
||||||
private WindbgDebugger debugger;
|
|
||||||
|
|
||||||
public WindbgIA64ThreadContext(WindbgDebugger debugger) {
|
|
||||||
super();
|
|
||||||
this.debugger = debugger;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setRegisterAsAddress(int index, Address value) {
|
|
||||||
setRegister(index, debugger.getAddressValue(value));
|
|
||||||
}
|
|
||||||
|
|
||||||
public Address getRegisterAsAddress(int index) {
|
|
||||||
return debugger.newAddress(getRegister(index));
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,44 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved.
|
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
|
||||||
*
|
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
|
||||||
* under the terms of the GNU General Public License version 2 only, as
|
|
||||||
* published by the Free Software Foundation.
|
|
||||||
*
|
|
||||||
* 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.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
package sun.jvm.hotspot.debugger.windbg.ia64;
|
|
||||||
|
|
||||||
import sun.jvm.hotspot.debugger.*;
|
|
||||||
import sun.jvm.hotspot.debugger.windbg.*;
|
|
||||||
|
|
||||||
public class WindbgIA64ThreadFactory implements WindbgThreadFactory {
|
|
||||||
private WindbgDebugger debugger;
|
|
||||||
|
|
||||||
public WindbgIA64ThreadFactory(WindbgDebugger debugger) {
|
|
||||||
this.debugger = debugger;
|
|
||||||
}
|
|
||||||
|
|
||||||
public ThreadProxy createThreadWrapper(Address threadIdentifierAddr) {
|
|
||||||
return new WindbgIA64Thread(debugger, threadIdentifierAddr);
|
|
||||||
}
|
|
||||||
|
|
||||||
public ThreadProxy createThreadWrapper(long id) {
|
|
||||||
return new WindbgIA64Thread(debugger, id);
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -474,20 +474,48 @@ public class InstanceKlass extends Klass {
|
||||||
}
|
}
|
||||||
|
|
||||||
// same as enum InnerClassAttributeOffset in VM code.
|
// same as enum InnerClassAttributeOffset in VM code.
|
||||||
public static interface InnerClassAttributeOffset {
|
private static class InnerClassAttributeOffset {
|
||||||
// from JVM spec. "InnerClasses" attribute
|
// from JVM spec. "InnerClasses" attribute
|
||||||
public static final int innerClassInnerClassInfoOffset = 0;
|
public static int innerClassInnerClassInfoOffset;
|
||||||
public static final int innerClassOuterClassInfoOffset = 1;
|
public static int innerClassOuterClassInfoOffset;
|
||||||
public static final int innerClassInnerNameOffset = 2;
|
public static int innerClassInnerNameOffset;
|
||||||
public static final int innerClassAccessFlagsOffset = 3;
|
public static int innerClassAccessFlagsOffset;
|
||||||
public static final int innerClassNextOffset = 4;
|
public static int innerClassNextOffset;
|
||||||
};
|
static {
|
||||||
|
VM.registerVMInitializedObserver(new Observer() {
|
||||||
|
public void update(Observable o, Object data) {
|
||||||
|
initialize(VM.getVM().getTypeDataBase());
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
public static interface EnclosingMethodAttributeOffset {
|
private static synchronized void initialize(TypeDataBase db) {
|
||||||
public static final int enclosing_method_class_index_offset = 0;
|
innerClassInnerClassInfoOffset = db.lookupIntConstant(
|
||||||
public static final int enclosing_method_method_index_offset = 1;
|
"InstanceKlass::inner_class_inner_class_info_offset").intValue();
|
||||||
public static final int enclosing_method_attribute_size = 2;
|
innerClassOuterClassInfoOffset = db.lookupIntConstant(
|
||||||
};
|
"InstanceKlass::inner_class_outer_class_info_offset").intValue();
|
||||||
|
innerClassInnerNameOffset = db.lookupIntConstant(
|
||||||
|
"InstanceKlass::inner_class_inner_name_offset").intValue();
|
||||||
|
innerClassAccessFlagsOffset = db.lookupIntConstant(
|
||||||
|
"InstanceKlass::inner_class_access_flags_offset").intValue();
|
||||||
|
innerClassNextOffset = db.lookupIntConstant(
|
||||||
|
"InstanceKlass::inner_class_next_offset").intValue();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private static class EnclosingMethodAttributeOffset {
|
||||||
|
public static int enclosingMethodAttributeSize;
|
||||||
|
static {
|
||||||
|
VM.registerVMInitializedObserver(new Observer() {
|
||||||
|
public void update(Observable o, Object data) {
|
||||||
|
initialize(VM.getVM().getTypeDataBase());
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
private static synchronized void initialize(TypeDataBase db) {
|
||||||
|
enclosingMethodAttributeSize = db.lookupIntConstant("InstanceKlass::enclosing_method_attribute_size").intValue();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// refer to compute_modifier_flags in VM code.
|
// refer to compute_modifier_flags in VM code.
|
||||||
public long computeModifierFlags() {
|
public long computeModifierFlags() {
|
||||||
|
@ -498,11 +526,11 @@ public class InstanceKlass extends Klass {
|
||||||
if (length > 0) {
|
if (length > 0) {
|
||||||
if (Assert.ASSERTS_ENABLED) {
|
if (Assert.ASSERTS_ENABLED) {
|
||||||
Assert.that(length % InnerClassAttributeOffset.innerClassNextOffset == 0 ||
|
Assert.that(length % InnerClassAttributeOffset.innerClassNextOffset == 0 ||
|
||||||
length % InnerClassAttributeOffset.innerClassNextOffset == EnclosingMethodAttributeOffset.enclosing_method_attribute_size,
|
length % InnerClassAttributeOffset.innerClassNextOffset == EnclosingMethodAttributeOffset.enclosingMethodAttributeSize,
|
||||||
"just checking");
|
"just checking");
|
||||||
}
|
}
|
||||||
for (int i = 0; i < length; i += InnerClassAttributeOffset.innerClassNextOffset) {
|
for (int i = 0; i < length; i += InnerClassAttributeOffset.innerClassNextOffset) {
|
||||||
if (i == length - EnclosingMethodAttributeOffset.enclosing_method_attribute_size) {
|
if (i == length - EnclosingMethodAttributeOffset.enclosingMethodAttributeSize) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
int ioff = innerClassList.at(i +
|
int ioff = innerClassList.at(i +
|
||||||
|
@ -547,11 +575,11 @@ public class InstanceKlass extends Klass {
|
||||||
if (length > 0) {
|
if (length > 0) {
|
||||||
if (Assert.ASSERTS_ENABLED) {
|
if (Assert.ASSERTS_ENABLED) {
|
||||||
Assert.that(length % InnerClassAttributeOffset.innerClassNextOffset == 0 ||
|
Assert.that(length % InnerClassAttributeOffset.innerClassNextOffset == 0 ||
|
||||||
length % InnerClassAttributeOffset.innerClassNextOffset == EnclosingMethodAttributeOffset.enclosing_method_attribute_size,
|
length % InnerClassAttributeOffset.innerClassNextOffset == EnclosingMethodAttributeOffset.enclosingMethodAttributeSize,
|
||||||
"just checking");
|
"just checking");
|
||||||
}
|
}
|
||||||
for (int i = 0; i < length; i += InnerClassAttributeOffset.innerClassNextOffset) {
|
for (int i = 0; i < length; i += InnerClassAttributeOffset.innerClassNextOffset) {
|
||||||
if (i == length - EnclosingMethodAttributeOffset.enclosing_method_attribute_size) {
|
if (i == length - EnclosingMethodAttributeOffset.enclosingMethodAttributeSize) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
int ioff = innerClassList.at(i +
|
int ioff = innerClassList.at(i +
|
||||||
|
|
|
@ -44,9 +44,7 @@ public class ObjectSynchronizer {
|
||||||
Type type;
|
Type type;
|
||||||
try {
|
try {
|
||||||
type = db.lookupType("ObjectSynchronizer");
|
type = db.lookupType("ObjectSynchronizer");
|
||||||
AddressField blockListField;
|
gBlockList = type.getAddressField("gBlockList").getValue();
|
||||||
blockListField = type.getAddressField("gBlockList");
|
|
||||||
gBlockListAddr = blockListField.getValue();
|
|
||||||
blockSize = db.lookupIntConstant("ObjectSynchronizer::_BLOCKSIZE").intValue();
|
blockSize = db.lookupIntConstant("ObjectSynchronizer::_BLOCKSIZE").intValue();
|
||||||
defaultCacheLineSize = db.lookupIntConstant("DEFAULT_CACHE_LINE_SIZE").intValue();
|
defaultCacheLineSize = db.lookupIntConstant("DEFAULT_CACHE_LINE_SIZE").intValue();
|
||||||
} catch (RuntimeException e) { }
|
} catch (RuntimeException e) { }
|
||||||
|
@ -84,7 +82,7 @@ public class ObjectSynchronizer {
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Iterator objectMonitorIterator() {
|
public static Iterator objectMonitorIterator() {
|
||||||
if (gBlockListAddr != null) {
|
if (gBlockList != null) {
|
||||||
return new ObjectMonitorIterator();
|
return new ObjectMonitorIterator();
|
||||||
} else {
|
} else {
|
||||||
return null;
|
return null;
|
||||||
|
@ -97,7 +95,7 @@ public class ObjectSynchronizer {
|
||||||
// and are not included by this Iterator. May add them later.
|
// and are not included by this Iterator. May add them later.
|
||||||
|
|
||||||
ObjectMonitorIterator() {
|
ObjectMonitorIterator() {
|
||||||
blockAddr = gBlockListAddr;
|
blockAddr = gBlockList;
|
||||||
index = blockSize - 1;
|
index = blockSize - 1;
|
||||||
block = new ObjectMonitor(blockAddr);
|
block = new ObjectMonitor(blockAddr);
|
||||||
}
|
}
|
||||||
|
@ -131,7 +129,7 @@ public class ObjectSynchronizer {
|
||||||
private Address blockAddr;
|
private Address blockAddr;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static Address gBlockListAddr;
|
private static Address gBlockList;
|
||||||
private static int blockSize;
|
private static int blockSize;
|
||||||
private static int defaultCacheLineSize;
|
private static int defaultCacheLineSize;
|
||||||
private static long objectMonitorTypeSize;
|
private static long objectMonitorTypeSize;
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2004, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 2004, 2017, Oracle and/or its affiliates. All rights reserved.
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
|
@ -92,14 +92,29 @@ public class PerfDataEntry extends VMObject {
|
||||||
return (flags() & 0x1) != 0;
|
return (flags() & 0x1) != 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
// NOTE: Keep this in sync with PerfData::Units enum in VM code
|
private static class PerfDataUnits {
|
||||||
public interface PerfDataUnits {
|
public static int U_None;
|
||||||
public static final int U_None = 1;
|
public static int U_Bytes;
|
||||||
public static final int U_Bytes = 2;
|
public static int U_Ticks;
|
||||||
public static final int U_Ticks = 3;
|
public static int U_Events;
|
||||||
public static final int U_Events = 4;
|
public static int U_String;
|
||||||
public static final int U_String = 5;
|
public static int U_Hertz;
|
||||||
public static final int U_Hertz = 6;
|
|
||||||
|
static {
|
||||||
|
VM.registerVMInitializedObserver(new Observer() {
|
||||||
|
public void update(Observable o, Object data) {
|
||||||
|
initialize(VM.getVM().getTypeDataBase());
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
private static synchronized void initialize(TypeDataBase db) {
|
||||||
|
U_None = db.lookupIntConstant("PerfData::U_None");
|
||||||
|
U_Bytes = db.lookupIntConstant("PerfData::U_Bytes");
|
||||||
|
U_Ticks = db.lookupIntConstant("PerfData::U_Ticks");
|
||||||
|
U_Events = db.lookupIntConstant("PerfData::U_Events");
|
||||||
|
U_String = db.lookupIntConstant("PerfData::U_String");
|
||||||
|
U_Hertz = db.lookupIntConstant("PerfData::U_Hertz");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// returns one of the constants in PerfDataUnits
|
// returns one of the constants in PerfDataUnits
|
||||||
|
@ -107,13 +122,6 @@ public class PerfDataEntry extends VMObject {
|
||||||
return (int) dataUnitsField.getValue(addr);
|
return (int) dataUnitsField.getValue(addr);
|
||||||
}
|
}
|
||||||
|
|
||||||
// NOTE: Keep this in sync with PerfData::Variability enum in VM code
|
|
||||||
public interface PerfDataVariability {
|
|
||||||
public static final int V_Constant = 1;
|
|
||||||
public static final int V_Monotonic = 2;
|
|
||||||
public static final int V_Variable = 3;
|
|
||||||
}
|
|
||||||
|
|
||||||
// returns one of the constants in PerfDataVariability
|
// returns one of the constants in PerfDataVariability
|
||||||
public int dataVariability() {
|
public int dataVariability() {
|
||||||
return (int) dataVariabilityField.getValue(addr);
|
return (int) dataVariabilityField.getValue(addr);
|
||||||
|
@ -451,23 +459,16 @@ public class PerfDataEntry extends VMObject {
|
||||||
}
|
}
|
||||||
|
|
||||||
// add units
|
// add units
|
||||||
switch (dataUnits()) {
|
int dataUnitsValue = dataUnits();
|
||||||
case PerfDataUnits.U_None:
|
|
||||||
break;
|
if (dataUnitsValue == PerfDataUnits.U_Bytes) {
|
||||||
case PerfDataUnits.U_Bytes:
|
|
||||||
str += " byte(s)";
|
str += " byte(s)";
|
||||||
break;
|
} else if (dataUnitsValue == PerfDataUnits.U_Ticks) {
|
||||||
case PerfDataUnits.U_Ticks:
|
|
||||||
str += " tick(s)";
|
str += " tick(s)";
|
||||||
break;
|
} else if (dataUnitsValue == PerfDataUnits.U_Events) {
|
||||||
case PerfDataUnits.U_Events:
|
|
||||||
str += " event(s)";
|
str += " event(s)";
|
||||||
break;
|
} else if (dataUnitsValue == PerfDataUnits.U_Hertz) {
|
||||||
case PerfDataUnits.U_String:
|
|
||||||
break;
|
|
||||||
case PerfDataUnits.U_Hertz:
|
|
||||||
str += " Hz";
|
str += " Hz";
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return str;
|
return str;
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2000, 2006, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
|
@ -117,10 +117,7 @@ public class VFrame {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
Frame s = fr.realSender(tempMap);
|
Frame s = fr.realSender(tempMap);
|
||||||
// ia64 in 1.4.1 only has java frames and no entryFrame
|
|
||||||
// so "s" can be null here for the first frame.
|
|
||||||
if (s == null) {
|
if (s == null) {
|
||||||
Assert.that(VM.getVM().getCPU().equals("ia64"), "Only ia64 should have null here");
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
if (s.isFirstFrame()) {
|
if (s.isFirstFrame()) {
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2002, 2016, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 2002, 2017, Oracle and/or its affiliates. All rights reserved.
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
|
@ -77,14 +77,14 @@ extern int _libproc_debug; /* set non-zero to enable debugging fprintfs */
|
||||||
typedef uint32_t syscall_t; /* holds a syscall instruction */
|
typedef uint32_t syscall_t; /* holds a syscall instruction */
|
||||||
#endif /* sparc */
|
#endif /* sparc */
|
||||||
|
|
||||||
#if defined(__i386) || defined(__ia64)
|
#if defined(__i386)
|
||||||
#define R_PC EIP
|
#define R_PC EIP
|
||||||
#define R_SP UESP
|
#define R_SP UESP
|
||||||
#define R_RVAL1 EAX /* register holding a function return value */
|
#define R_RVAL1 EAX /* register holding a function return value */
|
||||||
#define R_RVAL2 EDX /* 32 more bits for a 64-bit return value */
|
#define R_RVAL2 EDX /* 32 more bits for a 64-bit return value */
|
||||||
#define SYSCALL 0x9a /* syscall (lcall) instruction opcode */
|
#define SYSCALL 0x9a /* syscall (lcall) instruction opcode */
|
||||||
typedef uchar_t syscall_t[7]; /* holds a syscall instruction */
|
typedef uchar_t syscall_t[7]; /* holds a syscall instruction */
|
||||||
#endif /* __i386 || __ia64 */
|
#endif /* __i386 */
|
||||||
|
|
||||||
#define R_RVAL R_RVAL1 /* simple function return value register */
|
#define R_RVAL R_RVAL1 /* simple function return value register */
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue