8147978: Remove Method::_method_data for C1
Method::_method_data field removed when not using C2 or JVMCI Reviewed-by: dholmes, kvn
This commit is contained in:
parent
30ee713e36
commit
6d7d3228e7
@ -1502,6 +1502,7 @@ JRT_ENTRY(void, Runtime1::predicate_failed_trap(JavaThread* thread))
|
|||||||
nm->make_not_entrant();
|
nm->make_not_entrant();
|
||||||
|
|
||||||
methodHandle m(nm->method());
|
methodHandle m(nm->method());
|
||||||
|
if (ProfileInterpreter) {
|
||||||
MethodData* mdo = m->method_data();
|
MethodData* mdo = m->method_data();
|
||||||
|
|
||||||
if (mdo == NULL && !HAS_PENDING_EXCEPTION) {
|
if (mdo == NULL && !HAS_PENDING_EXCEPTION) {
|
||||||
@ -1518,6 +1519,7 @@ JRT_ENTRY(void, Runtime1::predicate_failed_trap(JavaThread* thread))
|
|||||||
if (mdo != NULL) {
|
if (mdo != NULL) {
|
||||||
mdo->inc_trap_count(Deoptimization::Reason_none);
|
mdo->inc_trap_count(Deoptimization::Reason_none);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (TracePredicateFailedTraps) {
|
if (TracePredicateFailedTraps) {
|
||||||
stringStream ss1, ss2;
|
stringStream ss1, ss2;
|
||||||
|
@ -383,14 +383,15 @@ void Method::build_interpreter_method_data(const methodHandle& method, TRAPS) {
|
|||||||
MutexLocker ml(MethodData_lock, THREAD);
|
MutexLocker ml(MethodData_lock, THREAD);
|
||||||
if (method->method_data() == NULL) {
|
if (method->method_data() == NULL) {
|
||||||
ClassLoaderData* loader_data = method->method_holder()->class_loader_data();
|
ClassLoaderData* loader_data = method->method_holder()->class_loader_data();
|
||||||
|
#if defined(COMPILER2) || INCLUDE_JVMCI
|
||||||
MethodData* method_data = MethodData::allocate(loader_data, method, THREAD);
|
MethodData* method_data = MethodData::allocate(loader_data, method, THREAD);
|
||||||
if (HAS_PENDING_EXCEPTION) {
|
if (HAS_PENDING_EXCEPTION) {
|
||||||
CompileBroker::log_metaspace_failure();
|
CompileBroker::log_metaspace_failure();
|
||||||
ClassLoaderDataGraph::set_metaspace_oom(true);
|
ClassLoaderDataGraph::set_metaspace_oom(true);
|
||||||
return; // return the exception (which is cleared)
|
return; // return the exception (which is cleared)
|
||||||
}
|
}
|
||||||
|
|
||||||
method->set_method_data(method_data);
|
method->set_method_data(method_data);
|
||||||
|
#endif
|
||||||
if (PrintMethodData && (Verbose || WizardMode)) {
|
if (PrintMethodData && (Verbose || WizardMode)) {
|
||||||
ResourceMark rm(THREAD);
|
ResourceMark rm(THREAD);
|
||||||
tty->print("build_interpreter_method_data for ");
|
tty->print("build_interpreter_method_data for ");
|
||||||
@ -920,7 +921,7 @@ void Method::unlink_method() {
|
|||||||
// shared class that failed to load, this->link_method() may
|
// shared class that failed to load, this->link_method() may
|
||||||
// have already been called (before an exception happened), so
|
// have already been called (before an exception happened), so
|
||||||
// this->_method_data may not be NULL.
|
// this->_method_data may not be NULL.
|
||||||
assert(!DumpSharedSpaces || _method_data == NULL, "unexpected method data?");
|
assert(!DumpSharedSpaces || method_data() == NULL, "unexpected method data?");
|
||||||
|
|
||||||
set_method_data(NULL);
|
set_method_data(NULL);
|
||||||
clear_method_counters();
|
clear_method_counters();
|
||||||
|
@ -64,7 +64,9 @@ class Method : public Metadata {
|
|||||||
friend class JVMCIVMStructs;
|
friend class JVMCIVMStructs;
|
||||||
private:
|
private:
|
||||||
ConstMethod* _constMethod; // Method read-only data.
|
ConstMethod* _constMethod; // Method read-only data.
|
||||||
|
#if defined(COMPILER2) || INCLUDE_JVMCI
|
||||||
MethodData* _method_data;
|
MethodData* _method_data;
|
||||||
|
#endif
|
||||||
MethodCounters* _method_counters;
|
MethodCounters* _method_counters;
|
||||||
AccessFlags _access_flags; // Access flags
|
AccessFlags _access_flags; // Access flags
|
||||||
int _vtable_index; // vtable index of this method (see VtableIndexFlag)
|
int _vtable_index; // vtable index of this method (see VtableIndexFlag)
|
||||||
@ -319,6 +321,7 @@ class Method : public Metadata {
|
|||||||
// InterpreterRuntime::exception_handler_for_exception.
|
// InterpreterRuntime::exception_handler_for_exception.
|
||||||
static int fast_exception_handler_bci_for(methodHandle mh, KlassHandle ex_klass, int throw_bci, TRAPS);
|
static int fast_exception_handler_bci_for(methodHandle mh, KlassHandle ex_klass, int throw_bci, TRAPS);
|
||||||
|
|
||||||
|
#if defined(COMPILER2) || INCLUDE_JVMCI
|
||||||
// method data access
|
// method data access
|
||||||
MethodData* method_data() const {
|
MethodData* method_data() const {
|
||||||
return _method_data;
|
return _method_data;
|
||||||
@ -330,6 +333,10 @@ class Method : public Metadata {
|
|||||||
// the initialization of data otherwise.
|
// the initialization of data otherwise.
|
||||||
OrderAccess::release_store_ptr((volatile void *)&_method_data, data);
|
OrderAccess::release_store_ptr((volatile void *)&_method_data, data);
|
||||||
}
|
}
|
||||||
|
#else
|
||||||
|
MethodData* method_data() const { return NULL; }
|
||||||
|
void set_method_data(MethodData* data) { }
|
||||||
|
#endif
|
||||||
|
|
||||||
MethodCounters* method_counters() const {
|
MethodCounters* method_counters() const {
|
||||||
return _method_counters;
|
return _method_counters;
|
||||||
@ -639,9 +646,16 @@ class Method : public Metadata {
|
|||||||
#endif /* CC_INTERP */
|
#endif /* CC_INTERP */
|
||||||
static ByteSize from_compiled_offset() { return byte_offset_of(Method, _from_compiled_entry); }
|
static ByteSize from_compiled_offset() { return byte_offset_of(Method, _from_compiled_entry); }
|
||||||
static ByteSize code_offset() { return byte_offset_of(Method, _code); }
|
static ByteSize code_offset() { return byte_offset_of(Method, _code); }
|
||||||
|
#if defined(COMPILER2) || INCLUDE_JVMCI
|
||||||
static ByteSize method_data_offset() {
|
static ByteSize method_data_offset() {
|
||||||
return byte_offset_of(Method, _method_data);
|
return byte_offset_of(Method, _method_data);
|
||||||
}
|
}
|
||||||
|
#else
|
||||||
|
static ByteSize method_data_offset() {
|
||||||
|
ShouldNotReachHere();
|
||||||
|
return in_ByteSize(0);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
static ByteSize method_counters_offset() {
|
static ByteSize method_counters_offset() {
|
||||||
return byte_offset_of(Method, _method_counters);
|
return byte_offset_of(Method, _method_counters);
|
||||||
}
|
}
|
||||||
@ -654,7 +668,11 @@ class Method : public Metadata {
|
|||||||
static ByteSize signature_handler_offset() { return in_ByteSize(sizeof(Method) + wordSize); }
|
static ByteSize signature_handler_offset() { return in_ByteSize(sizeof(Method) + wordSize); }
|
||||||
|
|
||||||
// for code generation
|
// for code generation
|
||||||
|
#if defined(COMPILER2) || INCLUDE_JVMCI
|
||||||
static int method_data_offset_in_bytes() { return offset_of(Method, _method_data); }
|
static int method_data_offset_in_bytes() { return offset_of(Method, _method_data); }
|
||||||
|
#else
|
||||||
|
static int method_data_offset_in_bytes() { ShouldNotReachHere(); return 0; }
|
||||||
|
#endif
|
||||||
static int intrinsic_id_offset_in_bytes() { return offset_of(Method, _intrinsic_id); }
|
static int intrinsic_id_offset_in_bytes() { return offset_of(Method, _intrinsic_id); }
|
||||||
static int intrinsic_id_size_in_bytes() { return sizeof(u2); }
|
static int intrinsic_id_size_in_bytes() { return sizeof(u2); }
|
||||||
|
|
||||||
|
@ -3464,6 +3464,12 @@ jint Arguments::finalize_vm_init_args(SysClassPath* scp_p, bool scp_assembly_req
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if !defined(COMPILER2) && !INCLUDE_JVMCI
|
||||||
|
UNSUPPORTED_OPTION(ProfileInterpreter, "ProfileInterpreter");
|
||||||
|
NOT_PRODUCT(UNSUPPORTED_OPTION(TraceProfileInterpreter, "TraceProfileInterpreter"));
|
||||||
|
UNSUPPORTED_OPTION(PrintMethodData, "PrintMethodData");
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifndef TIERED
|
#ifndef TIERED
|
||||||
// Tiered compilation is undefined.
|
// Tiered compilation is undefined.
|
||||||
UNSUPPORTED_OPTION(TieredCompilation, "TieredCompilation");
|
UNSUPPORTED_OPTION(TieredCompilation, "TieredCompilation");
|
||||||
|
@ -390,7 +390,7 @@ typedef CompactHashtable<Symbol*, char> SymbolCompactHashTable;
|
|||||||
nonstatic_field(MethodCounters, _invocation_counter, InvocationCounter) \
|
nonstatic_field(MethodCounters, _invocation_counter, InvocationCounter) \
|
||||||
nonstatic_field(MethodCounters, _backedge_counter, InvocationCounter) \
|
nonstatic_field(MethodCounters, _backedge_counter, InvocationCounter) \
|
||||||
nonstatic_field(Method, _constMethod, ConstMethod*) \
|
nonstatic_field(Method, _constMethod, ConstMethod*) \
|
||||||
nonstatic_field(Method, _method_data, MethodData*) \
|
COMPILER2_OR_JVMCI_PRESENT(nonstatic_field(Method, _method_data, MethodData*)) \
|
||||||
nonstatic_field(Method, _method_counters, MethodCounters*) \
|
nonstatic_field(Method, _method_counters, MethodCounters*) \
|
||||||
nonstatic_field(Method, _access_flags, AccessFlags) \
|
nonstatic_field(Method, _access_flags, AccessFlags) \
|
||||||
nonstatic_field(Method, _vtable_index, int) \
|
nonstatic_field(Method, _vtable_index, int) \
|
||||||
|
@ -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.
|
* 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
|
||||||
@ -206,6 +206,15 @@
|
|||||||
#define NOT_COMPILER2(code) code
|
#define NOT_COMPILER2(code) code
|
||||||
#endif // COMPILER2
|
#endif // COMPILER2
|
||||||
|
|
||||||
|
// COMPILER2 or JVMCI
|
||||||
|
#if defined(COMPILER2) || INCLUDE_JVMCI
|
||||||
|
#define COMPILER2_OR_JVMCI_PRESENT(code) code
|
||||||
|
#define NOT_COMPILER2_OR_JVMCI(code)
|
||||||
|
#else
|
||||||
|
#define COMPILER2_OR_JVMCI_PRESENT(code)
|
||||||
|
#define NOT_COMPILER2_OR_JVMCI(code) code
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef TIERED
|
#ifdef TIERED
|
||||||
#define TIERED_ONLY(code) code
|
#define TIERED_ONLY(code) code
|
||||||
#define NOT_TIERED(code)
|
#define NOT_TIERED(code)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user