Merge
This commit is contained in:
commit
a69cf10e06
@ -1,6 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
|
||||||
* Copyright 2012, 2013 SAP AG. 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
|
||||||
@ -23,9 +22,24 @@
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "precompiled.hpp"
|
package sun.jvm.hotspot.gc_interface;
|
||||||
#include "interpreter/bytecodes.hpp"
|
|
||||||
|
|
||||||
void Bytecodes::pd_initialize() {
|
//These definitions should be kept in sync with the definitions in the HotSpot
|
||||||
// No ppc specific initialization.
|
//code.
|
||||||
|
|
||||||
|
public enum G1YCType {
|
||||||
|
Normal ("Normal"),
|
||||||
|
InitialMark ("Initial Mark"),
|
||||||
|
DuringMark ("During Mark"),
|
||||||
|
Mixed ("Mixed"),
|
||||||
|
G1YCTypeEndSentinel ("Unknown");
|
||||||
|
|
||||||
|
private final String value;
|
||||||
|
|
||||||
|
G1YCType(String val) {
|
||||||
|
this.value = val;
|
||||||
|
}
|
||||||
|
public String value() {
|
||||||
|
return value;
|
||||||
|
}
|
||||||
}
|
}
|
@ -0,0 +1,69 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2014, 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.gc_interface;
|
||||||
|
|
||||||
|
//These definitions should be kept in sync with the definitions in the HotSpot code.
|
||||||
|
|
||||||
|
public enum GCCause {
|
||||||
|
_java_lang_system_gc ("System.gc()"),
|
||||||
|
_full_gc_alot ("FullGCAlot"),
|
||||||
|
_scavenge_alot ("ScavengeAlot"),
|
||||||
|
_allocation_profiler ("Allocation Profiler"),
|
||||||
|
_jvmti_force_gc ("JvmtiEnv ForceGarbageCollection"),
|
||||||
|
_gc_locker ("GCLocker Initiated GC"),
|
||||||
|
_heap_inspection ("Heap Inspection Initiated GC"),
|
||||||
|
_heap_dump ("Heap Dump Initiated GC"),
|
||||||
|
|
||||||
|
_no_gc ("No GC"),
|
||||||
|
_no_cause_specified ("Unknown GCCause"),
|
||||||
|
_allocation_failure ("Allocation Failure"),
|
||||||
|
|
||||||
|
_tenured_generation_full ("Tenured Generation Full"),
|
||||||
|
_metadata_GC_threshold ("Metadata GC Threshold"),
|
||||||
|
|
||||||
|
_cms_generation_full ("CMS Generation Full"),
|
||||||
|
_cms_initial_mark ("CMS Initial Mark"),
|
||||||
|
_cms_final_remark ("CMS Final Remark"),
|
||||||
|
_cms_concurrent_mark ("CMS Concurrent Mark"),
|
||||||
|
|
||||||
|
_old_generation_expanded_on_last_scavenge ("Old Generation Expanded On Last Scavenge"),
|
||||||
|
_old_generation_too_full_to_scavenge ("Old Generation Too Full To Scavenge"),
|
||||||
|
_adaptive_size_policy ("Ergonomics"),
|
||||||
|
|
||||||
|
_g1_inc_collection_pause ("G1 Evacuation Pause"),
|
||||||
|
_g1_humongous_allocation ("G1 Humongous Allocation"),
|
||||||
|
|
||||||
|
_last_ditch_collection ("Last ditch collection"),
|
||||||
|
_last_gc_cause ("ILLEGAL VALUE - last gc cause - ILLEGAL VALUE");
|
||||||
|
|
||||||
|
private final String value;
|
||||||
|
|
||||||
|
GCCause(String val) {
|
||||||
|
this.value = val;
|
||||||
|
}
|
||||||
|
public String value() {
|
||||||
|
return value;
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,50 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2014, 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.gc_interface;
|
||||||
|
|
||||||
|
//These definitions should be kept in sync with the definitions in the HotSpot code.
|
||||||
|
|
||||||
|
public enum GCName {
|
||||||
|
ParallelOld ("ParallelOld"),
|
||||||
|
SerialOld ("SerialOld"),
|
||||||
|
PSMarkSweep ("PSMarkSweep"),
|
||||||
|
ParallelScavenge ("ParallelScavenge"),
|
||||||
|
DefNew ("DefNew"),
|
||||||
|
ParNew ("ParNew"),
|
||||||
|
G1New ("G1New"),
|
||||||
|
ConcurrentMarkSweep ("ConcurrentMarkSweep"),
|
||||||
|
G1Old ("G1Old"),
|
||||||
|
GCNameEndSentinel ("GCNameEndSentinel");
|
||||||
|
|
||||||
|
private final String value;
|
||||||
|
|
||||||
|
GCName(String val) {
|
||||||
|
this.value = val;
|
||||||
|
}
|
||||||
|
public String value() {
|
||||||
|
return value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 2014, 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
|
||||||
@ -22,14 +22,24 @@
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "precompiled.hpp"
|
package sun.jvm.hotspot.gc_interface;
|
||||||
#include "interpreter/bytecodes.hpp"
|
|
||||||
|
|
||||||
|
//These definitions should be kept in sync with the definitions in the HotSpot code.
|
||||||
|
|
||||||
void Bytecodes::pd_initialize() {
|
public enum GCWhen {
|
||||||
// (nothing)
|
BeforeGC ("Before GC"),
|
||||||
|
AfterGC ("After GC"),
|
||||||
|
GCWhenEndSentinel ("GCWhenEndSentinel");
|
||||||
|
|
||||||
|
private final String value;
|
||||||
|
|
||||||
|
GCWhen(String val) {
|
||||||
|
this.value = val;
|
||||||
|
}
|
||||||
|
public String value() {
|
||||||
|
return value;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Bytecodes::Code Bytecodes::pd_base_code_for(Code code) {
|
|
||||||
return code;
|
|
||||||
}
|
|
@ -0,0 +1,45 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2014, 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.gc_interface;
|
||||||
|
|
||||||
|
//These definitions should be kept in sync with the definitions in the HotSpot code.
|
||||||
|
|
||||||
|
public enum ReferenceType {
|
||||||
|
REF_NONE ("None reference"), // Regular class
|
||||||
|
REF_OTHER ("Other reference"), // Subclass of java/lang/ref/Reference, but not subclass of one of the classes below
|
||||||
|
REF_SOFT ("Soft reference"), // Subclass of java/lang/ref/SoftReference
|
||||||
|
REF_WEAK ("Weak reference"), // Subclass of java/lang/ref/WeakReference
|
||||||
|
REF_FINAL ("Final reference"), // Subclass of java/lang/ref/FinalReference
|
||||||
|
REF_PHANTOM ("Phantom reference"); // Subclass of java/lang/ref/PhantomReference
|
||||||
|
|
||||||
|
private final String value;
|
||||||
|
|
||||||
|
ReferenceType(String val) {
|
||||||
|
this.value = val;
|
||||||
|
}
|
||||||
|
public String value() {
|
||||||
|
return value;
|
||||||
|
}
|
||||||
|
}
|
@ -56,6 +56,12 @@ public class Universe {
|
|||||||
private static AddressField narrowKlassBaseField;
|
private static AddressField narrowKlassBaseField;
|
||||||
private static CIntegerField narrowKlassShiftField;
|
private static CIntegerField narrowKlassShiftField;
|
||||||
|
|
||||||
|
public enum NARROW_OOP_MODE {
|
||||||
|
UnscaledNarrowOop,
|
||||||
|
ZeroBasedNarrowOop,
|
||||||
|
HeapBasedNarrowOop
|
||||||
|
}
|
||||||
|
|
||||||
static {
|
static {
|
||||||
VM.registerVMInitializedObserver(new Observer() {
|
VM.registerVMInitializedObserver(new Observer() {
|
||||||
public void update(Observable o, Object data) {
|
public void update(Observable o, Object data) {
|
||||||
@ -94,7 +100,17 @@ public class Universe {
|
|||||||
|
|
||||||
public Universe() {
|
public Universe() {
|
||||||
}
|
}
|
||||||
|
public static String narrowOopModeToString(NARROW_OOP_MODE mode) {
|
||||||
|
switch (mode) {
|
||||||
|
case UnscaledNarrowOop:
|
||||||
|
return "32-bits Oops";
|
||||||
|
case ZeroBasedNarrowOop:
|
||||||
|
return "zero based Compressed Oops";
|
||||||
|
case HeapBasedNarrowOop:
|
||||||
|
return "Compressed Oops with base";
|
||||||
|
}
|
||||||
|
return "";
|
||||||
|
}
|
||||||
public CollectedHeap heap() {
|
public CollectedHeap heap() {
|
||||||
try {
|
try {
|
||||||
return (CollectedHeap) heapConstructor.instantiateWrapperFor(collectedHeapField.getValue());
|
return (CollectedHeap) heapConstructor.instantiateWrapperFor(collectedHeapField.getValue());
|
||||||
|
@ -55,6 +55,7 @@ public class Klass extends Metadata implements ClassConstants {
|
|||||||
layoutHelper = new IntField(type.getJIntField("_layout_helper"), 0);
|
layoutHelper = new IntField(type.getJIntField("_layout_helper"), 0);
|
||||||
name = type.getAddressField("_name");
|
name = type.getAddressField("_name");
|
||||||
accessFlags = new CIntField(type.getCIntegerField("_access_flags"), 0);
|
accessFlags = new CIntField(type.getCIntegerField("_access_flags"), 0);
|
||||||
|
traceIDField = type.getField("_trace_id");
|
||||||
subklass = new MetadataField(type.getAddressField("_subklass"), 0);
|
subklass = new MetadataField(type.getAddressField("_subklass"), 0);
|
||||||
nextSibling = new MetadataField(type.getAddressField("_next_sibling"), 0);
|
nextSibling = new MetadataField(type.getAddressField("_next_sibling"), 0);
|
||||||
|
|
||||||
@ -86,6 +87,7 @@ public class Klass extends Metadata implements ClassConstants {
|
|||||||
private static CIntField accessFlags;
|
private static CIntField accessFlags;
|
||||||
private static MetadataField subklass;
|
private static MetadataField subklass;
|
||||||
private static MetadataField nextSibling;
|
private static MetadataField nextSibling;
|
||||||
|
private static sun.jvm.hotspot.types.Field traceIDField;
|
||||||
|
|
||||||
private Address getValue(AddressField field) {
|
private Address getValue(AddressField field) {
|
||||||
return addr.getAddressAt(field.getOffset());
|
return addr.getAddressAt(field.getOffset());
|
||||||
@ -106,6 +108,7 @@ public class Klass extends Metadata implements ClassConstants {
|
|||||||
public AccessFlags getAccessFlagsObj(){ return new AccessFlags(getAccessFlags()); }
|
public AccessFlags getAccessFlagsObj(){ return new AccessFlags(getAccessFlags()); }
|
||||||
public Klass getSubklassKlass() { return (Klass) subklass.getValue(this); }
|
public Klass getSubklassKlass() { return (Klass) subklass.getValue(this); }
|
||||||
public Klass getNextSiblingKlass() { return (Klass) nextSibling.getValue(this); }
|
public Klass getNextSiblingKlass() { return (Klass) nextSibling.getValue(this); }
|
||||||
|
public long traceID() { return traceIDField.getJLong(addr); }
|
||||||
|
|
||||||
// computed access flags - takes care of inner classes etc.
|
// computed access flags - takes care of inner classes etc.
|
||||||
// This is closer to actual source level than getAccessFlags() etc.
|
// This is closer to actual source level than getAccessFlags() etc.
|
||||||
|
@ -54,6 +54,8 @@ public class OopUtilities implements /* imports */ JVMTIThreadState {
|
|||||||
private static OopField threadNameField;
|
private static OopField threadNameField;
|
||||||
private static OopField threadGroupField;
|
private static OopField threadGroupField;
|
||||||
private static LongField threadEETopField;
|
private static LongField threadEETopField;
|
||||||
|
//tid field is new since 1.5
|
||||||
|
private static LongField threadTIDField;
|
||||||
// threadStatus field is new since 1.5
|
// threadStatus field is new since 1.5
|
||||||
private static IntField threadStatusField;
|
private static IntField threadStatusField;
|
||||||
// parkBlocker field is new since 1.6
|
// parkBlocker field is new since 1.6
|
||||||
@ -220,6 +222,7 @@ public class OopUtilities implements /* imports */ JVMTIThreadState {
|
|||||||
threadNameField = (OopField) k.findField("name", "[C");
|
threadNameField = (OopField) k.findField("name", "[C");
|
||||||
threadGroupField = (OopField) k.findField("group", "Ljava/lang/ThreadGroup;");
|
threadGroupField = (OopField) k.findField("group", "Ljava/lang/ThreadGroup;");
|
||||||
threadEETopField = (LongField) k.findField("eetop", "J");
|
threadEETopField = (LongField) k.findField("eetop", "J");
|
||||||
|
threadTIDField = (LongField) k.findField("tid", "J");
|
||||||
threadStatusField = (IntField) k.findField("threadStatus", "I");
|
threadStatusField = (IntField) k.findField("threadStatus", "I");
|
||||||
threadParkBlockerField = (OopField) k.findField("parkBlocker",
|
threadParkBlockerField = (OopField) k.findField("parkBlocker",
|
||||||
"Ljava/lang/Object;");
|
"Ljava/lang/Object;");
|
||||||
@ -268,6 +271,15 @@ public class OopUtilities implements /* imports */ JVMTIThreadState {
|
|||||||
return VM.getVM().getThreads().createJavaThreadWrapper(addr);
|
return VM.getVM().getThreads().createJavaThreadWrapper(addr);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static long threadOopGetTID(Oop threadOop) {
|
||||||
|
initThreadFields();
|
||||||
|
if (threadTIDField != null) {
|
||||||
|
return threadTIDField.getValue(threadOop);
|
||||||
|
} else {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/** returns value of java.lang.Thread.threadStatus field */
|
/** returns value of java.lang.Thread.threadStatus field */
|
||||||
public static int threadOopGetThreadStatus(Oop threadOop) {
|
public static int threadOopGetThreadStatus(Oop threadOop) {
|
||||||
initThreadFields();
|
initThreadFields();
|
||||||
|
@ -0,0 +1,67 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2014, 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.opto;
|
||||||
|
|
||||||
|
//These definitions should be kept in sync with the definitions in the HotSpot code.
|
||||||
|
|
||||||
|
public enum CompilerPhaseType {
|
||||||
|
PHASE_BEFORE_STRINGOPTS ("Before StringOpts"),
|
||||||
|
PHASE_AFTER_STRINGOPTS ("After StringOpts"),
|
||||||
|
PHASE_BEFORE_REMOVEUSELESS ("Before RemoveUseless"),
|
||||||
|
PHASE_AFTER_PARSING ("After Parsing"),
|
||||||
|
PHASE_ITER_GVN1 ("Iter GVN 1"),
|
||||||
|
PHASE_PHASEIDEAL_BEFORE_EA ("PhaseIdealLoop before EA"),
|
||||||
|
PHASE_ITER_GVN_AFTER_EA ("Iter GVN after EA"),
|
||||||
|
PHASE_ITER_GVN_AFTER_ELIMINATION ("Iter GVN after eliminating allocations and locks"),
|
||||||
|
PHASE_PHASEIDEALLOOP1 ("PhaseIdealLoop 1"),
|
||||||
|
PHASE_PHASEIDEALLOOP2 ("PhaseIdealLoop 2"),
|
||||||
|
PHASE_PHASEIDEALLOOP3 ("PhaseIdealLoop 3"),
|
||||||
|
PHASE_CPP1 ("PhaseCPP 1"),
|
||||||
|
PHASE_ITER_GVN2 ("Iter GVN 2"),
|
||||||
|
PHASE_PHASEIDEALLOOP_ITERATIONS ("PhaseIdealLoop iterations"),
|
||||||
|
PHASE_OPTIMIZE_FINISHED ("Optimize finished"),
|
||||||
|
PHASE_GLOBAL_CODE_MOTION ("Global code motion"),
|
||||||
|
PHASE_FINAL_CODE ("Final Code"),
|
||||||
|
PHASE_AFTER_EA ("After Escape Analysis"),
|
||||||
|
PHASE_BEFORE_CLOOPS ("Before CountedLoop"),
|
||||||
|
PHASE_AFTER_CLOOPS ("After CountedLoop"),
|
||||||
|
PHASE_BEFORE_BEAUTIFY_LOOPS ("Before beautify loops"),
|
||||||
|
PHASE_AFTER_BEAUTIFY_LOOPS ("After beautify loops"),
|
||||||
|
PHASE_BEFORE_MATCHING ("Before Matching"),
|
||||||
|
PHASE_INCREMENTAL_INLINE ("Incremental Inline"),
|
||||||
|
PHASE_INCREMENTAL_BOXING_INLINE ("Incremental Boxing Inline"),
|
||||||
|
PHASE_END ("End"),
|
||||||
|
PHASE_FAILURE ("Failure"),
|
||||||
|
PHASE_NUM_TYPES ("Number of Phase Types");
|
||||||
|
|
||||||
|
private final String value;
|
||||||
|
|
||||||
|
CompilerPhaseType(String val) {
|
||||||
|
this.value = val;
|
||||||
|
}
|
||||||
|
public String value() {
|
||||||
|
return value;
|
||||||
|
}
|
||||||
|
}
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 2014, 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
|
||||||
@ -19,27 +19,30 @@
|
|||||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 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
|
* or visit www.oracle.com if you need additional information or have any
|
||||||
* questions.
|
* questions.
|
||||||
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import sun.misc.Unsafe;
|
package sun.jvm.hotspot.runtime;
|
||||||
import java.lang.reflect.Field;
|
|
||||||
|
|
||||||
@SuppressWarnings("sunapi")
|
//These definitions should be kept in sync with the definitions in the HotSpot code.
|
||||||
public class Test8001071 {
|
|
||||||
public static Unsafe unsafe;
|
|
||||||
|
|
||||||
static {
|
public enum Flags {
|
||||||
try {
|
// value origin
|
||||||
Field f = Unsafe.class.getDeclaredField("theUnsafe");
|
DEFAULT ("Default"),
|
||||||
f.setAccessible(true);
|
COMMAND_LINE ("Command line"),
|
||||||
unsafe = (Unsafe) f.get(null);
|
ENVIRON_VAR ("Environment variable"),
|
||||||
} catch ( Exception e ) {
|
CONFIG_FILE ("Config file"),
|
||||||
e.printStackTrace();
|
MANAGEMENT ("Management"),
|
||||||
}
|
ERGONOMIC ("Ergonomic"),
|
||||||
}
|
ATTACH_ON_DEMAND ("Attach on demand"),
|
||||||
|
INTERNAL ("Internal");
|
||||||
|
|
||||||
public static void main(String args[]) {
|
private final String value;
|
||||||
unsafe.getObject(new Test8001071(), Short.MAX_VALUE);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
Flags(String val) {
|
||||||
|
this.value = val;
|
||||||
|
}
|
||||||
|
public String value() {
|
||||||
|
return value;
|
||||||
|
}
|
||||||
}
|
}
|
@ -41,6 +41,8 @@ public class Thread extends VMObject {
|
|||||||
private static AddressField currentPendingMonitorField;
|
private static AddressField currentPendingMonitorField;
|
||||||
private static AddressField currentWaitingMonitorField;
|
private static AddressField currentWaitingMonitorField;
|
||||||
|
|
||||||
|
private static JLongField allocatedBytesField;
|
||||||
|
|
||||||
static {
|
static {
|
||||||
VM.registerVMInitializedObserver(new Observer() {
|
VM.registerVMInitializedObserver(new Observer() {
|
||||||
public void update(Observable o, Object data) {
|
public void update(Observable o, Object data) {
|
||||||
@ -61,6 +63,7 @@ public class Thread extends VMObject {
|
|||||||
activeHandlesField = type.getAddressField("_active_handles");
|
activeHandlesField = type.getAddressField("_active_handles");
|
||||||
currentPendingMonitorField = type.getAddressField("_current_pending_monitor");
|
currentPendingMonitorField = type.getAddressField("_current_pending_monitor");
|
||||||
currentWaitingMonitorField = type.getAddressField("_current_waiting_monitor");
|
currentWaitingMonitorField = type.getAddressField("_current_waiting_monitor");
|
||||||
|
allocatedBytesField = type.getJLongField("_allocated_bytes");
|
||||||
}
|
}
|
||||||
|
|
||||||
public Thread(Address addr) {
|
public Thread(Address addr) {
|
||||||
@ -104,6 +107,10 @@ public class Thread extends VMObject {
|
|||||||
return new JNIHandleBlock(a);
|
return new JNIHandleBlock(a);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public long allocatedBytes() {
|
||||||
|
return allocatedBytesField.getValue(addr);
|
||||||
|
}
|
||||||
|
|
||||||
public boolean isVMThread() { return false; }
|
public boolean isVMThread() { return false; }
|
||||||
public boolean isJavaThread() { return false; }
|
public boolean isJavaThread() { return false; }
|
||||||
public boolean isCompilerThread() { return false; }
|
public boolean isCompilerThread() { return false; }
|
||||||
|
@ -0,0 +1,86 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2014, 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.runtime;
|
||||||
|
|
||||||
|
//These definitions should be kept in sync with the definitions in the HotSpot code.
|
||||||
|
|
||||||
|
public enum VMOps {
|
||||||
|
Dummy,
|
||||||
|
ThreadStop,
|
||||||
|
ThreadDump,
|
||||||
|
PrintThreads,
|
||||||
|
FindDeadlocks,
|
||||||
|
ForceSafepoint,
|
||||||
|
ForceAsyncSafepoint,
|
||||||
|
Deoptimize,
|
||||||
|
DeoptimizeFrame,
|
||||||
|
DeoptimizeAll,
|
||||||
|
ZombieAll,
|
||||||
|
UnlinkSymbols,
|
||||||
|
Verify,
|
||||||
|
PrintJNI,
|
||||||
|
HeapDumper,
|
||||||
|
DeoptimizeTheWorld,
|
||||||
|
CollectForMetadataAllocation,
|
||||||
|
GC_HeapInspection,
|
||||||
|
GenCollectFull,
|
||||||
|
GenCollectFullConcurrent,
|
||||||
|
GenCollectForAllocation,
|
||||||
|
ParallelGCFailedAllocation,
|
||||||
|
ParallelGCSystemGC,
|
||||||
|
CGC_Operation,
|
||||||
|
CMS_Initial_Mark,
|
||||||
|
CMS_Final_Remark,
|
||||||
|
G1CollectFull,
|
||||||
|
G1CollectForAllocation,
|
||||||
|
G1IncCollectionPause,
|
||||||
|
EnableBiasedLocking,
|
||||||
|
RevokeBias,
|
||||||
|
BulkRevokeBias,
|
||||||
|
PopulateDumpSharedSpace,
|
||||||
|
JNIFunctionTableCopier,
|
||||||
|
RedefineClasses,
|
||||||
|
GetOwnedMonitorInfo,
|
||||||
|
GetObjectMonitorUsage,
|
||||||
|
GetCurrentContendedMonitor,
|
||||||
|
GetStackTrace,
|
||||||
|
GetMultipleStackTraces,
|
||||||
|
GetAllStackTraces,
|
||||||
|
GetThreadListStackTraces,
|
||||||
|
GetFrameCount,
|
||||||
|
GetFrameLocation,
|
||||||
|
ChangeBreakpoints,
|
||||||
|
GetOrSetLocal,
|
||||||
|
GetCurrentLocation,
|
||||||
|
EnterInterpOnlyMode,
|
||||||
|
ChangeSingleStep,
|
||||||
|
HeapWalkOperation,
|
||||||
|
HeapIterateOperation,
|
||||||
|
ReportJavaOutOfMemory,
|
||||||
|
JFRCheckpoint,
|
||||||
|
Exit,
|
||||||
|
LinuxDllLoad,
|
||||||
|
Terminating
|
||||||
|
}
|
@ -82,14 +82,12 @@ VM_VER_DEFS = -DHOTSPOT_RELEASE_VERSION="\"$(HS_BUILD_VER)\"" \
|
|||||||
-DJRE_RELEASE_VERSION="\"$(JRE_RELEASE_VER)\"" \
|
-DJRE_RELEASE_VERSION="\"$(JRE_RELEASE_VER)\"" \
|
||||||
$(JDK_VER_DEFS)
|
$(JDK_VER_DEFS)
|
||||||
HS_LIB_ARCH = -DHOTSPOT_LIB_ARCH=\"$(LIBARCH)\"
|
HS_LIB_ARCH = -DHOTSPOT_LIB_ARCH=\"$(LIBARCH)\"
|
||||||
BUILD_TARGET = -DHOTSPOT_BUILD_TARGET="\"$(TARGET)\""
|
|
||||||
BUILD_USER = -DHOTSPOT_BUILD_USER="\"$(HOTSPOT_BUILD_USER)\""
|
BUILD_USER = -DHOTSPOT_BUILD_USER="\"$(HOTSPOT_BUILD_USER)\""
|
||||||
VM_DISTRO = -DHOTSPOT_VM_DISTRO="\"$(HOTSPOT_VM_DISTRO)\""
|
VM_DISTRO = -DHOTSPOT_VM_DISTRO="\"$(HOTSPOT_VM_DISTRO)\""
|
||||||
|
|
||||||
CXXFLAGS = \
|
CXXFLAGS = \
|
||||||
${SYSDEFS} \
|
${SYSDEFS} \
|
||||||
${INCLUDES} \
|
${INCLUDES} \
|
||||||
${BUILD_TARGET} \
|
|
||||||
${BUILD_USER} \
|
${BUILD_USER} \
|
||||||
${HS_LIB_ARCH} \
|
${HS_LIB_ARCH} \
|
||||||
${VM_DISTRO}
|
${VM_DISTRO}
|
||||||
|
@ -280,7 +280,10 @@ endif
|
|||||||
|
|
||||||
# optimization control flags (Used by fastdebug and release variants)
|
# optimization control flags (Used by fastdebug and release variants)
|
||||||
OPT_CFLAGS/NOOPT=-O0
|
OPT_CFLAGS/NOOPT=-O0
|
||||||
ifeq "$(shell expr \( $(CC_VER_MAJOR) \> 4 \) \| \( \( $(CC_VER_MAJOR) = 4 \) \& \( $(CC_VER_MINOR) \>= 8 \) \))" "1"
|
ifeq ($(USE_CLANG), true)
|
||||||
|
# Clang does not support -Og
|
||||||
|
OPT_CFLAGS/DEBUG=-O0
|
||||||
|
else ifeq "$(shell expr \( $(CC_VER_MAJOR) \> 4 \) \| \( \( $(CC_VER_MAJOR) = 4 \) \& \( $(CC_VER_MINOR) \>= 8 \) \))" "1"
|
||||||
# Allow basic optimizations which don't distrupt debugging. (Principally dead code elimination)
|
# Allow basic optimizations which don't distrupt debugging. (Principally dead code elimination)
|
||||||
OPT_CFLAGS/DEBUG=-Og
|
OPT_CFLAGS/DEBUG=-Og
|
||||||
else
|
else
|
||||||
@ -319,9 +322,20 @@ endif
|
|||||||
|
|
||||||
# Work around some compiler bugs.
|
# Work around some compiler bugs.
|
||||||
ifeq ($(USE_CLANG), true)
|
ifeq ($(USE_CLANG), true)
|
||||||
|
# Clang 4.2
|
||||||
ifeq ($(shell expr $(CC_VER_MAJOR) = 4 \& $(CC_VER_MINOR) = 2), 1)
|
ifeq ($(shell expr $(CC_VER_MAJOR) = 4 \& $(CC_VER_MINOR) = 2), 1)
|
||||||
OPT_CFLAGS/loopTransform.o += $(OPT_CFLAGS/NOOPT)
|
OPT_CFLAGS/loopTransform.o += $(OPT_CFLAGS/NOOPT)
|
||||||
OPT_CFLAGS/unsafe.o += -O1
|
OPT_CFLAGS/unsafe.o += -O1
|
||||||
|
# Clang 5.0
|
||||||
|
else ifeq ($(shell expr $(CC_VER_MAJOR) = 5 \& $(CC_VER_MINOR) = 0), 1)
|
||||||
|
OPT_CFLAGS/loopTransform.o += $(OPT_CFLAGS/NOOPT)
|
||||||
|
OPT_CFLAGS/unsafe.o += -O1
|
||||||
|
# Clang 5.1
|
||||||
|
else ifeq ($(shell expr $(CC_VER_MAJOR) = 5 \& $(CC_VER_MINOR) = 1), 1)
|
||||||
|
OPT_CFLAGS/loopTransform.o += $(OPT_CFLAGS/NOOPT)
|
||||||
|
OPT_CFLAGS/unsafe.o += -O1
|
||||||
|
else
|
||||||
|
$(error "Update compiler workarounds for Clang $(CC_VER_MAJOR).$(CC_VER_MINOR)")
|
||||||
endif
|
endif
|
||||||
else
|
else
|
||||||
# 6835796. Problem in GCC 4.3.0 with mulnode.o optimized compilation.
|
# 6835796. Problem in GCC 4.3.0 with mulnode.o optimized compilation.
|
||||||
@ -443,7 +457,10 @@ ifeq ($(USE_CLANG), true)
|
|||||||
CFLAGS += -flimit-debug-info
|
CFLAGS += -flimit-debug-info
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifeq "$(shell expr \( $(CC_VER_MAJOR) \> 4 \) \| \( \( $(CC_VER_MAJOR) = 4 \) \& \( $(CC_VER_MINOR) \>= 8 \) \))" "1"
|
ifeq ($(USE_CLANG), true)
|
||||||
|
# Clang does not support -Og
|
||||||
|
DEBUG_CFLAGS=-O0
|
||||||
|
else ifeq "$(shell expr \( $(CC_VER_MAJOR) \> 4 \) \| \( \( $(CC_VER_MAJOR) = 4 \) \& \( $(CC_VER_MINOR) \>= 8 \) \))" "1"
|
||||||
# Allow basic optimizations which don't distrupt debugging. (Principally dead code elimination)
|
# Allow basic optimizations which don't distrupt debugging. (Principally dead code elimination)
|
||||||
DEBUG_CFLAGS=-Og
|
DEBUG_CFLAGS=-Og
|
||||||
else
|
else
|
||||||
|
@ -81,14 +81,12 @@ VM_VER_DEFS = -DHOTSPOT_RELEASE_VERSION="\"$(HS_BUILD_VER)\"" \
|
|||||||
-DJRE_RELEASE_VERSION="\"$(JRE_RELEASE_VER)\"" \
|
-DJRE_RELEASE_VERSION="\"$(JRE_RELEASE_VER)\"" \
|
||||||
$(JDK_VER_DEFS)
|
$(JDK_VER_DEFS)
|
||||||
HS_LIB_ARCH = -DHOTSPOT_LIB_ARCH=\"$(LIBARCH)\"
|
HS_LIB_ARCH = -DHOTSPOT_LIB_ARCH=\"$(LIBARCH)\"
|
||||||
BUILD_TARGET = -DHOTSPOT_BUILD_TARGET="\"$(TARGET)\""
|
|
||||||
BUILD_USER = -DHOTSPOT_BUILD_USER="\"$(HOTSPOT_BUILD_USER)\""
|
BUILD_USER = -DHOTSPOT_BUILD_USER="\"$(HOTSPOT_BUILD_USER)\""
|
||||||
VM_DISTRO = -DHOTSPOT_VM_DISTRO="\"$(HOTSPOT_VM_DISTRO)\""
|
VM_DISTRO = -DHOTSPOT_VM_DISTRO="\"$(HOTSPOT_VM_DISTRO)\""
|
||||||
|
|
||||||
CXXFLAGS = \
|
CXXFLAGS = \
|
||||||
${SYSDEFS} \
|
${SYSDEFS} \
|
||||||
${INCLUDES} \
|
${INCLUDES} \
|
||||||
${BUILD_TARGET} \
|
|
||||||
${BUILD_USER} \
|
${BUILD_USER} \
|
||||||
${HS_LIB_ARCH} \
|
${HS_LIB_ARCH} \
|
||||||
${VM_DISTRO}
|
${VM_DISTRO}
|
||||||
|
@ -135,8 +135,12 @@ endif
|
|||||||
ifeq ($(JDK_MKTG_VERSION),)
|
ifeq ($(JDK_MKTG_VERSION),)
|
||||||
JDK_MKTG_VERSION=$(JDK_MINOR_VERSION).$(JDK_MICRO_VERSION)
|
JDK_MKTG_VERSION=$(JDK_MINOR_VERSION).$(JDK_MICRO_VERSION)
|
||||||
endif
|
endif
|
||||||
ifeq ($(JDK_VERSION),)
|
ifeq ($(JDK_VERSION),)
|
||||||
JDK_VERSION=$(JDK_MAJOR_VERSION).$(JDK_MINOR_VERSION).$(JDK_MICRO_VERSION)
|
ifeq ($(BUILD_FLAVOR), product)
|
||||||
|
JDK_VERSION=$(JDK_MAJOR_VERSION).$(JDK_MINOR_VERSION).$(JDK_MICRO_VERSION)
|
||||||
|
else
|
||||||
|
JDK_VERSION=$(JDK_MAJOR_VERSION).$(JDK_MINOR_VERSION).$(JDK_MICRO_VERSION)-$(BUILD_FLAVOR)
|
||||||
|
endif
|
||||||
endif
|
endif
|
||||||
ifeq ($(FULL_VERSION),)
|
ifeq ($(FULL_VERSION),)
|
||||||
FULL_VERSION="$(JDK_VERSION)"
|
FULL_VERSION="$(JDK_VERSION)"
|
||||||
|
@ -69,7 +69,7 @@ ifeq ($(ARCH), ia64)
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
# sparc
|
# sparc
|
||||||
ifeq ($(ARCH), sparc64)
|
ifneq (,$(findstring $(ARCH), sparc))
|
||||||
ifeq ($(ARCH_DATA_MODEL), 64)
|
ifeq ($(ARCH_DATA_MODEL), 64)
|
||||||
ARCH_DATA_MODEL = 64
|
ARCH_DATA_MODEL = 64
|
||||||
MAKE_ARGS += LP64=1
|
MAKE_ARGS += LP64=1
|
||||||
@ -83,30 +83,20 @@ ifeq ($(ARCH), sparc64)
|
|||||||
HS_ARCH = sparc
|
HS_ARCH = sparc
|
||||||
endif
|
endif
|
||||||
|
|
||||||
# amd64/x86_64
|
# i686/i586 and amd64/x86_64
|
||||||
ifneq (,$(findstring $(ARCH), amd64 x86_64))
|
ifneq (,$(findstring $(ARCH), amd64 x86_64 i686 i586))
|
||||||
ifeq ($(ARCH_DATA_MODEL), 64)
|
ifeq ($(ARCH_DATA_MODEL), 64)
|
||||||
ARCH_DATA_MODEL = 64
|
ARCH_DATA_MODEL = 64
|
||||||
MAKE_ARGS += LP64=1
|
MAKE_ARGS += LP64=1
|
||||||
PLATFORM = linux-amd64
|
PLATFORM = linux-amd64
|
||||||
VM_PLATFORM = linux_amd64
|
VM_PLATFORM = linux_amd64
|
||||||
HS_ARCH = x86
|
|
||||||
else
|
else
|
||||||
ARCH_DATA_MODEL = 32
|
ARCH_DATA_MODEL = 32
|
||||||
PLATFORM = linux-i586
|
PLATFORM = linux-i586
|
||||||
VM_PLATFORM = linux_i486
|
VM_PLATFORM = linux_i486
|
||||||
HS_ARCH = x86
|
|
||||||
# We have to reset ARCH to i686 since SRCARCH relies on it
|
|
||||||
ARCH = i686
|
|
||||||
endif
|
endif
|
||||||
endif
|
|
||||||
|
|
||||||
# i686/i586 ie 32-bit x86
|
HS_ARCH = x86
|
||||||
ifneq (,$(findstring $(ARCH), i686 i586))
|
|
||||||
ARCH_DATA_MODEL = 32
|
|
||||||
PLATFORM = linux-i586
|
|
||||||
VM_PLATFORM = linux_i486
|
|
||||||
HS_ARCH = x86
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
# ARM
|
# ARM
|
||||||
@ -118,20 +108,18 @@ ifeq ($(ARCH), arm)
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
# PPC
|
# PPC
|
||||||
ifeq ($(ARCH), ppc)
|
ifneq (,$(findstring $(ARCH), ppc))
|
||||||
ARCH_DATA_MODEL = 32
|
ifeq ($(ARCH_DATA_MODEL), 64)
|
||||||
PLATFORM = linux-ppc
|
MAKE_ARGS += LP64=1
|
||||||
VM_PLATFORM = linux_ppc
|
PLATFORM = linux-ppc64
|
||||||
HS_ARCH = ppc
|
VM_PLATFORM = linux_ppc64
|
||||||
endif
|
else
|
||||||
|
ARCH_DATA_MODEL = 32
|
||||||
|
PLATFORM = linux-ppc
|
||||||
|
VM_PLATFORM = linux_ppc
|
||||||
|
endif
|
||||||
|
|
||||||
# PPC64
|
HS_ARCH = ppc
|
||||||
ifeq ($(ARCH), ppc64)
|
|
||||||
ARCH_DATA_MODEL = 64
|
|
||||||
MAKE_ARGS += LP64=1
|
|
||||||
PLATFORM = linux-ppc64
|
|
||||||
VM_PLATFORM = linux_ppc64
|
|
||||||
HS_ARCH = ppc
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
# On 32 bit linux we build server and client, on 64 bit just server.
|
# On 32 bit linux we build server and client, on 64 bit just server.
|
||||||
|
@ -82,14 +82,12 @@ VM_VER_DEFS = -DHOTSPOT_RELEASE_VERSION="\"$(HS_BUILD_VER)\"" \
|
|||||||
-DJRE_RELEASE_VERSION="\"$(JRE_RELEASE_VER)\"" \
|
-DJRE_RELEASE_VERSION="\"$(JRE_RELEASE_VER)\"" \
|
||||||
$(JDK_VER_DEFS)
|
$(JDK_VER_DEFS)
|
||||||
HS_LIB_ARCH = -DHOTSPOT_LIB_ARCH=\"$(LIBARCH)\"
|
HS_LIB_ARCH = -DHOTSPOT_LIB_ARCH=\"$(LIBARCH)\"
|
||||||
BUILD_TARGET = -DHOTSPOT_BUILD_TARGET="\"$(TARGET)\""
|
|
||||||
BUILD_USER = -DHOTSPOT_BUILD_USER="\"$(HOTSPOT_BUILD_USER)\""
|
BUILD_USER = -DHOTSPOT_BUILD_USER="\"$(HOTSPOT_BUILD_USER)\""
|
||||||
VM_DISTRO = -DHOTSPOT_VM_DISTRO="\"$(HOTSPOT_VM_DISTRO)\""
|
VM_DISTRO = -DHOTSPOT_VM_DISTRO="\"$(HOTSPOT_VM_DISTRO)\""
|
||||||
|
|
||||||
CXXFLAGS = \
|
CXXFLAGS = \
|
||||||
${SYSDEFS} \
|
${SYSDEFS} \
|
||||||
${INCLUDES} \
|
${INCLUDES} \
|
||||||
${BUILD_TARGET} \
|
|
||||||
${BUILD_USER} \
|
${BUILD_USER} \
|
||||||
${HS_LIB_ARCH} \
|
${HS_LIB_ARCH} \
|
||||||
${VM_DISTRO}
|
${VM_DISTRO}
|
||||||
|
@ -29,8 +29,12 @@
|
|||||||
# and generate JNI header file for native methods.
|
# and generate JNI header file for native methods.
|
||||||
|
|
||||||
include $(GAMMADIR)/make/solaris/makefiles/rules.make
|
include $(GAMMADIR)/make/solaris/makefiles/rules.make
|
||||||
|
include $(GAMMADIR)/make/defs.make
|
||||||
AGENT_DIR = $(GAMMADIR)/agent
|
AGENT_DIR = $(GAMMADIR)/agent
|
||||||
include $(GAMMADIR)/make/sa.files
|
include $(GAMMADIR)/make/sa.files
|
||||||
|
|
||||||
|
-include $(HS_ALT_MAKE)/solaris/makefiles/sa.make
|
||||||
|
|
||||||
GENERATED = ../generated
|
GENERATED = ../generated
|
||||||
|
|
||||||
# tools.jar is needed by the JDI - SA binding
|
# tools.jar is needed by the JDI - SA binding
|
||||||
|
@ -77,14 +77,12 @@ VM_VER_DEFS = -DHOTSPOT_RELEASE_VERSION="\"$(HS_BUILD_VER)\"" \
|
|||||||
-DJRE_RELEASE_VERSION="\"$(JRE_RELEASE_VER)\"" \
|
-DJRE_RELEASE_VERSION="\"$(JRE_RELEASE_VER)\"" \
|
||||||
$(JDK_VER_DEFS)
|
$(JDK_VER_DEFS)
|
||||||
HS_LIB_ARCH = -DHOTSPOT_LIB_ARCH=\"$(LIBARCH)\"
|
HS_LIB_ARCH = -DHOTSPOT_LIB_ARCH=\"$(LIBARCH)\"
|
||||||
BUILD_TARGET = -DHOTSPOT_BUILD_TARGET="\"$(TARGET)\""
|
|
||||||
BUILD_USER = -DHOTSPOT_BUILD_USER="\"$(HOTSPOT_BUILD_USER)\""
|
BUILD_USER = -DHOTSPOT_BUILD_USER="\"$(HOTSPOT_BUILD_USER)\""
|
||||||
VM_DISTRO = -DHOTSPOT_VM_DISTRO="\"$(HOTSPOT_VM_DISTRO)\""
|
VM_DISTRO = -DHOTSPOT_VM_DISTRO="\"$(HOTSPOT_VM_DISTRO)\""
|
||||||
|
|
||||||
CXXFLAGS = \
|
CXXFLAGS = \
|
||||||
${SYSDEFS} \
|
${SYSDEFS} \
|
||||||
${INCLUDES} \
|
${INCLUDES} \
|
||||||
${BUILD_TARGET} \
|
|
||||||
${BUILD_USER} \
|
${BUILD_USER} \
|
||||||
${HS_LIB_ARCH} \
|
${HS_LIB_ARCH} \
|
||||||
${VM_DISTRO}
|
${VM_DISTRO}
|
||||||
|
@ -38,6 +38,22 @@ checkAndBuildSA::
|
|||||||
|
|
||||||
GENERATED = ../generated
|
GENERATED = ../generated
|
||||||
|
|
||||||
|
HS_COMMON_SRC_REL = src
|
||||||
|
|
||||||
|
!if "$(OPENJDK)" != "true"
|
||||||
|
HS_ALT_SRC_REL=src/closed
|
||||||
|
HS_ALT_SRC = $(WorkSpace)/$(HS_ALT_SRC_REL)
|
||||||
|
!ifndef HS_ALT_MAKE
|
||||||
|
HS_ALT_MAKE=$(WorkSpace)/make/closed
|
||||||
|
!endif
|
||||||
|
!endif
|
||||||
|
|
||||||
|
HS_COMMON_SRC = $(WorkSpace)/$(HS_COMMON_SRC_REL)
|
||||||
|
|
||||||
|
!ifdef HS_ALT_MAKE
|
||||||
|
!include $(HS_ALT_MAKE)/windows/makefiles/sa.make
|
||||||
|
!endif
|
||||||
|
|
||||||
# tools.jar is needed by the JDI - SA binding
|
# tools.jar is needed by the JDI - SA binding
|
||||||
SA_CLASSPATH = $(BOOT_JAVA_HOME)/lib/tools.jar
|
SA_CLASSPATH = $(BOOT_JAVA_HOME)/lib/tools.jar
|
||||||
|
|
||||||
|
@ -116,7 +116,7 @@ JDK_MAJOR_VERSION="\\\"$(JDK_MAJOR_VER)\\\""
|
|||||||
JDK_MINOR_VERSION="\\\"$(JDK_MINOR_VER)\\\""
|
JDK_MINOR_VERSION="\\\"$(JDK_MINOR_VER)\\\""
|
||||||
JDK_MICRO_VERSION="\\\"$(JDK_MICRO_VER)\\\""
|
JDK_MICRO_VERSION="\\\"$(JDK_MICRO_VER)\\\""
|
||||||
|
|
||||||
ReleaseOptions = -define HOTSPOT_RELEASE_VERSION=$(HOTSPOT_RELEASE_VERSION) -define JRE_RELEASE_VERSION=$(JRE_RELEASE_VERSION) -define HOTSPOT_VM_DISTRO=$(HOTSPOT_VM_DISTRO) -define JDK_MAJOR_VERSION=$(JDK_MAJOR_VERSION) -define JDK_MINOR_VERSION=$(JDK_MINOR_VERSION) -define JDK_MICRO_VERSION=$(JDK_MICRO_VERSION) -define JDK_BUILD_NUMBER=$(JDK_BUILD_NUMBER)
|
ReleaseOptions = -define HOTSPOT_RELEASE_VERSION=$(HOTSPOT_RELEASE_VERSION) -define JRE_RELEASE_VERSION=$(JRE_RELEASE_VERSION) -define HOTSPOT_VM_DISTRO=$(HOTSPOT_VM_DISTRO) -define JDK_MAJOR_VERSION=$(JDK_MAJOR_VERSION) -define JDK_MINOR_VERSION=$(JDK_MINOR_VERSION) -define JDK_MICRO_VERSION=$(JDK_MICRO_VERSION) -define JDK_BUILD_NUMBER=$(JDK_BUILD_NUMBER) -define VISUAL_STUDIO_BUILD=true
|
||||||
ProjectCreatorIDEOptions = $(ProjectCreatorIDEOptions) $(ReleaseOptions)
|
ProjectCreatorIDEOptions = $(ProjectCreatorIDEOptions) $(ReleaseOptions)
|
||||||
|
|
||||||
$(HOTSPOTBUILDSPACE)/$(ProjectFile): $(HOTSPOTBUILDSPACE)/classes/ProjectCreator.class
|
$(HOTSPOTBUILDSPACE)/$(ProjectFile): $(HOTSPOTBUILDSPACE)/classes/ProjectCreator.class
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
|
||||||
* Copyright 2012, 2014 SAP AG. All rights reserved.
|
* Copyright 2012, 2014 SAP AG. 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.
|
||||||
*
|
*
|
||||||
@ -693,7 +693,7 @@ void Assembler::test_asm() {
|
|||||||
// PPC 1, section 4.6.7 Floating-Point Compare Instructions
|
// PPC 1, section 4.6.7 Floating-Point Compare Instructions
|
||||||
fcmpu( CCR7, F24, F25);
|
fcmpu( CCR7, F24, F25);
|
||||||
|
|
||||||
tty->print_cr("\ntest_asm disassembly (0x%lx 0x%lx):", code()->insts_begin(), code()->insts_end());
|
tty->print_cr("\ntest_asm disassembly (0x%lx 0x%lx):", p2i(code()->insts_begin()), p2i(code()->insts_end()));
|
||||||
code()->decode();
|
code()->decode();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,31 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved.
|
|
||||||
* Copyright 2012, 2013 SAP AG. 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.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef CPU_PPC_VM_BYTECODES_PPC_HPP
|
|
||||||
#define CPU_PPC_VM_BYTECODES_PPC_HPP
|
|
||||||
|
|
||||||
// No ppc64 specific bytecodes
|
|
||||||
|
|
||||||
#endif // CPU_PPC_VM_BYTECODES_PPC_HPP
|
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 1997, 2014, 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
|
||||||
@ -50,34 +50,6 @@ bool CompiledIC::is_icholder_call_site(virtual_call_Relocation* call_site) {
|
|||||||
return is_icholder_entry(call->destination());
|
return is_icholder_entry(call->destination());
|
||||||
}
|
}
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
|
||||||
// High-level access to an inline cache. Guaranteed to be MT-safe.
|
|
||||||
|
|
||||||
CompiledIC::CompiledIC(nmethod* nm, NativeCall* call)
|
|
||||||
: _ic_call(call)
|
|
||||||
{
|
|
||||||
address ic_call = call->instruction_address();
|
|
||||||
|
|
||||||
assert(ic_call != NULL, "ic_call address must be set");
|
|
||||||
assert(nm != NULL, "must pass nmethod");
|
|
||||||
assert(nm->contains(ic_call), "must be in nmethod");
|
|
||||||
|
|
||||||
// Search for the ic_call at the given address.
|
|
||||||
RelocIterator iter(nm, ic_call, ic_call+1);
|
|
||||||
bool ret = iter.next();
|
|
||||||
assert(ret == true, "relocInfo must exist at this address");
|
|
||||||
assert(iter.addr() == ic_call, "must find ic_call");
|
|
||||||
if (iter.type() == relocInfo::virtual_call_type) {
|
|
||||||
virtual_call_Relocation* r = iter.virtual_call_reloc();
|
|
||||||
_is_optimized = false;
|
|
||||||
_value = nativeMovConstReg_at(r->cached_value());
|
|
||||||
} else {
|
|
||||||
assert(iter.type() == relocInfo::opt_virtual_call_type, "must be a virtual call");
|
|
||||||
_is_optimized = true;
|
|
||||||
_value = NULL;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
|
|
||||||
// A PPC CompiledStaticCall looks like this:
|
// A PPC CompiledStaticCall looks like this:
|
||||||
@ -203,7 +175,7 @@ void CompiledStaticCall::set_to_interpreted(methodHandle callee, address entry)
|
|||||||
if (TraceICs) {
|
if (TraceICs) {
|
||||||
ResourceMark rm;
|
ResourceMark rm;
|
||||||
tty->print_cr("CompiledStaticCall@" INTPTR_FORMAT ": set_to_interpreted %s",
|
tty->print_cr("CompiledStaticCall@" INTPTR_FORMAT ": set_to_interpreted %s",
|
||||||
instruction_address(),
|
p2i(instruction_address()),
|
||||||
callee->name_and_sig_as_C_string());
|
callee->name_and_sig_as_C_string());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
|
||||||
* Copyright 2012, 2014 SAP AG. All rights reserved.
|
* Copyright 2012, 2014 SAP AG. 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.
|
||||||
*
|
*
|
||||||
@ -140,7 +140,7 @@ frame frame::sender(RegisterMap* map) const {
|
|||||||
void frame::patch_pc(Thread* thread, address pc) {
|
void frame::patch_pc(Thread* thread, address pc) {
|
||||||
if (TracePcPatching) {
|
if (TracePcPatching) {
|
||||||
tty->print_cr("patch_pc at address " PTR_FORMAT " [" PTR_FORMAT " -> " PTR_FORMAT "]",
|
tty->print_cr("patch_pc at address " PTR_FORMAT " [" PTR_FORMAT " -> " PTR_FORMAT "]",
|
||||||
&((address*) _sp)[-1], ((address*) _sp)[-1], pc);
|
p2i(&((address*) _sp)[-1]), p2i(((address*) _sp)[-1]), p2i(pc));
|
||||||
}
|
}
|
||||||
own_abi()->lr = (uint64_t)pc;
|
own_abi()->lr = (uint64_t)pc;
|
||||||
_cb = CodeCache::find_blob(pc);
|
_cb = CodeCache::find_blob(pc);
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
|
||||||
* Copyright 2012, 2014 SAP AG. All rights reserved.
|
* Copyright 2012, 2014 SAP AG. 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.
|
||||||
*
|
*
|
||||||
@ -3099,7 +3099,7 @@ const char* stop_types[] = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
static void stop_on_request(int tp, const char* msg) {
|
static void stop_on_request(int tp, const char* msg) {
|
||||||
tty->print("PPC assembly code requires stop: (%s) %s\n", (void *)stop_types[tp%/*stop_end*/4], msg);
|
tty->print("PPC assembly code requires stop: (%s) %s\n", stop_types[tp%/*stop_end*/4], msg);
|
||||||
guarantee(false, err_msg("PPC assembly code requires stop: %s", msg));
|
guarantee(false, err_msg("PPC assembly code requires stop: %s", msg));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
|
||||||
* Copyright 2012, 2014 SAP AG. All rights reserved.
|
* Copyright 2012, 2014 SAP AG. 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.
|
||||||
*
|
*
|
||||||
@ -464,7 +464,7 @@ void trace_method_handle_stub(const char* adaptername,
|
|||||||
strstr(adaptername, "linkTo") == NULL); // static linkers don't have MH
|
strstr(adaptername, "linkTo") == NULL); // static linkers don't have MH
|
||||||
const char* mh_reg_name = has_mh ? "R23_method_handle" : "G23";
|
const char* mh_reg_name = has_mh ? "R23_method_handle" : "G23";
|
||||||
tty->print_cr("MH %s %s="INTPTR_FORMAT " sp=" INTPTR_FORMAT,
|
tty->print_cr("MH %s %s="INTPTR_FORMAT " sp=" INTPTR_FORMAT,
|
||||||
adaptername, mh_reg_name, (intptr_t) mh, entry_sp);
|
adaptername, mh_reg_name, (intptr_t) mh, (intptr_t) entry_sp);
|
||||||
|
|
||||||
if (Verbose) {
|
if (Verbose) {
|
||||||
tty->print_cr("Registers:");
|
tty->print_cr("Registers:");
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
|
||||||
* Copyright 2012, 2013 SAP AG. All rights reserved.
|
* Copyright 2012, 2014 SAP AG. 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
|
||||||
@ -147,9 +147,9 @@ void NativeCall::verify() {
|
|||||||
address addr = addr_at(0);
|
address addr = addr_at(0);
|
||||||
|
|
||||||
if (!NativeCall::is_call_at(addr)) {
|
if (!NativeCall::is_call_at(addr)) {
|
||||||
tty->print_cr("not a NativeCall at " PTR_FORMAT, addr);
|
tty->print_cr("not a NativeCall at " PTR_FORMAT, p2i(addr));
|
||||||
// TODO: PPC port: Disassembler::decode(addr - 20, addr + 20, tty);
|
// TODO: PPC port: Disassembler::decode(addr - 20, addr + 20, tty);
|
||||||
fatal(err_msg("not a NativeCall at " PTR_FORMAT, addr));
|
fatal(err_msg("not a NativeCall at " PTR_FORMAT, p2i(addr)));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif // ASSERT
|
#endif // ASSERT
|
||||||
@ -160,9 +160,9 @@ void NativeFarCall::verify() {
|
|||||||
|
|
||||||
NativeInstruction::verify();
|
NativeInstruction::verify();
|
||||||
if (!NativeFarCall::is_far_call_at(addr)) {
|
if (!NativeFarCall::is_far_call_at(addr)) {
|
||||||
tty->print_cr("not a NativeFarCall at " PTR_FORMAT, addr);
|
tty->print_cr("not a NativeFarCall at " PTR_FORMAT, p2i(addr));
|
||||||
// TODO: PPC port: Disassembler::decode(addr, 20, 20, tty);
|
// TODO: PPC port: Disassembler::decode(addr, 20, 20, tty);
|
||||||
fatal(err_msg("not a NativeFarCall at " PTR_FORMAT, addr));
|
fatal(err_msg("not a NativeFarCall at " PTR_FORMAT, p2i(addr)));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif // ASSERT
|
#endif // ASSERT
|
||||||
@ -306,9 +306,9 @@ void NativeMovConstReg::verify() {
|
|||||||
if (! (cb != NULL && MacroAssembler::is_calculate_address_from_global_toc_at(addr, cb->content_begin())) &&
|
if (! (cb != NULL && MacroAssembler::is_calculate_address_from_global_toc_at(addr, cb->content_begin())) &&
|
||||||
! (cb != NULL && MacroAssembler::is_set_narrow_oop(addr, cb->content_begin())) &&
|
! (cb != NULL && MacroAssembler::is_set_narrow_oop(addr, cb->content_begin())) &&
|
||||||
! MacroAssembler::is_bl(*((int*) addr))) {
|
! MacroAssembler::is_bl(*((int*) addr))) {
|
||||||
tty->print_cr("not a NativeMovConstReg at " PTR_FORMAT, addr);
|
tty->print_cr("not a NativeMovConstReg at " PTR_FORMAT, p2i(addr));
|
||||||
// TODO: PPC port: Disassembler::decode(addr, 20, 20, tty);
|
// TODO: PPC port: Disassembler::decode(addr, 20, 20, tty);
|
||||||
fatal(err_msg("not a NativeMovConstReg at " PTR_FORMAT, addr));
|
fatal(err_msg("not a NativeMovConstReg at " PTR_FORMAT, p2i(addr)));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -344,9 +344,9 @@ void NativeJump::verify() {
|
|||||||
|
|
||||||
NativeInstruction::verify();
|
NativeInstruction::verify();
|
||||||
if (!NativeJump::is_jump_at(addr)) {
|
if (!NativeJump::is_jump_at(addr)) {
|
||||||
tty->print_cr("not a NativeJump at " PTR_FORMAT, addr);
|
tty->print_cr("not a NativeJump at " PTR_FORMAT, p2i(addr));
|
||||||
// TODO: PPC port: Disassembler::decode(addr, 20, 20, tty);
|
// TODO: PPC port: Disassembler::decode(addr, 20, 20, tty);
|
||||||
fatal(err_msg("not a NativeJump at " PTR_FORMAT, addr));
|
fatal(err_msg("not a NativeJump at " PTR_FORMAT, p2i(addr)));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif // ASSERT
|
#endif // ASSERT
|
||||||
|
@ -1329,7 +1329,7 @@ void MachPrologNode::format(PhaseRegAlloc *ra_, outputStream *st) const {
|
|||||||
|
|
||||||
if (!false /* TODO: PPC port C->is_frameless_method()*/) {
|
if (!false /* TODO: PPC port C->is_frameless_method()*/) {
|
||||||
st->print("save return pc\n\t");
|
st->print("save return pc\n\t");
|
||||||
st->print("push frame %d\n\t", -framesize);
|
st->print("push frame %ld\n\t", -framesize);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
@ -352,7 +352,7 @@ void VM_Version::determine_section_size() {
|
|||||||
|
|
||||||
if (PrintAssembly) {
|
if (PrintAssembly) {
|
||||||
ttyLocker ttyl;
|
ttyLocker ttyl;
|
||||||
tty->print_cr("Decoding section size detection stub at " INTPTR_FORMAT " before execution:", code);
|
tty->print_cr("Decoding section size detection stub at " INTPTR_FORMAT " before execution:", p2i(code));
|
||||||
Disassembler::decode((u_char*)code, (u_char*)code_end, tty);
|
Disassembler::decode((u_char*)code, (u_char*)code_end, tty);
|
||||||
tty->print_cr("Time loop1 :%f", loop1_seconds);
|
tty->print_cr("Time loop1 :%f", loop1_seconds);
|
||||||
tty->print_cr("Time loop2 :%f", loop2_seconds);
|
tty->print_cr("Time loop2 :%f", loop2_seconds);
|
||||||
@ -435,7 +435,7 @@ void VM_Version::determine_features() {
|
|||||||
// Print the detection code.
|
// Print the detection code.
|
||||||
if (PrintAssembly) {
|
if (PrintAssembly) {
|
||||||
ttyLocker ttyl;
|
ttyLocker ttyl;
|
||||||
tty->print_cr("Decoding cpu-feature detection stub at " INTPTR_FORMAT " before execution:", code);
|
tty->print_cr("Decoding cpu-feature detection stub at " INTPTR_FORMAT " before execution:", p2i(code));
|
||||||
Disassembler::decode((u_char*)code, (u_char*)code_end, tty);
|
Disassembler::decode((u_char*)code, (u_char*)code_end, tty);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -468,7 +468,7 @@ void VM_Version::determine_features() {
|
|||||||
// Print the detection code.
|
// Print the detection code.
|
||||||
if (PrintAssembly) {
|
if (PrintAssembly) {
|
||||||
ttyLocker ttyl;
|
ttyLocker ttyl;
|
||||||
tty->print_cr("Decoding cpu-feature detection stub at " INTPTR_FORMAT " after execution:", code);
|
tty->print_cr("Decoding cpu-feature detection stub at " INTPTR_FORMAT " after execution:", p2i(code));
|
||||||
Disassembler::decode((u_char*)code, (u_char*)code_end, tty);
|
Disassembler::decode((u_char*)code, (u_char*)code_end, tty);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -50,34 +50,6 @@ bool CompiledIC::is_icholder_call_site(virtual_call_Relocation* call_site) {
|
|||||||
return is_icholder_entry(call->destination());
|
return is_icholder_entry(call->destination());
|
||||||
}
|
}
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
|
||||||
// High-level access to an inline cache. Guaranteed to be MT-safe.
|
|
||||||
|
|
||||||
CompiledIC::CompiledIC(nmethod* nm, NativeCall* call)
|
|
||||||
: _ic_call(call)
|
|
||||||
{
|
|
||||||
address ic_call = call->instruction_address();
|
|
||||||
|
|
||||||
assert(ic_call != NULL, "ic_call address must be set");
|
|
||||||
assert(nm != NULL, "must pass nmethod");
|
|
||||||
assert(nm->contains(ic_call), "must be in nmethod");
|
|
||||||
|
|
||||||
// Search for the ic_call at the given address.
|
|
||||||
RelocIterator iter(nm, ic_call, ic_call+1);
|
|
||||||
bool ret = iter.next();
|
|
||||||
assert(ret == true, "relocInfo must exist at this address");
|
|
||||||
assert(iter.addr() == ic_call, "must find ic_call");
|
|
||||||
if (iter.type() == relocInfo::virtual_call_type) {
|
|
||||||
virtual_call_Relocation* r = iter.virtual_call_reloc();
|
|
||||||
_is_optimized = false;
|
|
||||||
_value = nativeMovConstReg_at(r->cached_value());
|
|
||||||
} else {
|
|
||||||
assert(iter.type() == relocInfo::opt_virtual_call_type, "must be a virtual call");
|
|
||||||
_is_optimized = true;
|
|
||||||
_value = NULL;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
|
|
||||||
#define __ _masm.
|
#define __ _masm.
|
||||||
|
@ -436,32 +436,6 @@ void frame::set_interpreter_frame_sender_sp(intptr_t* sender_sp) {
|
|||||||
}
|
}
|
||||||
#endif // CC_INTERP
|
#endif // CC_INTERP
|
||||||
|
|
||||||
|
|
||||||
#ifdef ASSERT
|
|
||||||
// Debugging aid
|
|
||||||
static frame nth_sender(int n) {
|
|
||||||
frame f = JavaThread::current()->last_frame();
|
|
||||||
|
|
||||||
for(int i = 0; i < n; ++i)
|
|
||||||
f = f.sender((RegisterMap*)NULL);
|
|
||||||
|
|
||||||
printf("first frame %d\n", f.is_first_frame() ? 1 : 0);
|
|
||||||
printf("interpreted frame %d\n", f.is_interpreted_frame() ? 1 : 0);
|
|
||||||
printf("java frame %d\n", f.is_java_frame() ? 1 : 0);
|
|
||||||
printf("entry frame %d\n", f.is_entry_frame() ? 1 : 0);
|
|
||||||
printf("native frame %d\n", f.is_native_frame() ? 1 : 0);
|
|
||||||
if (f.is_compiled_frame()) {
|
|
||||||
if (f.is_deoptimized_frame())
|
|
||||||
printf("deoptimized frame 1\n");
|
|
||||||
else
|
|
||||||
printf("compiled frame 1\n");
|
|
||||||
}
|
|
||||||
|
|
||||||
return f;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
frame frame::sender_for_entry_frame(RegisterMap *map) const {
|
frame frame::sender_for_entry_frame(RegisterMap *map) const {
|
||||||
assert(map != NULL, "map must be set");
|
assert(map != NULL, "map must be set");
|
||||||
// Java frame called from C; skip all C frames and return top C
|
// Java frame called from C; skip all C frames and return top C
|
||||||
|
@ -1,30 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright (c) 1998, 2010, 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.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef CPU_X86_VM_BYTECODES_X86_HPP
|
|
||||||
#define CPU_X86_VM_BYTECODES_X86_HPP
|
|
||||||
|
|
||||||
// No i486 specific bytecodes
|
|
||||||
|
|
||||||
#endif // CPU_X86_VM_BYTECODES_X86_HPP
|
|
@ -47,34 +47,6 @@ bool CompiledIC::is_icholder_call_site(virtual_call_Relocation* call_site) {
|
|||||||
return is_icholder_entry(call->destination());
|
return is_icholder_entry(call->destination());
|
||||||
}
|
}
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
|
||||||
// High-level access to an inline cache. Guaranteed to be MT-safe.
|
|
||||||
|
|
||||||
CompiledIC::CompiledIC(nmethod* nm, NativeCall* call)
|
|
||||||
: _ic_call(call)
|
|
||||||
{
|
|
||||||
address ic_call = call->instruction_address();
|
|
||||||
|
|
||||||
assert(ic_call != NULL, "ic_call address must be set");
|
|
||||||
assert(nm != NULL, "must pass nmethod");
|
|
||||||
assert(nm->contains(ic_call), "must be in nmethod");
|
|
||||||
|
|
||||||
// Search for the ic_call at the given address.
|
|
||||||
RelocIterator iter(nm, ic_call, ic_call+1);
|
|
||||||
bool ret = iter.next();
|
|
||||||
assert(ret == true, "relocInfo must exist at this address");
|
|
||||||
assert(iter.addr() == ic_call, "must find ic_call");
|
|
||||||
if (iter.type() == relocInfo::virtual_call_type) {
|
|
||||||
virtual_call_Relocation* r = iter.virtual_call_reloc();
|
|
||||||
_is_optimized = false;
|
|
||||||
_value = nativeMovConstReg_at(r->cached_value());
|
|
||||||
} else {
|
|
||||||
assert(iter.type() == relocInfo::opt_virtual_call_type, "must be a virtual call");
|
|
||||||
_is_optimized = true;
|
|
||||||
_value = NULL;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
|
|
||||||
#define __ _masm.
|
#define __ _masm.
|
||||||
|
@ -280,6 +280,8 @@ address TemplateInterpreterGenerator::generate_result_handler_for(BasicType type
|
|||||||
case T_BYTE : __ sign_extend_byte (rax); break;
|
case T_BYTE : __ sign_extend_byte (rax); break;
|
||||||
case T_SHORT : __ sign_extend_short(rax); break;
|
case T_SHORT : __ sign_extend_short(rax); break;
|
||||||
case T_INT : /* nothing to do */ break;
|
case T_INT : /* nothing to do */ break;
|
||||||
|
case T_LONG : /* nothing to do */ break;
|
||||||
|
case T_VOID : /* nothing to do */ break;
|
||||||
case T_DOUBLE :
|
case T_DOUBLE :
|
||||||
case T_FLOAT :
|
case T_FLOAT :
|
||||||
{ const Register t = InterpreterRuntime::SignatureHandlerGenerator::temp();
|
{ const Register t = InterpreterRuntime::SignatureHandlerGenerator::temp();
|
||||||
|
@ -1,31 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
|
|
||||||
* Copyright 2007 Red Hat, Inc.
|
|
||||||
* 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.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "precompiled.hpp"
|
|
||||||
#include "interpreter/bytecodes.hpp"
|
|
||||||
|
|
||||||
void Bytecodes::pd_initialize() {
|
|
||||||
// No zero specific initialization
|
|
||||||
}
|
|
@ -1,31 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
|
|
||||||
* Copyright 2009 Red Hat, Inc.
|
|
||||||
* 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.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef CPU_ZERO_VM_BYTECODES_ZERO_HPP
|
|
||||||
#define CPU_ZERO_VM_BYTECODES_ZERO_HPP
|
|
||||||
|
|
||||||
// This file is intentionally empty
|
|
||||||
|
|
||||||
#endif // CPU_ZERO_VM_BYTECODES_ZERO_HPP
|
|
@ -58,34 +58,6 @@ bool CompiledIC::is_icholder_call_site(virtual_call_Relocation* call_site) {
|
|||||||
return is_icholder_entry(call->destination());
|
return is_icholder_entry(call->destination());
|
||||||
}
|
}
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
|
||||||
// High-level access to an inline cache. Guaranteed to be MT-safe.
|
|
||||||
|
|
||||||
CompiledIC::CompiledIC(nmethod* nm, NativeCall* call)
|
|
||||||
: _ic_call(call)
|
|
||||||
{
|
|
||||||
address ic_call = call->instruction_address();
|
|
||||||
|
|
||||||
assert(ic_call != NULL, "ic_call address must be set");
|
|
||||||
assert(nm != NULL, "must pass nmethod");
|
|
||||||
assert(nm->contains(ic_call), "must be in nmethod");
|
|
||||||
|
|
||||||
// Search for the ic_call at the given address.
|
|
||||||
RelocIterator iter(nm, ic_call, ic_call+1);
|
|
||||||
bool ret = iter.next();
|
|
||||||
assert(ret == true, "relocInfo must exist at this address");
|
|
||||||
assert(iter.addr() == ic_call, "must find ic_call");
|
|
||||||
if (iter.type() == relocInfo::virtual_call_type) {
|
|
||||||
virtual_call_Relocation* r = iter.virtual_call_reloc();
|
|
||||||
_is_optimized = false;
|
|
||||||
_value = nativeMovConstReg_at(r->cached_value());
|
|
||||||
} else {
|
|
||||||
assert(iter.type() == relocInfo::opt_virtual_call_type, "must be a virtual call");
|
|
||||||
_is_optimized = true;
|
|
||||||
_value = NULL;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
|
|
||||||
void CompiledStaticCall::emit_to_interp_stub(CodeBuffer &cbuf) {
|
void CompiledStaticCall::emit_to_interp_stub(CodeBuffer &cbuf) {
|
||||||
|
@ -37,6 +37,7 @@
|
|||||||
#include "prims/jvmtiExport.hpp"
|
#include "prims/jvmtiExport.hpp"
|
||||||
#include "prims/jvmtiThreadState.hpp"
|
#include "prims/jvmtiThreadState.hpp"
|
||||||
#include "runtime/arguments.hpp"
|
#include "runtime/arguments.hpp"
|
||||||
|
#include "runtime/atomic.inline.hpp"
|
||||||
#include "runtime/deoptimization.hpp"
|
#include "runtime/deoptimization.hpp"
|
||||||
#include "runtime/frame.inline.hpp"
|
#include "runtime/frame.inline.hpp"
|
||||||
#include "runtime/interfaceSupport.hpp"
|
#include "runtime/interfaceSupport.hpp"
|
||||||
|
@ -24,17 +24,13 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
// no precompiled headers
|
// no precompiled headers
|
||||||
#include "runtime/atomic.hpp"
|
|
||||||
#include "runtime/handles.inline.hpp"
|
#include "runtime/handles.inline.hpp"
|
||||||
#include "runtime/mutexLocker.hpp"
|
#include "runtime/mutexLocker.hpp"
|
||||||
#include "runtime/os.hpp"
|
#include "runtime/os.hpp"
|
||||||
#include "runtime/osThread.hpp"
|
#include "runtime/osThread.hpp"
|
||||||
#include "runtime/safepoint.hpp"
|
#include "runtime/safepoint.hpp"
|
||||||
#include "runtime/vmThread.hpp"
|
#include "runtime/vmThread.hpp"
|
||||||
#ifdef TARGET_ARCH_ppc
|
|
||||||
# include "assembler_ppc.inline.hpp"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
void OSThread::pd_initialize() {
|
void OSThread::pd_initialize() {
|
||||||
assert(this != NULL, "check");
|
assert(this != NULL, "check");
|
||||||
|
@ -48,6 +48,7 @@
|
|||||||
#include "prims/jvm.h"
|
#include "prims/jvm.h"
|
||||||
#include "prims/jvm_misc.hpp"
|
#include "prims/jvm_misc.hpp"
|
||||||
#include "runtime/arguments.hpp"
|
#include "runtime/arguments.hpp"
|
||||||
|
#include "runtime/atomic.inline.hpp"
|
||||||
#include "runtime/extendedPC.hpp"
|
#include "runtime/extendedPC.hpp"
|
||||||
#include "runtime/globals.hpp"
|
#include "runtime/globals.hpp"
|
||||||
#include "runtime/interfaceSupport.hpp"
|
#include "runtime/interfaceSupport.hpp"
|
||||||
@ -2812,13 +2813,6 @@ void os::yield() {
|
|||||||
|
|
||||||
os::YieldResult os::NakedYield() { sched_yield(); return os::YIELD_UNKNOWN; }
|
os::YieldResult os::NakedYield() { sched_yield(); return os::YIELD_UNKNOWN; }
|
||||||
|
|
||||||
void os::yield_all() {
|
|
||||||
// Yields to all threads, including threads with lower priorities
|
|
||||||
// Threads on Linux are all with same priority. The Solaris style
|
|
||||||
// os::yield_all() with nanosleep(1ms) is not necessary.
|
|
||||||
sched_yield();
|
|
||||||
}
|
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
// thread priority support
|
// thread priority support
|
||||||
|
|
||||||
@ -3075,7 +3069,7 @@ static bool do_suspend(OSThread* osthread) {
|
|||||||
|
|
||||||
for (int n = 0; !osthread->sr.is_suspended(); n++) {
|
for (int n = 0; !osthread->sr.is_suspended(); n++) {
|
||||||
for (int i = 0; i < RANDOMLY_LARGE_INTEGER2 && !osthread->sr.is_suspended(); i++) {
|
for (int i = 0; i < RANDOMLY_LARGE_INTEGER2 && !osthread->sr.is_suspended(); i++) {
|
||||||
os::yield_all();
|
os::yield();
|
||||||
}
|
}
|
||||||
|
|
||||||
// timeout, try to cancel the request
|
// timeout, try to cancel the request
|
||||||
@ -3109,7 +3103,7 @@ static void do_resume(OSThread* osthread) {
|
|||||||
if (sr_notify(osthread) == 0) {
|
if (sr_notify(osthread) == 0) {
|
||||||
for (int n = 0; n < RANDOMLY_LARGE_INTEGER && !osthread->sr.is_running(); n++) {
|
for (int n = 0; n < RANDOMLY_LARGE_INTEGER && !osthread->sr.is_running(); n++) {
|
||||||
for (int i = 0; i < 100 && !osthread->sr.is_running(); i++) {
|
for (int i = 0; i < 100 && !osthread->sr.is_running(); i++) {
|
||||||
os::yield_all();
|
os::yield();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
@ -41,6 +41,7 @@
|
|||||||
#include "prims/jvm.h"
|
#include "prims/jvm.h"
|
||||||
#include "prims/jvm_misc.hpp"
|
#include "prims/jvm_misc.hpp"
|
||||||
#include "runtime/arguments.hpp"
|
#include "runtime/arguments.hpp"
|
||||||
|
#include "runtime/atomic.inline.hpp"
|
||||||
#include "runtime/extendedPC.hpp"
|
#include "runtime/extendedPC.hpp"
|
||||||
#include "runtime/globals.hpp"
|
#include "runtime/globals.hpp"
|
||||||
#include "runtime/interfaceSupport.hpp"
|
#include "runtime/interfaceSupport.hpp"
|
||||||
@ -2600,13 +2601,6 @@ void os::yield() {
|
|||||||
|
|
||||||
os::YieldResult os::NakedYield() { sched_yield(); return os::YIELD_UNKNOWN; }
|
os::YieldResult os::NakedYield() { sched_yield(); return os::YIELD_UNKNOWN; }
|
||||||
|
|
||||||
void os::yield_all() {
|
|
||||||
// Yields to all threads, including threads with lower priorities
|
|
||||||
// Threads on Bsd are all with same priority. The Solaris style
|
|
||||||
// os::yield_all() with nanosleep(1ms) is not necessary.
|
|
||||||
sched_yield();
|
|
||||||
}
|
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
// thread priority support
|
// thread priority support
|
||||||
|
|
||||||
|
@ -41,6 +41,7 @@
|
|||||||
#include "prims/jvm.h"
|
#include "prims/jvm.h"
|
||||||
#include "prims/jvm_misc.hpp"
|
#include "prims/jvm_misc.hpp"
|
||||||
#include "runtime/arguments.hpp"
|
#include "runtime/arguments.hpp"
|
||||||
|
#include "runtime/atomic.inline.hpp"
|
||||||
#include "runtime/extendedPC.hpp"
|
#include "runtime/extendedPC.hpp"
|
||||||
#include "runtime/globals.hpp"
|
#include "runtime/globals.hpp"
|
||||||
#include "runtime/interfaceSupport.hpp"
|
#include "runtime/interfaceSupport.hpp"
|
||||||
@ -3795,13 +3796,6 @@ void os::yield() {
|
|||||||
|
|
||||||
os::YieldResult os::NakedYield() { sched_yield(); return os::YIELD_UNKNOWN; }
|
os::YieldResult os::NakedYield() { sched_yield(); return os::YIELD_UNKNOWN; }
|
||||||
|
|
||||||
void os::yield_all() {
|
|
||||||
// Yields to all threads, including threads with lower priorities
|
|
||||||
// Threads on Linux are all with same priority. The Solaris style
|
|
||||||
// os::yield_all() with nanosleep(1ms) is not necessary.
|
|
||||||
sched_yield();
|
|
||||||
}
|
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
// thread priority support
|
// thread priority support
|
||||||
|
|
||||||
|
@ -23,7 +23,6 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
// no precompiled headers
|
// no precompiled headers
|
||||||
#include "runtime/atomic.hpp"
|
|
||||||
#include "runtime/handles.inline.hpp"
|
#include "runtime/handles.inline.hpp"
|
||||||
#include "runtime/mutexLocker.hpp"
|
#include "runtime/mutexLocker.hpp"
|
||||||
#include "runtime/os.hpp"
|
#include "runtime/os.hpp"
|
||||||
|
@ -41,6 +41,7 @@
|
|||||||
#include "prims/jvm.h"
|
#include "prims/jvm.h"
|
||||||
#include "prims/jvm_misc.hpp"
|
#include "prims/jvm_misc.hpp"
|
||||||
#include "runtime/arguments.hpp"
|
#include "runtime/arguments.hpp"
|
||||||
|
#include "runtime/atomic.inline.hpp"
|
||||||
#include "runtime/extendedPC.hpp"
|
#include "runtime/extendedPC.hpp"
|
||||||
#include "runtime/globals.hpp"
|
#include "runtime/globals.hpp"
|
||||||
#include "runtime/interfaceSupport.hpp"
|
#include "runtime/interfaceSupport.hpp"
|
||||||
@ -3186,11 +3187,6 @@ void os::yield() {
|
|||||||
|
|
||||||
os::YieldResult os::NakedYield() { thr_yield(); return os::YIELD_UNKNOWN; }
|
os::YieldResult os::NakedYield() { thr_yield(); return os::YIELD_UNKNOWN; }
|
||||||
|
|
||||||
void os::yield_all() {
|
|
||||||
// Yields to all threads, including threads with lower priorities
|
|
||||||
os::sleep(Thread::current(), 1, false);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Interface for setting lwp priorities. If we are using T2 libthread,
|
// Interface for setting lwp priorities. If we are using T2 libthread,
|
||||||
// which forces the use of BoundThreads or we manually set UseBoundThreads,
|
// which forces the use of BoundThreads or we manually set UseBoundThreads,
|
||||||
// all of our threads will be assigned to real lwp's. Using the thr_setprio
|
// all of our threads will be assigned to real lwp's. Using the thr_setprio
|
||||||
|
@ -29,7 +29,6 @@
|
|||||||
#error "This file should only be included from thread.inline.hpp"
|
#error "This file should only be included from thread.inline.hpp"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "runtime/atomic.inline.hpp"
|
|
||||||
#include "runtime/thread.hpp"
|
#include "runtime/thread.hpp"
|
||||||
#include "runtime/threadLocalStorage.hpp"
|
#include "runtime/threadLocalStorage.hpp"
|
||||||
|
|
||||||
|
@ -23,7 +23,6 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
// no precompiled headers
|
// no precompiled headers
|
||||||
#include "runtime/atomic.hpp"
|
|
||||||
#include "runtime/handles.inline.hpp"
|
#include "runtime/handles.inline.hpp"
|
||||||
#include "runtime/mutexLocker.hpp"
|
#include "runtime/mutexLocker.hpp"
|
||||||
#include "runtime/os.hpp"
|
#include "runtime/os.hpp"
|
||||||
|
@ -44,6 +44,7 @@
|
|||||||
#include "prims/jvm.h"
|
#include "prims/jvm.h"
|
||||||
#include "prims/jvm_misc.hpp"
|
#include "prims/jvm_misc.hpp"
|
||||||
#include "runtime/arguments.hpp"
|
#include "runtime/arguments.hpp"
|
||||||
|
#include "runtime/atomic.inline.hpp"
|
||||||
#include "runtime/extendedPC.hpp"
|
#include "runtime/extendedPC.hpp"
|
||||||
#include "runtime/globals.hpp"
|
#include "runtime/globals.hpp"
|
||||||
#include "runtime/interfaceSupport.hpp"
|
#include "runtime/interfaceSupport.hpp"
|
||||||
@ -3526,11 +3527,6 @@ os::YieldResult os::NakedYield() {
|
|||||||
|
|
||||||
void os::yield() { os::NakedYield(); }
|
void os::yield() { os::NakedYield(); }
|
||||||
|
|
||||||
void os::yield_all() {
|
|
||||||
// Yields to all threads, including threads with lower priorities
|
|
||||||
Sleep(1);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Win32 only gives you access to seven real priorities at a time,
|
// Win32 only gives you access to seven real priorities at a time,
|
||||||
// so we compress Java's ten down to seven. It would be better
|
// so we compress Java's ten down to seven. It would be better
|
||||||
// if we dynamically adjusted relative priorities.
|
// if we dynamically adjusted relative priorities.
|
||||||
|
@ -23,6 +23,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include "precompiled.hpp"
|
#include "precompiled.hpp"
|
||||||
|
#include "runtime/atomic.inline.hpp"
|
||||||
#include "runtime/thread.inline.hpp"
|
#include "runtime/thread.inline.hpp"
|
||||||
#include "runtime/threadCritical.hpp"
|
#include "runtime/threadCritical.hpp"
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
|
||||||
* Copyright 2012, 2013 SAP AG. All rights reserved.
|
* Copyright 2012, 2014 SAP AG. 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
|
||||||
@ -307,7 +307,7 @@ JVM_handle_linux_signal(int sig,
|
|||||||
// doesn't work for us. We use:
|
// doesn't work for us. We use:
|
||||||
((NativeInstruction*)pc)->is_safepoint_poll()) {
|
((NativeInstruction*)pc)->is_safepoint_poll()) {
|
||||||
if (TraceTraps) {
|
if (TraceTraps) {
|
||||||
tty->print_cr("trap: safepoint_poll at " INTPTR_FORMAT " (SIGSEGV)", pc);
|
tty->print_cr("trap: safepoint_poll at " INTPTR_FORMAT " (SIGSEGV)", p2i(pc));
|
||||||
}
|
}
|
||||||
stub = SharedRuntime::get_poll_stub(pc);
|
stub = SharedRuntime::get_poll_stub(pc);
|
||||||
}
|
}
|
||||||
@ -316,7 +316,7 @@ JVM_handle_linux_signal(int sig,
|
|||||||
else if (sig == SIGTRAP && TrapBasedICMissChecks &&
|
else if (sig == SIGTRAP && TrapBasedICMissChecks &&
|
||||||
nativeInstruction_at(pc)->is_sigtrap_ic_miss_check()) {
|
nativeInstruction_at(pc)->is_sigtrap_ic_miss_check()) {
|
||||||
if (TraceTraps) {
|
if (TraceTraps) {
|
||||||
tty->print_cr("trap: ic_miss_check at " INTPTR_FORMAT " (SIGTRAP)", pc);
|
tty->print_cr("trap: ic_miss_check at " INTPTR_FORMAT " (SIGTRAP)", p2i(pc));
|
||||||
}
|
}
|
||||||
stub = SharedRuntime::get_ic_miss_stub();
|
stub = SharedRuntime::get_ic_miss_stub();
|
||||||
}
|
}
|
||||||
@ -325,7 +325,7 @@ JVM_handle_linux_signal(int sig,
|
|||||||
else if (sig == SIGTRAP && TrapBasedNullChecks &&
|
else if (sig == SIGTRAP && TrapBasedNullChecks &&
|
||||||
nativeInstruction_at(pc)->is_sigtrap_null_check()) {
|
nativeInstruction_at(pc)->is_sigtrap_null_check()) {
|
||||||
if (TraceTraps) {
|
if (TraceTraps) {
|
||||||
tty->print_cr("trap: null_check at " INTPTR_FORMAT " (SIGTRAP)", pc);
|
tty->print_cr("trap: null_check at " INTPTR_FORMAT " (SIGTRAP)", p2i(pc));
|
||||||
}
|
}
|
||||||
stub = SharedRuntime::continuation_for_implicit_exception(thread, pc, SharedRuntime::IMPLICIT_NULL);
|
stub = SharedRuntime::continuation_for_implicit_exception(thread, pc, SharedRuntime::IMPLICIT_NULL);
|
||||||
}
|
}
|
||||||
@ -335,7 +335,7 @@ JVM_handle_linux_signal(int sig,
|
|||||||
CodeCache::contains((void*) pc) &&
|
CodeCache::contains((void*) pc) &&
|
||||||
!MacroAssembler::needs_explicit_null_check((intptr_t) info->si_addr)) {
|
!MacroAssembler::needs_explicit_null_check((intptr_t) info->si_addr)) {
|
||||||
if (TraceTraps) {
|
if (TraceTraps) {
|
||||||
tty->print_cr("trap: null_check at " INTPTR_FORMAT " (SIGSEGV)", pc);
|
tty->print_cr("trap: null_check at " INTPTR_FORMAT " (SIGSEGV)", p2i(pc));
|
||||||
}
|
}
|
||||||
stub = SharedRuntime::continuation_for_implicit_exception(thread, pc, SharedRuntime::IMPLICIT_NULL);
|
stub = SharedRuntime::continuation_for_implicit_exception(thread, pc, SharedRuntime::IMPLICIT_NULL);
|
||||||
}
|
}
|
||||||
@ -345,7 +345,7 @@ JVM_handle_linux_signal(int sig,
|
|||||||
else if (sig == SIGTRAP && TrapBasedRangeChecks &&
|
else if (sig == SIGTRAP && TrapBasedRangeChecks &&
|
||||||
nativeInstruction_at(pc)->is_sigtrap_range_check()) {
|
nativeInstruction_at(pc)->is_sigtrap_range_check()) {
|
||||||
if (TraceTraps) {
|
if (TraceTraps) {
|
||||||
tty->print_cr("trap: range_check at " INTPTR_FORMAT " (SIGTRAP)", pc);
|
tty->print_cr("trap: range_check at " INTPTR_FORMAT " (SIGTRAP)", p2i(pc));
|
||||||
}
|
}
|
||||||
stub = SharedRuntime::continuation_for_implicit_exception(thread, pc, SharedRuntime::IMPLICIT_NULL);
|
stub = SharedRuntime::continuation_for_implicit_exception(thread, pc, SharedRuntime::IMPLICIT_NULL);
|
||||||
}
|
}
|
||||||
@ -572,7 +572,7 @@ void os::print_context(outputStream *st, void *context) {
|
|||||||
st->cr();
|
st->cr();
|
||||||
|
|
||||||
intptr_t *sp = (intptr_t *)os::Linux::ucontext_get_sp(uc);
|
intptr_t *sp = (intptr_t *)os::Linux::ucontext_get_sp(uc);
|
||||||
st->print_cr("Top of Stack: (sp=" PTR_FORMAT ")", sp);
|
st->print_cr("Top of Stack: (sp=" PTR_FORMAT ")", p2i(sp));
|
||||||
print_hex_dump(st, (address)sp, (address)(sp + 128), sizeof(intptr_t));
|
print_hex_dump(st, (address)sp, (address)(sp + 128), sizeof(intptr_t));
|
||||||
st->cr();
|
st->cr();
|
||||||
|
|
||||||
@ -580,7 +580,7 @@ void os::print_context(outputStream *st, void *context) {
|
|||||||
// point to garbage if entry point in an nmethod is corrupted. Leave
|
// point to garbage if entry point in an nmethod is corrupted. Leave
|
||||||
// this at the end, and hope for the best.
|
// this at the end, and hope for the best.
|
||||||
address pc = os::Linux::ucontext_get_pc(uc);
|
address pc = os::Linux::ucontext_get_pc(uc);
|
||||||
st->print_cr("Instructions: (pc=" PTR_FORMAT ")", pc);
|
st->print_cr("Instructions: (pc=" PTR_FORMAT ")", p2i(pc));
|
||||||
print_hex_dump(st, pc - 64, pc + 64, /*instrsize=*/4);
|
print_hex_dump(st, pc - 64, pc + 64, /*instrsize=*/4);
|
||||||
st->cr();
|
st->cr();
|
||||||
}
|
}
|
||||||
|
@ -38,6 +38,7 @@
|
|||||||
#include "prims/jvm.h"
|
#include "prims/jvm.h"
|
||||||
#include "prims/jvm_misc.hpp"
|
#include "prims/jvm_misc.hpp"
|
||||||
#include "runtime/arguments.hpp"
|
#include "runtime/arguments.hpp"
|
||||||
|
#include "runtime/atomic.inline.hpp"
|
||||||
#include "runtime/extendedPC.hpp"
|
#include "runtime/extendedPC.hpp"
|
||||||
#include "runtime/frame.inline.hpp"
|
#include "runtime/frame.inline.hpp"
|
||||||
#include "runtime/interfaceSupport.hpp"
|
#include "runtime/interfaceSupport.hpp"
|
||||||
|
@ -26,7 +26,6 @@
|
|||||||
#include "asm/macroAssembler.hpp"
|
#include "asm/macroAssembler.hpp"
|
||||||
#include "asm/macroAssembler.inline.hpp"
|
#include "asm/macroAssembler.inline.hpp"
|
||||||
#include "asm/codeBuffer.hpp"
|
#include "asm/codeBuffer.hpp"
|
||||||
#include "runtime/atomic.hpp"
|
|
||||||
#include "runtime/atomic.inline.hpp"
|
#include "runtime/atomic.inline.hpp"
|
||||||
#include "runtime/icache.hpp"
|
#include "runtime/icache.hpp"
|
||||||
#include "runtime/os.hpp"
|
#include "runtime/os.hpp"
|
||||||
|
@ -47,6 +47,7 @@
|
|||||||
#include "memory/resourceArea.hpp"
|
#include "memory/resourceArea.hpp"
|
||||||
#include "oops/objArrayKlass.hpp"
|
#include "oops/objArrayKlass.hpp"
|
||||||
#include "oops/oop.inline.hpp"
|
#include "oops/oop.inline.hpp"
|
||||||
|
#include "runtime/atomic.inline.hpp"
|
||||||
#include "runtime/biasedLocking.hpp"
|
#include "runtime/biasedLocking.hpp"
|
||||||
#include "runtime/compilationPolicy.hpp"
|
#include "runtime/compilationPolicy.hpp"
|
||||||
#include "runtime/interfaceSupport.hpp"
|
#include "runtime/interfaceSupport.hpp"
|
||||||
|
@ -38,7 +38,7 @@ ciConstantPoolCache::ciConstantPoolCache(Arena* arena,
|
|||||||
int expected_size) {
|
int expected_size) {
|
||||||
_elements =
|
_elements =
|
||||||
new (arena) GrowableArray<void*>(arena, expected_size, 0, 0);
|
new (arena) GrowableArray<void*>(arena, expected_size, 0, 0);
|
||||||
_keys = new (arena) GrowableArray<intptr_t>(arena, expected_size, 0, 0);
|
_keys = new (arena) GrowableArray<int>(arena, expected_size, 0, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------
|
// ------------------------------------------------------------------
|
||||||
|
@ -35,7 +35,7 @@
|
|||||||
// Usage note: this klass has nothing to do with ConstantPoolCache*.
|
// Usage note: this klass has nothing to do with ConstantPoolCache*.
|
||||||
class ciConstantPoolCache : public ResourceObj {
|
class ciConstantPoolCache : public ResourceObj {
|
||||||
private:
|
private:
|
||||||
GrowableArray<intptr_t>* _keys;
|
GrowableArray<int>* _keys;
|
||||||
GrowableArray<void*>* _elements;
|
GrowableArray<void*>* _elements;
|
||||||
|
|
||||||
int find(int index);
|
int find(int index);
|
||||||
|
@ -512,24 +512,9 @@ ciKlass* ciEnv::get_klass_by_index_impl(constantPoolHandle cpool,
|
|||||||
} else {
|
} else {
|
||||||
// Check if it's resolved if it's not a symbol constant pool entry.
|
// Check if it's resolved if it's not a symbol constant pool entry.
|
||||||
klass = KlassHandle(THREAD, ConstantPool::klass_at_if_loaded(cpool, index));
|
klass = KlassHandle(THREAD, ConstantPool::klass_at_if_loaded(cpool, index));
|
||||||
|
|
||||||
if (klass.is_null()) {
|
|
||||||
// The klass has not been inserted into the constant pool.
|
|
||||||
// Try to look it up by name.
|
// Try to look it up by name.
|
||||||
{
|
if (klass.is_null()) {
|
||||||
// We have to lock the cpool to keep the oop from being resolved
|
klass_name = cpool->klass_name_at(index);
|
||||||
// while we are accessing it.
|
|
||||||
MonitorLockerEx ml(cpool->lock());
|
|
||||||
constantTag tag = cpool->tag_at(index);
|
|
||||||
if (tag.is_klass()) {
|
|
||||||
// The klass has been inserted into the constant pool
|
|
||||||
// very recently.
|
|
||||||
klass = KlassHandle(THREAD, cpool->resolved_klass_at(index));
|
|
||||||
} else {
|
|
||||||
assert(cpool->tag_at(index).is_unresolved_klass(), "wrong tag");
|
|
||||||
klass_name = cpool->unresolved_klass_at(index);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
/* Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
|
/* Copyright (c) 2013, 2014, 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
|
||||||
@ -686,7 +686,7 @@ class CompileReplay : public StackObj {
|
|||||||
switch (cp->tag_at(i).value()) {
|
switch (cp->tag_at(i).value()) {
|
||||||
case JVM_CONSTANT_UnresolvedClass: {
|
case JVM_CONSTANT_UnresolvedClass: {
|
||||||
if (tag == JVM_CONSTANT_Class) {
|
if (tag == JVM_CONSTANT_Class) {
|
||||||
tty->print_cr("Resolving klass %s at %d", cp->unresolved_klass_at(i)->as_utf8(), i);
|
tty->print_cr("Resolving klass %s at %d", cp->klass_name_at(i)->as_utf8(), i);
|
||||||
Klass* k = cp->klass_at(i, CHECK);
|
Klass* k = cp->klass_at(i, CHECK);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -510,7 +510,7 @@ constantPoolHandle ClassFileParser::parse_constant_pool(TRAPS) {
|
|||||||
jbyte tag = cp->tag_at(index).value();
|
jbyte tag = cp->tag_at(index).value();
|
||||||
switch (tag) {
|
switch (tag) {
|
||||||
case JVM_CONSTANT_UnresolvedClass: {
|
case JVM_CONSTANT_UnresolvedClass: {
|
||||||
Symbol* class_name = cp->unresolved_klass_at(index);
|
Symbol* class_name = cp->klass_name_at(index);
|
||||||
// check the name, even if _cp_patches will overwrite it
|
// check the name, even if _cp_patches will overwrite it
|
||||||
verify_legal_class_name(class_name, CHECK_(nullHandle));
|
verify_legal_class_name(class_name, CHECK_(nullHandle));
|
||||||
break;
|
break;
|
||||||
@ -3161,7 +3161,7 @@ instanceKlassHandle ClassFileParser::parse_super_class(int super_class_index,
|
|||||||
if (_need_verify)
|
if (_need_verify)
|
||||||
is_array = super_klass->oop_is_array();
|
is_array = super_klass->oop_is_array();
|
||||||
} else if (_need_verify) {
|
} else if (_need_verify) {
|
||||||
is_array = (_cp->unresolved_klass_at(super_class_index)->byte_at(0) == JVM_SIGNATURE_ARRAY);
|
is_array = (_cp->klass_name_at(super_class_index)->byte_at(0) == JVM_SIGNATURE_ARRAY);
|
||||||
}
|
}
|
||||||
if (_need_verify) {
|
if (_need_verify) {
|
||||||
guarantee_property(!is_array,
|
guarantee_property(!is_array,
|
||||||
@ -3855,7 +3855,7 @@ instanceKlassHandle ClassFileParser::parseClassFile(Symbol* name,
|
|||||||
"Invalid this class index %u in constant pool in class file %s",
|
"Invalid this class index %u in constant pool in class file %s",
|
||||||
this_class_index, CHECK_(nullHandle));
|
this_class_index, CHECK_(nullHandle));
|
||||||
|
|
||||||
Symbol* class_name = cp->unresolved_klass_at(this_class_index);
|
Symbol* class_name = cp->klass_name_at(this_class_index);
|
||||||
assert(class_name != NULL, "class_name can't be null");
|
assert(class_name != NULL, "class_name can't be null");
|
||||||
|
|
||||||
// It's important to set parsed_name *before* resolving the super class.
|
// It's important to set parsed_name *before* resolving the super class.
|
||||||
@ -4139,8 +4139,8 @@ instanceKlassHandle ClassFileParser::parseClassFile(Symbol* name,
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Allocate mirror and initialize static fields
|
// Allocate mirror and initialize static fields
|
||||||
java_lang_Class::create_mirror(this_klass, protection_domain, CHECK_(nullHandle));
|
java_lang_Class::create_mirror(this_klass, class_loader, protection_domain,
|
||||||
|
CHECK_(nullHandle));
|
||||||
|
|
||||||
// Generate any default methods - default methods are interface methods
|
// Generate any default methods - default methods are interface methods
|
||||||
// that have a default implementation. This is new with Lambda project.
|
// that have a default implementation. This is new with Lambda project.
|
||||||
|
@ -57,6 +57,7 @@
|
|||||||
#include "memory/metadataFactory.hpp"
|
#include "memory/metadataFactory.hpp"
|
||||||
#include "memory/metaspaceShared.hpp"
|
#include "memory/metaspaceShared.hpp"
|
||||||
#include "memory/oopFactory.hpp"
|
#include "memory/oopFactory.hpp"
|
||||||
|
#include "runtime/atomic.inline.hpp"
|
||||||
#include "runtime/jniHandles.hpp"
|
#include "runtime/jniHandles.hpp"
|
||||||
#include "runtime/mutex.hpp"
|
#include "runtime/mutex.hpp"
|
||||||
#include "runtime/safepoint.hpp"
|
#include "runtime/safepoint.hpp"
|
||||||
@ -549,6 +550,7 @@ bool ClassLoaderData::contains_klass(Klass* klass) {
|
|||||||
// GC root of class loader data created.
|
// GC root of class loader data created.
|
||||||
ClassLoaderData* ClassLoaderDataGraph::_head = NULL;
|
ClassLoaderData* ClassLoaderDataGraph::_head = NULL;
|
||||||
ClassLoaderData* ClassLoaderDataGraph::_unloading = NULL;
|
ClassLoaderData* ClassLoaderDataGraph::_unloading = NULL;
|
||||||
|
ClassLoaderData* ClassLoaderDataGraph::_saved_unloading = NULL;
|
||||||
ClassLoaderData* ClassLoaderDataGraph::_saved_head = NULL;
|
ClassLoaderData* ClassLoaderDataGraph::_saved_head = NULL;
|
||||||
|
|
||||||
bool ClassLoaderDataGraph::_should_purge = false;
|
bool ClassLoaderDataGraph::_should_purge = false;
|
||||||
@ -656,7 +658,9 @@ void ClassLoaderDataGraph::loaded_classes_do(KlassClosure* klass_closure) {
|
|||||||
|
|
||||||
void ClassLoaderDataGraph::classes_unloading_do(void f(Klass* const)) {
|
void ClassLoaderDataGraph::classes_unloading_do(void f(Klass* const)) {
|
||||||
assert(SafepointSynchronize::is_at_safepoint(), "must be at safepoint!");
|
assert(SafepointSynchronize::is_at_safepoint(), "must be at safepoint!");
|
||||||
for (ClassLoaderData* cld = _unloading; cld != NULL; cld = cld->next()) {
|
// Only walk the head until any clds not purged from prior unloading
|
||||||
|
// (CMS doesn't purge right away).
|
||||||
|
for (ClassLoaderData* cld = _unloading; cld != _saved_unloading; cld = cld->next()) {
|
||||||
cld->classes_do(f);
|
cld->classes_do(f);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -704,6 +708,11 @@ bool ClassLoaderDataGraph::do_unloading(BoolObjectClosure* is_alive_closure) {
|
|||||||
ClassLoaderData* data = _head;
|
ClassLoaderData* data = _head;
|
||||||
ClassLoaderData* prev = NULL;
|
ClassLoaderData* prev = NULL;
|
||||||
bool seen_dead_loader = false;
|
bool seen_dead_loader = false;
|
||||||
|
|
||||||
|
// Save previous _unloading pointer for CMS which may add to unloading list before
|
||||||
|
// purging and we don't want to rewalk the previously unloaded class loader data.
|
||||||
|
_saved_unloading = _unloading;
|
||||||
|
|
||||||
// mark metadata seen on the stack and code cache so we can delete
|
// mark metadata seen on the stack and code cache so we can delete
|
||||||
// unneeded entries.
|
// unneeded entries.
|
||||||
bool has_redefined_a_class = JvmtiExport::has_redefined_a_class();
|
bool has_redefined_a_class = JvmtiExport::has_redefined_a_class();
|
||||||
|
@ -66,6 +66,7 @@ class ClassLoaderDataGraph : public AllStatic {
|
|||||||
static ClassLoaderData* _unloading;
|
static ClassLoaderData* _unloading;
|
||||||
// CMS support.
|
// CMS support.
|
||||||
static ClassLoaderData* _saved_head;
|
static ClassLoaderData* _saved_head;
|
||||||
|
static ClassLoaderData* _saved_unloading;
|
||||||
static bool _should_purge;
|
static bool _should_purge;
|
||||||
|
|
||||||
static ClassLoaderData* add(Handle class_loader, bool anonymous, TRAPS);
|
static ClassLoaderData* add(Handle class_loader, bool anonymous, TRAPS);
|
||||||
@ -187,8 +188,6 @@ class ClassLoaderData : public CHeapObj<mtClass> {
|
|||||||
JNIHandleBlock* handles() const;
|
JNIHandleBlock* handles() const;
|
||||||
void set_handles(JNIHandleBlock* handles);
|
void set_handles(JNIHandleBlock* handles);
|
||||||
|
|
||||||
Mutex* metaspace_lock() const { return _metaspace_lock; }
|
|
||||||
|
|
||||||
// GC interface.
|
// GC interface.
|
||||||
void clear_claimed() { _claimed = 0; }
|
void clear_claimed() { _claimed = 0; }
|
||||||
bool claimed() const { return _claimed == 1; }
|
bool claimed() const { return _claimed == 1; }
|
||||||
@ -216,6 +215,8 @@ class ClassLoaderData : public CHeapObj<mtClass> {
|
|||||||
return _the_null_class_loader_data;
|
return _the_null_class_loader_data;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Mutex* metaspace_lock() const { return _metaspace_lock; }
|
||||||
|
|
||||||
bool is_anonymous() const { return _is_anonymous; }
|
bool is_anonymous() const { return _is_anonymous; }
|
||||||
|
|
||||||
static void init_null_class_loader_data() {
|
static void init_null_class_loader_data() {
|
||||||
|
@ -558,7 +558,7 @@ void java_lang_Class::fixup_mirror(KlassHandle k, TRAPS) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
create_mirror(k, Handle(NULL), CHECK);
|
create_mirror(k, Handle(NULL), Handle(NULL), CHECK);
|
||||||
}
|
}
|
||||||
|
|
||||||
void java_lang_Class::initialize_mirror_fields(KlassHandle k,
|
void java_lang_Class::initialize_mirror_fields(KlassHandle k,
|
||||||
@ -578,7 +578,8 @@ void java_lang_Class::initialize_mirror_fields(KlassHandle k,
|
|||||||
InstanceKlass::cast(k())->do_local_static_fields(&initialize_static_field, mirror, CHECK);
|
InstanceKlass::cast(k())->do_local_static_fields(&initialize_static_field, mirror, CHECK);
|
||||||
}
|
}
|
||||||
|
|
||||||
void java_lang_Class::create_mirror(KlassHandle k, Handle protection_domain, TRAPS) {
|
void java_lang_Class::create_mirror(KlassHandle k, Handle class_loader,
|
||||||
|
Handle protection_domain, TRAPS) {
|
||||||
assert(k->java_mirror() == NULL, "should only assign mirror once");
|
assert(k->java_mirror() == NULL, "should only assign mirror once");
|
||||||
// Use this moment of initialization to cache modifier_flags also,
|
// Use this moment of initialization to cache modifier_flags also,
|
||||||
// to support Class.getModifiers(). Instance classes recalculate
|
// to support Class.getModifiers(). Instance classes recalculate
|
||||||
@ -633,6 +634,9 @@ void java_lang_Class::create_mirror(KlassHandle k, Handle protection_domain, TRA
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// set the classLoader field in the java_lang_Class instance
|
||||||
|
set_class_loader(mirror(), class_loader());
|
||||||
|
|
||||||
// Setup indirection from klass->mirror last
|
// Setup indirection from klass->mirror last
|
||||||
// after any exceptions can happen during allocations.
|
// after any exceptions can happen during allocations.
|
||||||
if (!k.is_null()) {
|
if (!k.is_null()) {
|
||||||
@ -694,6 +698,18 @@ void java_lang_Class::set_signers(oop java_class, objArrayOop signers) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void java_lang_Class::set_class_loader(oop java_class, oop loader) {
|
||||||
|
// jdk7 runs Queens in bootstrapping and jdk8-9 has no coordinated pushes yet.
|
||||||
|
if (_class_loader_offset != 0) {
|
||||||
|
java_class->obj_field_put(_class_loader_offset, loader);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
oop java_lang_Class::class_loader(oop java_class) {
|
||||||
|
assert(_class_loader_offset != 0, "must be set");
|
||||||
|
return java_class->obj_field(_class_loader_offset);
|
||||||
|
}
|
||||||
|
|
||||||
oop java_lang_Class::create_basic_type_mirror(const char* basic_type_name, BasicType type, TRAPS) {
|
oop java_lang_Class::create_basic_type_mirror(const char* basic_type_name, BasicType type, TRAPS) {
|
||||||
// This should be improved by adding a field at the Java level or by
|
// This should be improved by adding a field at the Java level or by
|
||||||
// introducing a new VM klass (see comment in ClassFileParser)
|
// introducing a new VM klass (see comment in ClassFileParser)
|
||||||
@ -853,6 +869,12 @@ void java_lang_Class::compute_offsets() {
|
|||||||
compute_optional_offset(classRedefinedCount_offset,
|
compute_optional_offset(classRedefinedCount_offset,
|
||||||
klass_oop, vmSymbols::classRedefinedCount_name(), vmSymbols::int_signature());
|
klass_oop, vmSymbols::classRedefinedCount_name(), vmSymbols::int_signature());
|
||||||
|
|
||||||
|
// Needs to be optional because the old build runs Queens during bootstrapping
|
||||||
|
// and jdk8-9 doesn't have coordinated pushes yet.
|
||||||
|
compute_optional_offset(_class_loader_offset,
|
||||||
|
klass_oop, vmSymbols::classLoader_name(),
|
||||||
|
vmSymbols::classloader_signature());
|
||||||
|
|
||||||
CLASS_INJECTED_FIELDS(INJECTED_FIELD_COMPUTE_OFFSET);
|
CLASS_INJECTED_FIELDS(INJECTED_FIELD_COMPUTE_OFFSET);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -3073,6 +3095,7 @@ int java_lang_Class::_klass_offset;
|
|||||||
int java_lang_Class::_array_klass_offset;
|
int java_lang_Class::_array_klass_offset;
|
||||||
int java_lang_Class::_oop_size_offset;
|
int java_lang_Class::_oop_size_offset;
|
||||||
int java_lang_Class::_static_oop_field_count_offset;
|
int java_lang_Class::_static_oop_field_count_offset;
|
||||||
|
int java_lang_Class::_class_loader_offset;
|
||||||
int java_lang_Class::_protection_domain_offset;
|
int java_lang_Class::_protection_domain_offset;
|
||||||
int java_lang_Class::_init_lock_offset;
|
int java_lang_Class::_init_lock_offset;
|
||||||
int java_lang_Class::_signers_offset;
|
int java_lang_Class::_signers_offset;
|
||||||
|
@ -240,19 +240,23 @@ class java_lang_Class : AllStatic {
|
|||||||
static int _protection_domain_offset;
|
static int _protection_domain_offset;
|
||||||
static int _init_lock_offset;
|
static int _init_lock_offset;
|
||||||
static int _signers_offset;
|
static int _signers_offset;
|
||||||
|
static int _class_loader_offset;
|
||||||
|
|
||||||
static bool offsets_computed;
|
static bool offsets_computed;
|
||||||
static int classRedefinedCount_offset;
|
static int classRedefinedCount_offset;
|
||||||
|
|
||||||
static GrowableArray<Klass*>* _fixup_mirror_list;
|
static GrowableArray<Klass*>* _fixup_mirror_list;
|
||||||
|
|
||||||
static void set_init_lock(oop java_class, oop init_lock);
|
static void set_init_lock(oop java_class, oop init_lock);
|
||||||
static void set_protection_domain(oop java_class, oop protection_domain);
|
static void set_protection_domain(oop java_class, oop protection_domain);
|
||||||
|
static void set_class_loader(oop java_class, oop class_loader);
|
||||||
static void initialize_mirror_fields(KlassHandle k, Handle mirror, Handle protection_domain, TRAPS);
|
static void initialize_mirror_fields(KlassHandle k, Handle mirror, Handle protection_domain, TRAPS);
|
||||||
public:
|
public:
|
||||||
static void compute_offsets();
|
static void compute_offsets();
|
||||||
|
|
||||||
// Instance creation
|
// Instance creation
|
||||||
static void create_mirror(KlassHandle k, Handle protection_domain, TRAPS);
|
static void create_mirror(KlassHandle k, Handle class_loader,
|
||||||
|
Handle protection_domain, TRAPS);
|
||||||
static void fixup_mirror(KlassHandle k, TRAPS);
|
static void fixup_mirror(KlassHandle k, TRAPS);
|
||||||
static oop create_basic_type_mirror(const char* basic_type_name, BasicType type, TRAPS);
|
static oop create_basic_type_mirror(const char* basic_type_name, BasicType type, TRAPS);
|
||||||
// Conversion
|
// Conversion
|
||||||
@ -290,6 +294,8 @@ class java_lang_Class : AllStatic {
|
|||||||
static objArrayOop signers(oop java_class);
|
static objArrayOop signers(oop java_class);
|
||||||
static void set_signers(oop java_class, objArrayOop signers);
|
static void set_signers(oop java_class, objArrayOop signers);
|
||||||
|
|
||||||
|
static oop class_loader(oop java_class);
|
||||||
|
|
||||||
static int oop_size(oop java_class);
|
static int oop_size(oop java_class);
|
||||||
static void set_oop_size(oop java_class, int size);
|
static void set_oop_size(oop java_class, int size);
|
||||||
static int static_oop_field_count(oop java_class);
|
static int static_oop_field_count(oop java_class);
|
||||||
|
@ -33,6 +33,7 @@
|
|||||||
#include "memory/gcLocker.inline.hpp"
|
#include "memory/gcLocker.inline.hpp"
|
||||||
#include "oops/oop.inline.hpp"
|
#include "oops/oop.inline.hpp"
|
||||||
#include "oops/oop.inline2.hpp"
|
#include "oops/oop.inline2.hpp"
|
||||||
|
#include "runtime/atomic.inline.hpp"
|
||||||
#include "runtime/mutexLocker.hpp"
|
#include "runtime/mutexLocker.hpp"
|
||||||
#include "utilities/hashtable.inline.hpp"
|
#include "utilities/hashtable.inline.hpp"
|
||||||
#if INCLUDE_ALL_GCS
|
#if INCLUDE_ALL_GCS
|
||||||
|
@ -33,6 +33,7 @@
|
|||||||
#include "memory/gcLocker.inline.hpp"
|
#include "memory/gcLocker.inline.hpp"
|
||||||
#include "oops/oop.inline.hpp"
|
#include "oops/oop.inline.hpp"
|
||||||
#include "oops/oop.inline2.hpp"
|
#include "oops/oop.inline2.hpp"
|
||||||
|
#include "runtime/atomic.inline.hpp"
|
||||||
#include "runtime/mutexLocker.hpp"
|
#include "runtime/mutexLocker.hpp"
|
||||||
#include "utilities/hashtable.inline.hpp"
|
#include "utilities/hashtable.inline.hpp"
|
||||||
|
|
||||||
|
@ -572,6 +572,7 @@
|
|||||||
template(serializePropertiesToByteArray_signature, "()[B") \
|
template(serializePropertiesToByteArray_signature, "()[B") \
|
||||||
template(serializeAgentPropertiesToByteArray_name, "serializeAgentPropertiesToByteArray") \
|
template(serializeAgentPropertiesToByteArray_name, "serializeAgentPropertiesToByteArray") \
|
||||||
template(classRedefinedCount_name, "classRedefinedCount") \
|
template(classRedefinedCount_name, "classRedefinedCount") \
|
||||||
|
template(classLoader_name, "classLoader") \
|
||||||
\
|
\
|
||||||
/* trace signatures */ \
|
/* trace signatures */ \
|
||||||
TRACE_TEMPLATES(template) \
|
TRACE_TEMPLATES(template) \
|
||||||
|
@ -159,6 +159,30 @@ address CompiledIC::stub_address() const {
|
|||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
// High-level access to an inline cache. Guaranteed to be MT-safe.
|
// High-level access to an inline cache. Guaranteed to be MT-safe.
|
||||||
|
|
||||||
|
CompiledIC::CompiledIC(nmethod* nm, NativeCall* call)
|
||||||
|
: _ic_call(call)
|
||||||
|
{
|
||||||
|
address ic_call = call->instruction_address();
|
||||||
|
|
||||||
|
assert(ic_call != NULL, "ic_call address must be set");
|
||||||
|
assert(nm != NULL, "must pass nmethod");
|
||||||
|
assert(nm->contains(ic_call), "must be in nmethod");
|
||||||
|
|
||||||
|
// Search for the ic_call at the given address.
|
||||||
|
RelocIterator iter(nm, ic_call, ic_call+1);
|
||||||
|
bool ret = iter.next();
|
||||||
|
assert(ret == true, "relocInfo must exist at this address");
|
||||||
|
assert(iter.addr() == ic_call, "must find ic_call");
|
||||||
|
if (iter.type() == relocInfo::virtual_call_type) {
|
||||||
|
virtual_call_Relocation* r = iter.virtual_call_reloc();
|
||||||
|
_is_optimized = false;
|
||||||
|
_value = nativeMovConstReg_at(r->cached_value());
|
||||||
|
} else {
|
||||||
|
assert(iter.type() == relocInfo::opt_virtual_call_type, "must be a virtual call");
|
||||||
|
_is_optimized = true;
|
||||||
|
_value = NULL;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
bool CompiledIC::set_to_megamorphic(CallInfo* call_info, Bytecodes::Code bytecode, TRAPS) {
|
bool CompiledIC::set_to_megamorphic(CallInfo* call_info, Bytecodes::Code bytecode, TRAPS) {
|
||||||
assert(CompiledIC_lock->is_locked() || SafepointSynchronize::is_at_safepoint(), "");
|
assert(CompiledIC_lock->is_locked() || SafepointSynchronize::is_at_safepoint(), "");
|
||||||
|
@ -37,6 +37,7 @@
|
|||||||
#include "oops/methodData.hpp"
|
#include "oops/methodData.hpp"
|
||||||
#include "prims/jvmtiRedefineClassesTrace.hpp"
|
#include "prims/jvmtiRedefineClassesTrace.hpp"
|
||||||
#include "prims/jvmtiImpl.hpp"
|
#include "prims/jvmtiImpl.hpp"
|
||||||
|
#include "runtime/atomic.inline.hpp"
|
||||||
#include "runtime/orderAccess.inline.hpp"
|
#include "runtime/orderAccess.inline.hpp"
|
||||||
#include "runtime/sharedRuntime.hpp"
|
#include "runtime/sharedRuntime.hpp"
|
||||||
#include "runtime/sweeper.hpp"
|
#include "runtime/sweeper.hpp"
|
||||||
@ -363,26 +364,29 @@ void nmethod::add_exception_cache_entry(ExceptionCache* new_entry) {
|
|||||||
set_exception_cache(new_entry);
|
set_exception_cache(new_entry);
|
||||||
}
|
}
|
||||||
|
|
||||||
void nmethod::remove_from_exception_cache(ExceptionCache* ec) {
|
void nmethod::clean_exception_cache(BoolObjectClosure* is_alive) {
|
||||||
ExceptionCache* prev = NULL;
|
ExceptionCache* prev = NULL;
|
||||||
ExceptionCache* curr = exception_cache();
|
ExceptionCache* curr = exception_cache();
|
||||||
assert(curr != NULL, "nothing to remove");
|
|
||||||
// find the previous and next entry of ec
|
|
||||||
while (curr != ec) {
|
|
||||||
prev = curr;
|
|
||||||
curr = curr->next();
|
|
||||||
assert(curr != NULL, "ExceptionCache not found");
|
|
||||||
}
|
|
||||||
// now: curr == ec
|
|
||||||
ExceptionCache* next = curr->next();
|
|
||||||
if (prev == NULL) {
|
|
||||||
set_exception_cache(next);
|
|
||||||
} else {
|
|
||||||
prev->set_next(next);
|
|
||||||
}
|
|
||||||
delete curr;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
while (curr != NULL) {
|
||||||
|
ExceptionCache* next = curr->next();
|
||||||
|
|
||||||
|
Klass* ex_klass = curr->exception_type();
|
||||||
|
if (ex_klass != NULL && !ex_klass->is_loader_alive(is_alive)) {
|
||||||
|
if (prev == NULL) {
|
||||||
|
set_exception_cache(next);
|
||||||
|
} else {
|
||||||
|
prev->set_next(next);
|
||||||
|
}
|
||||||
|
delete curr;
|
||||||
|
// prev stays the same.
|
||||||
|
} else {
|
||||||
|
prev = curr;
|
||||||
|
}
|
||||||
|
|
||||||
|
curr = next;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// public method for accessing the exception cache
|
// public method for accessing the exception cache
|
||||||
// These are the public access methods.
|
// These are the public access methods.
|
||||||
@ -668,8 +672,10 @@ nmethod::nmethod(
|
|||||||
_hotness_counter = NMethodSweeper::hotness_counter_reset_val();
|
_hotness_counter = NMethodSweeper::hotness_counter_reset_val();
|
||||||
|
|
||||||
code_buffer->copy_values_to(this);
|
code_buffer->copy_values_to(this);
|
||||||
if (ScavengeRootsInCode && detect_scavenge_root_oops()) {
|
if (ScavengeRootsInCode) {
|
||||||
CodeCache::add_scavenge_root_nmethod(this);
|
if (detect_scavenge_root_oops()) {
|
||||||
|
CodeCache::add_scavenge_root_nmethod(this);
|
||||||
|
}
|
||||||
Universe::heap()->register_nmethod(this);
|
Universe::heap()->register_nmethod(this);
|
||||||
}
|
}
|
||||||
debug_only(verify_scavenge_root_oops());
|
debug_only(verify_scavenge_root_oops());
|
||||||
@ -753,8 +759,10 @@ nmethod::nmethod(
|
|||||||
_hotness_counter = NMethodSweeper::hotness_counter_reset_val();
|
_hotness_counter = NMethodSweeper::hotness_counter_reset_val();
|
||||||
|
|
||||||
code_buffer->copy_values_to(this);
|
code_buffer->copy_values_to(this);
|
||||||
if (ScavengeRootsInCode && detect_scavenge_root_oops()) {
|
if (ScavengeRootsInCode) {
|
||||||
CodeCache::add_scavenge_root_nmethod(this);
|
if (detect_scavenge_root_oops()) {
|
||||||
|
CodeCache::add_scavenge_root_nmethod(this);
|
||||||
|
}
|
||||||
Universe::heap()->register_nmethod(this);
|
Universe::heap()->register_nmethod(this);
|
||||||
}
|
}
|
||||||
DEBUG_ONLY(verify_scavenge_root_oops();)
|
DEBUG_ONLY(verify_scavenge_root_oops();)
|
||||||
@ -869,8 +877,10 @@ nmethod::nmethod(
|
|||||||
code_buffer->copy_values_to(this);
|
code_buffer->copy_values_to(this);
|
||||||
debug_info->copy_to(this);
|
debug_info->copy_to(this);
|
||||||
dependencies->copy_to(this);
|
dependencies->copy_to(this);
|
||||||
if (ScavengeRootsInCode && detect_scavenge_root_oops()) {
|
if (ScavengeRootsInCode) {
|
||||||
CodeCache::add_scavenge_root_nmethod(this);
|
if (detect_scavenge_root_oops()) {
|
||||||
|
CodeCache::add_scavenge_root_nmethod(this);
|
||||||
|
}
|
||||||
Universe::heap()->register_nmethod(this);
|
Universe::heap()->register_nmethod(this);
|
||||||
}
|
}
|
||||||
debug_only(verify_scavenge_root_oops());
|
debug_only(verify_scavenge_root_oops());
|
||||||
@ -1612,15 +1622,7 @@ void nmethod::do_unloading(BoolObjectClosure* is_alive, bool unloading_occurred)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Exception cache
|
// Exception cache
|
||||||
ExceptionCache* ec = exception_cache();
|
clean_exception_cache(is_alive);
|
||||||
while (ec != NULL) {
|
|
||||||
Klass* ex_klass = ec->exception_type();
|
|
||||||
ExceptionCache* next_ec = ec->next();
|
|
||||||
if (ex_klass != NULL && !ex_klass->is_loader_alive(is_alive)) {
|
|
||||||
remove_from_exception_cache(ec);
|
|
||||||
}
|
|
||||||
ec = next_ec;
|
|
||||||
}
|
|
||||||
|
|
||||||
// If class unloading occurred we first iterate over all inline caches and
|
// If class unloading occurred we first iterate over all inline caches and
|
||||||
// clear ICs where the cached oop is referring to an unloaded klass or method.
|
// clear ICs where the cached oop is referring to an unloaded klass or method.
|
||||||
|
@ -529,7 +529,7 @@ public:
|
|||||||
void set_exception_cache(ExceptionCache *ec) { _exception_cache = ec; }
|
void set_exception_cache(ExceptionCache *ec) { _exception_cache = ec; }
|
||||||
address handler_for_exception_and_pc(Handle exception, address pc);
|
address handler_for_exception_and_pc(Handle exception, address pc);
|
||||||
void add_handler_for_exception_and_pc(Handle exception, address pc, address handler);
|
void add_handler_for_exception_and_pc(Handle exception, address pc, address handler);
|
||||||
void remove_from_exception_cache(ExceptionCache* ec);
|
void clean_exception_cache(BoolObjectClosure* is_alive);
|
||||||
|
|
||||||
// implicit exceptions support
|
// implicit exceptions support
|
||||||
address continuation_for_implicit_exception(address pc);
|
address continuation_for_implicit_exception(address pc);
|
||||||
|
@ -36,6 +36,7 @@
|
|||||||
#include "oops/oop.inline.hpp"
|
#include "oops/oop.inline.hpp"
|
||||||
#include "prims/nativeLookup.hpp"
|
#include "prims/nativeLookup.hpp"
|
||||||
#include "runtime/arguments.hpp"
|
#include "runtime/arguments.hpp"
|
||||||
|
#include "runtime/atomic.inline.hpp"
|
||||||
#include "runtime/compilationPolicy.hpp"
|
#include "runtime/compilationPolicy.hpp"
|
||||||
#include "runtime/init.hpp"
|
#include "runtime/init.hpp"
|
||||||
#include "runtime/interfaceSupport.hpp"
|
#include "runtime/interfaceSupport.hpp"
|
||||||
@ -589,11 +590,10 @@ void CompileTask::log_task_done(CompileLog* log) {
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Add a CompileTask to a CompileQueue
|
* Add a CompileTask to a CompileQueue.
|
||||||
*/
|
*/
|
||||||
void CompileQueue::add(CompileTask* task) {
|
void CompileQueue::add(CompileTask* task) {
|
||||||
assert(lock()->owned_by_self(), "must own lock");
|
assert(lock()->owned_by_self(), "must own lock");
|
||||||
assert(!CompileBroker::is_compilation_disabled_forever(), "Do not add task if compilation is turned off forever");
|
|
||||||
|
|
||||||
task->set_next(NULL);
|
task->set_next(NULL);
|
||||||
task->set_prev(NULL);
|
task->set_prev(NULL);
|
||||||
@ -639,8 +639,11 @@ void CompileQueue::free_all() {
|
|||||||
while (next != NULL) {
|
while (next != NULL) {
|
||||||
CompileTask* current = next;
|
CompileTask* current = next;
|
||||||
next = current->next();
|
next = current->next();
|
||||||
// Wake up thread that blocks on the compile task.
|
{
|
||||||
current->lock()->notify();
|
// Wake up thread that blocks on the compile task.
|
||||||
|
MutexLocker ct_lock(current->lock());
|
||||||
|
current->lock()->notify();
|
||||||
|
}
|
||||||
// Put the task back on the freelist.
|
// Put the task back on the freelist.
|
||||||
CompileTask::free(current);
|
CompileTask::free(current);
|
||||||
}
|
}
|
||||||
|
@ -26,6 +26,7 @@
|
|||||||
#define SHARE_VM_GC_IMPLEMENTATION_CONCURRENTMARKSWEEP_CMSOOPCLOSURES_HPP
|
#define SHARE_VM_GC_IMPLEMENTATION_CONCURRENTMARKSWEEP_CMSOOPCLOSURES_HPP
|
||||||
|
|
||||||
#include "memory/genOopClosures.hpp"
|
#include "memory/genOopClosures.hpp"
|
||||||
|
#include "memory/iterator.hpp"
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////
|
||||||
// Closures used by ConcurrentMarkSweepGeneration's collector
|
// Closures used by ConcurrentMarkSweepGeneration's collector
|
||||||
@ -48,33 +49,13 @@ class Par_MarkFromRootsClosure;
|
|||||||
} \
|
} \
|
||||||
}
|
}
|
||||||
|
|
||||||
// Applies the given oop closure to all oops in all klasses visited.
|
// TODO: This duplication of the MetadataAwareOopClosure class is only needed
|
||||||
class CMKlassClosure : public KlassClosure {
|
// because some CMS OopClosures derive from OopsInGenClosure. It would be
|
||||||
friend class CMSOopClosure;
|
// good to get rid of them completely.
|
||||||
friend class CMSOopsInGenClosure;
|
class MetadataAwareOopsInGenClosure: public OopsInGenClosure {
|
||||||
|
KlassToOopClosure _klass_closure;
|
||||||
OopClosure* _oop_closure;
|
|
||||||
|
|
||||||
// Used when _oop_closure couldn't be set in an initialization list.
|
|
||||||
void initialize(OopClosure* oop_closure) {
|
|
||||||
assert(_oop_closure == NULL, "Should only be called once");
|
|
||||||
_oop_closure = oop_closure;
|
|
||||||
}
|
|
||||||
public:
|
public:
|
||||||
CMKlassClosure(OopClosure* oop_closure = NULL) : _oop_closure(oop_closure) { }
|
MetadataAwareOopsInGenClosure() {
|
||||||
|
|
||||||
void do_klass(Klass* k);
|
|
||||||
};
|
|
||||||
|
|
||||||
// The base class for all CMS marking closures.
|
|
||||||
// It's used to proxy through the metadata to the oops defined in them.
|
|
||||||
class CMSOopClosure: public ExtendedOopClosure {
|
|
||||||
CMKlassClosure _klass_closure;
|
|
||||||
public:
|
|
||||||
CMSOopClosure() : ExtendedOopClosure() {
|
|
||||||
_klass_closure.initialize(this);
|
|
||||||
}
|
|
||||||
CMSOopClosure(ReferenceProcessor* rp) : ExtendedOopClosure(rp) {
|
|
||||||
_klass_closure.initialize(this);
|
_klass_closure.initialize(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -87,26 +68,7 @@ class CMSOopClosure: public ExtendedOopClosure {
|
|||||||
virtual void do_class_loader_data(ClassLoaderData* cld);
|
virtual void do_class_loader_data(ClassLoaderData* cld);
|
||||||
};
|
};
|
||||||
|
|
||||||
// TODO: This duplication of the CMSOopClosure class is only needed because
|
class MarkRefsIntoClosure: public MetadataAwareOopsInGenClosure {
|
||||||
// some CMS OopClosures derive from OopsInGenClosure. It would be good
|
|
||||||
// to get rid of them completely.
|
|
||||||
class CMSOopsInGenClosure: public OopsInGenClosure {
|
|
||||||
CMKlassClosure _klass_closure;
|
|
||||||
public:
|
|
||||||
CMSOopsInGenClosure() {
|
|
||||||
_klass_closure.initialize(this);
|
|
||||||
}
|
|
||||||
|
|
||||||
virtual bool do_metadata() { return do_metadata_nv(); }
|
|
||||||
inline bool do_metadata_nv() { return true; }
|
|
||||||
|
|
||||||
virtual void do_klass(Klass* k);
|
|
||||||
void do_klass_nv(Klass* k);
|
|
||||||
|
|
||||||
virtual void do_class_loader_data(ClassLoaderData* cld);
|
|
||||||
};
|
|
||||||
|
|
||||||
class MarkRefsIntoClosure: public CMSOopsInGenClosure {
|
|
||||||
private:
|
private:
|
||||||
const MemRegion _span;
|
const MemRegion _span;
|
||||||
CMSBitMap* _bitMap;
|
CMSBitMap* _bitMap;
|
||||||
@ -118,7 +80,7 @@ class MarkRefsIntoClosure: public CMSOopsInGenClosure {
|
|||||||
virtual void do_oop(narrowOop* p);
|
virtual void do_oop(narrowOop* p);
|
||||||
};
|
};
|
||||||
|
|
||||||
class Par_MarkRefsIntoClosure: public CMSOopsInGenClosure {
|
class Par_MarkRefsIntoClosure: public MetadataAwareOopsInGenClosure {
|
||||||
private:
|
private:
|
||||||
const MemRegion _span;
|
const MemRegion _span;
|
||||||
CMSBitMap* _bitMap;
|
CMSBitMap* _bitMap;
|
||||||
@ -132,7 +94,7 @@ class Par_MarkRefsIntoClosure: public CMSOopsInGenClosure {
|
|||||||
|
|
||||||
// A variant of the above used in certain kinds of CMS
|
// A variant of the above used in certain kinds of CMS
|
||||||
// marking verification.
|
// marking verification.
|
||||||
class MarkRefsIntoVerifyClosure: public CMSOopsInGenClosure {
|
class MarkRefsIntoVerifyClosure: public MetadataAwareOopsInGenClosure {
|
||||||
private:
|
private:
|
||||||
const MemRegion _span;
|
const MemRegion _span;
|
||||||
CMSBitMap* _verification_bm;
|
CMSBitMap* _verification_bm;
|
||||||
@ -147,7 +109,7 @@ class MarkRefsIntoVerifyClosure: public CMSOopsInGenClosure {
|
|||||||
};
|
};
|
||||||
|
|
||||||
// The non-parallel version (the parallel version appears further below).
|
// The non-parallel version (the parallel version appears further below).
|
||||||
class PushAndMarkClosure: public CMSOopClosure {
|
class PushAndMarkClosure: public MetadataAwareOopClosure {
|
||||||
private:
|
private:
|
||||||
CMSCollector* _collector;
|
CMSCollector* _collector;
|
||||||
MemRegion _span;
|
MemRegion _span;
|
||||||
@ -177,7 +139,7 @@ class PushAndMarkClosure: public CMSOopClosure {
|
|||||||
// synchronization (for instance, via CAS). The marking stack
|
// synchronization (for instance, via CAS). The marking stack
|
||||||
// used in the non-parallel case above is here replaced with
|
// used in the non-parallel case above is here replaced with
|
||||||
// an OopTaskQueue structure to allow efficient work stealing.
|
// an OopTaskQueue structure to allow efficient work stealing.
|
||||||
class Par_PushAndMarkClosure: public CMSOopClosure {
|
class Par_PushAndMarkClosure: public MetadataAwareOopClosure {
|
||||||
private:
|
private:
|
||||||
CMSCollector* _collector;
|
CMSCollector* _collector;
|
||||||
MemRegion _span;
|
MemRegion _span;
|
||||||
@ -198,7 +160,7 @@ class Par_PushAndMarkClosure: public CMSOopClosure {
|
|||||||
};
|
};
|
||||||
|
|
||||||
// The non-parallel version (the parallel version appears further below).
|
// The non-parallel version (the parallel version appears further below).
|
||||||
class MarkRefsIntoAndScanClosure: public CMSOopsInGenClosure {
|
class MarkRefsIntoAndScanClosure: public MetadataAwareOopsInGenClosure {
|
||||||
private:
|
private:
|
||||||
MemRegion _span;
|
MemRegion _span;
|
||||||
CMSBitMap* _bit_map;
|
CMSBitMap* _bit_map;
|
||||||
@ -239,7 +201,7 @@ class MarkRefsIntoAndScanClosure: public CMSOopsInGenClosure {
|
|||||||
// stack and the bitMap are shared, so access needs to be suitably
|
// stack and the bitMap are shared, so access needs to be suitably
|
||||||
// synchronized. An OopTaskQueue structure, supporting efficient
|
// synchronized. An OopTaskQueue structure, supporting efficient
|
||||||
// work stealing, replaces a CMSMarkStack for storing grey objects.
|
// work stealing, replaces a CMSMarkStack for storing grey objects.
|
||||||
class Par_MarkRefsIntoAndScanClosure: public CMSOopsInGenClosure {
|
class Par_MarkRefsIntoAndScanClosure: public MetadataAwareOopsInGenClosure {
|
||||||
private:
|
private:
|
||||||
MemRegion _span;
|
MemRegion _span;
|
||||||
CMSBitMap* _bit_map;
|
CMSBitMap* _bit_map;
|
||||||
@ -265,7 +227,7 @@ class Par_MarkRefsIntoAndScanClosure: public CMSOopsInGenClosure {
|
|||||||
// This closure is used during the concurrent marking phase
|
// This closure is used during the concurrent marking phase
|
||||||
// following the first checkpoint. Its use is buried in
|
// following the first checkpoint. Its use is buried in
|
||||||
// the closure MarkFromRootsClosure.
|
// the closure MarkFromRootsClosure.
|
||||||
class PushOrMarkClosure: public CMSOopClosure {
|
class PushOrMarkClosure: public MetadataAwareOopClosure {
|
||||||
private:
|
private:
|
||||||
CMSCollector* _collector;
|
CMSCollector* _collector;
|
||||||
MemRegion _span;
|
MemRegion _span;
|
||||||
@ -298,7 +260,7 @@ class PushOrMarkClosure: public CMSOopClosure {
|
|||||||
// This closure is used during the concurrent marking phase
|
// This closure is used during the concurrent marking phase
|
||||||
// following the first checkpoint. Its use is buried in
|
// following the first checkpoint. Its use is buried in
|
||||||
// the closure Par_MarkFromRootsClosure.
|
// the closure Par_MarkFromRootsClosure.
|
||||||
class Par_PushOrMarkClosure: public CMSOopClosure {
|
class Par_PushOrMarkClosure: public MetadataAwareOopClosure {
|
||||||
private:
|
private:
|
||||||
CMSCollector* _collector;
|
CMSCollector* _collector;
|
||||||
MemRegion _whole_span;
|
MemRegion _whole_span;
|
||||||
@ -338,7 +300,7 @@ class Par_PushOrMarkClosure: public CMSOopClosure {
|
|||||||
// processing phase of the CMS final checkpoint step, as
|
// processing phase of the CMS final checkpoint step, as
|
||||||
// well as during the concurrent precleaning of the discovered
|
// well as during the concurrent precleaning of the discovered
|
||||||
// reference lists.
|
// reference lists.
|
||||||
class CMSKeepAliveClosure: public CMSOopClosure {
|
class CMSKeepAliveClosure: public MetadataAwareOopClosure {
|
||||||
private:
|
private:
|
||||||
CMSCollector* _collector;
|
CMSCollector* _collector;
|
||||||
const MemRegion _span;
|
const MemRegion _span;
|
||||||
@ -358,7 +320,7 @@ class CMSKeepAliveClosure: public CMSOopClosure {
|
|||||||
inline void do_oop_nv(narrowOop* p) { CMSKeepAliveClosure::do_oop_work(p); }
|
inline void do_oop_nv(narrowOop* p) { CMSKeepAliveClosure::do_oop_work(p); }
|
||||||
};
|
};
|
||||||
|
|
||||||
class CMSInnerParMarkAndPushClosure: public CMSOopClosure {
|
class CMSInnerParMarkAndPushClosure: public MetadataAwareOopClosure {
|
||||||
private:
|
private:
|
||||||
CMSCollector* _collector;
|
CMSCollector* _collector;
|
||||||
MemRegion _span;
|
MemRegion _span;
|
||||||
@ -379,7 +341,7 @@ class CMSInnerParMarkAndPushClosure: public CMSOopClosure {
|
|||||||
// A parallel (MT) version of the above, used when
|
// A parallel (MT) version of the above, used when
|
||||||
// reference processing is parallel; the only difference
|
// reference processing is parallel; the only difference
|
||||||
// is in the do_oop method.
|
// is in the do_oop method.
|
||||||
class CMSParKeepAliveClosure: public CMSOopClosure {
|
class CMSParKeepAliveClosure: public MetadataAwareOopClosure {
|
||||||
private:
|
private:
|
||||||
MemRegion _span;
|
MemRegion _span;
|
||||||
OopTaskQueue* _work_queue;
|
OopTaskQueue* _work_queue;
|
||||||
|
@ -44,33 +44,20 @@ inline void Par_MarkRefsIntoAndScanClosure::trim_queue(uint max) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// CMSOopClosure and CMSoopsInGenClosure are duplicated,
|
// MetadataAwareOopClosure and MetadataAwareOopsInGenClosure are duplicated,
|
||||||
// until we get rid of OopsInGenClosure.
|
// until we get rid of OopsInGenClosure.
|
||||||
|
|
||||||
inline void CMSOopClosure::do_klass(Klass* k) { do_klass_nv(k); }
|
inline void MetadataAwareOopsInGenClosure::do_klass_nv(Klass* k) {
|
||||||
inline void CMSOopsInGenClosure::do_klass(Klass* k) { do_klass_nv(k); }
|
|
||||||
|
|
||||||
inline void CMSOopClosure::do_klass_nv(Klass* k) {
|
|
||||||
ClassLoaderData* cld = k->class_loader_data();
|
|
||||||
do_class_loader_data(cld);
|
|
||||||
}
|
|
||||||
inline void CMSOopsInGenClosure::do_klass_nv(Klass* k) {
|
|
||||||
ClassLoaderData* cld = k->class_loader_data();
|
ClassLoaderData* cld = k->class_loader_data();
|
||||||
do_class_loader_data(cld);
|
do_class_loader_data(cld);
|
||||||
}
|
}
|
||||||
|
inline void MetadataAwareOopsInGenClosure::do_klass(Klass* k) { do_klass_nv(k); }
|
||||||
|
|
||||||
inline void CMSOopClosure::do_class_loader_data(ClassLoaderData* cld) {
|
inline void MetadataAwareOopsInGenClosure::do_class_loader_data(ClassLoaderData* cld) {
|
||||||
assert(_klass_closure._oop_closure == this, "Must be");
|
assert(_klass_closure._oop_closure == this, "Must be");
|
||||||
|
|
||||||
bool claim = true; // Must claim the class loader data before processing.
|
bool claim = true; // Must claim the class loader data before processing.
|
||||||
cld->oops_do(_klass_closure._oop_closure, &_klass_closure, claim);
|
cld->oops_do(_klass_closure._oop_closure, &_klass_closure, claim);
|
||||||
}
|
}
|
||||||
inline void CMSOopsInGenClosure::do_class_loader_data(ClassLoaderData* cld) {
|
|
||||||
assert(_klass_closure._oop_closure == this, "Must be");
|
|
||||||
|
|
||||||
bool claim = true; // Must claim the class loader data before processing.
|
|
||||||
cld->oops_do(_klass_closure._oop_closure, &_klass_closure, claim);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
#endif // SHARE_VM_GC_IMPLEMENTATION_CONCURRENTMARKSWEEP_CMSOOPCLOSURES_INLINE_HPP
|
#endif // SHARE_VM_GC_IMPLEMENTATION_CONCURRENTMARKSWEEP_CMSOOPCLOSURES_INLINE_HPP
|
||||||
|
@ -49,13 +49,14 @@
|
|||||||
#include "memory/genCollectedHeap.hpp"
|
#include "memory/genCollectedHeap.hpp"
|
||||||
#include "memory/genMarkSweep.hpp"
|
#include "memory/genMarkSweep.hpp"
|
||||||
#include "memory/genOopClosures.inline.hpp"
|
#include "memory/genOopClosures.inline.hpp"
|
||||||
#include "memory/iterator.hpp"
|
#include "memory/iterator.inline.hpp"
|
||||||
#include "memory/padded.hpp"
|
#include "memory/padded.hpp"
|
||||||
#include "memory/referencePolicy.hpp"
|
#include "memory/referencePolicy.hpp"
|
||||||
#include "memory/resourceArea.hpp"
|
#include "memory/resourceArea.hpp"
|
||||||
#include "memory/tenuredGeneration.hpp"
|
#include "memory/tenuredGeneration.hpp"
|
||||||
#include "oops/oop.inline.hpp"
|
#include "oops/oop.inline.hpp"
|
||||||
#include "prims/jvmtiExport.hpp"
|
#include "prims/jvmtiExport.hpp"
|
||||||
|
#include "runtime/atomic.inline.hpp"
|
||||||
#include "runtime/globals_extension.hpp"
|
#include "runtime/globals_extension.hpp"
|
||||||
#include "runtime/handles.inline.hpp"
|
#include "runtime/handles.inline.hpp"
|
||||||
#include "runtime/java.hpp"
|
#include "runtime/java.hpp"
|
||||||
@ -2024,7 +2025,7 @@ void CMSCollector::do_compaction_work(bool clear_all_soft_refs) {
|
|||||||
SerialOldTracer* gc_tracer = GenMarkSweep::gc_tracer();
|
SerialOldTracer* gc_tracer = GenMarkSweep::gc_tracer();
|
||||||
gc_tracer->report_gc_start(gch->gc_cause(), gc_timer->gc_start());
|
gc_tracer->report_gc_start(gch->gc_cause(), gc_timer->gc_start());
|
||||||
|
|
||||||
GCTraceTime t("CMS:MSC ", PrintGCDetails && Verbose, true, NULL);
|
GCTraceTime t("CMS:MSC ", PrintGCDetails && Verbose, true, NULL, gc_tracer->gc_id());
|
||||||
if (PrintGC && Verbose && !(GCCause::is_user_requested_gc(gch->gc_cause()))) {
|
if (PrintGC && Verbose && !(GCCause::is_user_requested_gc(gch->gc_cause()))) {
|
||||||
gclog_or_tty->print_cr("Compact ConcurrentMarkSweepGeneration after %d "
|
gclog_or_tty->print_cr("Compact ConcurrentMarkSweepGeneration after %d "
|
||||||
"collections passed to foreground collector", _full_gcs_since_conc_gc);
|
"collections passed to foreground collector", _full_gcs_since_conc_gc);
|
||||||
@ -2534,8 +2535,10 @@ void CMSCollector::collect_in_foreground(bool clear_all_soft_refs, GCCause::Caus
|
|||||||
assert(ConcurrentMarkSweepThread::vm_thread_has_cms_token(),
|
assert(ConcurrentMarkSweepThread::vm_thread_has_cms_token(),
|
||||||
"VM thread should have CMS token");
|
"VM thread should have CMS token");
|
||||||
|
|
||||||
|
// The gc id is created in register_foreground_gc_start if this collection is synchronous
|
||||||
|
const GCId gc_id = _collectorState == InitialMarking ? GCId::peek() : _gc_tracer_cm->gc_id();
|
||||||
NOT_PRODUCT(GCTraceTime t("CMS:MS (foreground) ", PrintGCDetails && Verbose,
|
NOT_PRODUCT(GCTraceTime t("CMS:MS (foreground) ", PrintGCDetails && Verbose,
|
||||||
true, NULL);)
|
true, NULL, gc_id);)
|
||||||
if (UseAdaptiveSizePolicy) {
|
if (UseAdaptiveSizePolicy) {
|
||||||
size_policy()->ms_collection_begin();
|
size_policy()->ms_collection_begin();
|
||||||
}
|
}
|
||||||
@ -3120,7 +3123,7 @@ void CMSCollector::verify_after_remark_work_2() {
|
|||||||
// Mark from roots one level into CMS
|
// Mark from roots one level into CMS
|
||||||
MarkRefsIntoVerifyClosure notOlder(_span, verification_mark_bm(),
|
MarkRefsIntoVerifyClosure notOlder(_span, verification_mark_bm(),
|
||||||
markBitMap());
|
markBitMap());
|
||||||
CMKlassClosure klass_closure(¬Older);
|
KlassToOopClosure klass_closure(¬Older);
|
||||||
|
|
||||||
gch->rem_set()->prepare_for_younger_refs_iterate(false); // Not parallel.
|
gch->rem_set()->prepare_for_younger_refs_iterate(false); // Not parallel.
|
||||||
gch->gen_process_strong_roots(_cmsGen->level(),
|
gch->gen_process_strong_roots(_cmsGen->level(),
|
||||||
@ -3538,6 +3541,7 @@ class CMSPhaseAccounting: public StackObj {
|
|||||||
public:
|
public:
|
||||||
CMSPhaseAccounting(CMSCollector *collector,
|
CMSPhaseAccounting(CMSCollector *collector,
|
||||||
const char *phase,
|
const char *phase,
|
||||||
|
const GCId gc_id,
|
||||||
bool print_cr = true);
|
bool print_cr = true);
|
||||||
~CMSPhaseAccounting();
|
~CMSPhaseAccounting();
|
||||||
|
|
||||||
@ -3546,6 +3550,7 @@ class CMSPhaseAccounting: public StackObj {
|
|||||||
const char *_phase;
|
const char *_phase;
|
||||||
elapsedTimer _wallclock;
|
elapsedTimer _wallclock;
|
||||||
bool _print_cr;
|
bool _print_cr;
|
||||||
|
const GCId _gc_id;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
// Not MT-safe; so do not pass around these StackObj's
|
// Not MT-safe; so do not pass around these StackObj's
|
||||||
@ -3561,15 +3566,15 @@ class CMSPhaseAccounting: public StackObj {
|
|||||||
|
|
||||||
CMSPhaseAccounting::CMSPhaseAccounting(CMSCollector *collector,
|
CMSPhaseAccounting::CMSPhaseAccounting(CMSCollector *collector,
|
||||||
const char *phase,
|
const char *phase,
|
||||||
|
const GCId gc_id,
|
||||||
bool print_cr) :
|
bool print_cr) :
|
||||||
_collector(collector), _phase(phase), _print_cr(print_cr) {
|
_collector(collector), _phase(phase), _print_cr(print_cr), _gc_id(gc_id) {
|
||||||
|
|
||||||
if (PrintCMSStatistics != 0) {
|
if (PrintCMSStatistics != 0) {
|
||||||
_collector->resetYields();
|
_collector->resetYields();
|
||||||
}
|
}
|
||||||
if (PrintGCDetails) {
|
if (PrintGCDetails) {
|
||||||
gclog_or_tty->date_stamp(PrintGCDateStamps);
|
gclog_or_tty->gclog_stamp(_gc_id);
|
||||||
gclog_or_tty->stamp(PrintGCTimeStamps);
|
|
||||||
gclog_or_tty->print_cr("[%s-concurrent-%s-start]",
|
gclog_or_tty->print_cr("[%s-concurrent-%s-start]",
|
||||||
_collector->cmsGen()->short_name(), _phase);
|
_collector->cmsGen()->short_name(), _phase);
|
||||||
}
|
}
|
||||||
@ -3583,8 +3588,7 @@ CMSPhaseAccounting::~CMSPhaseAccounting() {
|
|||||||
_collector->stopTimer();
|
_collector->stopTimer();
|
||||||
_wallclock.stop();
|
_wallclock.stop();
|
||||||
if (PrintGCDetails) {
|
if (PrintGCDetails) {
|
||||||
gclog_or_tty->date_stamp(PrintGCDateStamps);
|
gclog_or_tty->gclog_stamp(_gc_id);
|
||||||
gclog_or_tty->stamp(PrintGCTimeStamps);
|
|
||||||
gclog_or_tty->print("[%s-concurrent-%s: %3.3f/%3.3f secs]",
|
gclog_or_tty->print("[%s-concurrent-%s: %3.3f/%3.3f secs]",
|
||||||
_collector->cmsGen()->short_name(),
|
_collector->cmsGen()->short_name(),
|
||||||
_phase, _collector->timerValue(), _wallclock.seconds());
|
_phase, _collector->timerValue(), _wallclock.seconds());
|
||||||
@ -3682,7 +3686,7 @@ void CMSCollector::checkpointRootsInitialWork(bool asynch) {
|
|||||||
setup_cms_unloading_and_verification_state();
|
setup_cms_unloading_and_verification_state();
|
||||||
|
|
||||||
NOT_PRODUCT(GCTraceTime t("\ncheckpointRootsInitialWork",
|
NOT_PRODUCT(GCTraceTime t("\ncheckpointRootsInitialWork",
|
||||||
PrintGCDetails && Verbose, true, _gc_timer_cm);)
|
PrintGCDetails && Verbose, true, _gc_timer_cm, _gc_tracer_cm->gc_id());)
|
||||||
if (UseAdaptiveSizePolicy) {
|
if (UseAdaptiveSizePolicy) {
|
||||||
size_policy()->checkpoint_roots_initial_begin();
|
size_policy()->checkpoint_roots_initial_begin();
|
||||||
}
|
}
|
||||||
@ -3740,7 +3744,7 @@ void CMSCollector::checkpointRootsInitialWork(bool asynch) {
|
|||||||
gch->set_par_threads(0);
|
gch->set_par_threads(0);
|
||||||
} else {
|
} else {
|
||||||
// The serial version.
|
// The serial version.
|
||||||
CMKlassClosure klass_closure(¬Older);
|
KlassToOopClosure klass_closure(¬Older);
|
||||||
gch->rem_set()->prepare_for_younger_refs_iterate(false); // Not parallel.
|
gch->rem_set()->prepare_for_younger_refs_iterate(false); // Not parallel.
|
||||||
gch->gen_process_strong_roots(_cmsGen->level(),
|
gch->gen_process_strong_roots(_cmsGen->level(),
|
||||||
true, // younger gens are roots
|
true, // younger gens are roots
|
||||||
@ -3799,7 +3803,7 @@ bool CMSCollector::markFromRoots(bool asynch) {
|
|||||||
|
|
||||||
CMSTokenSyncWithLocks ts(true, bitMapLock());
|
CMSTokenSyncWithLocks ts(true, bitMapLock());
|
||||||
TraceCPUTime tcpu(PrintGCDetails, true, gclog_or_tty);
|
TraceCPUTime tcpu(PrintGCDetails, true, gclog_or_tty);
|
||||||
CMSPhaseAccounting pa(this, "mark", !PrintGCDetails);
|
CMSPhaseAccounting pa(this, "mark", _gc_tracer_cm->gc_id(), !PrintGCDetails);
|
||||||
res = markFromRootsWork(asynch);
|
res = markFromRootsWork(asynch);
|
||||||
if (res) {
|
if (res) {
|
||||||
_collectorState = Precleaning;
|
_collectorState = Precleaning;
|
||||||
@ -4202,7 +4206,7 @@ void CMSConcMarkingTask::do_scan_and_mark(int i, CompactibleFreeListSpace* sp) {
|
|||||||
pst->all_tasks_completed();
|
pst->all_tasks_completed();
|
||||||
}
|
}
|
||||||
|
|
||||||
class Par_ConcMarkingClosure: public CMSOopClosure {
|
class Par_ConcMarkingClosure: public MetadataAwareOopClosure {
|
||||||
private:
|
private:
|
||||||
CMSCollector* _collector;
|
CMSCollector* _collector;
|
||||||
CMSConcMarkingTask* _task;
|
CMSConcMarkingTask* _task;
|
||||||
@ -4215,7 +4219,7 @@ class Par_ConcMarkingClosure: public CMSOopClosure {
|
|||||||
public:
|
public:
|
||||||
Par_ConcMarkingClosure(CMSCollector* collector, CMSConcMarkingTask* task, OopTaskQueue* work_queue,
|
Par_ConcMarkingClosure(CMSCollector* collector, CMSConcMarkingTask* task, OopTaskQueue* work_queue,
|
||||||
CMSBitMap* bit_map, CMSMarkStack* overflow_stack):
|
CMSBitMap* bit_map, CMSMarkStack* overflow_stack):
|
||||||
CMSOopClosure(collector->ref_processor()),
|
MetadataAwareOopClosure(collector->ref_processor()),
|
||||||
_collector(collector),
|
_collector(collector),
|
||||||
_task(task),
|
_task(task),
|
||||||
_span(collector->_span),
|
_span(collector->_span),
|
||||||
@ -4522,7 +4526,7 @@ void CMSCollector::preclean() {
|
|||||||
_start_sampling = false;
|
_start_sampling = false;
|
||||||
}
|
}
|
||||||
TraceCPUTime tcpu(PrintGCDetails, true, gclog_or_tty);
|
TraceCPUTime tcpu(PrintGCDetails, true, gclog_or_tty);
|
||||||
CMSPhaseAccounting pa(this, "preclean", !PrintGCDetails);
|
CMSPhaseAccounting pa(this, "preclean", _gc_tracer_cm->gc_id(), !PrintGCDetails);
|
||||||
preclean_work(CMSPrecleanRefLists1, CMSPrecleanSurvivors1);
|
preclean_work(CMSPrecleanRefLists1, CMSPrecleanSurvivors1);
|
||||||
}
|
}
|
||||||
CMSTokenSync x(true); // is cms thread
|
CMSTokenSync x(true); // is cms thread
|
||||||
@ -4551,7 +4555,7 @@ void CMSCollector::abortable_preclean() {
|
|||||||
// we will never do an actual abortable preclean cycle.
|
// we will never do an actual abortable preclean cycle.
|
||||||
if (get_eden_used() > CMSScheduleRemarkEdenSizeThreshold) {
|
if (get_eden_used() > CMSScheduleRemarkEdenSizeThreshold) {
|
||||||
TraceCPUTime tcpu(PrintGCDetails, true, gclog_or_tty);
|
TraceCPUTime tcpu(PrintGCDetails, true, gclog_or_tty);
|
||||||
CMSPhaseAccounting pa(this, "abortable-preclean", !PrintGCDetails);
|
CMSPhaseAccounting pa(this, "abortable-preclean", _gc_tracer_cm->gc_id(), !PrintGCDetails);
|
||||||
// We need more smarts in the abortable preclean
|
// We need more smarts in the abortable preclean
|
||||||
// loop below to deal with cases where allocation
|
// loop below to deal with cases where allocation
|
||||||
// in young gen is very very slow, and our precleaning
|
// in young gen is very very slow, and our precleaning
|
||||||
@ -4696,7 +4700,7 @@ size_t CMSCollector::preclean_work(bool clean_refs, bool clean_survivor) {
|
|||||||
GCTimer *gc_timer = NULL; // Currently not tracing concurrent phases
|
GCTimer *gc_timer = NULL; // Currently not tracing concurrent phases
|
||||||
rp->preclean_discovered_references(
|
rp->preclean_discovered_references(
|
||||||
rp->is_alive_non_header(), &keep_alive, &complete_trace, &yield_cl,
|
rp->is_alive_non_header(), &keep_alive, &complete_trace, &yield_cl,
|
||||||
gc_timer);
|
gc_timer, _gc_tracer_cm->gc_id());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (clean_survivor) { // preclean the active survivor space(s)
|
if (clean_survivor) { // preclean the active survivor space(s)
|
||||||
@ -4986,7 +4990,7 @@ size_t CMSCollector::preclean_card_table(ConcurrentMarkSweepGeneration* gen,
|
|||||||
}
|
}
|
||||||
|
|
||||||
class PrecleanKlassClosure : public KlassClosure {
|
class PrecleanKlassClosure : public KlassClosure {
|
||||||
CMKlassClosure _cm_klass_closure;
|
KlassToOopClosure _cm_klass_closure;
|
||||||
public:
|
public:
|
||||||
PrecleanKlassClosure(OopClosure* oop_closure) : _cm_klass_closure(oop_closure) {}
|
PrecleanKlassClosure(OopClosure* oop_closure) : _cm_klass_closure(oop_closure) {}
|
||||||
void do_klass(Klass* k) {
|
void do_klass(Klass* k) {
|
||||||
@ -5039,7 +5043,7 @@ void CMSCollector::checkpointRootsFinal(bool asynch,
|
|||||||
// expect it to be false and set to true
|
// expect it to be false and set to true
|
||||||
FlagSetting fl(gch->_is_gc_active, false);
|
FlagSetting fl(gch->_is_gc_active, false);
|
||||||
NOT_PRODUCT(GCTraceTime t("Scavenge-Before-Remark",
|
NOT_PRODUCT(GCTraceTime t("Scavenge-Before-Remark",
|
||||||
PrintGCDetails && Verbose, true, _gc_timer_cm);)
|
PrintGCDetails && Verbose, true, _gc_timer_cm, _gc_tracer_cm->gc_id());)
|
||||||
int level = _cmsGen->level() - 1;
|
int level = _cmsGen->level() - 1;
|
||||||
if (level >= 0) {
|
if (level >= 0) {
|
||||||
gch->do_collection(true, // full (i.e. force, see below)
|
gch->do_collection(true, // full (i.e. force, see below)
|
||||||
@ -5068,7 +5072,7 @@ void CMSCollector::checkpointRootsFinal(bool asynch,
|
|||||||
void CMSCollector::checkpointRootsFinalWork(bool asynch,
|
void CMSCollector::checkpointRootsFinalWork(bool asynch,
|
||||||
bool clear_all_soft_refs, bool init_mark_was_synchronous) {
|
bool clear_all_soft_refs, bool init_mark_was_synchronous) {
|
||||||
|
|
||||||
NOT_PRODUCT(GCTraceTime tr("checkpointRootsFinalWork", PrintGCDetails, false, _gc_timer_cm);)
|
NOT_PRODUCT(GCTraceTime tr("checkpointRootsFinalWork", PrintGCDetails, false, _gc_timer_cm, _gc_tracer_cm->gc_id());)
|
||||||
|
|
||||||
assert(haveFreelistLocks(), "must have free list locks");
|
assert(haveFreelistLocks(), "must have free list locks");
|
||||||
assert_lock_strong(bitMapLock());
|
assert_lock_strong(bitMapLock());
|
||||||
@ -5123,11 +5127,11 @@ void CMSCollector::checkpointRootsFinalWork(bool asynch,
|
|||||||
// the most recent young generation GC, minus those cleaned up by the
|
// the most recent young generation GC, minus those cleaned up by the
|
||||||
// concurrent precleaning.
|
// concurrent precleaning.
|
||||||
if (CMSParallelRemarkEnabled && CollectedHeap::use_parallel_gc_threads()) {
|
if (CMSParallelRemarkEnabled && CollectedHeap::use_parallel_gc_threads()) {
|
||||||
GCTraceTime t("Rescan (parallel) ", PrintGCDetails, false, _gc_timer_cm);
|
GCTraceTime t("Rescan (parallel) ", PrintGCDetails, false, _gc_timer_cm, _gc_tracer_cm->gc_id());
|
||||||
do_remark_parallel();
|
do_remark_parallel();
|
||||||
} else {
|
} else {
|
||||||
GCTraceTime t("Rescan (non-parallel) ", PrintGCDetails, false,
|
GCTraceTime t("Rescan (non-parallel) ", PrintGCDetails, false,
|
||||||
_gc_timer_cm);
|
_gc_timer_cm, _gc_tracer_cm->gc_id());
|
||||||
do_remark_non_parallel();
|
do_remark_non_parallel();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -5140,7 +5144,7 @@ void CMSCollector::checkpointRootsFinalWork(bool asynch,
|
|||||||
verify_overflow_empty();
|
verify_overflow_empty();
|
||||||
|
|
||||||
{
|
{
|
||||||
NOT_PRODUCT(GCTraceTime ts("refProcessingWork", PrintGCDetails, false, _gc_timer_cm);)
|
NOT_PRODUCT(GCTraceTime ts("refProcessingWork", PrintGCDetails, false, _gc_timer_cm, _gc_tracer_cm->gc_id());)
|
||||||
refProcessingWork(asynch, clear_all_soft_refs);
|
refProcessingWork(asynch, clear_all_soft_refs);
|
||||||
}
|
}
|
||||||
verify_work_stacks_empty();
|
verify_work_stacks_empty();
|
||||||
@ -5224,7 +5228,7 @@ void CMSParInitialMarkTask::work(uint worker_id) {
|
|||||||
_timer.start();
|
_timer.start();
|
||||||
GenCollectedHeap* gch = GenCollectedHeap::heap();
|
GenCollectedHeap* gch = GenCollectedHeap::heap();
|
||||||
Par_MarkRefsIntoClosure par_mri_cl(_collector->_span, &(_collector->_markBitMap));
|
Par_MarkRefsIntoClosure par_mri_cl(_collector->_span, &(_collector->_markBitMap));
|
||||||
CMKlassClosure klass_closure(&par_mri_cl);
|
KlassToOopClosure klass_closure(&par_mri_cl);
|
||||||
|
|
||||||
// ---------- young gen roots --------------
|
// ---------- young gen roots --------------
|
||||||
{
|
{
|
||||||
@ -5298,7 +5302,7 @@ class CMSParRemarkTask: public CMSParMarkTask {
|
|||||||
};
|
};
|
||||||
|
|
||||||
class RemarkKlassClosure : public KlassClosure {
|
class RemarkKlassClosure : public KlassClosure {
|
||||||
CMKlassClosure _cm_klass_closure;
|
KlassToOopClosure _cm_klass_closure;
|
||||||
public:
|
public:
|
||||||
RemarkKlassClosure(OopClosure* oop_closure) : _cm_klass_closure(oop_closure) {}
|
RemarkKlassClosure(OopClosure* oop_closure) : _cm_klass_closure(oop_closure) {}
|
||||||
void do_klass(Klass* k) {
|
void do_klass(Klass* k) {
|
||||||
@ -5921,7 +5925,7 @@ void CMSCollector::do_remark_non_parallel() {
|
|||||||
NULL, // space is set further below
|
NULL, // space is set further below
|
||||||
&_markBitMap, &_markStack, &mrias_cl);
|
&_markBitMap, &_markStack, &mrias_cl);
|
||||||
{
|
{
|
||||||
GCTraceTime t("grey object rescan", PrintGCDetails, false, _gc_timer_cm);
|
GCTraceTime t("grey object rescan", PrintGCDetails, false, _gc_timer_cm, _gc_tracer_cm->gc_id());
|
||||||
// Iterate over the dirty cards, setting the corresponding bits in the
|
// Iterate over the dirty cards, setting the corresponding bits in the
|
||||||
// mod union table.
|
// mod union table.
|
||||||
{
|
{
|
||||||
@ -5958,7 +5962,7 @@ void CMSCollector::do_remark_non_parallel() {
|
|||||||
Universe::verify();
|
Universe::verify();
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
GCTraceTime t("root rescan", PrintGCDetails, false, _gc_timer_cm);
|
GCTraceTime t("root rescan", PrintGCDetails, false, _gc_timer_cm, _gc_tracer_cm->gc_id());
|
||||||
|
|
||||||
verify_work_stacks_empty();
|
verify_work_stacks_empty();
|
||||||
|
|
||||||
@ -5978,7 +5982,7 @@ void CMSCollector::do_remark_non_parallel() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
GCTraceTime t("visit unhandled CLDs", PrintGCDetails, false, _gc_timer_cm);
|
GCTraceTime t("visit unhandled CLDs", PrintGCDetails, false, _gc_timer_cm, _gc_tracer_cm->gc_id());
|
||||||
|
|
||||||
verify_work_stacks_empty();
|
verify_work_stacks_empty();
|
||||||
|
|
||||||
@ -5997,7 +6001,7 @@ void CMSCollector::do_remark_non_parallel() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
GCTraceTime t("dirty klass scan", PrintGCDetails, false, _gc_timer_cm);
|
GCTraceTime t("dirty klass scan", PrintGCDetails, false, _gc_timer_cm, _gc_tracer_cm->gc_id());
|
||||||
|
|
||||||
verify_work_stacks_empty();
|
verify_work_stacks_empty();
|
||||||
|
|
||||||
@ -6199,7 +6203,7 @@ void CMSCollector::refProcessingWork(bool asynch, bool clear_all_soft_refs) {
|
|||||||
_span, &_markBitMap, &_markStack,
|
_span, &_markBitMap, &_markStack,
|
||||||
&cmsKeepAliveClosure, false /* !preclean */);
|
&cmsKeepAliveClosure, false /* !preclean */);
|
||||||
{
|
{
|
||||||
GCTraceTime t("weak refs processing", PrintGCDetails, false, _gc_timer_cm);
|
GCTraceTime t("weak refs processing", PrintGCDetails, false, _gc_timer_cm, _gc_tracer_cm->gc_id());
|
||||||
|
|
||||||
ReferenceProcessorStats stats;
|
ReferenceProcessorStats stats;
|
||||||
if (rp->processing_is_mt()) {
|
if (rp->processing_is_mt()) {
|
||||||
@ -6224,13 +6228,15 @@ void CMSCollector::refProcessingWork(bool asynch, bool clear_all_soft_refs) {
|
|||||||
&cmsKeepAliveClosure,
|
&cmsKeepAliveClosure,
|
||||||
&cmsDrainMarkingStackClosure,
|
&cmsDrainMarkingStackClosure,
|
||||||
&task_executor,
|
&task_executor,
|
||||||
_gc_timer_cm);
|
_gc_timer_cm,
|
||||||
|
_gc_tracer_cm->gc_id());
|
||||||
} else {
|
} else {
|
||||||
stats = rp->process_discovered_references(&_is_alive_closure,
|
stats = rp->process_discovered_references(&_is_alive_closure,
|
||||||
&cmsKeepAliveClosure,
|
&cmsKeepAliveClosure,
|
||||||
&cmsDrainMarkingStackClosure,
|
&cmsDrainMarkingStackClosure,
|
||||||
NULL,
|
NULL,
|
||||||
_gc_timer_cm);
|
_gc_timer_cm,
|
||||||
|
_gc_tracer_cm->gc_id());
|
||||||
}
|
}
|
||||||
_gc_tracer_cm->report_gc_reference_stats(stats);
|
_gc_tracer_cm->report_gc_reference_stats(stats);
|
||||||
|
|
||||||
@ -6241,7 +6247,7 @@ void CMSCollector::refProcessingWork(bool asynch, bool clear_all_soft_refs) {
|
|||||||
|
|
||||||
if (should_unload_classes()) {
|
if (should_unload_classes()) {
|
||||||
{
|
{
|
||||||
GCTraceTime t("class unloading", PrintGCDetails, false, _gc_timer_cm);
|
GCTraceTime t("class unloading", PrintGCDetails, false, _gc_timer_cm, _gc_tracer_cm->gc_id());
|
||||||
|
|
||||||
// Unload classes and purge the SystemDictionary.
|
// Unload classes and purge the SystemDictionary.
|
||||||
bool purged_class = SystemDictionary::do_unloading(&_is_alive_closure);
|
bool purged_class = SystemDictionary::do_unloading(&_is_alive_closure);
|
||||||
@ -6254,7 +6260,7 @@ void CMSCollector::refProcessingWork(bool asynch, bool clear_all_soft_refs) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
GCTraceTime t("scrub symbol table", PrintGCDetails, false, _gc_timer_cm);
|
GCTraceTime t("scrub symbol table", PrintGCDetails, false, _gc_timer_cm, _gc_tracer_cm->gc_id());
|
||||||
// Clean up unreferenced symbols in symbol table.
|
// Clean up unreferenced symbols in symbol table.
|
||||||
SymbolTable::unlink();
|
SymbolTable::unlink();
|
||||||
}
|
}
|
||||||
@ -6263,7 +6269,7 @@ void CMSCollector::refProcessingWork(bool asynch, bool clear_all_soft_refs) {
|
|||||||
// CMS doesn't use the StringTable as hard roots when class unloading is turned off.
|
// CMS doesn't use the StringTable as hard roots when class unloading is turned off.
|
||||||
// Need to check if we really scanned the StringTable.
|
// Need to check if we really scanned the StringTable.
|
||||||
if ((roots_scanning_options() & SharedHeap::SO_Strings) == 0) {
|
if ((roots_scanning_options() & SharedHeap::SO_Strings) == 0) {
|
||||||
GCTraceTime t("scrub string table", PrintGCDetails, false, _gc_timer_cm);
|
GCTraceTime t("scrub string table", PrintGCDetails, false, _gc_timer_cm, _gc_tracer_cm->gc_id());
|
||||||
// Delete entries for dead interned strings.
|
// Delete entries for dead interned strings.
|
||||||
StringTable::unlink(&_is_alive_closure);
|
StringTable::unlink(&_is_alive_closure);
|
||||||
}
|
}
|
||||||
@ -6330,7 +6336,7 @@ void CMSCollector::sweep(bool asynch) {
|
|||||||
_intra_sweep_timer.start();
|
_intra_sweep_timer.start();
|
||||||
if (asynch) {
|
if (asynch) {
|
||||||
TraceCPUTime tcpu(PrintGCDetails, true, gclog_or_tty);
|
TraceCPUTime tcpu(PrintGCDetails, true, gclog_or_tty);
|
||||||
CMSPhaseAccounting pa(this, "sweep", !PrintGCDetails);
|
CMSPhaseAccounting pa(this, "sweep", _gc_tracer_cm->gc_id(), !PrintGCDetails);
|
||||||
// First sweep the old gen
|
// First sweep the old gen
|
||||||
{
|
{
|
||||||
CMSTokenSyncWithLocks ts(true, _cmsGen->freelistLock(),
|
CMSTokenSyncWithLocks ts(true, _cmsGen->freelistLock(),
|
||||||
@ -6551,7 +6557,7 @@ void CMSCollector::reset(bool asynch) {
|
|||||||
// Clear the mark bitmap (no grey objects to start with)
|
// Clear the mark bitmap (no grey objects to start with)
|
||||||
// for the next cycle.
|
// for the next cycle.
|
||||||
TraceCPUTime tcpu(PrintGCDetails, true, gclog_or_tty);
|
TraceCPUTime tcpu(PrintGCDetails, true, gclog_or_tty);
|
||||||
CMSPhaseAccounting cmspa(this, "reset", !PrintGCDetails);
|
CMSPhaseAccounting cmspa(this, "reset", _gc_tracer_cm->gc_id(), !PrintGCDetails);
|
||||||
|
|
||||||
HeapWord* curAddr = _markBitMap.startWord();
|
HeapWord* curAddr = _markBitMap.startWord();
|
||||||
while (curAddr < _markBitMap.endWord()) {
|
while (curAddr < _markBitMap.endWord()) {
|
||||||
@ -6617,7 +6623,7 @@ void CMSCollector::reset(bool asynch) {
|
|||||||
void CMSCollector::do_CMS_operation(CMS_op_type op, GCCause::Cause gc_cause) {
|
void CMSCollector::do_CMS_operation(CMS_op_type op, GCCause::Cause gc_cause) {
|
||||||
gclog_or_tty->date_stamp(PrintGC && PrintGCDateStamps);
|
gclog_or_tty->date_stamp(PrintGC && PrintGCDateStamps);
|
||||||
TraceCPUTime tcpu(PrintGCDetails, true, gclog_or_tty);
|
TraceCPUTime tcpu(PrintGCDetails, true, gclog_or_tty);
|
||||||
GCTraceTime t(GCCauseString("GC", gc_cause), PrintGC, !PrintGCDetails, NULL);
|
GCTraceTime t(GCCauseString("GC", gc_cause), PrintGC, !PrintGCDetails, NULL, _gc_tracer_cm->gc_id());
|
||||||
TraceCollectorStats tcs(counters());
|
TraceCollectorStats tcs(counters());
|
||||||
|
|
||||||
switch (op) {
|
switch (op) {
|
||||||
@ -7735,7 +7741,7 @@ PushAndMarkVerifyClosure::PushAndMarkVerifyClosure(
|
|||||||
CMSCollector* collector, MemRegion span,
|
CMSCollector* collector, MemRegion span,
|
||||||
CMSBitMap* verification_bm, CMSBitMap* cms_bm,
|
CMSBitMap* verification_bm, CMSBitMap* cms_bm,
|
||||||
CMSMarkStack* mark_stack):
|
CMSMarkStack* mark_stack):
|
||||||
CMSOopClosure(collector->ref_processor()),
|
MetadataAwareOopClosure(collector->ref_processor()),
|
||||||
_collector(collector),
|
_collector(collector),
|
||||||
_span(span),
|
_span(span),
|
||||||
_verification_bm(verification_bm),
|
_verification_bm(verification_bm),
|
||||||
@ -7788,7 +7794,7 @@ PushOrMarkClosure::PushOrMarkClosure(CMSCollector* collector,
|
|||||||
MemRegion span,
|
MemRegion span,
|
||||||
CMSBitMap* bitMap, CMSMarkStack* markStack,
|
CMSBitMap* bitMap, CMSMarkStack* markStack,
|
||||||
HeapWord* finger, MarkFromRootsClosure* parent) :
|
HeapWord* finger, MarkFromRootsClosure* parent) :
|
||||||
CMSOopClosure(collector->ref_processor()),
|
MetadataAwareOopClosure(collector->ref_processor()),
|
||||||
_collector(collector),
|
_collector(collector),
|
||||||
_span(span),
|
_span(span),
|
||||||
_bitMap(bitMap),
|
_bitMap(bitMap),
|
||||||
@ -7805,7 +7811,7 @@ Par_PushOrMarkClosure::Par_PushOrMarkClosure(CMSCollector* collector,
|
|||||||
HeapWord* finger,
|
HeapWord* finger,
|
||||||
HeapWord** global_finger_addr,
|
HeapWord** global_finger_addr,
|
||||||
Par_MarkFromRootsClosure* parent) :
|
Par_MarkFromRootsClosure* parent) :
|
||||||
CMSOopClosure(collector->ref_processor()),
|
MetadataAwareOopClosure(collector->ref_processor()),
|
||||||
_collector(collector),
|
_collector(collector),
|
||||||
_whole_span(collector->_span),
|
_whole_span(collector->_span),
|
||||||
_span(span),
|
_span(span),
|
||||||
@ -7854,11 +7860,6 @@ void Par_PushOrMarkClosure::handle_stack_overflow(HeapWord* lost) {
|
|||||||
_overflow_stack->expand(); // expand the stack if possible
|
_overflow_stack->expand(); // expand the stack if possible
|
||||||
}
|
}
|
||||||
|
|
||||||
void CMKlassClosure::do_klass(Klass* k) {
|
|
||||||
assert(_oop_closure != NULL, "Not initialized?");
|
|
||||||
k->oops_do(_oop_closure);
|
|
||||||
}
|
|
||||||
|
|
||||||
void PushOrMarkClosure::do_oop(oop obj) {
|
void PushOrMarkClosure::do_oop(oop obj) {
|
||||||
// Ignore mark word because we are running concurrent with mutators.
|
// Ignore mark word because we are running concurrent with mutators.
|
||||||
assert(obj->is_oop_or_null(true), "expected an oop or NULL");
|
assert(obj->is_oop_or_null(true), "expected an oop or NULL");
|
||||||
@ -7956,7 +7957,7 @@ PushAndMarkClosure::PushAndMarkClosure(CMSCollector* collector,
|
|||||||
CMSBitMap* mod_union_table,
|
CMSBitMap* mod_union_table,
|
||||||
CMSMarkStack* mark_stack,
|
CMSMarkStack* mark_stack,
|
||||||
bool concurrent_precleaning):
|
bool concurrent_precleaning):
|
||||||
CMSOopClosure(rp),
|
MetadataAwareOopClosure(rp),
|
||||||
_collector(collector),
|
_collector(collector),
|
||||||
_span(span),
|
_span(span),
|
||||||
_bit_map(bit_map),
|
_bit_map(bit_map),
|
||||||
@ -8029,7 +8030,7 @@ Par_PushAndMarkClosure::Par_PushAndMarkClosure(CMSCollector* collector,
|
|||||||
ReferenceProcessor* rp,
|
ReferenceProcessor* rp,
|
||||||
CMSBitMap* bit_map,
|
CMSBitMap* bit_map,
|
||||||
OopTaskQueue* work_queue):
|
OopTaskQueue* work_queue):
|
||||||
CMSOopClosure(rp),
|
MetadataAwareOopClosure(rp),
|
||||||
_collector(collector),
|
_collector(collector),
|
||||||
_span(span),
|
_span(span),
|
||||||
_bit_map(bit_map),
|
_bit_map(bit_map),
|
||||||
|
@ -1444,7 +1444,7 @@ class Par_MarkFromRootsClosure: public BitMapClosure {
|
|||||||
|
|
||||||
// The following closures are used to do certain kinds of verification of
|
// The following closures are used to do certain kinds of verification of
|
||||||
// CMS marking.
|
// CMS marking.
|
||||||
class PushAndMarkVerifyClosure: public CMSOopClosure {
|
class PushAndMarkVerifyClosure: public MetadataAwareOopClosure {
|
||||||
CMSCollector* _collector;
|
CMSCollector* _collector;
|
||||||
MemRegion _span;
|
MemRegion _span;
|
||||||
CMSBitMap* _verification_bm;
|
CMSBitMap* _verification_bm;
|
||||||
|
@ -56,7 +56,7 @@ void VM_CMS_Operation::release_and_notify_pending_list_lock() {
|
|||||||
void VM_CMS_Operation::verify_before_gc() {
|
void VM_CMS_Operation::verify_before_gc() {
|
||||||
if (VerifyBeforeGC &&
|
if (VerifyBeforeGC &&
|
||||||
GenCollectedHeap::heap()->total_collections() >= VerifyGCStartAt) {
|
GenCollectedHeap::heap()->total_collections() >= VerifyGCStartAt) {
|
||||||
GCTraceTime tm("Verify Before", false, false, _collector->_gc_timer_cm);
|
GCTraceTime tm("Verify Before", false, false, _collector->_gc_timer_cm, _collector->_gc_tracer_cm->gc_id());
|
||||||
HandleMark hm;
|
HandleMark hm;
|
||||||
FreelistLocker x(_collector);
|
FreelistLocker x(_collector);
|
||||||
MutexLockerEx y(_collector->bitMapLock(), Mutex::_no_safepoint_check_flag);
|
MutexLockerEx y(_collector->bitMapLock(), Mutex::_no_safepoint_check_flag);
|
||||||
@ -68,7 +68,7 @@ void VM_CMS_Operation::verify_before_gc() {
|
|||||||
void VM_CMS_Operation::verify_after_gc() {
|
void VM_CMS_Operation::verify_after_gc() {
|
||||||
if (VerifyAfterGC &&
|
if (VerifyAfterGC &&
|
||||||
GenCollectedHeap::heap()->total_collections() >= VerifyGCStartAt) {
|
GenCollectedHeap::heap()->total_collections() >= VerifyGCStartAt) {
|
||||||
GCTraceTime tm("Verify After", false, false, _collector->_gc_timer_cm);
|
GCTraceTime tm("Verify After", false, false, _collector->_gc_timer_cm, _collector->_gc_tracer_cm->gc_id());
|
||||||
HandleMark hm;
|
HandleMark hm;
|
||||||
FreelistLocker x(_collector);
|
FreelistLocker x(_collector);
|
||||||
MutexLockerEx y(_collector->bitMapLock(), Mutex::_no_safepoint_check_flag);
|
MutexLockerEx y(_collector->bitMapLock(), Mutex::_no_safepoint_check_flag);
|
||||||
|
@ -28,6 +28,7 @@
|
|||||||
#include "gc_implementation/g1/g1CollectorPolicy.hpp"
|
#include "gc_implementation/g1/g1CollectorPolicy.hpp"
|
||||||
#include "gc_implementation/g1/g1ErgoVerbose.hpp"
|
#include "gc_implementation/g1/g1ErgoVerbose.hpp"
|
||||||
#include "memory/space.inline.hpp"
|
#include "memory/space.inline.hpp"
|
||||||
|
#include "runtime/atomic.inline.hpp"
|
||||||
|
|
||||||
// Even though we don't use the GC efficiency in our heuristics as
|
// Even though we don't use the GC efficiency in our heuristics as
|
||||||
// much as we used to, we still order according to GC efficiency. This
|
// much as we used to, we still order according to GC efficiency. This
|
||||||
|
@ -45,6 +45,7 @@
|
|||||||
#include "oops/oop.inline.hpp"
|
#include "oops/oop.inline.hpp"
|
||||||
#include "runtime/handles.inline.hpp"
|
#include "runtime/handles.inline.hpp"
|
||||||
#include "runtime/java.hpp"
|
#include "runtime/java.hpp"
|
||||||
|
#include "runtime/atomic.inline.hpp"
|
||||||
#include "runtime/prefetch.inline.hpp"
|
#include "runtime/prefetch.inline.hpp"
|
||||||
#include "services/memTracker.hpp"
|
#include "services/memTracker.hpp"
|
||||||
|
|
||||||
@ -511,6 +512,7 @@ ConcurrentMark::ConcurrentMark(G1CollectedHeap* g1h, ReservedSpace heap_rs) :
|
|||||||
_has_overflown(false),
|
_has_overflown(false),
|
||||||
_concurrent(false),
|
_concurrent(false),
|
||||||
_has_aborted(false),
|
_has_aborted(false),
|
||||||
|
_aborted_gc_id(GCId::undefined()),
|
||||||
_restart_for_overflow(false),
|
_restart_for_overflow(false),
|
||||||
_concurrent_marking_in_progress(false),
|
_concurrent_marking_in_progress(false),
|
||||||
|
|
||||||
@ -1020,8 +1022,7 @@ void ConcurrentMark::enter_first_sync_barrier(uint worker_id) {
|
|||||||
force_overflow()->update();
|
force_overflow()->update();
|
||||||
|
|
||||||
if (G1Log::fine()) {
|
if (G1Log::fine()) {
|
||||||
gclog_or_tty->date_stamp(PrintGCDateStamps);
|
gclog_or_tty->gclog_stamp(concurrent_gc_id());
|
||||||
gclog_or_tty->stamp(PrintGCTimeStamps);
|
|
||||||
gclog_or_tty->print_cr("[GC concurrent-mark-reset-for-overflow]");
|
gclog_or_tty->print_cr("[GC concurrent-mark-reset-for-overflow]");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -2469,7 +2470,7 @@ void ConcurrentMark::weakRefsWork(bool clear_all_soft_refs) {
|
|||||||
if (G1Log::finer()) {
|
if (G1Log::finer()) {
|
||||||
gclog_or_tty->put(' ');
|
gclog_or_tty->put(' ');
|
||||||
}
|
}
|
||||||
GCTraceTime t("GC ref-proc", G1Log::finer(), false, g1h->gc_timer_cm());
|
GCTraceTime t("GC ref-proc", G1Log::finer(), false, g1h->gc_timer_cm(), concurrent_gc_id());
|
||||||
|
|
||||||
ReferenceProcessor* rp = g1h->ref_processor_cm();
|
ReferenceProcessor* rp = g1h->ref_processor_cm();
|
||||||
|
|
||||||
@ -2526,7 +2527,8 @@ void ConcurrentMark::weakRefsWork(bool clear_all_soft_refs) {
|
|||||||
&g1_keep_alive,
|
&g1_keep_alive,
|
||||||
&g1_drain_mark_stack,
|
&g1_drain_mark_stack,
|
||||||
executor,
|
executor,
|
||||||
g1h->gc_timer_cm());
|
g1h->gc_timer_cm(),
|
||||||
|
concurrent_gc_id());
|
||||||
g1h->gc_tracer_cm()->report_gc_reference_stats(stats);
|
g1h->gc_tracer_cm()->report_gc_reference_stats(stats);
|
||||||
|
|
||||||
// The do_oop work routines of the keep_alive and drain_marking_stack
|
// The do_oop work routines of the keep_alive and drain_marking_stack
|
||||||
@ -3261,6 +3263,12 @@ void ConcurrentMark::abort() {
|
|||||||
}
|
}
|
||||||
_first_overflow_barrier_sync.abort();
|
_first_overflow_barrier_sync.abort();
|
||||||
_second_overflow_barrier_sync.abort();
|
_second_overflow_barrier_sync.abort();
|
||||||
|
const GCId& gc_id = _g1h->gc_tracer_cm()->gc_id();
|
||||||
|
if (!gc_id.is_undefined()) {
|
||||||
|
// We can do multiple full GCs before ConcurrentMarkThread::run() gets a chance
|
||||||
|
// to detect that it was aborted. Only keep track of the first GC id that we aborted.
|
||||||
|
_aborted_gc_id = gc_id;
|
||||||
|
}
|
||||||
_has_aborted = true;
|
_has_aborted = true;
|
||||||
|
|
||||||
SATBMarkQueueSet& satb_mq_set = JavaThread::satb_mark_queue_set();
|
SATBMarkQueueSet& satb_mq_set = JavaThread::satb_mark_queue_set();
|
||||||
@ -3275,6 +3283,13 @@ void ConcurrentMark::abort() {
|
|||||||
_g1h->register_concurrent_cycle_end();
|
_g1h->register_concurrent_cycle_end();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const GCId& ConcurrentMark::concurrent_gc_id() {
|
||||||
|
if (has_aborted()) {
|
||||||
|
return _aborted_gc_id;
|
||||||
|
}
|
||||||
|
return _g1h->gc_tracer_cm()->gc_id();
|
||||||
|
}
|
||||||
|
|
||||||
static void print_ms_time_info(const char* prefix, const char* name,
|
static void print_ms_time_info(const char* prefix, const char* name,
|
||||||
NumberSeq& ns) {
|
NumberSeq& ns) {
|
||||||
gclog_or_tty->print_cr("%s%5d %12s: total time = %8.2f s (avg = %8.2f ms).",
|
gclog_or_tty->print_cr("%s%5d %12s: total time = %8.2f s (avg = %8.2f ms).",
|
||||||
|
@ -26,6 +26,7 @@
|
|||||||
#define SHARE_VM_GC_IMPLEMENTATION_G1_CONCURRENTMARK_HPP
|
#define SHARE_VM_GC_IMPLEMENTATION_G1_CONCURRENTMARK_HPP
|
||||||
|
|
||||||
#include "gc_implementation/g1/heapRegionSet.hpp"
|
#include "gc_implementation/g1/heapRegionSet.hpp"
|
||||||
|
#include "gc_implementation/shared/gcId.hpp"
|
||||||
#include "utilities/taskqueue.hpp"
|
#include "utilities/taskqueue.hpp"
|
||||||
|
|
||||||
class G1CollectedHeap;
|
class G1CollectedHeap;
|
||||||
@ -444,6 +445,7 @@ protected:
|
|||||||
volatile bool _concurrent;
|
volatile bool _concurrent;
|
||||||
// Set at the end of a Full GC so that marking aborts
|
// Set at the end of a Full GC so that marking aborts
|
||||||
volatile bool _has_aborted;
|
volatile bool _has_aborted;
|
||||||
|
GCId _aborted_gc_id;
|
||||||
|
|
||||||
// Used when remark aborts due to an overflow to indicate that
|
// Used when remark aborts due to an overflow to indicate that
|
||||||
// another concurrent marking phase should start
|
// another concurrent marking phase should start
|
||||||
@ -824,6 +826,8 @@ public:
|
|||||||
|
|
||||||
bool has_aborted() { return _has_aborted; }
|
bool has_aborted() { return _has_aborted; }
|
||||||
|
|
||||||
|
const GCId& concurrent_gc_id();
|
||||||
|
|
||||||
// This prints the global/local fingers. It is used for debugging.
|
// This prints the global/local fingers. It is used for debugging.
|
||||||
NOT_PRODUCT(void print_finger();)
|
NOT_PRODUCT(void print_finger();)
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 2001, 2013, 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.
|
||||||
*
|
*
|
||||||
@ -29,6 +29,7 @@
|
|||||||
#include "gc_implementation/g1/g1Log.hpp"
|
#include "gc_implementation/g1/g1Log.hpp"
|
||||||
#include "gc_implementation/g1/g1MMUTracker.hpp"
|
#include "gc_implementation/g1/g1MMUTracker.hpp"
|
||||||
#include "gc_implementation/g1/vm_operations_g1.hpp"
|
#include "gc_implementation/g1/vm_operations_g1.hpp"
|
||||||
|
#include "gc_implementation/shared/gcTrace.hpp"
|
||||||
#include "memory/resourceArea.hpp"
|
#include "memory/resourceArea.hpp"
|
||||||
#include "runtime/vmThread.hpp"
|
#include "runtime/vmThread.hpp"
|
||||||
|
|
||||||
@ -111,8 +112,7 @@ void ConcurrentMarkThread::run() {
|
|||||||
double scan_start = os::elapsedTime();
|
double scan_start = os::elapsedTime();
|
||||||
if (!cm()->has_aborted()) {
|
if (!cm()->has_aborted()) {
|
||||||
if (G1Log::fine()) {
|
if (G1Log::fine()) {
|
||||||
gclog_or_tty->date_stamp(PrintGCDateStamps);
|
gclog_or_tty->gclog_stamp(cm()->concurrent_gc_id());
|
||||||
gclog_or_tty->stamp(PrintGCTimeStamps);
|
|
||||||
gclog_or_tty->print_cr("[GC concurrent-root-region-scan-start]");
|
gclog_or_tty->print_cr("[GC concurrent-root-region-scan-start]");
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -120,8 +120,7 @@ void ConcurrentMarkThread::run() {
|
|||||||
|
|
||||||
double scan_end = os::elapsedTime();
|
double scan_end = os::elapsedTime();
|
||||||
if (G1Log::fine()) {
|
if (G1Log::fine()) {
|
||||||
gclog_or_tty->date_stamp(PrintGCDateStamps);
|
gclog_or_tty->gclog_stamp(cm()->concurrent_gc_id());
|
||||||
gclog_or_tty->stamp(PrintGCTimeStamps);
|
|
||||||
gclog_or_tty->print_cr("[GC concurrent-root-region-scan-end, %1.7lf secs]",
|
gclog_or_tty->print_cr("[GC concurrent-root-region-scan-end, %1.7lf secs]",
|
||||||
scan_end - scan_start);
|
scan_end - scan_start);
|
||||||
}
|
}
|
||||||
@ -129,8 +128,7 @@ void ConcurrentMarkThread::run() {
|
|||||||
|
|
||||||
double mark_start_sec = os::elapsedTime();
|
double mark_start_sec = os::elapsedTime();
|
||||||
if (G1Log::fine()) {
|
if (G1Log::fine()) {
|
||||||
gclog_or_tty->date_stamp(PrintGCDateStamps);
|
gclog_or_tty->gclog_stamp(cm()->concurrent_gc_id());
|
||||||
gclog_or_tty->stamp(PrintGCTimeStamps);
|
|
||||||
gclog_or_tty->print_cr("[GC concurrent-mark-start]");
|
gclog_or_tty->print_cr("[GC concurrent-mark-start]");
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -153,8 +151,7 @@ void ConcurrentMarkThread::run() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (G1Log::fine()) {
|
if (G1Log::fine()) {
|
||||||
gclog_or_tty->date_stamp(PrintGCDateStamps);
|
gclog_or_tty->gclog_stamp(cm()->concurrent_gc_id());
|
||||||
gclog_or_tty->stamp(PrintGCTimeStamps);
|
|
||||||
gclog_or_tty->print_cr("[GC concurrent-mark-end, %1.7lf secs]",
|
gclog_or_tty->print_cr("[GC concurrent-mark-end, %1.7lf secs]",
|
||||||
mark_end_sec - mark_start_sec);
|
mark_end_sec - mark_start_sec);
|
||||||
}
|
}
|
||||||
@ -169,8 +166,7 @@ void ConcurrentMarkThread::run() {
|
|||||||
"in remark (restart #%d).", iter);
|
"in remark (restart #%d).", iter);
|
||||||
}
|
}
|
||||||
if (G1Log::fine()) {
|
if (G1Log::fine()) {
|
||||||
gclog_or_tty->date_stamp(PrintGCDateStamps);
|
gclog_or_tty->gclog_stamp(cm()->concurrent_gc_id());
|
||||||
gclog_or_tty->stamp(PrintGCTimeStamps);
|
|
||||||
gclog_or_tty->print_cr("[GC concurrent-mark-restart-for-overflow]");
|
gclog_or_tty->print_cr("[GC concurrent-mark-restart-for-overflow]");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -213,8 +209,7 @@ void ConcurrentMarkThread::run() {
|
|||||||
|
|
||||||
double cleanup_start_sec = os::elapsedTime();
|
double cleanup_start_sec = os::elapsedTime();
|
||||||
if (G1Log::fine()) {
|
if (G1Log::fine()) {
|
||||||
gclog_or_tty->date_stamp(PrintGCDateStamps);
|
gclog_or_tty->gclog_stamp(cm()->concurrent_gc_id());
|
||||||
gclog_or_tty->stamp(PrintGCTimeStamps);
|
|
||||||
gclog_or_tty->print_cr("[GC concurrent-cleanup-start]");
|
gclog_or_tty->print_cr("[GC concurrent-cleanup-start]");
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -234,8 +229,7 @@ void ConcurrentMarkThread::run() {
|
|||||||
|
|
||||||
double cleanup_end_sec = os::elapsedTime();
|
double cleanup_end_sec = os::elapsedTime();
|
||||||
if (G1Log::fine()) {
|
if (G1Log::fine()) {
|
||||||
gclog_or_tty->date_stamp(PrintGCDateStamps);
|
gclog_or_tty->gclog_stamp(cm()->concurrent_gc_id());
|
||||||
gclog_or_tty->stamp(PrintGCTimeStamps);
|
|
||||||
gclog_or_tty->print_cr("[GC concurrent-cleanup-end, %1.7lf secs]",
|
gclog_or_tty->print_cr("[GC concurrent-cleanup-end, %1.7lf secs]",
|
||||||
cleanup_end_sec - cleanup_start_sec);
|
cleanup_end_sec - cleanup_start_sec);
|
||||||
}
|
}
|
||||||
@ -276,8 +270,7 @@ void ConcurrentMarkThread::run() {
|
|||||||
|
|
||||||
if (cm()->has_aborted()) {
|
if (cm()->has_aborted()) {
|
||||||
if (G1Log::fine()) {
|
if (G1Log::fine()) {
|
||||||
gclog_or_tty->date_stamp(PrintGCDateStamps);
|
gclog_or_tty->gclog_stamp(cm()->concurrent_gc_id());
|
||||||
gclog_or_tty->stamp(PrintGCTimeStamps);
|
|
||||||
gclog_or_tty->print_cr("[GC concurrent-mark-abort]");
|
gclog_or_tty->print_cr("[GC concurrent-mark-abort]");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -26,7 +26,7 @@
|
|||||||
#include "gc_implementation/g1/dirtyCardQueue.hpp"
|
#include "gc_implementation/g1/dirtyCardQueue.hpp"
|
||||||
#include "gc_implementation/g1/g1CollectedHeap.inline.hpp"
|
#include "gc_implementation/g1/g1CollectedHeap.inline.hpp"
|
||||||
#include "gc_implementation/g1/heapRegionRemSet.hpp"
|
#include "gc_implementation/g1/heapRegionRemSet.hpp"
|
||||||
#include "runtime/atomic.hpp"
|
#include "runtime/atomic.inline.hpp"
|
||||||
#include "runtime/mutexLocker.hpp"
|
#include "runtime/mutexLocker.hpp"
|
||||||
#include "runtime/safepoint.hpp"
|
#include "runtime/safepoint.hpp"
|
||||||
#include "runtime/thread.inline.hpp"
|
#include "runtime/thread.inline.hpp"
|
||||||
|
@ -24,6 +24,7 @@
|
|||||||
|
|
||||||
#include "precompiled.hpp"
|
#include "precompiled.hpp"
|
||||||
#include "gc_implementation/g1/g1BlockOffsetTable.inline.hpp"
|
#include "gc_implementation/g1/g1BlockOffsetTable.inline.hpp"
|
||||||
|
#include "gc_implementation/g1/heapRegion.hpp"
|
||||||
#include "memory/space.hpp"
|
#include "memory/space.hpp"
|
||||||
#include "oops/oop.inline.hpp"
|
#include "oops/oop.inline.hpp"
|
||||||
#include "runtime/java.hpp"
|
#include "runtime/java.hpp"
|
||||||
@ -98,6 +99,20 @@ bool G1BlockOffsetSharedArray::is_card_boundary(HeapWord* p) const {
|
|||||||
return (delta & right_n_bits(LogN_words)) == (size_t)NoBits;
|
return (delta & right_n_bits(LogN_words)) == (size_t)NoBits;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void G1BlockOffsetSharedArray::set_offset_array(HeapWord* left, HeapWord* right, u_char offset) {
|
||||||
|
check_index(index_for(right - 1), "right address out of range");
|
||||||
|
assert(left < right, "Heap addresses out of order");
|
||||||
|
size_t num_cards = pointer_delta(right, left) >> LogN_words;
|
||||||
|
if (UseMemSetInBOT) {
|
||||||
|
memset(&_offset_array[index_for(left)], offset, num_cards);
|
||||||
|
} else {
|
||||||
|
size_t i = index_for(left);
|
||||||
|
const size_t end = i + num_cards;
|
||||||
|
for (; i < end; i++) {
|
||||||
|
_offset_array[i] = offset;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////
|
||||||
// G1BlockOffsetArray
|
// G1BlockOffsetArray
|
||||||
@ -107,7 +122,7 @@ G1BlockOffsetArray::G1BlockOffsetArray(G1BlockOffsetSharedArray* array,
|
|||||||
MemRegion mr, bool init_to_zero) :
|
MemRegion mr, bool init_to_zero) :
|
||||||
G1BlockOffsetTable(mr.start(), mr.end()),
|
G1BlockOffsetTable(mr.start(), mr.end()),
|
||||||
_unallocated_block(_bottom),
|
_unallocated_block(_bottom),
|
||||||
_array(array), _csp(NULL),
|
_array(array), _gsp(NULL),
|
||||||
_init_to_zero(init_to_zero) {
|
_init_to_zero(init_to_zero) {
|
||||||
assert(_bottom <= _end, "arguments out of order");
|
assert(_bottom <= _end, "arguments out of order");
|
||||||
if (!_init_to_zero) {
|
if (!_init_to_zero) {
|
||||||
@ -117,9 +132,8 @@ G1BlockOffsetArray::G1BlockOffsetArray(G1BlockOffsetSharedArray* array,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void G1BlockOffsetArray::set_space(Space* sp) {
|
void G1BlockOffsetArray::set_space(G1OffsetTableContigSpace* sp) {
|
||||||
_sp = sp;
|
_gsp = sp;
|
||||||
_csp = sp->toContiguousSpace();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// The arguments follow the normal convention of denoting
|
// The arguments follow the normal convention of denoting
|
||||||
@ -378,7 +392,7 @@ G1BlockOffsetArray::block_start_unsafe_const(const void* addr) const {
|
|||||||
}
|
}
|
||||||
// Otherwise, find the block start using the table.
|
// Otherwise, find the block start using the table.
|
||||||
HeapWord* q = block_at_or_preceding(addr, false, 0);
|
HeapWord* q = block_at_or_preceding(addr, false, 0);
|
||||||
HeapWord* n = q + _sp->block_size(q);
|
HeapWord* n = q + block_size(q);
|
||||||
return forward_to_block_containing_addr_const(q, n, addr);
|
return forward_to_block_containing_addr_const(q, n, addr);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -406,31 +420,17 @@ G1BlockOffsetArray::forward_to_block_containing_addr_slow(HeapWord* q,
|
|||||||
err_msg("next_boundary is beyond the end of the covered region "
|
err_msg("next_boundary is beyond the end of the covered region "
|
||||||
" next_boundary " PTR_FORMAT " _array->_end " PTR_FORMAT,
|
" next_boundary " PTR_FORMAT " _array->_end " PTR_FORMAT,
|
||||||
next_boundary, _array->_end));
|
next_boundary, _array->_end));
|
||||||
if (csp() != NULL) {
|
if (addr >= gsp()->top()) return gsp()->top();
|
||||||
if (addr >= csp()->top()) return csp()->top();
|
while (next_boundary < addr) {
|
||||||
while (next_boundary < addr) {
|
while (n <= next_boundary) {
|
||||||
while (n <= next_boundary) {
|
q = n;
|
||||||
q = n;
|
oop obj = oop(q);
|
||||||
oop obj = oop(q);
|
if (obj->klass_or_null() == NULL) return q;
|
||||||
if (obj->klass_or_null() == NULL) return q;
|
n += obj->size();
|
||||||
n += obj->size();
|
|
||||||
}
|
|
||||||
assert(q <= next_boundary && n > next_boundary, "Consequence of loop");
|
|
||||||
// [q, n) is the block that crosses the boundary.
|
|
||||||
alloc_block_work2(&next_boundary, &next_index, q, n);
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
while (next_boundary < addr) {
|
|
||||||
while (n <= next_boundary) {
|
|
||||||
q = n;
|
|
||||||
oop obj = oop(q);
|
|
||||||
if (obj->klass_or_null() == NULL) return q;
|
|
||||||
n += _sp->block_size(q);
|
|
||||||
}
|
|
||||||
assert(q <= next_boundary && n > next_boundary, "Consequence of loop");
|
|
||||||
// [q, n) is the block that crosses the boundary.
|
|
||||||
alloc_block_work2(&next_boundary, &next_index, q, n);
|
|
||||||
}
|
}
|
||||||
|
assert(q <= next_boundary && n > next_boundary, "Consequence of loop");
|
||||||
|
// [q, n) is the block that crosses the boundary.
|
||||||
|
alloc_block_work2(&next_boundary, &next_index, q, n);
|
||||||
}
|
}
|
||||||
return forward_to_block_containing_addr_const(q, n, addr);
|
return forward_to_block_containing_addr_const(q, n, addr);
|
||||||
}
|
}
|
||||||
@ -637,7 +637,7 @@ block_start_unsafe_const(const void* addr) const {
|
|||||||
assert(_bottom <= addr && addr < _end,
|
assert(_bottom <= addr && addr < _end,
|
||||||
"addr must be covered by this Array");
|
"addr must be covered by this Array");
|
||||||
HeapWord* q = block_at_or_preceding(addr, true, _next_offset_index-1);
|
HeapWord* q = block_at_or_preceding(addr, true, _next_offset_index-1);
|
||||||
HeapWord* n = q + _sp->block_size(q);
|
HeapWord* n = q + block_size(q);
|
||||||
return forward_to_block_containing_addr_const(q, n, addr);
|
return forward_to_block_containing_addr_const(q, n, addr);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -52,8 +52,8 @@
|
|||||||
// consolidation.
|
// consolidation.
|
||||||
|
|
||||||
// Forward declarations
|
// Forward declarations
|
||||||
class ContiguousSpace;
|
|
||||||
class G1BlockOffsetSharedArray;
|
class G1BlockOffsetSharedArray;
|
||||||
|
class G1OffsetTableContigSpace;
|
||||||
|
|
||||||
class G1BlockOffsetTable VALUE_OBJ_CLASS_SPEC {
|
class G1BlockOffsetTable VALUE_OBJ_CLASS_SPEC {
|
||||||
friend class VMStructs;
|
friend class VMStructs;
|
||||||
@ -157,6 +157,8 @@ private:
|
|||||||
return _offset_array[index];
|
return _offset_array[index];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void set_offset_array(HeapWord* left, HeapWord* right, u_char offset);
|
||||||
|
|
||||||
void set_offset_array(size_t index, u_char offset) {
|
void set_offset_array(size_t index, u_char offset) {
|
||||||
check_index(index, "index out of range");
|
check_index(index, "index out of range");
|
||||||
check_offset(offset, "offset too large");
|
check_offset(offset, "offset too large");
|
||||||
@ -170,21 +172,6 @@ private:
|
|||||||
_offset_array[index] = (u_char) pointer_delta(high, low);
|
_offset_array[index] = (u_char) pointer_delta(high, low);
|
||||||
}
|
}
|
||||||
|
|
||||||
void set_offset_array(HeapWord* left, HeapWord* right, u_char offset) {
|
|
||||||
check_index(index_for(right - 1), "right address out of range");
|
|
||||||
assert(left < right, "Heap addresses out of order");
|
|
||||||
size_t num_cards = pointer_delta(right, left) >> LogN_words;
|
|
||||||
if (UseMemSetInBOT) {
|
|
||||||
memset(&_offset_array[index_for(left)], offset, num_cards);
|
|
||||||
} else {
|
|
||||||
size_t i = index_for(left);
|
|
||||||
const size_t end = i + num_cards;
|
|
||||||
for (; i < end; i++) {
|
|
||||||
_offset_array[i] = offset;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void set_offset_array(size_t left, size_t right, u_char offset) {
|
void set_offset_array(size_t left, size_t right, u_char offset) {
|
||||||
check_index(right, "right index out of range");
|
check_index(right, "right index out of range");
|
||||||
assert(left <= right, "indexes out of order");
|
assert(left <= right, "indexes out of order");
|
||||||
@ -281,11 +268,7 @@ private:
|
|||||||
G1BlockOffsetSharedArray* _array;
|
G1BlockOffsetSharedArray* _array;
|
||||||
|
|
||||||
// The space that owns this subregion.
|
// The space that owns this subregion.
|
||||||
Space* _sp;
|
G1OffsetTableContigSpace* _gsp;
|
||||||
|
|
||||||
// If "_sp" is a contiguous space, the field below is the view of "_sp"
|
|
||||||
// as a contiguous space, else NULL.
|
|
||||||
ContiguousSpace* _csp;
|
|
||||||
|
|
||||||
// If true, array entries are initialized to 0; otherwise, they are
|
// If true, array entries are initialized to 0; otherwise, they are
|
||||||
// initialized to point backwards to the beginning of the covered region.
|
// initialized to point backwards to the beginning of the covered region.
|
||||||
@ -310,7 +293,9 @@ private:
|
|||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
ContiguousSpace* csp() const { return _csp; }
|
G1OffsetTableContigSpace* gsp() const { return _gsp; }
|
||||||
|
|
||||||
|
inline size_t block_size(const HeapWord* p) const;
|
||||||
|
|
||||||
// Returns the address of a block whose start is at most "addr".
|
// Returns the address of a block whose start is at most "addr".
|
||||||
// If "has_max_index" is true, "assumes "max_index" is the last valid one
|
// If "has_max_index" is true, "assumes "max_index" is the last valid one
|
||||||
@ -363,7 +348,7 @@ public:
|
|||||||
// "this" to be passed as a parameter to a member constructor for
|
// "this" to be passed as a parameter to a member constructor for
|
||||||
// the containing concrete subtype of Space.
|
// the containing concrete subtype of Space.
|
||||||
// This would be legal C++, but MS VC++ doesn't allow it.
|
// This would be legal C++, but MS VC++ doesn't allow it.
|
||||||
void set_space(Space* sp);
|
void set_space(G1OffsetTableContigSpace* sp);
|
||||||
|
|
||||||
// Resets the covered region to the given "mr".
|
// Resets the covered region to the given "mr".
|
||||||
void set_region(MemRegion mr);
|
void set_region(MemRegion mr);
|
||||||
|
@ -26,6 +26,7 @@
|
|||||||
#define SHARE_VM_GC_IMPLEMENTATION_G1_G1BLOCKOFFSETTABLE_INLINE_HPP
|
#define SHARE_VM_GC_IMPLEMENTATION_G1_G1BLOCKOFFSETTABLE_INLINE_HPP
|
||||||
|
|
||||||
#include "gc_implementation/g1/g1BlockOffsetTable.hpp"
|
#include "gc_implementation/g1/g1BlockOffsetTable.hpp"
|
||||||
|
#include "gc_implementation/g1/heapRegion.hpp"
|
||||||
#include "memory/space.hpp"
|
#include "memory/space.hpp"
|
||||||
|
|
||||||
inline HeapWord* G1BlockOffsetTable::block_start(const void* addr) {
|
inline HeapWord* G1BlockOffsetTable::block_start(const void* addr) {
|
||||||
@ -69,6 +70,11 @@ G1BlockOffsetSharedArray::address_for_index(size_t index) const {
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
inline size_t
|
||||||
|
G1BlockOffsetArray::block_size(const HeapWord* p) const {
|
||||||
|
return gsp()->block_size(p);
|
||||||
|
}
|
||||||
|
|
||||||
inline HeapWord*
|
inline HeapWord*
|
||||||
G1BlockOffsetArray::block_at_or_preceding(const void* addr,
|
G1BlockOffsetArray::block_at_or_preceding(const void* addr,
|
||||||
bool has_max_index,
|
bool has_max_index,
|
||||||
@ -88,7 +94,7 @@ G1BlockOffsetArray::block_at_or_preceding(const void* addr,
|
|||||||
// to go back by.
|
// to go back by.
|
||||||
size_t n_cards_back = BlockOffsetArray::entry_to_cards_back(offset);
|
size_t n_cards_back = BlockOffsetArray::entry_to_cards_back(offset);
|
||||||
q -= (N_words * n_cards_back);
|
q -= (N_words * n_cards_back);
|
||||||
assert(q >= _sp->bottom(), "Went below bottom!");
|
assert(q >= gsp()->bottom(), "Went below bottom!");
|
||||||
index -= n_cards_back;
|
index -= n_cards_back;
|
||||||
offset = _array->offset_array(index);
|
offset = _array->offset_array(index);
|
||||||
}
|
}
|
||||||
@ -101,21 +107,12 @@ inline HeapWord*
|
|||||||
G1BlockOffsetArray::
|
G1BlockOffsetArray::
|
||||||
forward_to_block_containing_addr_const(HeapWord* q, HeapWord* n,
|
forward_to_block_containing_addr_const(HeapWord* q, HeapWord* n,
|
||||||
const void* addr) const {
|
const void* addr) const {
|
||||||
if (csp() != NULL) {
|
if (addr >= gsp()->top()) return gsp()->top();
|
||||||
if (addr >= csp()->top()) return csp()->top();
|
while (n <= addr) {
|
||||||
while (n <= addr) {
|
q = n;
|
||||||
q = n;
|
oop obj = oop(q);
|
||||||
oop obj = oop(q);
|
if (obj->klass_or_null() == NULL) return q;
|
||||||
if (obj->klass_or_null() == NULL) return q;
|
n += obj->size();
|
||||||
n += obj->size();
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
while (n <= addr) {
|
|
||||||
q = n;
|
|
||||||
oop obj = oop(q);
|
|
||||||
if (obj->klass_or_null() == NULL) return q;
|
|
||||||
n += _sp->block_size(q);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
assert(q <= n, "wrong order for q and addr");
|
assert(q <= n, "wrong order for q and addr");
|
||||||
assert(addr < n, "wrong order for addr and n");
|
assert(addr < n, "wrong order for addr and n");
|
||||||
@ -126,7 +123,7 @@ inline HeapWord*
|
|||||||
G1BlockOffsetArray::forward_to_block_containing_addr(HeapWord* q,
|
G1BlockOffsetArray::forward_to_block_containing_addr(HeapWord* q,
|
||||||
const void* addr) {
|
const void* addr) {
|
||||||
if (oop(q)->klass_or_null() == NULL) return q;
|
if (oop(q)->klass_or_null() == NULL) return q;
|
||||||
HeapWord* n = q + _sp->block_size(q);
|
HeapWord* n = q + block_size(q);
|
||||||
// In the normal case, where the query "addr" is a card boundary, and the
|
// In the normal case, where the query "addr" is a card boundary, and the
|
||||||
// offset table chunks are the same size as cards, the block starting at
|
// offset table chunks are the same size as cards, the block starting at
|
||||||
// "q" will contain addr, so the test below will fail, and we'll fall
|
// "q" will contain addr, so the test below will fail, and we'll fall
|
||||||
|
@ -62,6 +62,7 @@
|
|||||||
#include "memory/referenceProcessor.hpp"
|
#include "memory/referenceProcessor.hpp"
|
||||||
#include "oops/oop.inline.hpp"
|
#include "oops/oop.inline.hpp"
|
||||||
#include "oops/oop.pcgc.inline.hpp"
|
#include "oops/oop.pcgc.inline.hpp"
|
||||||
|
#include "runtime/atomic.inline.hpp"
|
||||||
#include "runtime/prefetch.inline.hpp"
|
#include "runtime/prefetch.inline.hpp"
|
||||||
#include "runtime/orderAccess.inline.hpp"
|
#include "runtime/orderAccess.inline.hpp"
|
||||||
#include "runtime/vmThread.hpp"
|
#include "runtime/vmThread.hpp"
|
||||||
@ -1298,7 +1299,7 @@ bool G1CollectedHeap::do_collection(bool explicit_gc,
|
|||||||
TraceCPUTime tcpu(G1Log::finer(), true, gclog_or_tty);
|
TraceCPUTime tcpu(G1Log::finer(), true, gclog_or_tty);
|
||||||
|
|
||||||
{
|
{
|
||||||
GCTraceTime t(GCCauseString("Full GC", gc_cause()), G1Log::fine(), true, NULL);
|
GCTraceTime t(GCCauseString("Full GC", gc_cause()), G1Log::fine(), true, NULL, gc_tracer->gc_id());
|
||||||
TraceCollectorStats tcs(g1mm()->full_collection_counters());
|
TraceCollectorStats tcs(g1mm()->full_collection_counters());
|
||||||
TraceMemoryManagerStats tms(true /* fullGC */, gc_cause());
|
TraceMemoryManagerStats tms(true /* fullGC */, gc_cause());
|
||||||
|
|
||||||
@ -3858,8 +3859,7 @@ void G1CollectedHeap::log_gc_header() {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
gclog_or_tty->date_stamp(PrintGCDateStamps);
|
gclog_or_tty->gclog_stamp(_gc_tracer_stw->gc_id());
|
||||||
gclog_or_tty->stamp(PrintGCTimeStamps);
|
|
||||||
|
|
||||||
GCCauseString gc_cause_str = GCCauseString("GC pause", gc_cause())
|
GCCauseString gc_cause_str = GCCauseString("GC pause", gc_cause())
|
||||||
.append(g1_policy()->gcs_are_young() ? "(young)" : "(mixed)")
|
.append(g1_policy()->gcs_are_young() ? "(young)" : "(mixed)")
|
||||||
@ -5340,17 +5340,14 @@ public:
|
|||||||
class G1CopyingKeepAliveClosure: public OopClosure {
|
class G1CopyingKeepAliveClosure: public OopClosure {
|
||||||
G1CollectedHeap* _g1h;
|
G1CollectedHeap* _g1h;
|
||||||
OopClosure* _copy_non_heap_obj_cl;
|
OopClosure* _copy_non_heap_obj_cl;
|
||||||
OopsInHeapRegionClosure* _copy_metadata_obj_cl;
|
|
||||||
G1ParScanThreadState* _par_scan_state;
|
G1ParScanThreadState* _par_scan_state;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
G1CopyingKeepAliveClosure(G1CollectedHeap* g1h,
|
G1CopyingKeepAliveClosure(G1CollectedHeap* g1h,
|
||||||
OopClosure* non_heap_obj_cl,
|
OopClosure* non_heap_obj_cl,
|
||||||
OopsInHeapRegionClosure* metadata_obj_cl,
|
|
||||||
G1ParScanThreadState* pss):
|
G1ParScanThreadState* pss):
|
||||||
_g1h(g1h),
|
_g1h(g1h),
|
||||||
_copy_non_heap_obj_cl(non_heap_obj_cl),
|
_copy_non_heap_obj_cl(non_heap_obj_cl),
|
||||||
_copy_metadata_obj_cl(metadata_obj_cl),
|
|
||||||
_par_scan_state(pss)
|
_par_scan_state(pss)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
@ -5383,7 +5380,7 @@ public:
|
|||||||
_par_scan_state->push_on_queue(p);
|
_par_scan_state->push_on_queue(p);
|
||||||
} else {
|
} else {
|
||||||
assert(!Metaspace::contains((const void*)p),
|
assert(!Metaspace::contains((const void*)p),
|
||||||
err_msg("Otherwise need to call _copy_metadata_obj_cl->do_oop(p) "
|
err_msg("Unexpectedly found a pointer from metadata: "
|
||||||
PTR_FORMAT, p));
|
PTR_FORMAT, p));
|
||||||
_copy_non_heap_obj_cl->do_oop(p);
|
_copy_non_heap_obj_cl->do_oop(p);
|
||||||
}
|
}
|
||||||
@ -5478,22 +5475,18 @@ public:
|
|||||||
pss.set_evac_failure_closure(&evac_failure_cl);
|
pss.set_evac_failure_closure(&evac_failure_cl);
|
||||||
|
|
||||||
G1ParScanExtRootClosure only_copy_non_heap_cl(_g1h, &pss, NULL);
|
G1ParScanExtRootClosure only_copy_non_heap_cl(_g1h, &pss, NULL);
|
||||||
G1ParScanMetadataClosure only_copy_metadata_cl(_g1h, &pss, NULL);
|
|
||||||
|
|
||||||
G1ParScanAndMarkExtRootClosure copy_mark_non_heap_cl(_g1h, &pss, NULL);
|
G1ParScanAndMarkExtRootClosure copy_mark_non_heap_cl(_g1h, &pss, NULL);
|
||||||
G1ParScanAndMarkMetadataClosure copy_mark_metadata_cl(_g1h, &pss, NULL);
|
|
||||||
|
|
||||||
OopClosure* copy_non_heap_cl = &only_copy_non_heap_cl;
|
OopClosure* copy_non_heap_cl = &only_copy_non_heap_cl;
|
||||||
OopsInHeapRegionClosure* copy_metadata_cl = &only_copy_metadata_cl;
|
|
||||||
|
|
||||||
if (_g1h->g1_policy()->during_initial_mark_pause()) {
|
if (_g1h->g1_policy()->during_initial_mark_pause()) {
|
||||||
// We also need to mark copied objects.
|
// We also need to mark copied objects.
|
||||||
copy_non_heap_cl = ©_mark_non_heap_cl;
|
copy_non_heap_cl = ©_mark_non_heap_cl;
|
||||||
copy_metadata_cl = ©_mark_metadata_cl;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Keep alive closure.
|
// Keep alive closure.
|
||||||
G1CopyingKeepAliveClosure keep_alive(_g1h, copy_non_heap_cl, copy_metadata_cl, &pss);
|
G1CopyingKeepAliveClosure keep_alive(_g1h, copy_non_heap_cl, &pss);
|
||||||
|
|
||||||
// Complete GC closure
|
// Complete GC closure
|
||||||
G1ParEvacuateFollowersClosure drain_queue(_g1h, &pss, _task_queues, _terminator);
|
G1ParEvacuateFollowersClosure drain_queue(_g1h, &pss, _task_queues, _terminator);
|
||||||
@ -5588,18 +5581,14 @@ public:
|
|||||||
|
|
||||||
|
|
||||||
G1ParScanExtRootClosure only_copy_non_heap_cl(_g1h, &pss, NULL);
|
G1ParScanExtRootClosure only_copy_non_heap_cl(_g1h, &pss, NULL);
|
||||||
G1ParScanMetadataClosure only_copy_metadata_cl(_g1h, &pss, NULL);
|
|
||||||
|
|
||||||
G1ParScanAndMarkExtRootClosure copy_mark_non_heap_cl(_g1h, &pss, NULL);
|
G1ParScanAndMarkExtRootClosure copy_mark_non_heap_cl(_g1h, &pss, NULL);
|
||||||
G1ParScanAndMarkMetadataClosure copy_mark_metadata_cl(_g1h, &pss, NULL);
|
|
||||||
|
|
||||||
OopClosure* copy_non_heap_cl = &only_copy_non_heap_cl;
|
OopClosure* copy_non_heap_cl = &only_copy_non_heap_cl;
|
||||||
OopsInHeapRegionClosure* copy_metadata_cl = &only_copy_metadata_cl;
|
|
||||||
|
|
||||||
if (_g1h->g1_policy()->during_initial_mark_pause()) {
|
if (_g1h->g1_policy()->during_initial_mark_pause()) {
|
||||||
// We also need to mark copied objects.
|
// We also need to mark copied objects.
|
||||||
copy_non_heap_cl = ©_mark_non_heap_cl;
|
copy_non_heap_cl = ©_mark_non_heap_cl;
|
||||||
copy_metadata_cl = ©_mark_metadata_cl;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Is alive closure
|
// Is alive closure
|
||||||
@ -5607,7 +5596,7 @@ public:
|
|||||||
|
|
||||||
// Copying keep alive closure. Applied to referent objects that need
|
// Copying keep alive closure. Applied to referent objects that need
|
||||||
// to be copied.
|
// to be copied.
|
||||||
G1CopyingKeepAliveClosure keep_alive(_g1h, copy_non_heap_cl, copy_metadata_cl, &pss);
|
G1CopyingKeepAliveClosure keep_alive(_g1h, copy_non_heap_cl, &pss);
|
||||||
|
|
||||||
ReferenceProcessor* rp = _g1h->ref_processor_cm();
|
ReferenceProcessor* rp = _g1h->ref_processor_cm();
|
||||||
|
|
||||||
@ -5713,22 +5702,18 @@ void G1CollectedHeap::process_discovered_references(uint no_of_gc_workers) {
|
|||||||
assert(pss.refs()->is_empty(), "pre-condition");
|
assert(pss.refs()->is_empty(), "pre-condition");
|
||||||
|
|
||||||
G1ParScanExtRootClosure only_copy_non_heap_cl(this, &pss, NULL);
|
G1ParScanExtRootClosure only_copy_non_heap_cl(this, &pss, NULL);
|
||||||
G1ParScanMetadataClosure only_copy_metadata_cl(this, &pss, NULL);
|
|
||||||
|
|
||||||
G1ParScanAndMarkExtRootClosure copy_mark_non_heap_cl(this, &pss, NULL);
|
G1ParScanAndMarkExtRootClosure copy_mark_non_heap_cl(this, &pss, NULL);
|
||||||
G1ParScanAndMarkMetadataClosure copy_mark_metadata_cl(this, &pss, NULL);
|
|
||||||
|
|
||||||
OopClosure* copy_non_heap_cl = &only_copy_non_heap_cl;
|
OopClosure* copy_non_heap_cl = &only_copy_non_heap_cl;
|
||||||
OopsInHeapRegionClosure* copy_metadata_cl = &only_copy_metadata_cl;
|
|
||||||
|
|
||||||
if (_g1h->g1_policy()->during_initial_mark_pause()) {
|
if (_g1h->g1_policy()->during_initial_mark_pause()) {
|
||||||
// We also need to mark copied objects.
|
// We also need to mark copied objects.
|
||||||
copy_non_heap_cl = ©_mark_non_heap_cl;
|
copy_non_heap_cl = ©_mark_non_heap_cl;
|
||||||
copy_metadata_cl = ©_mark_metadata_cl;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Keep alive closure.
|
// Keep alive closure.
|
||||||
G1CopyingKeepAliveClosure keep_alive(this, copy_non_heap_cl, copy_metadata_cl, &pss);
|
G1CopyingKeepAliveClosure keep_alive(this, copy_non_heap_cl, &pss);
|
||||||
|
|
||||||
// Serial Complete GC closure
|
// Serial Complete GC closure
|
||||||
G1STWDrainQueueClosure drain_queue(this, &pss);
|
G1STWDrainQueueClosure drain_queue(this, &pss);
|
||||||
@ -5743,7 +5728,8 @@ void G1CollectedHeap::process_discovered_references(uint no_of_gc_workers) {
|
|||||||
&keep_alive,
|
&keep_alive,
|
||||||
&drain_queue,
|
&drain_queue,
|
||||||
NULL,
|
NULL,
|
||||||
_gc_timer_stw);
|
_gc_timer_stw,
|
||||||
|
_gc_tracer_stw->gc_id());
|
||||||
} else {
|
} else {
|
||||||
// Parallel reference processing
|
// Parallel reference processing
|
||||||
assert(rp->num_q() == no_of_gc_workers, "sanity");
|
assert(rp->num_q() == no_of_gc_workers, "sanity");
|
||||||
@ -5754,7 +5740,8 @@ void G1CollectedHeap::process_discovered_references(uint no_of_gc_workers) {
|
|||||||
&keep_alive,
|
&keep_alive,
|
||||||
&drain_queue,
|
&drain_queue,
|
||||||
&par_task_executor,
|
&par_task_executor,
|
||||||
_gc_timer_stw);
|
_gc_timer_stw,
|
||||||
|
_gc_tracer_stw->gc_id());
|
||||||
}
|
}
|
||||||
|
|
||||||
_gc_tracer_stw->report_gc_reference_stats(stats);
|
_gc_tracer_stw->report_gc_reference_stats(stats);
|
||||||
@ -6993,7 +6980,7 @@ public:
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ScavengeRootsInCode && nm->detect_scavenge_root_oops()) {
|
if (ScavengeRootsInCode) {
|
||||||
_g1h->register_nmethod(nm);
|
_g1h->register_nmethod(nm);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -28,6 +28,7 @@
|
|||||||
#include "gc_implementation/g1/g1GCPhaseTimes.hpp"
|
#include "gc_implementation/g1/g1GCPhaseTimes.hpp"
|
||||||
#include "gc_implementation/g1/g1Log.hpp"
|
#include "gc_implementation/g1/g1Log.hpp"
|
||||||
#include "gc_implementation/g1/g1StringDedup.hpp"
|
#include "gc_implementation/g1/g1StringDedup.hpp"
|
||||||
|
#include "runtime/atomic.inline.hpp"
|
||||||
|
|
||||||
// Helper class for avoiding interleaved logging
|
// Helper class for avoiding interleaved logging
|
||||||
class LineBuffer: public StackObj {
|
class LineBuffer: public StackObj {
|
||||||
|
@ -28,7 +28,7 @@
|
|||||||
#include "gc_implementation/g1/g1HotCardCache.hpp"
|
#include "gc_implementation/g1/g1HotCardCache.hpp"
|
||||||
#include "gc_implementation/g1/g1RemSet.hpp"
|
#include "gc_implementation/g1/g1RemSet.hpp"
|
||||||
#include "gc_implementation/g1/heapRegion.hpp"
|
#include "gc_implementation/g1/heapRegion.hpp"
|
||||||
#include "runtime/atomic.hpp"
|
#include "runtime/atomic.inline.hpp"
|
||||||
|
|
||||||
G1HotCardCache::G1HotCardCache(G1CollectedHeap *g1h):
|
G1HotCardCache::G1HotCardCache(G1CollectedHeap *g1h):
|
||||||
_g1h(g1h), _hot_cache(NULL), _use_cache(false), _card_counts(g1h) {}
|
_g1h(g1h), _hot_cache(NULL), _use_cache(false), _card_counts(g1h) {}
|
||||||
|
@ -44,6 +44,7 @@
|
|||||||
#include "oops/instanceRefKlass.hpp"
|
#include "oops/instanceRefKlass.hpp"
|
||||||
#include "oops/oop.inline.hpp"
|
#include "oops/oop.inline.hpp"
|
||||||
#include "prims/jvmtiExport.hpp"
|
#include "prims/jvmtiExport.hpp"
|
||||||
|
#include "runtime/atomic.inline.hpp"
|
||||||
#include "runtime/biasedLocking.hpp"
|
#include "runtime/biasedLocking.hpp"
|
||||||
#include "runtime/fprofiler.hpp"
|
#include "runtime/fprofiler.hpp"
|
||||||
#include "runtime/synchronizer.hpp"
|
#include "runtime/synchronizer.hpp"
|
||||||
@ -123,7 +124,7 @@ void G1MarkSweep::allocate_stacks() {
|
|||||||
void G1MarkSweep::mark_sweep_phase1(bool& marked_for_unloading,
|
void G1MarkSweep::mark_sweep_phase1(bool& marked_for_unloading,
|
||||||
bool clear_all_softrefs) {
|
bool clear_all_softrefs) {
|
||||||
// Recursively traverse all live objects and mark them
|
// Recursively traverse all live objects and mark them
|
||||||
GCTraceTime tm("phase 1", G1Log::fine() && Verbose, true, gc_timer());
|
GCTraceTime tm("phase 1", G1Log::fine() && Verbose, true, gc_timer(), gc_tracer()->gc_id());
|
||||||
GenMarkSweep::trace(" 1");
|
GenMarkSweep::trace(" 1");
|
||||||
|
|
||||||
SharedHeap* sh = SharedHeap::heap();
|
SharedHeap* sh = SharedHeap::heap();
|
||||||
@ -146,7 +147,8 @@ void G1MarkSweep::mark_sweep_phase1(bool& marked_for_unloading,
|
|||||||
&GenMarkSweep::keep_alive,
|
&GenMarkSweep::keep_alive,
|
||||||
&GenMarkSweep::follow_stack_closure,
|
&GenMarkSweep::follow_stack_closure,
|
||||||
NULL,
|
NULL,
|
||||||
gc_timer());
|
gc_timer(),
|
||||||
|
gc_tracer()->gc_id());
|
||||||
gc_tracer()->report_gc_reference_stats(stats);
|
gc_tracer()->report_gc_reference_stats(stats);
|
||||||
|
|
||||||
|
|
||||||
@ -260,7 +262,7 @@ void G1MarkSweep::mark_sweep_phase2() {
|
|||||||
|
|
||||||
G1CollectedHeap* g1h = G1CollectedHeap::heap();
|
G1CollectedHeap* g1h = G1CollectedHeap::heap();
|
||||||
|
|
||||||
GCTraceTime tm("phase 2", G1Log::fine() && Verbose, true, gc_timer());
|
GCTraceTime tm("phase 2", G1Log::fine() && Verbose, true, gc_timer(), gc_tracer()->gc_id());
|
||||||
GenMarkSweep::trace("2");
|
GenMarkSweep::trace("2");
|
||||||
|
|
||||||
// find the first region
|
// find the first region
|
||||||
@ -297,7 +299,7 @@ void G1MarkSweep::mark_sweep_phase3() {
|
|||||||
G1CollectedHeap* g1h = G1CollectedHeap::heap();
|
G1CollectedHeap* g1h = G1CollectedHeap::heap();
|
||||||
|
|
||||||
// Adjust the pointers to reflect the new locations
|
// Adjust the pointers to reflect the new locations
|
||||||
GCTraceTime tm("phase 3", G1Log::fine() && Verbose, true, gc_timer());
|
GCTraceTime tm("phase 3", G1Log::fine() && Verbose, true, gc_timer(), gc_tracer()->gc_id());
|
||||||
GenMarkSweep::trace("3");
|
GenMarkSweep::trace("3");
|
||||||
|
|
||||||
SharedHeap* sh = SharedHeap::heap();
|
SharedHeap* sh = SharedHeap::heap();
|
||||||
@ -358,7 +360,7 @@ void G1MarkSweep::mark_sweep_phase4() {
|
|||||||
// to use a higher index (saved from phase2) when verifying perm_gen.
|
// to use a higher index (saved from phase2) when verifying perm_gen.
|
||||||
G1CollectedHeap* g1h = G1CollectedHeap::heap();
|
G1CollectedHeap* g1h = G1CollectedHeap::heap();
|
||||||
|
|
||||||
GCTraceTime tm("phase 4", G1Log::fine() && Verbose, true, gc_timer());
|
GCTraceTime tm("phase 4", G1Log::fine() && Verbose, true, gc_timer(), gc_tracer()->gc_id());
|
||||||
GenMarkSweep::trace("4");
|
GenMarkSweep::trace("4");
|
||||||
|
|
||||||
G1SpaceCompactClosure blk;
|
G1SpaceCompactClosure blk;
|
||||||
|
@ -26,6 +26,7 @@
|
|||||||
#include "gc_implementation/g1/g1SATBCardTableModRefBS.hpp"
|
#include "gc_implementation/g1/g1SATBCardTableModRefBS.hpp"
|
||||||
#include "gc_implementation/g1/heapRegion.hpp"
|
#include "gc_implementation/g1/heapRegion.hpp"
|
||||||
#include "gc_implementation/g1/satbQueue.hpp"
|
#include "gc_implementation/g1/satbQueue.hpp"
|
||||||
|
#include "runtime/atomic.inline.hpp"
|
||||||
#include "runtime/mutexLocker.hpp"
|
#include "runtime/mutexLocker.hpp"
|
||||||
#include "runtime/orderAccess.inline.hpp"
|
#include "runtime/orderAccess.inline.hpp"
|
||||||
#include "runtime/thread.inline.hpp"
|
#include "runtime/thread.inline.hpp"
|
||||||
|
@ -31,6 +31,7 @@
|
|||||||
#include "gc_implementation/g1/g1StringDedupStat.hpp"
|
#include "gc_implementation/g1/g1StringDedupStat.hpp"
|
||||||
#include "gc_implementation/g1/g1StringDedupTable.hpp"
|
#include "gc_implementation/g1/g1StringDedupTable.hpp"
|
||||||
#include "gc_implementation/g1/g1StringDedupThread.hpp"
|
#include "gc_implementation/g1/g1StringDedupThread.hpp"
|
||||||
|
#include "runtime/atomic.inline.hpp"
|
||||||
|
|
||||||
bool G1StringDedup::_enabled = false;
|
bool G1StringDedup::_enabled = false;
|
||||||
|
|
||||||
@ -211,3 +212,16 @@ G1StringDedupUnlinkOrOopsDoClosure::~G1StringDedupUnlinkOrOopsDoClosure() {
|
|||||||
G1StringDedupTable::finish_rehash(_rehashed_table);
|
G1StringDedupTable::finish_rehash(_rehashed_table);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Atomically claims the next available queue for exclusive access by
|
||||||
|
// the current thread. Returns the queue number of the claimed queue.
|
||||||
|
size_t G1StringDedupUnlinkOrOopsDoClosure::claim_queue() {
|
||||||
|
return (size_t)Atomic::add_ptr(1, &_next_queue) - 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Atomically claims the next available table partition for exclusive
|
||||||
|
// access by the current thread. Returns the table bucket number where
|
||||||
|
// the claimed partition starts.
|
||||||
|
size_t G1StringDedupUnlinkOrOopsDoClosure::claim_table_partition(size_t partition_size) {
|
||||||
|
return (size_t)Atomic::add_ptr(partition_size, &_next_bucket) - partition_size;
|
||||||
|
}
|
||||||
|
@ -84,6 +84,7 @@
|
|||||||
|
|
||||||
#include "memory/allocation.hpp"
|
#include "memory/allocation.hpp"
|
||||||
#include "oops/oop.hpp"
|
#include "oops/oop.hpp"
|
||||||
|
#include "runtime/atomic.hpp"
|
||||||
|
|
||||||
class OopClosure;
|
class OopClosure;
|
||||||
class BoolObjectClosure;
|
class BoolObjectClosure;
|
||||||
@ -174,16 +175,12 @@ public:
|
|||||||
|
|
||||||
// Atomically claims the next available queue for exclusive access by
|
// Atomically claims the next available queue for exclusive access by
|
||||||
// the current thread. Returns the queue number of the claimed queue.
|
// the current thread. Returns the queue number of the claimed queue.
|
||||||
size_t claim_queue() {
|
size_t claim_queue();
|
||||||
return (size_t)Atomic::add_ptr(1, &_next_queue) - 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Atomically claims the next available table partition for exclusive
|
// Atomically claims the next available table partition for exclusive
|
||||||
// access by the current thread. Returns the table bucket number where
|
// access by the current thread. Returns the table bucket number where
|
||||||
// the claimed partition starts.
|
// the claimed partition starts.
|
||||||
size_t claim_table_partition(size_t partition_size) {
|
size_t claim_table_partition(size_t partition_size);
|
||||||
return (size_t)Atomic::add_ptr(partition_size, &_next_bucket) - partition_size;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Applies and returns the result from the is_alive closure, or
|
// Applies and returns the result from the is_alive closure, or
|
||||||
// returns true if no such closure was provided.
|
// returns true if no such closure was provided.
|
||||||
|
@ -26,6 +26,7 @@
|
|||||||
#include "classfile/javaClasses.hpp"
|
#include "classfile/javaClasses.hpp"
|
||||||
#include "gc_implementation/g1/g1StringDedupQueue.hpp"
|
#include "gc_implementation/g1/g1StringDedupQueue.hpp"
|
||||||
#include "memory/gcLocker.hpp"
|
#include "memory/gcLocker.hpp"
|
||||||
|
#include "runtime/atomic.inline.hpp"
|
||||||
#include "runtime/mutexLocker.hpp"
|
#include "runtime/mutexLocker.hpp"
|
||||||
#include "utilities/stack.inline.hpp"
|
#include "utilities/stack.inline.hpp"
|
||||||
|
|
||||||
|
@ -28,6 +28,7 @@
|
|||||||
#include "gc_implementation/g1/g1StringDedupTable.hpp"
|
#include "gc_implementation/g1/g1StringDedupTable.hpp"
|
||||||
#include "gc_implementation/g1/g1StringDedupThread.hpp"
|
#include "gc_implementation/g1/g1StringDedupThread.hpp"
|
||||||
#include "gc_implementation/g1/g1StringDedupQueue.hpp"
|
#include "gc_implementation/g1/g1StringDedupQueue.hpp"
|
||||||
|
#include "runtime/atomic.inline.hpp"
|
||||||
|
|
||||||
G1StringDedupThread* G1StringDedupThread::_thread = NULL;
|
G1StringDedupThread* G1StringDedupThread::_thread = NULL;
|
||||||
|
|
||||||
|
@ -34,6 +34,7 @@
|
|||||||
#include "memory/iterator.hpp"
|
#include "memory/iterator.hpp"
|
||||||
#include "memory/space.inline.hpp"
|
#include "memory/space.inline.hpp"
|
||||||
#include "oops/oop.inline.hpp"
|
#include "oops/oop.inline.hpp"
|
||||||
|
#include "runtime/atomic.inline.hpp"
|
||||||
#include "runtime/orderAccess.inline.hpp"
|
#include "runtime/orderAccess.inline.hpp"
|
||||||
|
|
||||||
PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
|
PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
|
||||||
@ -48,7 +49,7 @@ HeapRegionDCTOC::HeapRegionDCTOC(G1CollectedHeap* g1,
|
|||||||
HeapRegion* hr, ExtendedOopClosure* cl,
|
HeapRegion* hr, ExtendedOopClosure* cl,
|
||||||
CardTableModRefBS::PrecisionStyle precision,
|
CardTableModRefBS::PrecisionStyle precision,
|
||||||
FilterKind fk) :
|
FilterKind fk) :
|
||||||
ContiguousSpaceDCTOC(hr, cl, precision, NULL),
|
DirtyCardToOopClosure(hr, cl, precision, NULL),
|
||||||
_hr(hr), _fk(fk), _g1(g1) { }
|
_hr(hr), _fk(fk), _g1(g1) { }
|
||||||
|
|
||||||
FilterOutOfRegionClosure::FilterOutOfRegionClosure(HeapRegion* r,
|
FilterOutOfRegionClosure::FilterOutOfRegionClosure(HeapRegion* r,
|
||||||
@ -77,19 +78,18 @@ HeapWord* walk_mem_region_loop(ClosureType* cl, G1CollectedHeap* g1h,
|
|||||||
return cur;
|
return cur;
|
||||||
}
|
}
|
||||||
|
|
||||||
void HeapRegionDCTOC::walk_mem_region_with_cl(MemRegion mr,
|
void HeapRegionDCTOC::walk_mem_region(MemRegion mr,
|
||||||
HeapWord* bottom,
|
HeapWord* bottom,
|
||||||
HeapWord* top,
|
HeapWord* top) {
|
||||||
ExtendedOopClosure* cl) {
|
|
||||||
G1CollectedHeap* g1h = _g1;
|
G1CollectedHeap* g1h = _g1;
|
||||||
int oop_size;
|
int oop_size;
|
||||||
ExtendedOopClosure* cl2 = NULL;
|
ExtendedOopClosure* cl2 = NULL;
|
||||||
|
|
||||||
FilterIntoCSClosure intoCSFilt(this, g1h, cl);
|
FilterIntoCSClosure intoCSFilt(this, g1h, _cl);
|
||||||
FilterOutOfRegionClosure outOfRegionFilt(_hr, cl);
|
FilterOutOfRegionClosure outOfRegionFilt(_hr, _cl);
|
||||||
|
|
||||||
switch (_fk) {
|
switch (_fk) {
|
||||||
case NoFilterKind: cl2 = cl; break;
|
case NoFilterKind: cl2 = _cl; break;
|
||||||
case IntoCSFilterKind: cl2 = &intoCSFilt; break;
|
case IntoCSFilterKind: cl2 = &intoCSFilt; break;
|
||||||
case OutOfRegionFilterKind: cl2 = &outOfRegionFilt; break;
|
case OutOfRegionFilterKind: cl2 = &outOfRegionFilt; break;
|
||||||
default: ShouldNotReachHere();
|
default: ShouldNotReachHere();
|
||||||
@ -111,17 +111,17 @@ void HeapRegionDCTOC::walk_mem_region_with_cl(MemRegion mr,
|
|||||||
// We replicate the loop below for several kinds of possible filters.
|
// We replicate the loop below for several kinds of possible filters.
|
||||||
switch (_fk) {
|
switch (_fk) {
|
||||||
case NoFilterKind:
|
case NoFilterKind:
|
||||||
bottom = walk_mem_region_loop(cl, g1h, _hr, bottom, top);
|
bottom = walk_mem_region_loop(_cl, g1h, _hr, bottom, top);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case IntoCSFilterKind: {
|
case IntoCSFilterKind: {
|
||||||
FilterIntoCSClosure filt(this, g1h, cl);
|
FilterIntoCSClosure filt(this, g1h, _cl);
|
||||||
bottom = walk_mem_region_loop(&filt, g1h, _hr, bottom, top);
|
bottom = walk_mem_region_loop(&filt, g1h, _hr, bottom, top);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
case OutOfRegionFilterKind: {
|
case OutOfRegionFilterKind: {
|
||||||
FilterOutOfRegionClosure filt(_hr, cl);
|
FilterOutOfRegionClosure filt(_hr, _cl);
|
||||||
bottom = walk_mem_region_loop(&filt, g1h, _hr, bottom, top);
|
bottom = walk_mem_region_loop(&filt, g1h, _hr, bottom, top);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -25,7 +25,7 @@
|
|||||||
#ifndef SHARE_VM_GC_IMPLEMENTATION_G1_HEAPREGION_HPP
|
#ifndef SHARE_VM_GC_IMPLEMENTATION_G1_HEAPREGION_HPP
|
||||||
#define SHARE_VM_GC_IMPLEMENTATION_G1_HEAPREGION_HPP
|
#define SHARE_VM_GC_IMPLEMENTATION_G1_HEAPREGION_HPP
|
||||||
|
|
||||||
#include "gc_implementation/g1/g1BlockOffsetTable.inline.hpp"
|
#include "gc_implementation/g1/g1BlockOffsetTable.hpp"
|
||||||
#include "gc_implementation/g1/g1_specialized_oop_closures.hpp"
|
#include "gc_implementation/g1/g1_specialized_oop_closures.hpp"
|
||||||
#include "gc_implementation/g1/survRateGroup.hpp"
|
#include "gc_implementation/g1/survRateGroup.hpp"
|
||||||
#include "gc_implementation/shared/ageTable.hpp"
|
#include "gc_implementation/shared/ageTable.hpp"
|
||||||
@ -71,7 +71,7 @@ class nmethod;
|
|||||||
// in the concurrent marker used by G1 to filter remembered
|
// in the concurrent marker used by G1 to filter remembered
|
||||||
// sets.
|
// sets.
|
||||||
|
|
||||||
class HeapRegionDCTOC : public ContiguousSpaceDCTOC {
|
class HeapRegionDCTOC : public DirtyCardToOopClosure {
|
||||||
public:
|
public:
|
||||||
// Specification of possible DirtyCardToOopClosure filtering.
|
// Specification of possible DirtyCardToOopClosure filtering.
|
||||||
enum FilterKind {
|
enum FilterKind {
|
||||||
@ -85,39 +85,13 @@ protected:
|
|||||||
FilterKind _fk;
|
FilterKind _fk;
|
||||||
G1CollectedHeap* _g1;
|
G1CollectedHeap* _g1;
|
||||||
|
|
||||||
void walk_mem_region_with_cl(MemRegion mr,
|
|
||||||
HeapWord* bottom, HeapWord* top,
|
|
||||||
ExtendedOopClosure* cl);
|
|
||||||
|
|
||||||
// We don't specialize this for FilteringClosure; filtering is handled by
|
|
||||||
// the "FilterKind" mechanism. But we provide this to avoid a compiler
|
|
||||||
// warning.
|
|
||||||
void walk_mem_region_with_cl(MemRegion mr,
|
|
||||||
HeapWord* bottom, HeapWord* top,
|
|
||||||
FilteringClosure* cl) {
|
|
||||||
HeapRegionDCTOC::walk_mem_region_with_cl(mr, bottom, top,
|
|
||||||
(ExtendedOopClosure*)cl);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Get the actual top of the area on which the closure will
|
|
||||||
// operate, given where the top is assumed to be (the end of the
|
|
||||||
// memory region passed to do_MemRegion) and where the object
|
|
||||||
// at the top is assumed to start. For example, an object may
|
|
||||||
// start at the top but actually extend past the assumed top,
|
|
||||||
// in which case the top becomes the end of the object.
|
|
||||||
HeapWord* get_actual_top(HeapWord* top, HeapWord* top_obj) {
|
|
||||||
return ContiguousSpaceDCTOC::get_actual_top(top, top_obj);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Walk the given memory region from bottom to (actual) top
|
// Walk the given memory region from bottom to (actual) top
|
||||||
// looking for objects and applying the oop closure (_cl) to
|
// looking for objects and applying the oop closure (_cl) to
|
||||||
// them. The base implementation of this treats the area as
|
// them. The base implementation of this treats the area as
|
||||||
// blocks, where a block may or may not be an object. Sub-
|
// blocks, where a block may or may not be an object. Sub-
|
||||||
// classes should override this to provide more accurate
|
// classes should override this to provide more accurate
|
||||||
// or possibly more efficient walking.
|
// or possibly more efficient walking.
|
||||||
void walk_mem_region(MemRegion mr, HeapWord* bottom, HeapWord* top) {
|
void walk_mem_region(MemRegion mr, HeapWord* bottom, HeapWord* top);
|
||||||
Filtering_DCTOC::walk_mem_region(mr, bottom, top);
|
|
||||||
}
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
HeapRegionDCTOC(G1CollectedHeap* g1,
|
HeapRegionDCTOC(G1CollectedHeap* g1,
|
||||||
|
@ -25,6 +25,8 @@
|
|||||||
#ifndef SHARE_VM_GC_IMPLEMENTATION_G1_HEAPREGION_INLINE_HPP
|
#ifndef SHARE_VM_GC_IMPLEMENTATION_G1_HEAPREGION_INLINE_HPP
|
||||||
#define SHARE_VM_GC_IMPLEMENTATION_G1_HEAPREGION_INLINE_HPP
|
#define SHARE_VM_GC_IMPLEMENTATION_G1_HEAPREGION_INLINE_HPP
|
||||||
|
|
||||||
|
#include "gc_implementation/g1/g1BlockOffsetTable.inline.hpp"
|
||||||
|
|
||||||
inline HeapWord* G1OffsetTableContigSpace::allocate(size_t size) {
|
inline HeapWord* G1OffsetTableContigSpace::allocate(size_t size) {
|
||||||
HeapWord* res = ContiguousSpace::allocate(size);
|
HeapWord* res = ContiguousSpace::allocate(size);
|
||||||
if (res != NULL) {
|
if (res != NULL) {
|
||||||
|
@ -32,6 +32,7 @@
|
|||||||
#include "memory/padded.inline.hpp"
|
#include "memory/padded.inline.hpp"
|
||||||
#include "memory/space.inline.hpp"
|
#include "memory/space.inline.hpp"
|
||||||
#include "oops/oop.inline.hpp"
|
#include "oops/oop.inline.hpp"
|
||||||
|
#include "runtime/atomic.inline.hpp"
|
||||||
#include "utilities/bitMap.inline.hpp"
|
#include "utilities/bitMap.inline.hpp"
|
||||||
#include "utilities/globalDefinitions.hpp"
|
#include "utilities/globalDefinitions.hpp"
|
||||||
#include "utilities/growableArray.hpp"
|
#include "utilities/growableArray.hpp"
|
||||||
|
@ -29,6 +29,7 @@
|
|||||||
#include "memory/allocation.inline.hpp"
|
#include "memory/allocation.inline.hpp"
|
||||||
#include "memory/cardTableModRefBS.hpp"
|
#include "memory/cardTableModRefBS.hpp"
|
||||||
#include "memory/space.inline.hpp"
|
#include "memory/space.inline.hpp"
|
||||||
|
#include "runtime/atomic.inline.hpp"
|
||||||
#include "runtime/mutexLocker.hpp"
|
#include "runtime/mutexLocker.hpp"
|
||||||
|
|
||||||
#define SPARSE_PRT_VERBOSE 0
|
#define SPARSE_PRT_VERBOSE 0
|
||||||
|
@ -226,7 +226,7 @@ void VM_CGC_Operation::release_and_notify_pending_list_lock() {
|
|||||||
void VM_CGC_Operation::doit() {
|
void VM_CGC_Operation::doit() {
|
||||||
gclog_or_tty->date_stamp(G1Log::fine() && PrintGCDateStamps);
|
gclog_or_tty->date_stamp(G1Log::fine() && PrintGCDateStamps);
|
||||||
TraceCPUTime tcpu(G1Log::finer(), true, gclog_or_tty);
|
TraceCPUTime tcpu(G1Log::finer(), true, gclog_or_tty);
|
||||||
GCTraceTime t(_printGCMessage, G1Log::fine(), true, G1CollectedHeap::heap()->gc_timer_cm());
|
GCTraceTime t(_printGCMessage, G1Log::fine(), true, G1CollectedHeap::heap()->gc_timer_cm(), G1CollectedHeap::heap()->concurrent_mark()->concurrent_gc_id());
|
||||||
SharedHeap* sh = SharedHeap::heap();
|
SharedHeap* sh = SharedHeap::heap();
|
||||||
// This could go away if CollectedHeap gave access to _gc_is_active...
|
// This could go away if CollectedHeap gave access to _gc_is_active...
|
||||||
if (sh != NULL) {
|
if (sh != NULL) {
|
||||||
|
@ -47,6 +47,7 @@
|
|||||||
#include "oops/objArrayOop.hpp"
|
#include "oops/objArrayOop.hpp"
|
||||||
#include "oops/oop.inline.hpp"
|
#include "oops/oop.inline.hpp"
|
||||||
#include "oops/oop.pcgc.inline.hpp"
|
#include "oops/oop.pcgc.inline.hpp"
|
||||||
|
#include "runtime/atomic.inline.hpp"
|
||||||
#include "runtime/handles.hpp"
|
#include "runtime/handles.hpp"
|
||||||
#include "runtime/handles.inline.hpp"
|
#include "runtime/handles.inline.hpp"
|
||||||
#include "runtime/java.hpp"
|
#include "runtime/java.hpp"
|
||||||
@ -955,7 +956,7 @@ void ParNewGeneration::collect(bool full,
|
|||||||
size_policy->minor_collection_begin();
|
size_policy->minor_collection_begin();
|
||||||
}
|
}
|
||||||
|
|
||||||
GCTraceTime t1(GCCauseString("GC", gch->gc_cause()), PrintGC && !PrintGCDetails, true, NULL);
|
GCTraceTime t1(GCCauseString("GC", gch->gc_cause()), PrintGC && !PrintGCDetails, true, NULL, gc_tracer.gc_id());
|
||||||
// Capture heap used before collection (for printing).
|
// Capture heap used before collection (for printing).
|
||||||
size_t gch_prev_used = gch->used();
|
size_t gch_prev_used = gch->used();
|
||||||
|
|
||||||
@ -1013,14 +1014,14 @@ void ParNewGeneration::collect(bool full,
|
|||||||
ParNewRefProcTaskExecutor task_executor(*this, thread_state_set);
|
ParNewRefProcTaskExecutor task_executor(*this, thread_state_set);
|
||||||
stats = rp->process_discovered_references(&is_alive, &keep_alive,
|
stats = rp->process_discovered_references(&is_alive, &keep_alive,
|
||||||
&evacuate_followers, &task_executor,
|
&evacuate_followers, &task_executor,
|
||||||
_gc_timer);
|
_gc_timer, gc_tracer.gc_id());
|
||||||
} else {
|
} else {
|
||||||
thread_state_set.flush();
|
thread_state_set.flush();
|
||||||
gch->set_par_threads(0); // 0 ==> non-parallel.
|
gch->set_par_threads(0); // 0 ==> non-parallel.
|
||||||
gch->save_marks();
|
gch->save_marks();
|
||||||
stats = rp->process_discovered_references(&is_alive, &keep_alive,
|
stats = rp->process_discovered_references(&is_alive, &keep_alive,
|
||||||
&evacuate_followers, NULL,
|
&evacuate_followers, NULL,
|
||||||
_gc_timer);
|
_gc_timer, gc_tracer.gc_id());
|
||||||
}
|
}
|
||||||
gc_tracer.report_gc_reference_stats(stats);
|
gc_tracer.report_gc_reference_stats(stats);
|
||||||
if (!promotion_failed()) {
|
if (!promotion_failed()) {
|
||||||
|
@ -26,6 +26,7 @@
|
|||||||
#include "gc_implementation/parallelScavenge/parMarkBitMap.hpp"
|
#include "gc_implementation/parallelScavenge/parMarkBitMap.hpp"
|
||||||
#include "gc_implementation/parallelScavenge/psParallelCompact.hpp"
|
#include "gc_implementation/parallelScavenge/psParallelCompact.hpp"
|
||||||
#include "oops/oop.inline.hpp"
|
#include "oops/oop.inline.hpp"
|
||||||
|
#include "runtime/atomic.inline.hpp"
|
||||||
#include "runtime/os.hpp"
|
#include "runtime/os.hpp"
|
||||||
#include "utilities/bitMap.inline.hpp"
|
#include "utilities/bitMap.inline.hpp"
|
||||||
#include "services/memTracker.hpp"
|
#include "services/memTracker.hpp"
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user