Merge
This commit is contained in:
commit
2fc76e8a55
@ -402,14 +402,6 @@ address TemplateInterpreterGenerator::generate_exception_handler_common(
|
||||
return entry;
|
||||
}
|
||||
|
||||
address TemplateInterpreterGenerator::generate_continuation_for(TosState state) {
|
||||
address entry = __ pc();
|
||||
// NULL last_sp until next java call
|
||||
__ str(zr, Address(rfp, frame::interpreter_frame_last_sp_offset * wordSize));
|
||||
__ dispatch_next(state);
|
||||
return entry;
|
||||
}
|
||||
|
||||
address TemplateInterpreterGenerator::generate_return_entry_for(TosState state, int step, size_t index_size) {
|
||||
address entry = __ pc();
|
||||
|
||||
|
@ -270,12 +270,6 @@ address TemplateInterpreterGenerator::generate_exception_handler_common(const ch
|
||||
return entry;
|
||||
}
|
||||
|
||||
address TemplateInterpreterGenerator::generate_continuation_for(TosState state) {
|
||||
// Not used.
|
||||
STOP("generate_continuation_for");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
address TemplateInterpreterGenerator::generate_return_entry_for(TosState state, int step, size_t index_size) {
|
||||
address entry = __ pc();
|
||||
|
||||
|
@ -646,12 +646,6 @@ address TemplateInterpreterGenerator::generate_exception_handler_common(const ch
|
||||
return entry;
|
||||
}
|
||||
|
||||
address TemplateInterpreterGenerator::generate_continuation_for(TosState state) {
|
||||
address entry = __ pc();
|
||||
__ unimplemented("generate_continuation_for");
|
||||
return entry;
|
||||
}
|
||||
|
||||
// This entry is returned to when a call returns to the interpreter.
|
||||
// When we arrive here, we expect that the callee stack frame is already popped.
|
||||
address TemplateInterpreterGenerator::generate_return_entry_for(TosState state, int step, size_t index_size) {
|
||||
|
@ -642,13 +642,6 @@ address TemplateInterpreterGenerator::generate_exception_handler_common(const ch
|
||||
return entry;
|
||||
}
|
||||
|
||||
// Unused, should never pass by.
|
||||
address TemplateInterpreterGenerator::generate_continuation_for (TosState state) {
|
||||
address entry = __ pc();
|
||||
__ should_not_reach_here();
|
||||
return entry;
|
||||
}
|
||||
|
||||
address TemplateInterpreterGenerator::generate_return_entry_for (TosState state, int step, size_t index_size) {
|
||||
address entry = __ pc();
|
||||
|
||||
|
@ -466,12 +466,6 @@ address TemplateInterpreterGenerator::generate_safept_entry_for(TosState state,
|
||||
}
|
||||
|
||||
|
||||
address TemplateInterpreterGenerator::generate_continuation_for(TosState state) {
|
||||
address entry = __ pc();
|
||||
__ dispatch_next(state);
|
||||
return entry;
|
||||
}
|
||||
|
||||
//
|
||||
// Helpers for commoning out cases in the various type of method entries.
|
||||
//
|
||||
|
@ -171,16 +171,6 @@ address TemplateInterpreterGenerator::generate_exception_handler_common(
|
||||
return entry;
|
||||
}
|
||||
|
||||
|
||||
address TemplateInterpreterGenerator::generate_continuation_for(TosState state) {
|
||||
address entry = __ pc();
|
||||
// NULL last_sp until next java call
|
||||
__ movptr(Address(rbp, frame::interpreter_frame_last_sp_offset * wordSize), (int32_t)NULL_WORD);
|
||||
__ dispatch_next(state);
|
||||
return entry;
|
||||
}
|
||||
|
||||
|
||||
address TemplateInterpreterGenerator::generate_return_entry_for(TosState state, int step, size_t index_size) {
|
||||
address entry = __ pc();
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1999, 2016, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1999, 2017, 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
|
||||
@ -374,7 +374,7 @@ bool ciEnv::check_klass_accessibility(ciKlass* accessing_klass,
|
||||
}
|
||||
if (resolved_klass->is_instance_klass()) {
|
||||
return (Reflection::verify_class_access(accessing_klass->get_Klass(),
|
||||
resolved_klass,
|
||||
InstanceKlass::cast(resolved_klass),
|
||||
true) == Reflection::ACCESS_OK);
|
||||
}
|
||||
return true;
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1997, 2017, 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
|
||||
@ -4374,10 +4374,12 @@ static void check_super_class_access(const InstanceKlass* this_klass, TRAPS) {
|
||||
}
|
||||
|
||||
Reflection::VerifyClassAccessResults vca_result =
|
||||
Reflection::verify_class_access(this_klass, super, false);
|
||||
Reflection::verify_class_access(this_klass, InstanceKlass::cast(super), false);
|
||||
if (vca_result != Reflection::ACCESS_OK) {
|
||||
ResourceMark rm(THREAD);
|
||||
char* msg = Reflection::verify_class_access_msg(this_klass, super, vca_result);
|
||||
char* msg = Reflection::verify_class_access_msg(this_klass,
|
||||
InstanceKlass::cast(super),
|
||||
vca_result);
|
||||
if (msg == NULL) {
|
||||
Exceptions::fthrow(
|
||||
THREAD_AND_LOCATION,
|
||||
@ -4406,10 +4408,12 @@ static void check_super_interface_access(const InstanceKlass* this_klass, TRAPS)
|
||||
Klass* const k = local_interfaces->at(i);
|
||||
assert (k != NULL && k->is_interface(), "invalid interface");
|
||||
Reflection::VerifyClassAccessResults vca_result =
|
||||
Reflection::verify_class_access(this_klass, k, false);
|
||||
Reflection::verify_class_access(this_klass, InstanceKlass::cast(k), false);
|
||||
if (vca_result != Reflection::ACCESS_OK) {
|
||||
ResourceMark rm(THREAD);
|
||||
char* msg = Reflection::verify_class_access_msg(this_klass, k, vca_result);
|
||||
char* msg = Reflection::verify_class_access_msg(this_klass,
|
||||
InstanceKlass::cast(k),
|
||||
vca_result);
|
||||
if (msg == NULL) {
|
||||
Exceptions::fthrow(
|
||||
THREAD_AND_LOCATION,
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1997, 2017, 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
|
||||
@ -275,10 +275,12 @@ void LinkInfo::print() {
|
||||
|
||||
void LinkResolver::check_klass_accessability(KlassHandle ref_klass, KlassHandle sel_klass, TRAPS) {
|
||||
Reflection::VerifyClassAccessResults vca_result =
|
||||
Reflection::verify_class_access(ref_klass(), sel_klass(), true);
|
||||
Reflection::verify_class_access(ref_klass(), InstanceKlass::cast(sel_klass()), true);
|
||||
if (vca_result != Reflection::ACCESS_OK) {
|
||||
ResourceMark rm(THREAD);
|
||||
char* msg = Reflection::verify_class_access_msg(ref_klass(), sel_klass(), vca_result);
|
||||
char* msg = Reflection::verify_class_access_msg(ref_klass(),
|
||||
InstanceKlass::cast(sel_klass()),
|
||||
vca_result);
|
||||
if (msg == NULL) {
|
||||
Exceptions::fthrow(
|
||||
THREAD_AND_LOCATION,
|
||||
|
@ -193,7 +193,6 @@ EntryPoint TemplateInterpreter::_trace_code;
|
||||
EntryPoint TemplateInterpreter::_return_entry[TemplateInterpreter::number_of_return_entries];
|
||||
EntryPoint TemplateInterpreter::_earlyret_entry;
|
||||
EntryPoint TemplateInterpreter::_deopt_entry [TemplateInterpreter::number_of_deopt_entries ];
|
||||
EntryPoint TemplateInterpreter::_continuation_entry;
|
||||
EntryPoint TemplateInterpreter::_safept_entry;
|
||||
|
||||
address TemplateInterpreter::_invoke_return_entry[TemplateInterpreter::number_of_return_addrs];
|
||||
|
@ -119,7 +119,6 @@ class TemplateInterpreter: public AbstractInterpreter {
|
||||
static EntryPoint _return_entry[number_of_return_entries]; // entry points to return to from a call
|
||||
static EntryPoint _earlyret_entry; // entry point to return early from a call
|
||||
static EntryPoint _deopt_entry[number_of_deopt_entries]; // entry points to return to from a deoptimization
|
||||
static EntryPoint _continuation_entry;
|
||||
static EntryPoint _safept_entry;
|
||||
|
||||
static address _invoke_return_entry[number_of_return_addrs]; // for invokestatic, invokespecial, invokevirtual return entries
|
||||
@ -158,7 +157,6 @@ class TemplateInterpreter: public AbstractInterpreter {
|
||||
#ifndef PRODUCT
|
||||
static address trace_code (TosState state) { return _trace_code.entry(state); }
|
||||
#endif // !PRODUCT
|
||||
static address continuation (TosState state) { return _continuation_entry.entry(state); }
|
||||
static address* dispatch_table(TosState state) { return _active_table.table_for(state); }
|
||||
static address* dispatch_table() { return _active_table.table_for(); }
|
||||
static int distance_from_dispatch_table(TosState state){ return _active_table.distance_from(state); }
|
||||
|
@ -165,21 +165,6 @@ void TemplateInterpreterGenerator::generate_all() {
|
||||
}
|
||||
}
|
||||
|
||||
{ CodeletMark cm(_masm, "continuation entry points");
|
||||
Interpreter::_continuation_entry =
|
||||
EntryPoint(
|
||||
generate_continuation_for(btos),
|
||||
generate_continuation_for(ztos),
|
||||
generate_continuation_for(ctos),
|
||||
generate_continuation_for(stos),
|
||||
generate_continuation_for(atos),
|
||||
generate_continuation_for(itos),
|
||||
generate_continuation_for(ltos),
|
||||
generate_continuation_for(ftos),
|
||||
generate_continuation_for(dtos),
|
||||
generate_continuation_for(vtos)
|
||||
);
|
||||
}
|
||||
|
||||
{ CodeletMark cm(_masm, "safepoint entry points");
|
||||
Interpreter::_safept_entry =
|
||||
|
@ -52,7 +52,6 @@ class TemplateInterpreterGenerator: public AbstractInterpreterGenerator {
|
||||
address generate_exception_handler_common(const char* name, const char* message, bool pass_oop);
|
||||
address generate_ClassCastException_handler();
|
||||
address generate_ArrayIndexOutOfBounds_handler(const char* name);
|
||||
address generate_continuation_for(TosState state);
|
||||
address generate_return_entry_for(TosState state, int step, size_t index_size);
|
||||
address generate_earlyret_entry_for(TosState state);
|
||||
address generate_deopt_entry_for(TosState state, int step);
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1999, 2016, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1999, 2017, 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
|
||||
@ -79,7 +79,7 @@ bool JVMCIEnv::check_klass_accessibility(KlassHandle accessing_klass, KlassHandl
|
||||
}
|
||||
if (resolved_klass->is_instance_klass()) {
|
||||
Reflection::VerifyClassAccessResults result =
|
||||
Reflection::verify_class_access(accessing_klass(), resolved_klass(), true);
|
||||
Reflection::verify_class_access(accessing_klass(), InstanceKlass::cast(resolved_klass()), true);
|
||||
return result == Reflection::ACCESS_OK;
|
||||
}
|
||||
return true;
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2008, 2016, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2008, 2017, 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
|
||||
@ -1209,7 +1209,7 @@ JVM_ENTRY(jobject, MHN_resolve_Mem(JNIEnv *env, jobject igcls, jobject mname_jh,
|
||||
// Emulate LinkResolver::check_klass_accessability.
|
||||
Klass* caller = java_lang_Class::as_Klass(JNIHandles::resolve_non_null(caller_jh));
|
||||
if (Reflection::verify_class_access(caller,
|
||||
reference_klass,
|
||||
InstanceKlass::cast(reference_klass),
|
||||
true) != Reflection::ACCESS_OK) {
|
||||
THROW_MSG_NULL(vmSymbols::java_lang_InternalError(), reference_klass->external_name());
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1999, 2016, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1999, 2017, 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
|
||||
@ -81,8 +81,6 @@ class Atomic : AllStatic {
|
||||
inline static size_t add (size_t add_value, volatile size_t* dest);
|
||||
inline static intptr_t add_ptr(intptr_t add_value, volatile intptr_t* dest);
|
||||
inline static void* add_ptr(intptr_t add_value, volatile void* dest);
|
||||
// See comment above about using jlong atomics on 32-bit platforms
|
||||
inline static jlong add (jlong add_value, volatile jlong* dest);
|
||||
|
||||
// Atomically increment location. inc*() provide:
|
||||
// <fence> increment-dest <membar StoreLoad|StoreStore>
|
||||
@ -199,16 +197,6 @@ inline unsigned Atomic::cmpxchg(unsigned int exchange_value,
|
||||
(jint)compare_value, order);
|
||||
}
|
||||
|
||||
inline jlong Atomic::add(jlong add_value, volatile jlong* dest) {
|
||||
jlong old = load(dest);
|
||||
jlong new_value = old + add_value;
|
||||
while (old != cmpxchg(new_value, dest, old)) {
|
||||
old = load(dest);
|
||||
new_value = old + add_value;
|
||||
}
|
||||
return old;
|
||||
}
|
||||
|
||||
inline jshort Atomic::add(jshort add_value, volatile jshort* dest) {
|
||||
// Most platforms do not support atomic add on a 2-byte value. However,
|
||||
// if the value occupies the most significant 16 bits of an aligned 32-bit
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1997, 2017, 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
|
||||
@ -477,7 +477,7 @@ static bool can_relax_access_check_for(const Klass* accessor,
|
||||
Note: a loose module is a module that can read all current and future unnamed modules.
|
||||
*/
|
||||
Reflection::VerifyClassAccessResults Reflection::verify_class_access(
|
||||
const Klass* current_class, const Klass* new_class, bool classloader_only) {
|
||||
const Klass* current_class, const InstanceKlass* new_class, bool classloader_only) {
|
||||
|
||||
// Verify that current_class can access new_class. If the classloader_only
|
||||
// flag is set, we automatically allow any accesses in which current_class
|
||||
@ -504,13 +504,6 @@ Reflection::VerifyClassAccessResults Reflection::verify_class_access(
|
||||
// Find the module entry for current_class, the accessor
|
||||
ModuleEntry* module_from = current_class->module();
|
||||
// Find the module entry for new_class, the accessee
|
||||
if (new_class->is_objArray_klass()) {
|
||||
new_class = ObjArrayKlass::cast(new_class)->bottom_klass();
|
||||
}
|
||||
if (new_class->is_typeArray_klass()) {
|
||||
// A TypeArray's defining module is java.base, access to the TypeArray is allowed
|
||||
return ACCESS_OK;
|
||||
}
|
||||
ModuleEntry* module_to = new_class->module();
|
||||
|
||||
// both in same (possibly unnamed) module
|
||||
@ -563,7 +556,7 @@ Reflection::VerifyClassAccessResults Reflection::verify_class_access(
|
||||
// Return an error message specific to the specified Klass*'s and result.
|
||||
// This function must be called from within a block containing a ResourceMark.
|
||||
char* Reflection::verify_class_access_msg(const Klass* current_class,
|
||||
const Klass* new_class,
|
||||
const InstanceKlass* new_class,
|
||||
VerifyClassAccessResults result) {
|
||||
assert(result != ACCESS_OK, "must be failure result");
|
||||
char * msg = NULL;
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1997, 2017, 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
|
||||
@ -82,12 +82,12 @@ class Reflection: public AllStatic {
|
||||
|
||||
// Verification
|
||||
static VerifyClassAccessResults verify_class_access(const Klass* current_class,
|
||||
const Klass* new_class,
|
||||
const InstanceKlass* new_class,
|
||||
bool classloader_only);
|
||||
// Return an error message specific to the specified Klass*'s and result.
|
||||
// This function must be called from within a block containing a ResourceMark.
|
||||
static char* verify_class_access_msg(const Klass* current_class,
|
||||
const Klass* new_class,
|
||||
const InstanceKlass* new_class,
|
||||
const VerifyClassAccessResults result);
|
||||
|
||||
static bool verify_field_access(const Klass* current_class,
|
||||
|
@ -62,7 +62,7 @@ class MallocSiteHashtableEntry : public CHeapObj<mtNMT> {
|
||||
public:
|
||||
MallocSiteHashtableEntry() : _next(NULL) { }
|
||||
|
||||
MallocSiteHashtableEntry(NativeCallStack stack):
|
||||
MallocSiteHashtableEntry(const NativeCallStack& stack):
|
||||
_malloc_site(stack), _next(NULL) { }
|
||||
|
||||
inline const MallocSiteHashtableEntry* next() const {
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2014, 2017, 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
|
||||
@ -40,8 +40,8 @@
|
||||
*/
|
||||
class MemoryCounter VALUE_OBJ_CLASS_SPEC {
|
||||
private:
|
||||
size_t _count;
|
||||
size_t _size;
|
||||
volatile size_t _count;
|
||||
volatile size_t _size;
|
||||
|
||||
DEBUG_ONLY(size_t _peak_count;)
|
||||
DEBUG_ONLY(size_t _peak_size; )
|
||||
@ -53,26 +53,28 @@ class MemoryCounter VALUE_OBJ_CLASS_SPEC {
|
||||
}
|
||||
|
||||
inline void allocate(size_t sz) {
|
||||
Atomic::add(1, (volatile MemoryCounterType*)&_count);
|
||||
Atomic::add(1, &_count);
|
||||
if (sz > 0) {
|
||||
Atomic::add((MemoryCounterType)sz, (volatile MemoryCounterType*)&_size);
|
||||
Atomic::add(sz, &_size);
|
||||
DEBUG_ONLY(_peak_size = MAX2(_peak_size, _size));
|
||||
}
|
||||
DEBUG_ONLY(_peak_count = MAX2(_peak_count, _count);)
|
||||
}
|
||||
|
||||
inline void deallocate(size_t sz) {
|
||||
assert(_count > 0, "Negative counter");
|
||||
assert(_size >= sz, "Negative size");
|
||||
Atomic::add(-1, (volatile MemoryCounterType*)&_count);
|
||||
assert(_count > 0, "Nothing allocated yet");
|
||||
assert(_size >= sz, "deallocation > allocated");
|
||||
Atomic::add(-1, &_count);
|
||||
if (sz > 0) {
|
||||
Atomic::add(-(MemoryCounterType)sz, (volatile MemoryCounterType*)&_size);
|
||||
// unary minus operator applied to unsigned type, result still unsigned
|
||||
#pragma warning(suppress: 4146)
|
||||
Atomic::add(-sz, &_size);
|
||||
}
|
||||
}
|
||||
|
||||
inline void resize(long sz) {
|
||||
if (sz != 0) {
|
||||
Atomic::add((MemoryCounterType)sz, (volatile MemoryCounterType*)&_size);
|
||||
Atomic::add(sz, &_size);
|
||||
DEBUG_ONLY(_peak_size = MAX2(_size, _peak_size);)
|
||||
}
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2014, 2017, 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
|
||||
@ -30,13 +30,6 @@
|
||||
|
||||
#define CALC_OBJ_SIZE_IN_TYPE(obj, type) (align_size_up_(sizeof(obj), sizeof(type))/sizeof(type))
|
||||
|
||||
// Data type for memory counters
|
||||
#ifdef _LP64
|
||||
typedef jlong MemoryCounterType;
|
||||
#else
|
||||
typedef jint MemoryCounterType;
|
||||
#endif
|
||||
|
||||
// Native memory tracking level
|
||||
enum NMT_TrackingLevel {
|
||||
NMT_unknown = 0xFF,
|
||||
|
Loading…
x
Reference in New Issue
Block a user