This commit is contained in:
Alejandro Murillo 2016-02-18 15:19:39 -08:00
commit d55b2fce32
111 changed files with 2078 additions and 1019 deletions

View file

@ -333,6 +333,8 @@ static SpecialFlag const special_jvm_flags[] = {
// --- Non-alias flags - sorted by obsolete_in then expired_in:
{ "MaxGCMinorPauseMillis", JDK_Version::jdk(8), JDK_Version::undefined(), JDK_Version::undefined() },
{ "UseParNewGC", JDK_Version::jdk(9), JDK_Version::undefined(), JDK_Version::jdk(10) },
{ "ConvertSleepToYield", JDK_Version::jdk(9), JDK_Version::jdk(10), JDK_Version::jdk(11) },
{ "ConvertYieldToSleep", JDK_Version::jdk(9), JDK_Version::jdk(10), JDK_Version::jdk(11) },
// --- Deprecated alias flags (see also aliased_jvm_flags) - sorted by obsolete_in then expired_in:
{ "DefaultMaxRAMFraction", JDK_Version::jdk(8), JDK_Version::undefined(), JDK_Version::undefined() },

View file

@ -1239,9 +1239,8 @@ public:
product_pd(bool, DontYieldALot, \
"Throw away obvious excess yield calls") \
\
product_pd(bool, ConvertSleepToYield, \
"Convert sleep(0) to thread yield " \
"(may be off for Solaris to improve GUI)") \
product(bool, ConvertSleepToYield, true, \
"Convert sleep(0) to thread yield ") \
\
product(bool, ConvertYieldToSleep, false, \
"Convert yield to a sleep of MinSleepInterval to simulate Win32 " \
@ -1279,10 +1278,6 @@ public:
experimental(intx, hashCode, 5, \
"(Unstable) select hashCode generation algorithm") \
\
experimental(intx, WorkAroundNPTLTimedWaitHang, 0, \
"(Unstable, Linux-specific) " \
"avoid NPTL-FUTEX hang pthread_cond_timedwait") \
\
product(bool, FilterSpuriousWakeups, true, \
"When true prevents OS-level spurious, or premature, wakeups " \
"from Object.wait (Ignored for Windows)") \
@ -2012,11 +2007,15 @@ public:
range(min_intx, 100) \
\
product(uintx, InitiatingHeapOccupancyPercent, 45, \
"Percentage of the (entire) heap occupancy to start a " \
"concurrent GC cycle. It is used by GCs that trigger a " \
"concurrent GC cycle based on the occupancy of the entire heap, " \
"not just one of the generations (e.g., G1). A value of 0 " \
"denotes 'do constant GC cycles'.") \
"The percent occupancy (IHOP) of the current old generation " \
"capacity above which a concurrent mark cycle will be initiated " \
"Its value may change over time if adaptive IHOP is enabled, " \
"otherwise the value remains constant. " \
"In the latter case a value of 0 will result as frequent as " \
"possible concurrent marking cycles. A value of 100 disables " \
"concurrent marking. " \
"Fragmentation waste in the old generation is not considered " \
"free space in this calculation. (G1 collector only)") \
range(0, 100) \
\
manageable(intx, CMSTriggerInterval, -1, \

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 2016, 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
@ -145,6 +145,7 @@ jint init_globals() {
}
javaClasses_init(); // must happen after vtable initialization
stubRoutines_init2(); // note: StubRoutines need 2-phase init
MethodHandles::generate_adapters();
CodeCacheExtensions::complete_step(CodeCacheExtensionsSteps::StubRoutines2);
#if INCLUDE_NMT
@ -181,8 +182,7 @@ void exit_globals() {
}
}
static bool _init_completed = false;
static volatile bool _init_completed = false;
bool is_init_completed() {
return _init_completed;

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 2016, 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
@ -417,6 +417,14 @@ class RuntimeHistogramElement : public HistogramElement {
os::verify_stack_alignment(); \
/* begin of body */
#define VM_ENTRY_BASE_FROM_LEAF(result_type, header, thread) \
TRACE_CALL(result_type, header) \
debug_only(ResetNoHandleMark __rnhm;) \
HandleMarkCleaner __hm(thread); \
Thread* THREAD = thread; \
os::verify_stack_alignment(); \
/* begin of body */
// ENTRY routines may lock, GC and throw exceptions
@ -584,6 +592,14 @@ extern "C" { \
VM_LEAF_BASE(result_type, header)
#define JVM_ENTRY_FROM_LEAF(env, result_type, header) \
{ { \
JavaThread* thread=JavaThread::thread_from_jni_environment(env); \
ThreadInVMfromNative __tiv(thread); \
debug_only(VMNativeEntryWrapper __vew;) \
VM_ENTRY_BASE_FROM_LEAF(result_type, header, thread)
#define JVM_END } }
#endif // SHARE_VM_RUNTIME_INTERFACESUPPORT_HPP

View file

@ -359,6 +359,11 @@ class SharedRuntime: AllStatic {
static address clean_opt_virtual_call_entry();
static address clean_static_call_entry();
#if defined(X86) && defined(COMPILER1)
// For Object.hashCode, System.identityHashCode try to pull hashCode from object header if available.
static void inline_check_hashcode_from_object_header(MacroAssembler* masm, methodHandle method, Register obj_reg, Register result);
#endif // X86 && COMPILER1
public:
// Read the array of BasicTypes from a Java signature, and compute where

View file

@ -37,7 +37,7 @@
StubCodeDesc* StubCodeDesc::_list = NULL;
int StubCodeDesc::_count = 0;
bool StubCodeDesc::_frozen = false;
StubCodeDesc* StubCodeDesc::desc_for(address pc) {
StubCodeDesc* p = _list;
@ -46,20 +46,23 @@ StubCodeDesc* StubCodeDesc::desc_for(address pc) {
return p;
}
StubCodeDesc* StubCodeDesc::desc_for_index(int index) {
StubCodeDesc* p = _list;
while (p != NULL && p->index() != index) p = p->_next;
return p;
}
const char* StubCodeDesc::name_for(address pc) {
StubCodeDesc* p = desc_for(pc);
return p == NULL ? NULL : p->name();
}
void StubCodeDesc::freeze() {
assert(!_frozen, "repeated freeze operation");
_frozen = true;
}
void StubCodeDesc::print_on(outputStream* st) const {
st->print("%s", group());
st->print("::");
@ -110,12 +113,10 @@ StubCodeGenerator::~StubCodeGenerator() {
}
}
void StubCodeGenerator::stub_prolog(StubCodeDesc* cdesc) {
// default implementation - do nothing
}
void StubCodeGenerator::stub_epilog(StubCodeDesc* cdesc) {
// default implementation - record the cdesc
if (_first_stub == NULL) _first_stub = cdesc;

View file

@ -28,7 +28,7 @@
#include "asm/assembler.hpp"
#include "memory/allocation.hpp"
// All the basic framework for stubcode generation/debugging/printing.
// All the basic framework for stub code generation/debugging/printing.
// A StubCodeDesc describes a piece of generated code (usually stubs).
@ -37,9 +37,10 @@
// this may have to change if searching becomes too slow.
class StubCodeDesc: public CHeapObj<mtCode> {
protected:
private:
static StubCodeDesc* _list; // the list of all descriptors
static int _count; // length of list
static bool _frozen; // determines whether _list modifications are allowed
StubCodeDesc* _next; // the next element in the linked list
const char* _group; // the group to which the stub code belongs
@ -68,6 +69,7 @@ class StubCodeDesc: public CHeapObj<mtCode> {
static const char* name_for(address pc); // returns the name of the code containing pc or NULL
StubCodeDesc(const char* group, const char* name, address begin, address end = NULL) {
assert(!_frozen, "no modifications allowed");
assert(name != NULL, "no name specified");
_next = _list;
_group = group;
@ -78,6 +80,8 @@ class StubCodeDesc: public CHeapObj<mtCode> {
_list = this;
};
static void freeze();
const char* group() const { return _group; }
const char* name() const { return _name; }
int index() const { return _index; }
@ -117,7 +121,7 @@ class StubCodeGenerator: public StackObj {
// later via an address pointing into it.
class StubCodeMark: public StackObj {
protected:
private:
StubCodeGenerator* _cgen;
StubCodeDesc* _cdesc;

View file

@ -3600,6 +3600,9 @@ jint Threads::create_vm(JavaVMInitArgs* args, bool* canTryAgain) {
vm_exit_during_initialization("Failed to initialize tracing backend");
}
// No more stub generation allowed after that point.
StubCodeDesc::freeze();
// Set flag that basic initialization has completed. Used by exceptions and various
// debug stuff, that does not work until all basic classes have been initialized.
set_init_completed();