7023639: JSR 292 method handle invocation needs a fast path for compiled code

6984705: JSR 292 method handle creation should not go through JNI

Remove assembly code for JDK 7 chained method handles

Co-authored-by: John Rose <john.r.rose@oracle.com>
Co-authored-by: Michael Haupt <michael.haupt@oracle.com>
Reviewed-by: jrose, twisti, kvn, mhaupt
This commit is contained in:
Christian Thalinger 2012-07-24 10:51:00 -07:00
parent 893817c28d
commit 12901d0e5b
181 changed files with 5760 additions and 14402 deletions

View file

@ -358,43 +358,6 @@ void* SingletonBlob::operator new(size_t s, unsigned size) {
}
//----------------------------------------------------------------------------------------------------
// Implementation of RicochetBlob
RicochetBlob::RicochetBlob(
CodeBuffer* cb,
int size,
int bounce_offset,
int exception_offset,
int frame_size
)
: SingletonBlob("RicochetBlob", cb, sizeof(RicochetBlob), size, frame_size, (OopMapSet*) NULL)
{
_bounce_offset = bounce_offset;
_exception_offset = exception_offset;
}
RicochetBlob* RicochetBlob::create(
CodeBuffer* cb,
int bounce_offset,
int exception_offset,
int frame_size)
{
RicochetBlob* blob = NULL;
ThreadInVMfromUnknown __tiv; // get to VM state in case we block on CodeCache_lock
{
MutexLockerEx mu(CodeCache_lock, Mutex::_no_safepoint_check_flag);
unsigned int size = allocation_size(cb, sizeof(RicochetBlob));
blob = new (size) RicochetBlob(cb, size, bounce_offset, exception_offset, frame_size);
}
trace_new_stub(blob, "RicochetBlob");
return blob;
}
//----------------------------------------------------------------------------------------------------
// Implementation of DeoptimizationBlob

View file

@ -35,7 +35,6 @@
// Suptypes are:
// nmethod : Compiled Java methods (include method that calls to native code)
// RuntimeStub : Call to VM runtime methods
// RicochetBlob : Used for blocking MethodHandle adapters
// DeoptimizationBlob : Used for deoptimizatation
// ExceptionBlob : Used for stack unrolling
// SafepointBlob : Used to handle illegal instruction exceptions
@ -99,7 +98,6 @@ class CodeBlob VALUE_OBJ_CLASS_SPEC {
virtual bool is_buffer_blob() const { return false; }
virtual bool is_nmethod() const { return false; }
virtual bool is_runtime_stub() const { return false; }
virtual bool is_ricochet_stub() const { return false; }
virtual bool is_deoptimization_stub() const { return false; }
virtual bool is_uncommon_trap_stub() const { return false; }
virtual bool is_exception_stub() const { return false; }
@ -349,50 +347,6 @@ class SingletonBlob: public CodeBlob {
};
//----------------------------------------------------------------------------------------------------
// RicochetBlob
// Holds an arbitrary argument list indefinitely while Java code executes recursively.
class RicochetBlob: public SingletonBlob {
friend class VMStructs;
private:
int _bounce_offset;
int _exception_offset;
// Creation support
RicochetBlob(
CodeBuffer* cb,
int size,
int bounce_offset,
int exception_offset,
int frame_size
);
public:
// Creation
static RicochetBlob* create(
CodeBuffer* cb,
int bounce_offset,
int exception_offset,
int frame_size
);
// Typing
bool is_ricochet_stub() const { return true; }
// GC for args
void preserve_callee_argument_oops(frame fr, const RegisterMap *reg_map, OopClosure* f) { /* Nothing to do */ }
address bounce_addr() const { return code_begin() + _bounce_offset; }
address exception_addr() const { return code_begin() + _exception_offset; }
bool returns_to_bounce_addr(address pc) const {
address bounce_pc = bounce_addr();
return (pc == bounce_pc || (pc + frame::pc_return_offset) == bounce_pc);
}
};
//----------------------------------------------------------------------------------------------------
// DeoptimizationBlob

View file

@ -796,7 +796,6 @@ void CodeCache::print_internals() {
int nmethodCount = 0;
int runtimeStubCount = 0;
int adapterCount = 0;
int ricochetStubCount = 0;
int deoptimizationStubCount = 0;
int uncommonTrapStubCount = 0;
int bufferBlobCount = 0;
@ -841,8 +840,6 @@ void CodeCache::print_internals() {
}
} else if (cb->is_runtime_stub()) {
runtimeStubCount++;
} else if (cb->is_ricochet_stub()) {
ricochetStubCount++;
} else if (cb->is_deoptimization_stub()) {
deoptimizationStubCount++;
} else if (cb->is_uncommon_trap_stub()) {
@ -879,7 +876,6 @@ void CodeCache::print_internals() {
tty->print_cr("runtime_stubs: %d",runtimeStubCount);
tty->print_cr("adapters: %d",adapterCount);
tty->print_cr("buffer blobs: %d",bufferBlobCount);
tty->print_cr("ricochet_stubs: %d",ricochetStubCount);
tty->print_cr("deoptimization_stubs: %d",deoptimizationStubCount);
tty->print_cr("uncommon_traps: %d",uncommonTrapStubCount);
tty->print_cr("\nnmethod size distribution (non-zombie java)");

View file

@ -311,6 +311,7 @@ void DebugInformationRecorder::describe_scope(int pc_offset,
assert(method == NULL ||
(method->is_native() && bci == 0) ||
(!method->is_native() && 0 <= bci && bci < method->code_size()) ||
(method->is_compiled_lambda_form() && bci == -99) || // this might happen in C1
bci == -1, "illegal bci");
// serialize the locals/expressions/monitors

View file

@ -945,8 +945,12 @@ void nmethod::log_new_nmethod() const {
void nmethod::print_on(outputStream* st, const char* msg) const {
if (st != NULL) {
ttyLocker ttyl;
CompileTask::print_compilation(st, this, msg);
if (WizardMode) st->print(" (" INTPTR_FORMAT ")", this);
if (WizardMode) {
CompileTask::print_compilation(st, this, msg, /*short_form:*/ true);
st->print_cr(" (" INTPTR_FORMAT ")", this);
} else {
CompileTask::print_compilation(st, this, msg, /*short_form:*/ false);
}
}
}
@ -964,7 +968,9 @@ void nmethod::print_nmethod(bool printmethod) {
if (printmethod) {
print_code();
print_pcs();
oop_maps()->print();
if (oop_maps()) {
oop_maps()->print();
}
}
if (PrintDebugInfo) {
print_scopes();

View file

@ -55,6 +55,8 @@ class VtableStub {
int index() const { return _index; }
static VMReg receiver_location() { return _receiver_location; }
void set_next(VtableStub* n) { _next = n; }
public:
address code_begin() const { return (address)(this + 1); }
address code_end() const { return code_begin() + pd_code_size_limit(_is_vtable_stub); }
address entry_point() const { return code_begin(); }
@ -65,6 +67,7 @@ class VtableStub {
}
bool contains(address pc) const { return code_begin() <= pc && pc < code_end(); }
private:
void set_exception_points(address npe_addr, address ame_addr) {
_npe_offset = npe_addr - code_begin();
_ame_offset = ame_addr - code_begin();