Skip to content

Commit

Permalink
Merge
Browse files Browse the repository at this point in the history
  • Loading branch information
J. Duke committed Jul 5, 2017
2 parents e8d53ad + d0a89bf commit 171e39a
Show file tree
Hide file tree
Showing 397 changed files with 10,323 additions and 3,762 deletions.
1 change: 1 addition & 0 deletions .hgtags-top-repo
Original file line number Diff line number Diff line change
Expand Up @@ -197,3 +197,4 @@ c1be681d80a1f1c848dc671d664fccb19e046a12 jdk8-b72
93b9664f97eeb6f89397a8842318ebacaac9feb9 jdk8-b73
b43aa5bd8ca5c8121336495382d35ecfa7a71536 jdk8-b74
2a713921952cbd77a1e699626976cb6cdfe3e57e jdk8-b75
278af9fc67e7eba2884936b49ec07345f423aabb jdk8-b76
1 change: 1 addition & 0 deletions corba/.hgtags
Original file line number Diff line number Diff line change
Expand Up @@ -197,3 +197,4 @@ cb40427f47145b01b7e53c3e02b38ff7625efbda jdk8-b72
191afde59e7be0e1a1d76d06f2a32ff17444f0ec jdk8-b73
2132845cf5f717ff5c240a2431c0c0e03e66e3a5 jdk8-b74
d4e68ce17795601017ac2f952baad7272942c36e jdk8-b75
58be6ca3c0603882a1ec478724e337aac85e0da0 jdk8-b76
2 changes: 2 additions & 0 deletions hotspot/.hgtags
Original file line number Diff line number Diff line change
Expand Up @@ -312,3 +312,5 @@ d5cb5830f570d1304ea4b196dde672a291b55f29 jdk8-b72
1a3e54283c54aaa8b3437813e8507fbdc966e5b6 jdk8-b74
b4391649e91ea8d37f66317a03d6d2573a93d10d hs25-b17
6778d0b1659323a506ca47600ca29a9d9f8b383d jdk8-b75
20b605466ccb1b3725eb25314d9e8782199630c5 jdk8-b76
412d722168bc23f8e6d98995202728678561417f hs25-b18
12 changes: 1 addition & 11 deletions hotspot/agent/src/os/linux/LinuxDebuggerLocal.c
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ JNIEXPORT jbyteArray JNICALL Java_sun_jvm_hotspot_debugger_linux_LinuxDebuggerLo
return (err == PS_OK)? array : 0;
}

#if defined(i386) || defined(ia64) || defined(amd64) || defined(sparc) || defined(sparcv9)
#if defined(i386) || defined(amd64) || defined(sparc) || defined(sparcv9)
JNIEXPORT jlongArray JNICALL Java_sun_jvm_hotspot_debugger_linux_LinuxDebuggerLocal_getThreadIntegerRegisterSet0
(JNIEnv *env, jobject this_obj, jint lwp_id) {

Expand All @@ -299,9 +299,6 @@ JNIEXPORT jlongArray JNICALL Java_sun_jvm_hotspot_debugger_linux_LinuxDebuggerLo
#ifdef i386
#define NPRGREG sun_jvm_hotspot_debugger_x86_X86ThreadContext_NPRGREG
#endif
#ifdef ia64
#define NPRGREG IA64_REG_COUNT
#endif
#ifdef amd64
#define NPRGREG sun_jvm_hotspot_debugger_amd64_AMD64ThreadContext_NPRGREG
#endif
Expand Down Expand Up @@ -336,13 +333,6 @@ JNIEXPORT jlongArray JNICALL Java_sun_jvm_hotspot_debugger_linux_LinuxDebuggerLo

#endif /* i386 */

#if ia64
regs = (*env)->GetLongArrayElements(env, array, &isCopy);
for (i = 0; i < NPRGREG; i++ ) {
regs[i] = 0xDEADDEAD;
}
#endif /* ia64 */

#ifdef amd64
#define REG_INDEX(reg) sun_jvm_hotspot_debugger_amd64_AMD64ThreadContext_##reg

Expand Down
8 changes: 0 additions & 8 deletions hotspot/agent/src/os/linux/libproc.h
Original file line number Diff line number Diff line change
Expand Up @@ -79,14 +79,6 @@ combination of ptrace and /proc calls.
*************************************************************************************/

#ifdef ia64
struct user_regs_struct {
/* copied from user.h which doesn't define this in a struct */

#define IA64_REG_COUNT (EF_SIZE/8+32) /* integer and fp regs */
unsigned long regs[IA64_REG_COUNT]; /* integer and fp regs */
};
#endif

#if defined(sparc) || defined(sparcv9)
#define user_regs_struct pt_regs
Expand Down
92 changes: 2 additions & 90 deletions hotspot/agent/src/os/win32/windbg/sawindbg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,7 @@

#include "sun_jvm_hotspot_debugger_windbg_WindbgDebuggerLocal.h"

#ifdef _M_IA64
#include "sun_jvm_hotspot_debugger_ia64_IA64ThreadContext.h"
#define NPRGREG sun_jvm_hotspot_debugger_ia64_IA64ThreadContext_NPRGREG
#elif _M_IX86
#ifdef _M_IX86
#include "sun_jvm_hotspot_debugger_x86_X86ThreadContext.h"
#define NPRGREG sun_jvm_hotspot_debugger_x86_X86ThreadContext_NPRGREG
#elif _M_AMD64
Expand Down Expand Up @@ -491,92 +488,7 @@ static bool addThreads(JNIEnv* env, jobject obj) {
memset(&context, 0, sizeof(CONTEXT));

#undef REG_INDEX
#ifdef _M_IA64
#define REG_INDEX(x) sun_jvm_hotspot_debugger_ia64_IA64ThreadContext_##x

context.ContextFlags = CONTEXT_FULL | CONTEXT_DEBUG;
ptrIDebugAdvanced->GetThreadContext(&context, sizeof(CONTEXT));

ptrRegs[REG_INDEX(GR0)] = 0; // always 0
ptrRegs[REG_INDEX(GR1)] = context.IntGp; // r1
ptrRegs[REG_INDEX(GR2)] = context.IntT0; // r2-r3
ptrRegs[REG_INDEX(GR3)] = context.IntT1;
ptrRegs[REG_INDEX(GR4)] = context.IntS0; // r4-r7
ptrRegs[REG_INDEX(GR5)] = context.IntS1;
ptrRegs[REG_INDEX(GR6)] = context.IntS2;
ptrRegs[REG_INDEX(GR7)] = context.IntS3;
ptrRegs[REG_INDEX(GR8)] = context.IntV0; // r8
ptrRegs[REG_INDEX(GR9)] = context.IntT2; // r9-r11
ptrRegs[REG_INDEX(GR10)] = context.IntT3;
ptrRegs[REG_INDEX(GR11)] = context.IntT4;
ptrRegs[REG_INDEX(GR12)] = context.IntSp; // r12 stack pointer
ptrRegs[REG_INDEX(GR13)] = context.IntTeb; // r13 teb
ptrRegs[REG_INDEX(GR14)] = context.IntT5; // r14-r31
ptrRegs[REG_INDEX(GR15)] = context.IntT6;
ptrRegs[REG_INDEX(GR16)] = context.IntT7;
ptrRegs[REG_INDEX(GR17)] = context.IntT8;
ptrRegs[REG_INDEX(GR18)] = context.IntT9;
ptrRegs[REG_INDEX(GR19)] = context.IntT10;
ptrRegs[REG_INDEX(GR20)] = context.IntT11;
ptrRegs[REG_INDEX(GR21)] = context.IntT12;
ptrRegs[REG_INDEX(GR22)] = context.IntT13;
ptrRegs[REG_INDEX(GR23)] = context.IntT14;
ptrRegs[REG_INDEX(GR24)] = context.IntT15;
ptrRegs[REG_INDEX(GR25)] = context.IntT16;
ptrRegs[REG_INDEX(GR26)] = context.IntT17;
ptrRegs[REG_INDEX(GR27)] = context.IntT18;
ptrRegs[REG_INDEX(GR28)] = context.IntT19;
ptrRegs[REG_INDEX(GR29)] = context.IntT20;
ptrRegs[REG_INDEX(GR30)] = context.IntT21;
ptrRegs[REG_INDEX(GR31)] = context.IntT22;

ptrRegs[REG_INDEX(INT_NATS)] = context.IntNats;
ptrRegs[REG_INDEX(PREDS)] = context.Preds;

ptrRegs[REG_INDEX(BR_RP)] = context.BrRp;
ptrRegs[REG_INDEX(BR1)] = context.BrS0; // b1-b5
ptrRegs[REG_INDEX(BR2)] = context.BrS1;
ptrRegs[REG_INDEX(BR3)] = context.BrS2;
ptrRegs[REG_INDEX(BR4)] = context.BrS3;
ptrRegs[REG_INDEX(BR5)] = context.BrS4;
ptrRegs[REG_INDEX(BR6)] = context.BrT0; // b6-b7
ptrRegs[REG_INDEX(BR7)] = context.BrT1;

ptrRegs[REG_INDEX(AP_UNAT)] = context.ApUNAT;
ptrRegs[REG_INDEX(AP_LC)] = context.ApLC;
ptrRegs[REG_INDEX(AP_EC)] = context.ApEC;
ptrRegs[REG_INDEX(AP_CCV)] = context.ApCCV;
ptrRegs[REG_INDEX(AP_DCR)] = context.ApDCR;

ptrRegs[REG_INDEX(RS_PFS)] = context.RsPFS;
ptrRegs[REG_INDEX(RS_BSP)] = context.RsBSP;
ptrRegs[REG_INDEX(RS_BSPSTORE)] = context.RsBSPSTORE;
ptrRegs[REG_INDEX(RS_RSC)] = context.RsRSC;
ptrRegs[REG_INDEX(RS_RNAT)] = context.RsRNAT;

ptrRegs[REG_INDEX(ST_IPSR)] = context.StIPSR;
ptrRegs[REG_INDEX(ST_IIP)] = context.StIIP;
ptrRegs[REG_INDEX(ST_IFS)] = context.StIFS;

ptrRegs[REG_INDEX(DB_I0)] = context.DbI0;
ptrRegs[REG_INDEX(DB_I1)] = context.DbI1;
ptrRegs[REG_INDEX(DB_I2)] = context.DbI2;
ptrRegs[REG_INDEX(DB_I3)] = context.DbI3;
ptrRegs[REG_INDEX(DB_I4)] = context.DbI4;
ptrRegs[REG_INDEX(DB_I5)] = context.DbI5;
ptrRegs[REG_INDEX(DB_I6)] = context.DbI6;
ptrRegs[REG_INDEX(DB_I7)] = context.DbI7;

ptrRegs[REG_INDEX(DB_D0)] = context.DbD0;
ptrRegs[REG_INDEX(DB_D1)] = context.DbD1;
ptrRegs[REG_INDEX(DB_D2)] = context.DbD2;
ptrRegs[REG_INDEX(DB_D3)] = context.DbD3;
ptrRegs[REG_INDEX(DB_D4)] = context.DbD4;
ptrRegs[REG_INDEX(DB_D5)] = context.DbD5;
ptrRegs[REG_INDEX(DB_D6)] = context.DbD6;
ptrRegs[REG_INDEX(DB_D7)] = context.DbD7;

#elif _M_IX86
#ifdef _M_IX86
#define REG_INDEX(x) sun_jvm_hotspot_debugger_x86_X86ThreadContext_##x

context.ContextFlags = CONTEXT_FULL | CONTEXT_DEBUG_REGISTERS;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2005, 2013, 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
Expand Down Expand Up @@ -34,21 +34,11 @@ class WindbgAMD64Thread implements ThreadProxy {
private boolean gotID;
private long id;

/** The address argument must be the address of the HANDLE of the
desired thread in the target process. */
// The address argument must be the address of the OSThread::_thread_id
WindbgAMD64Thread(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;
this.sysId = (long)addr.getCIntegerAt(0, 4, true);
gotID = false;
}

WindbgAMD64Thread(WindbgDebugger debugger, long sysId) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2002, 2003, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2002, 2013, 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
Expand Down Expand Up @@ -34,21 +34,11 @@ class WindbgX86Thread implements ThreadProxy {
private boolean gotID;
private long id;

/** The address argument must be the address of the HANDLE of the
desired thread in the target process. */
// The address argument must be the address of OSThread::_thread_id
WindbgX86Thread(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;
this.sysId = (long)addr.getCIntegerAt(0, 4, true);
gotID = false;
}

WindbgX86Thread(WindbgDebugger debugger, long sysId) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* @(#)BinaryTreeDictionary.java
* Copyright (c) 2000, 2008, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2000, 2013, 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
Expand Down Expand Up @@ -30,7 +30,7 @@
import sun.jvm.hotspot.types.*;
import sun.jvm.hotspot.runtime.*;

public class BinaryTreeDictionary extends VMObject {
public class AFLBinaryTreeDictionary extends VMObject {
static {
VM.registerVMInitializedObserver(new Observer() {
public void update(Observable o, Object data) {
Expand All @@ -40,8 +40,8 @@ public void update(Observable o, Object data) {
}

private static synchronized void initialize(TypeDataBase db) {
Type type = db.lookupType("BinaryTreeDictionary");
totalSizeField = type.getCIntegerField("_totalSize");
Type type = db.lookupType("AFLBinaryTreeDictionary");
totalSizeField = type.getCIntegerField("_total_size");
}

// Fields
Expand All @@ -53,7 +53,7 @@ public long size() {
}

// Constructor
public BinaryTreeDictionary(Address addr) {
public AFLBinaryTreeDictionary(Address addr) {
super(addr);
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2003, 2013, 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
Expand Down Expand Up @@ -117,9 +117,9 @@ public long free() {
}

// large block
BinaryTreeDictionary bfbd = (BinaryTreeDictionary) VMObjectFactory.newObject(BinaryTreeDictionary.class,
AFLBinaryTreeDictionary aflbd = (AFLBinaryTreeDictionary) VMObjectFactory.newObject(AFLBinaryTreeDictionary.class,
dictionaryField.getValue(addr));
size += bfbd.size();
size += aflbd.size();


// linear block in TLAB
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* @(#)FreeList.java
*
* Copyright (c) 2000, 2008, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2000, 2013, 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
Expand Down Expand Up @@ -41,7 +41,7 @@ public void update(Observable o, Object data) {
}

private static synchronized void initialize(TypeDataBase db) {
Type type = db.lookupType("FreeList");
Type type = db.lookupType("FreeList<FreeChunk>");
sizeField = type.getCIntegerField("_size");
countField = type.getCIntegerField("_count");
headerSize = type.getSize();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -467,7 +467,7 @@ private List collectLiveRegions() {
liveRegions.add(tlab.start());
liveRegions.add(tlab.start());
liveRegions.add(tlab.top());
liveRegions.add(tlab.end());
liveRegions.add(tlab.hardEnd());
}
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2004, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2004, 2013, 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
Expand Down Expand Up @@ -32,6 +32,7 @@
// to the sys_thread_t structure of the classic JVM implementation.
public class OSThread extends VMObject {
private static JIntField interruptedField;
private static JIntField threadIdField;
static {
VM.registerVMInitializedObserver(new Observer() {
public void update(Observable o, Object data) {
Expand All @@ -43,6 +44,7 @@ public void update(Observable o, Object data) {
private static synchronized void initialize(TypeDataBase db) {
Type type = db.lookupType("OSThread");
interruptedField = type.getJIntField("_interrupted");
threadIdField = type.getJIntField("_thread_id");
}

public OSThread(Address addr) {
Expand All @@ -52,4 +54,9 @@ public OSThread(Address addr) {
public boolean interrupted() {
return ((int)interruptedField.getValue(addr)) != 0;
}

public int threadId() {
return (int)threadIdField.getValue(addr);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
import java.io.*;
import java.util.*;
import sun.jvm.hotspot.debugger.*;
import sun.jvm.hotspot.oops.*;
import sun.jvm.hotspot.types.*;

/** <P> ThreadLocalAllocBuffer: a descriptor for thread-local storage
Expand Down Expand Up @@ -62,9 +63,22 @@ public ThreadLocalAllocBuffer(Address addr) {
super(addr);
}

public Address start() { return startField.getValue(addr); }
public Address end() { return endField.getValue(addr); }
public Address top() { return topField.getValue(addr); }
public Address start() { return startField.getValue(addr); }
public Address end() { return endField.getValue(addr); }
public Address top() { return topField.getValue(addr); }
public Address hardEnd() { return end().addOffsetTo(alignmentReserve()); }

private long alignmentReserve() {
return Oop.alignObjectSize(endReserve());
}

private long endReserve() {
long minFillerArraySize = Array.baseOffsetInBytes(BasicType.T_INT);
long reserveForAllocationPrefetch = VM.getVM().getReserveForAllocationPrefetch();
long heapWordSize = VM.getVM().getHeapWordSize();

return Math.max(minFillerArraySize, reserveForAllocationPrefetch * heapWordSize);
}

/** Support for iteration over heap -- not sure how this will
interact with GC in reflective system, but necessary for the
Expand Down

0 comments on commit 171e39a

Please sign in to comment.