mirror of
https://github.com/openjdk/jdk.git
synced 2026-03-25 15:20:11 +00:00
8140274: methodHandles and constantPoolHandles should be passed as const references
Modified code to use const reference parameters Reviewed-by: sspitsyn, twisti
This commit is contained in:
parent
686fb800c8
commit
f1e89ea4cc
@ -1276,7 +1276,7 @@ static void gen_special_dispatch(MacroAssembler* masm,
|
||||
// return to caller
|
||||
//
|
||||
nmethod* SharedRuntime::generate_native_wrapper(MacroAssembler* masm,
|
||||
methodHandle method,
|
||||
const methodHandle& method,
|
||||
int compile_id,
|
||||
BasicType* in_sig_bt,
|
||||
VMRegPair* in_regs,
|
||||
|
||||
@ -1701,7 +1701,7 @@ static void gen_special_dispatch(MacroAssembler* masm,
|
||||
// return to caller
|
||||
//
|
||||
nmethod *SharedRuntime::generate_native_wrapper(MacroAssembler *masm,
|
||||
methodHandle method,
|
||||
const methodHandle& method,
|
||||
int compile_id,
|
||||
BasicType *in_sig_bt,
|
||||
VMRegPair *in_regs,
|
||||
|
||||
@ -1955,7 +1955,7 @@ static void gen_special_dispatch(MacroAssembler* masm,
|
||||
// return to caller
|
||||
//
|
||||
nmethod* SharedRuntime::generate_native_wrapper(MacroAssembler* masm,
|
||||
methodHandle method,
|
||||
const methodHandle& method,
|
||||
int compile_id,
|
||||
BasicType* in_sig_bt,
|
||||
VMRegPair* in_regs,
|
||||
|
||||
@ -1502,7 +1502,7 @@ static void gen_special_dispatch(MacroAssembler* masm,
|
||||
// return to caller
|
||||
//
|
||||
nmethod* SharedRuntime::generate_native_wrapper(MacroAssembler* masm,
|
||||
methodHandle method,
|
||||
const methodHandle& method,
|
||||
int compile_id,
|
||||
BasicType* in_sig_bt,
|
||||
VMRegPair* in_regs,
|
||||
|
||||
@ -1694,7 +1694,7 @@ class ComputeMoveOrder: public StackObj {
|
||||
};
|
||||
|
||||
static void verify_oop_args(MacroAssembler* masm,
|
||||
methodHandle method,
|
||||
const methodHandle& method,
|
||||
const BasicType* sig_bt,
|
||||
const VMRegPair* regs) {
|
||||
Register temp_reg = rbx; // not part of any compiled calling seq
|
||||
@ -1804,7 +1804,7 @@ static void gen_special_dispatch(MacroAssembler* masm,
|
||||
// return to caller
|
||||
//
|
||||
nmethod* SharedRuntime::generate_native_wrapper(MacroAssembler* masm,
|
||||
methodHandle method,
|
||||
const methodHandle& method,
|
||||
int compile_id,
|
||||
BasicType* in_sig_bt,
|
||||
VMRegPair* in_regs,
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright 2007, 2008, 2009, 2010, 2011 Red Hat, Inc.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
@ -76,7 +76,7 @@ AdapterHandlerEntry* SharedRuntime::generate_i2c2i_adapters(
|
||||
}
|
||||
|
||||
nmethod *SharedRuntime::generate_native_wrapper(MacroAssembler *masm,
|
||||
methodHandle method,
|
||||
const methodHandle& method,
|
||||
int compile_id,
|
||||
BasicType *sig_bt,
|
||||
VMRegPair *regs,
|
||||
|
||||
@ -3811,7 +3811,7 @@ bool os::find(address addr, outputStream* st) {
|
||||
// able to use structured exception handling (thread-local exception filters)
|
||||
// on, e.g., Win32.
|
||||
void
|
||||
os::os_exception_wrapper(java_call_t f, JavaValue* value, methodHandle* method,
|
||||
os::os_exception_wrapper(java_call_t f, JavaValue* value, const methodHandle& method,
|
||||
JavaCallArguments* args, Thread* thread) {
|
||||
f(value, method, args, thread);
|
||||
}
|
||||
|
||||
@ -3745,7 +3745,7 @@ bool os::find(address addr, outputStream* st) {
|
||||
// able to use structured exception handling (thread-local exception filters)
|
||||
// on, e.g., Win32.
|
||||
void os::os_exception_wrapper(java_call_t f, JavaValue* value,
|
||||
methodHandle* method, JavaCallArguments* args,
|
||||
const methodHandle& method, JavaCallArguments* args,
|
||||
Thread* thread) {
|
||||
f(value, method, args, thread);
|
||||
}
|
||||
|
||||
@ -4960,7 +4960,7 @@ bool os::find(address addr, outputStream* st) {
|
||||
// able to use structured exception handling (thread-local exception filters)
|
||||
// on, e.g., Win32.
|
||||
void
|
||||
os::os_exception_wrapper(java_call_t f, JavaValue* value, methodHandle* method,
|
||||
os::os_exception_wrapper(java_call_t f, JavaValue* value, const methodHandle& method,
|
||||
JavaCallArguments* args, Thread* thread) {
|
||||
f(value, method, args, thread);
|
||||
}
|
||||
|
||||
@ -3774,7 +3774,7 @@ ExtendedPC os::get_thread_pc(Thread* thread) {
|
||||
// This does not do anything on Solaris. This is basically a hook for being
|
||||
// able to use structured exception handling (thread-local exception filters) on, e.g., Win32.
|
||||
void os::os_exception_wrapper(java_call_t f, JavaValue* value,
|
||||
methodHandle* method, JavaCallArguments* args,
|
||||
const methodHandle& method, JavaCallArguments* args,
|
||||
Thread* thread) {
|
||||
f(value, method, args, thread);
|
||||
}
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1999, 2015, 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
|
||||
@ -71,7 +71,7 @@
|
||||
extern LONG WINAPI topLevelExceptionFilter(_EXCEPTION_POINTERS* );
|
||||
|
||||
// Install a win32 structured exception handler around thread.
|
||||
void os::os_exception_wrapper(java_call_t f, JavaValue* value, methodHandle* method, JavaCallArguments* args, Thread* thread) {
|
||||
void os::os_exception_wrapper(java_call_t f, JavaValue* value, const methodHandle& method, JavaCallArguments* args, Thread* thread) {
|
||||
__try {
|
||||
|
||||
#ifndef AMD64
|
||||
|
||||
@ -509,7 +509,7 @@ static void append_oop_references(GrowableArray<oop>* oops, Klass* k) {
|
||||
}
|
||||
}
|
||||
|
||||
void CodeBuffer::finalize_oop_references(methodHandle mh) {
|
||||
void CodeBuffer::finalize_oop_references(const methodHandle& mh) {
|
||||
No_Safepoint_Verifier nsv;
|
||||
|
||||
GrowableArray<oop> oops;
|
||||
|
||||
@ -541,7 +541,7 @@ class CodeBuffer: public StackObj {
|
||||
bool insts_contains2(address pc) const { return _insts.contains2(pc); }
|
||||
|
||||
// Record any extra oops required to keep embedded metadata alive
|
||||
void finalize_oop_references(methodHandle method);
|
||||
void finalize_oop_references(const methodHandle& method);
|
||||
|
||||
// Allocated size in all sections, when aligned and concatenated
|
||||
// (this is the eventual state of the content in its final
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1999, 2015, 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
|
||||
@ -98,7 +98,7 @@ BufferBlob* Compiler::init_buffer_blob() {
|
||||
return buffer_blob;
|
||||
}
|
||||
|
||||
bool Compiler::is_intrinsic_supported(methodHandle method) {
|
||||
bool Compiler::is_intrinsic_supported(const methodHandle& method) {
|
||||
vmIntrinsics::ID id = method->intrinsic_id();
|
||||
assert(id != vmIntrinsics::_none, "must be a VM intrinsic");
|
||||
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1999, 2015, 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
|
||||
@ -56,7 +56,7 @@ class Compiler: public AbstractCompiler {
|
||||
virtual void print_timers();
|
||||
|
||||
// Check if the C1 compiler supports an intrinsic for 'method'.
|
||||
virtual bool is_intrinsic_supported(methodHandle method);
|
||||
virtual bool is_intrinsic_supported(const methodHandle& method);
|
||||
|
||||
// Size of the code buffer
|
||||
static int code_buffer_size();
|
||||
|
||||
@ -380,7 +380,7 @@ bool ciEnv::check_klass_accessibility(ciKlass* accessing_klass,
|
||||
// ------------------------------------------------------------------
|
||||
// ciEnv::get_klass_by_name_impl
|
||||
ciKlass* ciEnv::get_klass_by_name_impl(ciKlass* accessing_klass,
|
||||
constantPoolHandle cpool,
|
||||
const constantPoolHandle& cpool,
|
||||
ciSymbol* name,
|
||||
bool require_local) {
|
||||
ASSERT_IN_VM;
|
||||
@ -502,7 +502,7 @@ ciKlass* ciEnv::get_klass_by_name(ciKlass* accessing_klass,
|
||||
// ciEnv::get_klass_by_index_impl
|
||||
//
|
||||
// Implementation of get_klass_by_index.
|
||||
ciKlass* ciEnv::get_klass_by_index_impl(constantPoolHandle cpool,
|
||||
ciKlass* ciEnv::get_klass_by_index_impl(const constantPoolHandle& cpool,
|
||||
int index,
|
||||
bool& is_accessible,
|
||||
ciInstanceKlass* accessor) {
|
||||
@ -559,7 +559,7 @@ ciKlass* ciEnv::get_klass_by_index_impl(constantPoolHandle cpool,
|
||||
// ciEnv::get_klass_by_index
|
||||
//
|
||||
// Get a klass from the constant pool.
|
||||
ciKlass* ciEnv::get_klass_by_index(constantPoolHandle cpool,
|
||||
ciKlass* ciEnv::get_klass_by_index(const constantPoolHandle& cpool,
|
||||
int index,
|
||||
bool& is_accessible,
|
||||
ciInstanceKlass* accessor) {
|
||||
@ -570,7 +570,7 @@ ciKlass* ciEnv::get_klass_by_index(constantPoolHandle cpool,
|
||||
// ciEnv::get_constant_by_index_impl
|
||||
//
|
||||
// Implementation of get_constant_by_index().
|
||||
ciConstant ciEnv::get_constant_by_index_impl(constantPoolHandle cpool,
|
||||
ciConstant ciEnv::get_constant_by_index_impl(const constantPoolHandle& cpool,
|
||||
int pool_index, int cache_index,
|
||||
ciInstanceKlass* accessor) {
|
||||
bool ignore_will_link;
|
||||
@ -656,7 +656,7 @@ ciConstant ciEnv::get_constant_by_index_impl(constantPoolHandle cpool,
|
||||
// Pull a constant out of the constant pool. How appropriate.
|
||||
//
|
||||
// Implementation note: this query is currently in no way cached.
|
||||
ciConstant ciEnv::get_constant_by_index(constantPoolHandle cpool,
|
||||
ciConstant ciEnv::get_constant_by_index(const constantPoolHandle& cpool,
|
||||
int pool_index, int cache_index,
|
||||
ciInstanceKlass* accessor) {
|
||||
GUARDED_VM_ENTRY(return get_constant_by_index_impl(cpool, pool_index, cache_index, accessor);)
|
||||
@ -736,7 +736,7 @@ Method* ciEnv::lookup_method(InstanceKlass* accessor,
|
||||
|
||||
// ------------------------------------------------------------------
|
||||
// ciEnv::get_method_by_index_impl
|
||||
ciMethod* ciEnv::get_method_by_index_impl(constantPoolHandle cpool,
|
||||
ciMethod* ciEnv::get_method_by_index_impl(const constantPoolHandle& cpool,
|
||||
int index, Bytecodes::Code bc,
|
||||
ciInstanceKlass* accessor) {
|
||||
if (bc == Bytecodes::_invokedynamic) {
|
||||
@ -848,7 +848,7 @@ ciInstanceKlass* ciEnv::get_instance_klass_for_declared_method_holder(ciKlass* m
|
||||
|
||||
// ------------------------------------------------------------------
|
||||
// ciEnv::get_method_by_index
|
||||
ciMethod* ciEnv::get_method_by_index(constantPoolHandle cpool,
|
||||
ciMethod* ciEnv::get_method_by_index(const constantPoolHandle& cpool,
|
||||
int index, Bytecodes::Code bc,
|
||||
ciInstanceKlass* accessor) {
|
||||
GUARDED_VM_ENTRY(return get_method_by_index_impl(cpool, index, bc, accessor);)
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1999, 2015, 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
|
||||
@ -118,34 +118,34 @@ private:
|
||||
bool require_local);
|
||||
|
||||
// Constant pool access.
|
||||
ciKlass* get_klass_by_index(constantPoolHandle cpool,
|
||||
ciKlass* get_klass_by_index(const constantPoolHandle& cpool,
|
||||
int klass_index,
|
||||
bool& is_accessible,
|
||||
ciInstanceKlass* loading_klass);
|
||||
ciConstant get_constant_by_index(constantPoolHandle cpool,
|
||||
ciConstant get_constant_by_index(const constantPoolHandle& cpool,
|
||||
int pool_index, int cache_index,
|
||||
ciInstanceKlass* accessor);
|
||||
ciField* get_field_by_index(ciInstanceKlass* loading_klass,
|
||||
int field_index);
|
||||
ciMethod* get_method_by_index(constantPoolHandle cpool,
|
||||
ciMethod* get_method_by_index(const constantPoolHandle& cpool,
|
||||
int method_index, Bytecodes::Code bc,
|
||||
ciInstanceKlass* loading_klass);
|
||||
|
||||
// Implementation methods for loading and constant pool access.
|
||||
ciKlass* get_klass_by_name_impl(ciKlass* accessing_klass,
|
||||
constantPoolHandle cpool,
|
||||
const constantPoolHandle& cpool,
|
||||
ciSymbol* klass_name,
|
||||
bool require_local);
|
||||
ciKlass* get_klass_by_index_impl(constantPoolHandle cpool,
|
||||
ciKlass* get_klass_by_index_impl(const constantPoolHandle& cpool,
|
||||
int klass_index,
|
||||
bool& is_accessible,
|
||||
ciInstanceKlass* loading_klass);
|
||||
ciConstant get_constant_by_index_impl(constantPoolHandle cpool,
|
||||
ciConstant get_constant_by_index_impl(const constantPoolHandle& cpool,
|
||||
int pool_index, int cache_index,
|
||||
ciInstanceKlass* loading_klass);
|
||||
ciField* get_field_by_index_impl(ciInstanceKlass* loading_klass,
|
||||
int field_index);
|
||||
ciMethod* get_method_by_index_impl(constantPoolHandle cpool,
|
||||
ciMethod* get_method_by_index_impl(const constantPoolHandle& cpool,
|
||||
int method_index, Bytecodes::Code bc,
|
||||
ciInstanceKlass* loading_klass);
|
||||
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1999, 2015, 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
|
||||
@ -36,7 +36,7 @@
|
||||
|
||||
// ------------------------------------------------------------------
|
||||
// ciSignature::ciSignature
|
||||
ciSignature::ciSignature(ciKlass* accessing_klass, constantPoolHandle cpool, ciSymbol* symbol) {
|
||||
ciSignature::ciSignature(ciKlass* accessing_klass, const constantPoolHandle& cpool, ciSymbol* symbol) {
|
||||
ASSERT_IN_VM;
|
||||
EXCEPTION_CONTEXT;
|
||||
_accessing_klass = accessing_klass;
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1999, 2015, 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
|
||||
@ -46,7 +46,7 @@ private:
|
||||
friend class ciBytecodeStream;
|
||||
friend class ciObjectFactory;
|
||||
|
||||
ciSignature(ciKlass* accessing_klass, constantPoolHandle cpool, ciSymbol* signature);
|
||||
ciSignature(ciKlass* accessing_klass, const constantPoolHandle& cpool, ciSymbol* signature);
|
||||
ciSignature(ciKlass* accessing_klass, ciSymbol* signature, ciMethodType* method_type);
|
||||
|
||||
void get_all_klasses();
|
||||
|
||||
@ -646,7 +646,7 @@ constantPoolHandle ClassFileParser::parse_constant_pool(TRAPS) {
|
||||
}
|
||||
|
||||
|
||||
void ClassFileParser::patch_constant_pool(constantPoolHandle cp, int index, Handle patch, TRAPS) {
|
||||
void ClassFileParser::patch_constant_pool(const constantPoolHandle& cp, int index, Handle patch, TRAPS) {
|
||||
BasicType patch_type = T_VOID;
|
||||
|
||||
switch (cp->tag_at(index).value()) {
|
||||
@ -4411,7 +4411,7 @@ ClassFileParser::~ClassFileParser() {
|
||||
|
||||
void ClassFileParser::print_field_layout(Symbol* name,
|
||||
Array<u2>* fields,
|
||||
constantPoolHandle cp,
|
||||
const constantPoolHandle& cp,
|
||||
int instance_size,
|
||||
int instance_fields_start,
|
||||
int instance_fields_end,
|
||||
|
||||
@ -241,7 +241,7 @@ class ClassFileParser VALUE_OBJ_CLASS_SPEC {
|
||||
|
||||
void print_field_layout(Symbol* name,
|
||||
Array<u2>* fields,
|
||||
constantPoolHandle cp,
|
||||
const constantPoolHandle& cp,
|
||||
int instance_size,
|
||||
int instance_fields_start,
|
||||
int instance_fields_end,
|
||||
@ -403,7 +403,7 @@ class ClassFileParser VALUE_OBJ_CLASS_SPEC {
|
||||
assert(!has_cp_patch_at(index), "");
|
||||
return patch;
|
||||
}
|
||||
void patch_constant_pool(constantPoolHandle cp, int index, Handle patch, TRAPS);
|
||||
void patch_constant_pool(const constantPoolHandle& cp, int index, Handle patch, TRAPS);
|
||||
|
||||
// Wrapper for constantTag.is_klass_[or_]reference.
|
||||
// In older versions of the VM, Klass*s cannot sneak into early phases of
|
||||
|
||||
@ -1561,7 +1561,7 @@ void java_lang_Throwable::print_stack_element(outputStream *st, Handle mirror,
|
||||
st->print_cr("%s", buf);
|
||||
}
|
||||
|
||||
void java_lang_Throwable::print_stack_element(outputStream *st, methodHandle method, int bci) {
|
||||
void java_lang_Throwable::print_stack_element(outputStream *st, const methodHandle& method, int bci) {
|
||||
Handle mirror = method->method_holder()->java_mirror();
|
||||
int method_id = method->orig_method_idnum();
|
||||
int version = method->constants()->version();
|
||||
@ -1632,7 +1632,7 @@ void java_lang_Throwable::print_stack_trace(oop throwable, outputStream* st) {
|
||||
}
|
||||
}
|
||||
|
||||
void java_lang_Throwable::fill_in_stack_trace(Handle throwable, methodHandle method, TRAPS) {
|
||||
void java_lang_Throwable::fill_in_stack_trace(Handle throwable, const methodHandle& method, TRAPS) {
|
||||
if (!StackTraceInThrowable) return;
|
||||
ResourceMark rm(THREAD);
|
||||
|
||||
@ -1763,7 +1763,7 @@ void java_lang_Throwable::fill_in_stack_trace(Handle throwable, methodHandle met
|
||||
set_backtrace(throwable(), bt.backtrace());
|
||||
}
|
||||
|
||||
void java_lang_Throwable::fill_in_stack_trace(Handle throwable, methodHandle method) {
|
||||
void java_lang_Throwable::fill_in_stack_trace(Handle throwable, const methodHandle& method) {
|
||||
// No-op if stack trace is disabled
|
||||
if (!StackTraceInThrowable) {
|
||||
return;
|
||||
@ -1945,7 +1945,7 @@ oop java_lang_StackTraceElement::create(Handle mirror, int method_id,
|
||||
return element();
|
||||
}
|
||||
|
||||
oop java_lang_StackTraceElement::create(methodHandle method, int bci, TRAPS) {
|
||||
oop java_lang_StackTraceElement::create(const methodHandle& method, int bci, TRAPS) {
|
||||
Handle mirror (THREAD, method->method_holder()->java_mirror());
|
||||
int method_id = method->orig_method_idnum();
|
||||
int cpref = method->name_index();
|
||||
|
||||
@ -532,7 +532,7 @@ class java_lang_Throwable: AllStatic {
|
||||
static Symbol* detail_message(oop throwable);
|
||||
static void print_stack_element(outputStream *st, Handle mirror, int method,
|
||||
int version, int bci, int cpref);
|
||||
static void print_stack_element(outputStream *st, methodHandle method, int bci);
|
||||
static void print_stack_element(outputStream *st, const methodHandle& method, int bci);
|
||||
static void print_stack_usage(Handle stream);
|
||||
|
||||
// Allocate space for backtrace (created but stack trace not filled in)
|
||||
@ -540,8 +540,8 @@ class java_lang_Throwable: AllStatic {
|
||||
// Fill in current stack trace for throwable with preallocated backtrace (no GC)
|
||||
static void fill_in_stack_trace_of_preallocated_backtrace(Handle throwable);
|
||||
// Fill in current stack trace, can cause GC
|
||||
static void fill_in_stack_trace(Handle throwable, methodHandle method, TRAPS);
|
||||
static void fill_in_stack_trace(Handle throwable, methodHandle method = methodHandle());
|
||||
static void fill_in_stack_trace(Handle throwable, const methodHandle& method, TRAPS);
|
||||
static void fill_in_stack_trace(Handle throwable, const methodHandle& method = methodHandle());
|
||||
// Programmatic access to stack trace
|
||||
static oop get_stack_trace_element(oop throwable, int index, TRAPS);
|
||||
static int get_stack_trace_depth(oop throwable, TRAPS);
|
||||
@ -1347,7 +1347,7 @@ class java_lang_StackTraceElement: AllStatic {
|
||||
|
||||
// Create an instance of StackTraceElement
|
||||
static oop create(Handle mirror, int method, int version, int bci, int cpref, TRAPS);
|
||||
static oop create(methodHandle method, int bci, TRAPS);
|
||||
static oop create(const methodHandle& method, int bci, TRAPS);
|
||||
|
||||
// Debugging
|
||||
friend class JavaClasses;
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2005, 2014, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2005, 2015, 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
|
||||
@ -32,7 +32,7 @@
|
||||
|
||||
// add new entry to the table
|
||||
void ResolutionErrorTable::add_entry(int index, unsigned int hash,
|
||||
constantPoolHandle pool, int cp_index,
|
||||
const constantPoolHandle& pool, int cp_index,
|
||||
Symbol* error, Symbol* message)
|
||||
{
|
||||
assert_locked_or_safepoint(SystemDictionary_lock);
|
||||
@ -44,7 +44,7 @@ void ResolutionErrorTable::add_entry(int index, unsigned int hash,
|
||||
|
||||
// find entry in the table
|
||||
ResolutionErrorEntry* ResolutionErrorTable::find_entry(int index, unsigned int hash,
|
||||
constantPoolHandle pool, int cp_index)
|
||||
const constantPoolHandle& pool, int cp_index)
|
||||
{
|
||||
assert_locked_or_safepoint(SystemDictionary_lock);
|
||||
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2005, 2014, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2005, 2015, 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
|
||||
@ -56,15 +56,15 @@ public:
|
||||
}
|
||||
|
||||
void add_entry(int index, unsigned int hash,
|
||||
constantPoolHandle pool, int which, Symbol* error, Symbol* message);
|
||||
const constantPoolHandle& pool, int which, Symbol* error, Symbol* message);
|
||||
|
||||
|
||||
// find error given the constant pool and constant pool index
|
||||
ResolutionErrorEntry* find_entry(int index, unsigned int hash,
|
||||
constantPoolHandle pool, int cp_index);
|
||||
const constantPoolHandle& pool, int cp_index);
|
||||
|
||||
|
||||
unsigned int compute_hash(constantPoolHandle pool, int cp_index) {
|
||||
unsigned int compute_hash(const constantPoolHandle& pool, int cp_index) {
|
||||
return (unsigned int) pool->identity_hash() + cp_index;
|
||||
}
|
||||
|
||||
|
||||
@ -371,7 +371,7 @@ Symbol* SymbolTable::lookup_only_unicode(const jchar* name, int utf16_length,
|
||||
}
|
||||
}
|
||||
|
||||
void SymbolTable::add(ClassLoaderData* loader_data, constantPoolHandle cp,
|
||||
void SymbolTable::add(ClassLoaderData* loader_data, const constantPoolHandle& cp,
|
||||
int names_count,
|
||||
const char** names, int* lengths, int* cp_indices,
|
||||
unsigned int* hashValues, TRAPS) {
|
||||
@ -452,7 +452,7 @@ Symbol* SymbolTable::basic_add(int index_arg, u1 *name, int len,
|
||||
|
||||
// This version of basic_add adds symbols in batch from the constant pool
|
||||
// parsing.
|
||||
bool SymbolTable::basic_add(ClassLoaderData* loader_data, constantPoolHandle cp,
|
||||
bool SymbolTable::basic_add(ClassLoaderData* loader_data, const constantPoolHandle& cp,
|
||||
int names_count,
|
||||
const char** names, int* lengths,
|
||||
int* cp_indices, unsigned int* hashValues,
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1997, 2015, 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
|
||||
@ -100,12 +100,12 @@ private:
|
||||
Symbol* basic_add(int index, u1* name, int len, unsigned int hashValue,
|
||||
bool c_heap, TRAPS);
|
||||
bool basic_add(ClassLoaderData* loader_data,
|
||||
constantPoolHandle cp, int names_count,
|
||||
const constantPoolHandle& cp, int names_count,
|
||||
const char** names, int* lengths, int* cp_indices,
|
||||
unsigned int* hashValues, TRAPS);
|
||||
|
||||
static void new_symbols(ClassLoaderData* loader_data,
|
||||
constantPoolHandle cp, int names_count,
|
||||
const constantPoolHandle& cp, int names_count,
|
||||
const char** name, int* lengths,
|
||||
int* cp_indices, unsigned int* hashValues,
|
||||
TRAPS) {
|
||||
@ -170,7 +170,7 @@ public:
|
||||
static Symbol* lookup_only_unicode(const jchar* name, int len, unsigned int& hash);
|
||||
|
||||
static void add(ClassLoaderData* loader_data,
|
||||
constantPoolHandle cp, int names_count,
|
||||
const constantPoolHandle& cp, int names_count,
|
||||
const char** names, int* lengths, int* cp_indices,
|
||||
unsigned int* hashValues, TRAPS);
|
||||
|
||||
|
||||
@ -2155,7 +2155,7 @@ bool SystemDictionary::add_loader_constraint(Symbol* class_name,
|
||||
|
||||
// Add entry to resolution error table to record the error when the first
|
||||
// attempt to resolve a reference to a class has failed.
|
||||
void SystemDictionary::add_resolution_error(constantPoolHandle pool, int which,
|
||||
void SystemDictionary::add_resolution_error(const constantPoolHandle& pool, int which,
|
||||
Symbol* error, Symbol* message) {
|
||||
unsigned int hash = resolution_errors()->compute_hash(pool, which);
|
||||
int index = resolution_errors()->hash_to_index(hash);
|
||||
@ -2171,7 +2171,7 @@ void SystemDictionary::delete_resolution_error(ConstantPool* pool) {
|
||||
}
|
||||
|
||||
// Lookup resolution error table. Returns error if found, otherwise NULL.
|
||||
Symbol* SystemDictionary::find_resolution_error(constantPoolHandle pool, int which,
|
||||
Symbol* SystemDictionary::find_resolution_error(const constantPoolHandle& pool, int which,
|
||||
Symbol** message) {
|
||||
unsigned int hash = resolution_errors()->compute_hash(pool, which);
|
||||
int index = resolution_errors()->hash_to_index(hash);
|
||||
|
||||
@ -547,10 +547,10 @@ public:
|
||||
|
||||
// Record the error when the first attempt to resolve a reference from a constant
|
||||
// pool entry to a class fails.
|
||||
static void add_resolution_error(constantPoolHandle pool, int which, Symbol* error,
|
||||
static void add_resolution_error(const constantPoolHandle& pool, int which, Symbol* error,
|
||||
Symbol* message);
|
||||
static void delete_resolution_error(ConstantPool* pool);
|
||||
static Symbol* find_resolution_error(constantPoolHandle pool, int which,
|
||||
static Symbol* find_resolution_error(const constantPoolHandle& pool, int which,
|
||||
Symbol** message);
|
||||
|
||||
protected:
|
||||
|
||||
@ -605,7 +605,7 @@ void ClassVerifier::verify_class(TRAPS) {
|
||||
}
|
||||
}
|
||||
|
||||
void ClassVerifier::verify_method(methodHandle m, TRAPS) {
|
||||
void ClassVerifier::verify_method(const methodHandle& m, TRAPS) {
|
||||
HandleMark hm(THREAD);
|
||||
_method = m; // initialize _method
|
||||
if (VerboseVerification) {
|
||||
@ -1901,7 +1901,7 @@ void ClassVerifier::verify_exception_handler_targets(u2 bci, bool this_uninit, S
|
||||
}
|
||||
|
||||
void ClassVerifier::verify_cp_index(
|
||||
u2 bci, constantPoolHandle cp, int index, TRAPS) {
|
||||
u2 bci, const constantPoolHandle& cp, int index, TRAPS) {
|
||||
int nconstants = cp->length();
|
||||
if ((index <= 0) || (index >= nconstants)) {
|
||||
verify_error(ErrorContext::bad_cp_index(bci, index),
|
||||
@ -1912,7 +1912,7 @@ void ClassVerifier::verify_cp_index(
|
||||
}
|
||||
|
||||
void ClassVerifier::verify_cp_type(
|
||||
u2 bci, int index, constantPoolHandle cp, unsigned int types, TRAPS) {
|
||||
u2 bci, int index, const constantPoolHandle& cp, unsigned int types, TRAPS) {
|
||||
|
||||
// In some situations, bytecode rewriting may occur while we're verifying.
|
||||
// In this case, a constant pool cache exists and some indices refer to that
|
||||
@ -1931,7 +1931,7 @@ void ClassVerifier::verify_cp_type(
|
||||
}
|
||||
|
||||
void ClassVerifier::verify_cp_class_type(
|
||||
u2 bci, int index, constantPoolHandle cp, TRAPS) {
|
||||
u2 bci, int index, const constantPoolHandle& cp, TRAPS) {
|
||||
verify_cp_index(bci, cp, index, CHECK_VERIFY(this));
|
||||
constantTag tag = cp->tag_at(index);
|
||||
if (!tag.is_klass() && !tag.is_unresolved_klass()) {
|
||||
@ -2023,7 +2023,7 @@ bool ClassVerifier::is_protected_access(instanceKlassHandle this_class,
|
||||
|
||||
void ClassVerifier::verify_ldc(
|
||||
int opcode, u2 index, StackMapFrame* current_frame,
|
||||
constantPoolHandle cp, u2 bci, TRAPS) {
|
||||
const constantPoolHandle& cp, u2 bci, TRAPS) {
|
||||
verify_cp_index(bci, cp, index, CHECK_VERIFY(this));
|
||||
constantTag tag = cp->tag_at(index);
|
||||
unsigned int types;
|
||||
@ -2165,7 +2165,7 @@ bool ClassVerifier::name_in_supers(
|
||||
|
||||
void ClassVerifier::verify_field_instructions(RawBytecodeStream* bcs,
|
||||
StackMapFrame* current_frame,
|
||||
constantPoolHandle cp,
|
||||
const constantPoolHandle& cp,
|
||||
bool allow_arrays,
|
||||
TRAPS) {
|
||||
u2 index = bcs->get_index_u2();
|
||||
@ -2477,7 +2477,7 @@ bool ClassVerifier::ends_in_athrow(u4 start_bc_offset) {
|
||||
void ClassVerifier::verify_invoke_init(
|
||||
RawBytecodeStream* bcs, u2 ref_class_index, VerificationType ref_class_type,
|
||||
StackMapFrame* current_frame, u4 code_length, bool in_try_block,
|
||||
bool *this_uninit, constantPoolHandle cp, StackMapTable* stackmap_table,
|
||||
bool *this_uninit, const constantPoolHandle& cp, StackMapTable* stackmap_table,
|
||||
TRAPS) {
|
||||
u2 bci = bcs->bci();
|
||||
VerificationType type = current_frame->pop_stack(
|
||||
@ -2613,7 +2613,7 @@ bool ClassVerifier::is_same_or_direct_interface(
|
||||
void ClassVerifier::verify_invoke_instructions(
|
||||
RawBytecodeStream* bcs, u4 code_length, StackMapFrame* current_frame,
|
||||
bool in_try_block, bool *this_uninit, VerificationType return_type,
|
||||
constantPoolHandle cp, StackMapTable* stackmap_table, TRAPS) {
|
||||
const constantPoolHandle& cp, StackMapTable* stackmap_table, TRAPS) {
|
||||
// Make sure the constant pool item is the right type
|
||||
u2 index = bcs->get_index_u2();
|
||||
Bytecodes::Code opcode = bcs->raw_code();
|
||||
@ -2878,7 +2878,7 @@ VerificationType ClassVerifier::get_newarray_type(
|
||||
}
|
||||
|
||||
void ClassVerifier::verify_anewarray(
|
||||
u2 bci, u2 index, constantPoolHandle cp,
|
||||
u2 bci, u2 index, const constantPoolHandle& cp,
|
||||
StackMapFrame* current_frame, TRAPS) {
|
||||
verify_cp_class_type(bci, index, cp, CHECK_VERIFY(this));
|
||||
current_frame->pop_stack(
|
||||
|
||||
@ -262,14 +262,14 @@ class ClassVerifier : public StackObj {
|
||||
|
||||
ErrorContext _error_context; // contains information about an error
|
||||
|
||||
void verify_method(methodHandle method, TRAPS);
|
||||
void verify_method(const methodHandle& method, TRAPS);
|
||||
char* generate_code_data(methodHandle m, u4 code_length, TRAPS);
|
||||
void verify_exception_handler_table(u4 code_length, char* code_data,
|
||||
int& min, int& max, TRAPS);
|
||||
void verify_local_variable_table(u4 code_length, char* code_data, TRAPS);
|
||||
|
||||
VerificationType cp_ref_index_to_type(
|
||||
int index, constantPoolHandle cp, TRAPS) {
|
||||
int index, const constantPoolHandle& cp, TRAPS) {
|
||||
return cp_index_to_type(cp->klass_ref_index_at(index), cp, THREAD);
|
||||
}
|
||||
|
||||
@ -277,10 +277,10 @@ class ClassVerifier : public StackObj {
|
||||
instanceKlassHandle this_class, Klass* target_class,
|
||||
Symbol* field_name, Symbol* field_sig, bool is_method);
|
||||
|
||||
void verify_cp_index(u2 bci, constantPoolHandle cp, int index, TRAPS);
|
||||
void verify_cp_type(u2 bci, int index, constantPoolHandle cp,
|
||||
void verify_cp_index(u2 bci, const constantPoolHandle& cp, int index, TRAPS);
|
||||
void verify_cp_type(u2 bci, int index, const constantPoolHandle& cp,
|
||||
unsigned int types, TRAPS);
|
||||
void verify_cp_class_type(u2 bci, int index, constantPoolHandle cp, TRAPS);
|
||||
void verify_cp_class_type(u2 bci, int index, const constantPoolHandle& cp, TRAPS);
|
||||
|
||||
u2 verify_stackmap_table(
|
||||
u2 stackmap_index, u2 bci, StackMapFrame* current_frame,
|
||||
@ -292,7 +292,7 @@ class ClassVerifier : public StackObj {
|
||||
|
||||
void verify_ldc(
|
||||
int opcode, u2 index, StackMapFrame *current_frame,
|
||||
constantPoolHandle cp, u2 bci, TRAPS);
|
||||
const constantPoolHandle& cp, u2 bci, TRAPS);
|
||||
|
||||
void verify_switch(
|
||||
RawBytecodeStream* bcs, u4 code_length, char* code_data,
|
||||
@ -300,12 +300,12 @@ class ClassVerifier : public StackObj {
|
||||
|
||||
void verify_field_instructions(
|
||||
RawBytecodeStream* bcs, StackMapFrame* current_frame,
|
||||
constantPoolHandle cp, bool allow_arrays, TRAPS);
|
||||
const constantPoolHandle& cp, bool allow_arrays, TRAPS);
|
||||
|
||||
void verify_invoke_init(
|
||||
RawBytecodeStream* bcs, u2 ref_index, VerificationType ref_class_type,
|
||||
StackMapFrame* current_frame, u4 code_length, bool in_try_block,
|
||||
bool* this_uninit, constantPoolHandle cp, StackMapTable* stackmap_table,
|
||||
bool* this_uninit, const constantPoolHandle& cp, StackMapTable* stackmap_table,
|
||||
TRAPS);
|
||||
|
||||
// Used by ends_in_athrow() to push all handlers that contain bci onto the
|
||||
@ -322,10 +322,10 @@ class ClassVerifier : public StackObj {
|
||||
void verify_invoke_instructions(
|
||||
RawBytecodeStream* bcs, u4 code_length, StackMapFrame* current_frame,
|
||||
bool in_try_block, bool* this_uninit, VerificationType return_type,
|
||||
constantPoolHandle cp, StackMapTable* stackmap_table, TRAPS);
|
||||
const constantPoolHandle& cp, StackMapTable* stackmap_table, TRAPS);
|
||||
|
||||
VerificationType get_newarray_type(u2 index, u2 bci, TRAPS);
|
||||
void verify_anewarray(u2 bci, u2 index, constantPoolHandle cp,
|
||||
void verify_anewarray(u2 bci, u2 index, const constantPoolHandle& cp,
|
||||
StackMapFrame* current_frame, TRAPS);
|
||||
void verify_return_value(
|
||||
VerificationType return_type, VerificationType type, u2 offset,
|
||||
@ -406,7 +406,7 @@ class ClassVerifier : public StackObj {
|
||||
int change_sig_to_verificationType(
|
||||
SignatureStream* sig_type, VerificationType* inference_type, TRAPS);
|
||||
|
||||
VerificationType cp_index_to_type(int index, constantPoolHandle cp, TRAPS) {
|
||||
VerificationType cp_index_to_type(int index, const constantPoolHandle& cp, TRAPS) {
|
||||
return VerificationType::reference_type(cp->klass_name_at(index));
|
||||
}
|
||||
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1997, 2015, 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,7 +417,7 @@ int vmIntrinsics::predicates_needed(vmIntrinsics::ID id) {
|
||||
}
|
||||
}
|
||||
|
||||
bool vmIntrinsics::is_disabled_by_flags(methodHandle method, methodHandle compilation_context) {
|
||||
bool vmIntrinsics::is_disabled_by_flags(const methodHandle& method, const methodHandle& compilation_context) {
|
||||
vmIntrinsics::ID id = method->intrinsic_id();
|
||||
assert(id != vmIntrinsics::_none, "must be a VM intrinsic");
|
||||
|
||||
|
||||
@ -1402,7 +1402,7 @@ public:
|
||||
|
||||
// Returns true if a compiler intrinsic is disabled by command-line flags
|
||||
// and false otherwise.
|
||||
static bool is_disabled_by_flags(methodHandle method, methodHandle compilation_context);
|
||||
static bool is_disabled_by_flags(const methodHandle& method, const methodHandle& compilation_context);
|
||||
};
|
||||
|
||||
#endif // SHARE_VM_CLASSFILE_VMSYMBOLS_HPP
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1997, 2015, 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
|
||||
@ -462,7 +462,7 @@ void CompiledIC::set_to_monomorphic(CompiledICInfo& info) {
|
||||
// is_optimized: Compiler has generated an optimized call (i.e., no inline
|
||||
// cache) static_bound: The call can be static bound (i.e, no need to use
|
||||
// inline cache)
|
||||
void CompiledIC::compute_monomorphic_entry(methodHandle method,
|
||||
void CompiledIC::compute_monomorphic_entry(const methodHandle& method,
|
||||
KlassHandle receiver_klass,
|
||||
bool is_optimized,
|
||||
bool static_bound,
|
||||
@ -594,7 +594,7 @@ void CompiledStaticCall::set(const StaticCallInfo& info) {
|
||||
|
||||
// Compute settings for a CompiledStaticCall. Since we might have to set
|
||||
// the stub when calling to the interpreter, we need to return arguments.
|
||||
void CompiledStaticCall::compute_entry(methodHandle m, StaticCallInfo& info) {
|
||||
void CompiledStaticCall::compute_entry(const methodHandle& m, StaticCallInfo& info) {
|
||||
nmethod* m_code = m->code();
|
||||
info._callee = m;
|
||||
if (m_code != NULL && m_code->is_in_use()) {
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1997, 2015, 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
|
||||
@ -222,7 +222,7 @@ class CompiledIC: public ResourceObj {
|
||||
// allocation in the code cache fails.
|
||||
bool set_to_megamorphic(CallInfo* call_info, Bytecodes::Code bytecode, TRAPS);
|
||||
|
||||
static void compute_monomorphic_entry(methodHandle method, KlassHandle receiver_klass,
|
||||
static void compute_monomorphic_entry(const methodHandle& method, KlassHandle receiver_klass,
|
||||
bool is_optimized, bool static_bound, CompiledICInfo& info, TRAPS);
|
||||
|
||||
// Location
|
||||
@ -324,7 +324,7 @@ class CompiledStaticCall: public NativeCall {
|
||||
void set(const StaticCallInfo& info);
|
||||
|
||||
// Compute entry point given a method
|
||||
static void compute_entry(methodHandle m, StaticCallInfo& info);
|
||||
static void compute_entry(const methodHandle& m, StaticCallInfo& info);
|
||||
|
||||
// Stub support
|
||||
address find_stub();
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1998, 2015, 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
|
||||
@ -324,7 +324,7 @@ int DebugInformationRecorder::find_sharable_decode_offset(int stream_offset) {
|
||||
// must call add_safepoint before: it sets PcDesc and this routine uses
|
||||
// the last PcDesc set
|
||||
void DebugInformationRecorder::describe_scope(int pc_offset,
|
||||
methodHandle methodH,
|
||||
const methodHandle& methodH,
|
||||
ciMethod* method,
|
||||
int bci,
|
||||
bool reexecute,
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1998, 2012, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1998, 2015, 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
|
||||
@ -98,7 +98,7 @@ class DebugInformationRecorder: public ResourceObj {
|
||||
// by add_non_safepoint, and the locals, expressions, and monitors
|
||||
// must all be null.
|
||||
void describe_scope(int pc_offset,
|
||||
methodHandle methodH,
|
||||
const methodHandle& methodH,
|
||||
ciMethod* method,
|
||||
int bci,
|
||||
bool reexecute,
|
||||
|
||||
@ -558,7 +558,7 @@ void nmethod::init_defaults() {
|
||||
#endif
|
||||
}
|
||||
|
||||
nmethod* nmethod::new_native_nmethod(methodHandle method,
|
||||
nmethod* nmethod::new_native_nmethod(const methodHandle& method,
|
||||
int compile_id,
|
||||
CodeBuffer *code_buffer,
|
||||
int vep_offset,
|
||||
@ -596,7 +596,7 @@ nmethod* nmethod::new_native_nmethod(methodHandle method,
|
||||
return nm;
|
||||
}
|
||||
|
||||
nmethod* nmethod::new_nmethod(methodHandle method,
|
||||
nmethod* nmethod::new_nmethod(const methodHandle& method,
|
||||
int compile_id,
|
||||
int entry_bci,
|
||||
CodeOffsets* offsets,
|
||||
|
||||
@ -307,7 +307,7 @@ class nmethod : public CodeBlob {
|
||||
|
||||
public:
|
||||
// create nmethod with entry_bci
|
||||
static nmethod* new_nmethod(methodHandle method,
|
||||
static nmethod* new_nmethod(const methodHandle& method,
|
||||
int compile_id,
|
||||
int entry_bci,
|
||||
CodeOffsets* offsets,
|
||||
@ -327,7 +327,7 @@ class nmethod : public CodeBlob {
|
||||
#endif
|
||||
);
|
||||
|
||||
static nmethod* new_native_nmethod(methodHandle method,
|
||||
static nmethod* new_native_nmethod(const methodHandle& method,
|
||||
int compile_id,
|
||||
CodeBuffer *code_buffer,
|
||||
int vep_offset,
|
||||
|
||||
@ -110,7 +110,7 @@ class AbstractCompiler : public CHeapObj<mtCompiler> {
|
||||
// Missing feature tests
|
||||
virtual bool supports_native() { return true; }
|
||||
virtual bool supports_osr () { return true; }
|
||||
virtual bool can_compile_method(methodHandle method) { return true; }
|
||||
virtual bool can_compile_method(const methodHandle& method) { return true; }
|
||||
|
||||
// Determine if the current compiler provides an intrinsic
|
||||
// for method 'method'. An intrinsic is available if:
|
||||
@ -141,7 +141,7 @@ class AbstractCompiler : public CHeapObj<mtCompiler> {
|
||||
// disable intrinsics on a per-method basis. In cases (2) and (3) the
|
||||
// compilation context is aClass::aMethod and java.lang.ref.Reference::get,
|
||||
// respectively.
|
||||
virtual bool is_intrinsic_available(methodHandle method, methodHandle compilation_context) {
|
||||
virtual bool is_intrinsic_available(const methodHandle& method, const methodHandle& compilation_context) {
|
||||
return is_intrinsic_supported(method) &&
|
||||
!vmIntrinsics::is_disabled_by_flags(method, compilation_context);
|
||||
}
|
||||
@ -154,7 +154,7 @@ class AbstractCompiler : public CHeapObj<mtCompiler> {
|
||||
// by default no intrinsics are supported by a compiler except
|
||||
// the ones listed in the method. Overriding methods should conform
|
||||
// to this behavior.
|
||||
virtual bool is_intrinsic_supported(methodHandle method) {
|
||||
virtual bool is_intrinsic_supported(const methodHandle& method) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@ -777,10 +777,10 @@ void CompileBroker::mark_on_stack() {
|
||||
// CompileBroker::compile_method
|
||||
//
|
||||
// Request compilation of a method.
|
||||
void CompileBroker::compile_method_base(methodHandle method,
|
||||
void CompileBroker::compile_method_base(const methodHandle& method,
|
||||
int osr_bci,
|
||||
int comp_level,
|
||||
methodHandle hot_method,
|
||||
const methodHandle& hot_method,
|
||||
int hot_count,
|
||||
const char* comment,
|
||||
Thread* thread) {
|
||||
@ -980,9 +980,9 @@ void CompileBroker::compile_method_base(methodHandle method,
|
||||
}
|
||||
|
||||
|
||||
nmethod* CompileBroker::compile_method(methodHandle method, int osr_bci,
|
||||
nmethod* CompileBroker::compile_method(const methodHandle& method, int osr_bci,
|
||||
int comp_level,
|
||||
methodHandle hot_method, int hot_count,
|
||||
const methodHandle& hot_method, int hot_count,
|
||||
const char* comment, Thread* THREAD) {
|
||||
// make sure arguments make sense
|
||||
assert(method->method_holder()->oop_is_instance(), "not an instance method");
|
||||
@ -1121,7 +1121,7 @@ nmethod* CompileBroker::compile_method(methodHandle method, int osr_bci,
|
||||
// CompileBroker::compilation_is_complete
|
||||
//
|
||||
// See if compilation of this method is already complete.
|
||||
bool CompileBroker::compilation_is_complete(methodHandle method,
|
||||
bool CompileBroker::compilation_is_complete(const methodHandle& method,
|
||||
int osr_bci,
|
||||
int comp_level) {
|
||||
bool is_osr = (osr_bci != standard_entry_bci);
|
||||
@ -1154,7 +1154,7 @@ bool CompileBroker::compilation_is_complete(methodHandle method,
|
||||
* versa). This can be remedied by a full queue search to disambiguate
|
||||
* cases. If it is deemed profitable, this may be done.
|
||||
*/
|
||||
bool CompileBroker::compilation_is_in_queue(methodHandle method) {
|
||||
bool CompileBroker::compilation_is_in_queue(const methodHandle& method) {
|
||||
return method->queued_for_compilation();
|
||||
}
|
||||
|
||||
@ -1162,7 +1162,7 @@ bool CompileBroker::compilation_is_in_queue(methodHandle method) {
|
||||
// CompileBroker::compilation_is_prohibited
|
||||
//
|
||||
// See if this compilation is not allowed.
|
||||
bool CompileBroker::compilation_is_prohibited(methodHandle method, int osr_bci, int comp_level) {
|
||||
bool CompileBroker::compilation_is_prohibited(const methodHandle& method, int osr_bci, int comp_level) {
|
||||
bool is_native = method->is_native();
|
||||
// Some compilers may not support the compilation of natives.
|
||||
AbstractCompiler *comp = compiler(comp_level);
|
||||
@ -1205,7 +1205,7 @@ bool CompileBroker::compilation_is_prohibited(methodHandle method, int osr_bci,
|
||||
* and the ID is not within the specified range, the method is not compiled and 0 is returned.
|
||||
* The function also allows to generate separate compilation IDs for OSR compilations.
|
||||
*/
|
||||
int CompileBroker::assign_compile_id(methodHandle method, int osr_bci) {
|
||||
int CompileBroker::assign_compile_id(const methodHandle& method, int osr_bci) {
|
||||
#ifdef ASSERT
|
||||
bool is_osr = (osr_bci != standard_entry_bci);
|
||||
int id;
|
||||
@ -1240,7 +1240,7 @@ int CompileBroker::assign_compile_id(methodHandle method, int osr_bci) {
|
||||
// CompileBroker::assign_compile_id_unlocked
|
||||
//
|
||||
// Public wrapper for assign_compile_id that acquires the needed locks
|
||||
uint CompileBroker::assign_compile_id_unlocked(Thread* thread, methodHandle method, int osr_bci) {
|
||||
uint CompileBroker::assign_compile_id_unlocked(Thread* thread, const methodHandle& method, int osr_bci) {
|
||||
MutexLocker locker(MethodCompileQueue_lock, thread);
|
||||
return assign_compile_id(method, osr_bci);
|
||||
}
|
||||
@ -1257,7 +1257,7 @@ bool CompileBroker::is_compile_blocking() {
|
||||
|
||||
// ------------------------------------------------------------------
|
||||
// CompileBroker::preload_classes
|
||||
void CompileBroker::preload_classes(methodHandle method, TRAPS) {
|
||||
void CompileBroker::preload_classes(const methodHandle& method, TRAPS) {
|
||||
// Move this code over from c1_Compiler.cpp
|
||||
ShouldNotReachHere();
|
||||
}
|
||||
@ -1270,10 +1270,10 @@ void CompileBroker::preload_classes(methodHandle method, TRAPS) {
|
||||
// compilation. Add this task to the queue.
|
||||
CompileTask* CompileBroker::create_compile_task(CompileQueue* queue,
|
||||
int compile_id,
|
||||
methodHandle method,
|
||||
const methodHandle& method,
|
||||
int osr_bci,
|
||||
int comp_level,
|
||||
methodHandle hot_method,
|
||||
const methodHandle& hot_method,
|
||||
int hot_count,
|
||||
const char* comment,
|
||||
bool blocking) {
|
||||
@ -1866,7 +1866,7 @@ void CompileBroker::handle_full_code_cache(int code_blob_type) {
|
||||
// CompileBroker::set_last_compile
|
||||
//
|
||||
// Record this compilation for debugging purposes.
|
||||
void CompileBroker::set_last_compile(CompilerThread* thread, methodHandle method, bool is_osr, int comp_level) {
|
||||
void CompileBroker::set_last_compile(CompilerThread* thread, const methodHandle& method, bool is_osr, int comp_level) {
|
||||
ResourceMark rm;
|
||||
char* method_name = method->name()->as_C_string();
|
||||
strncpy(_last_method_compiled, method_name, CompileBroker::name_buffer_length);
|
||||
@ -1952,7 +1952,7 @@ void CompileBroker::pop_jni_handle_block() {
|
||||
// CompileBroker::check_break_at
|
||||
//
|
||||
// Should the compilation break at the current compilation.
|
||||
bool CompileBroker::check_break_at(methodHandle method, int compile_id, bool is_osr) {
|
||||
bool CompileBroker::check_break_at(const methodHandle& method, int compile_id, bool is_osr) {
|
||||
if (CICountOSR && is_osr && (compile_id == CIBreakAtOSR)) {
|
||||
return true;
|
||||
} else if( CompilerOracle::should_break_at(method) ) { // break when compiling
|
||||
|
||||
@ -144,7 +144,7 @@ class CompileBroker: AllStatic {
|
||||
|
||||
// Compile type Information for print_last_compile() and CompilerCounters
|
||||
enum { no_compile, normal_compile, osr_compile, native_compile };
|
||||
static int assign_compile_id (methodHandle method, int osr_bci);
|
||||
static int assign_compile_id (const methodHandle& method, int osr_bci);
|
||||
|
||||
|
||||
private:
|
||||
@ -217,17 +217,17 @@ class CompileBroker: AllStatic {
|
||||
|
||||
static JavaThread* make_thread(const char* name, CompileQueue* queue, CompilerCounters* counters, AbstractCompiler* comp, bool compiler_thread, TRAPS);
|
||||
static void init_compiler_sweeper_threads(int c1_compiler_count, int c2_compiler_count);
|
||||
static bool compilation_is_complete (methodHandle method, int osr_bci, int comp_level);
|
||||
static bool compilation_is_prohibited(methodHandle method, int osr_bci, int comp_level);
|
||||
static bool compilation_is_complete (const methodHandle& method, int osr_bci, int comp_level);
|
||||
static bool compilation_is_prohibited(const methodHandle& method, int osr_bci, int comp_level);
|
||||
static bool is_compile_blocking();
|
||||
static void preload_classes (methodHandle method, TRAPS);
|
||||
static void preload_classes (const methodHandle& method, TRAPS);
|
||||
|
||||
static CompileTask* create_compile_task(CompileQueue* queue,
|
||||
int compile_id,
|
||||
methodHandle method,
|
||||
const methodHandle& method,
|
||||
int osr_bci,
|
||||
int comp_level,
|
||||
methodHandle hot_method,
|
||||
const methodHandle& hot_method,
|
||||
int hot_count,
|
||||
const char* comment,
|
||||
bool blocking);
|
||||
@ -235,16 +235,16 @@ class CompileBroker: AllStatic {
|
||||
|
||||
static void invoke_compiler_on_method(CompileTask* task);
|
||||
static void post_compile(CompilerThread* thread, CompileTask* task, EventCompilation& event, bool success, ciEnv* ci_env);
|
||||
static void set_last_compile(CompilerThread *thread, methodHandle method, bool is_osr, int comp_level);
|
||||
static void set_last_compile(CompilerThread *thread, const methodHandle& method, bool is_osr, int comp_level);
|
||||
static void push_jni_handle_block();
|
||||
static void pop_jni_handle_block();
|
||||
static bool check_break_at(methodHandle method, int compile_id, bool is_osr);
|
||||
static bool check_break_at(const methodHandle& method, int compile_id, bool is_osr);
|
||||
static void collect_statistics(CompilerThread* thread, elapsedTimer time, CompileTask* task);
|
||||
|
||||
static void compile_method_base(methodHandle method,
|
||||
static void compile_method_base(const methodHandle& method,
|
||||
int osr_bci,
|
||||
int comp_level,
|
||||
methodHandle hot_method,
|
||||
const methodHandle& hot_method,
|
||||
int hot_count,
|
||||
const char* comment,
|
||||
Thread* thread);
|
||||
@ -265,7 +265,7 @@ class CompileBroker: AllStatic {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static bool compilation_is_in_queue(methodHandle method);
|
||||
static bool compilation_is_in_queue(const methodHandle& method);
|
||||
static void print_compile_queues(outputStream* st);
|
||||
static int queue_size(int comp_level) {
|
||||
CompileQueue *q = compile_queue(comp_level);
|
||||
@ -273,15 +273,15 @@ class CompileBroker: AllStatic {
|
||||
}
|
||||
static void compilation_init();
|
||||
static void init_compiler_thread_log();
|
||||
static nmethod* compile_method(methodHandle method,
|
||||
static nmethod* compile_method(const methodHandle& method,
|
||||
int osr_bci,
|
||||
int comp_level,
|
||||
methodHandle hot_method,
|
||||
const methodHandle& hot_method,
|
||||
int hot_count,
|
||||
const char* comment, Thread* thread);
|
||||
|
||||
// Acquire any needed locks and assign a compile id
|
||||
static uint assign_compile_id_unlocked(Thread* thread, methodHandle method, int osr_bci);
|
||||
static uint assign_compile_id_unlocked(Thread* thread, const methodHandle& method, int osr_bci);
|
||||
|
||||
static void compiler_thread_loop();
|
||||
static uint get_compilation_id() { return _compilation_id; }
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1998, 2014, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1998, 2015, 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
|
||||
@ -75,10 +75,10 @@ void CompileTask::free(CompileTask* task) {
|
||||
|
||||
|
||||
void CompileTask::initialize(int compile_id,
|
||||
methodHandle method,
|
||||
const methodHandle& method,
|
||||
int osr_bci,
|
||||
int comp_level,
|
||||
methodHandle hot_method,
|
||||
const methodHandle& hot_method,
|
||||
int hot_count,
|
||||
const char* comment,
|
||||
bool is_blocking) {
|
||||
|
||||
@ -71,8 +71,8 @@ class CompileTask : public CHeapObj<mtCompiler> {
|
||||
_lock = new Monitor(Mutex::nonleaf+2, "CompileTaskLock");
|
||||
}
|
||||
|
||||
void initialize(int compile_id, methodHandle method, int osr_bci, int comp_level,
|
||||
methodHandle hot_method, int hot_count, const char* comment,
|
||||
void initialize(int compile_id, const methodHandle& method, int osr_bci, int comp_level,
|
||||
const methodHandle& hot_method, int hot_count, const char* comment,
|
||||
bool is_blocking);
|
||||
|
||||
static CompileTask* allocate();
|
||||
|
||||
@ -313,7 +313,7 @@ static void add_predicate(OracleCommand command, BasicMatcher* bm) {
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
bool CompilerOracle::has_option_value(methodHandle method, const char* option, T& value) {
|
||||
bool CompilerOracle::has_option_value(const methodHandle& method, const char* option, T& value) {
|
||||
if (option_list != NULL) {
|
||||
TypedMethodOptionMatcher* m = option_list->match(method, option, get_type_for<T>());
|
||||
if (m != NULL) {
|
||||
@ -325,19 +325,19 @@ bool CompilerOracle::has_option_value(methodHandle method, const char* option, T
|
||||
}
|
||||
|
||||
// Explicit instantiation for all OptionTypes supported.
|
||||
template bool CompilerOracle::has_option_value<intx>(methodHandle method, const char* option, intx& value);
|
||||
template bool CompilerOracle::has_option_value<uintx>(methodHandle method, const char* option, uintx& value);
|
||||
template bool CompilerOracle::has_option_value<bool>(methodHandle method, const char* option, bool& value);
|
||||
template bool CompilerOracle::has_option_value<ccstr>(methodHandle method, const char* option, ccstr& value);
|
||||
template bool CompilerOracle::has_option_value<double>(methodHandle method, const char* option, double& value);
|
||||
template bool CompilerOracle::has_option_value<intx>(const methodHandle& method, const char* option, intx& value);
|
||||
template bool CompilerOracle::has_option_value<uintx>(const methodHandle& method, const char* option, uintx& value);
|
||||
template bool CompilerOracle::has_option_value<bool>(const methodHandle& method, const char* option, bool& value);
|
||||
template bool CompilerOracle::has_option_value<ccstr>(const methodHandle& method, const char* option, ccstr& value);
|
||||
template bool CompilerOracle::has_option_value<double>(const methodHandle& method, const char* option, double& value);
|
||||
|
||||
bool CompilerOracle::has_option_string(methodHandle method, const char* option) {
|
||||
bool CompilerOracle::has_option_string(const methodHandle& method, const char* option) {
|
||||
bool value = false;
|
||||
has_option_value(method, option, value);
|
||||
return value;
|
||||
}
|
||||
|
||||
bool CompilerOracle::should_exclude(methodHandle method, bool& quietly) {
|
||||
bool CompilerOracle::should_exclude(const methodHandle& method, bool& quietly) {
|
||||
quietly = true;
|
||||
if (lists[ExcludeCommand] != NULL) {
|
||||
if (lists[ExcludeCommand]->match(method)) {
|
||||
@ -352,17 +352,17 @@ bool CompilerOracle::should_exclude(methodHandle method, bool& quietly) {
|
||||
return false;
|
||||
}
|
||||
|
||||
bool CompilerOracle::should_inline(methodHandle method) {
|
||||
bool CompilerOracle::should_inline(const methodHandle& method) {
|
||||
return (check_predicate(InlineCommand, method));
|
||||
}
|
||||
|
||||
// Check both DontInlineCommand and ExcludeCommand here
|
||||
// - consistent behavior for all compilers
|
||||
bool CompilerOracle::should_not_inline(methodHandle method) {
|
||||
bool CompilerOracle::should_not_inline(const methodHandle& method) {
|
||||
return check_predicate(DontInlineCommand, method) || check_predicate(ExcludeCommand, method);
|
||||
}
|
||||
|
||||
bool CompilerOracle::should_print(methodHandle method) {
|
||||
bool CompilerOracle::should_print(const methodHandle& method) {
|
||||
return check_predicate(PrintCommand, method);
|
||||
}
|
||||
|
||||
@ -370,13 +370,13 @@ bool CompilerOracle::should_print_methods() {
|
||||
return lists[PrintCommand] != NULL;
|
||||
}
|
||||
|
||||
bool CompilerOracle::should_log(methodHandle method) {
|
||||
bool CompilerOracle::should_log(const methodHandle& method) {
|
||||
if (!LogCompilation) return false;
|
||||
if (lists[LogCommand] == NULL) return true; // by default, log all
|
||||
return (check_predicate(LogCommand, method));
|
||||
}
|
||||
|
||||
bool CompilerOracle::should_break_at(methodHandle method) {
|
||||
bool CompilerOracle::should_break_at(const methodHandle& method) {
|
||||
return check_predicate(BreakCommand, method);
|
||||
}
|
||||
|
||||
@ -756,7 +756,7 @@ void CompilerOracle::append_comment_to_file(const char* message) {
|
||||
stream.cr();
|
||||
}
|
||||
|
||||
void CompilerOracle::append_exclude_to_file(methodHandle method) {
|
||||
void CompilerOracle::append_exclude_to_file(const methodHandle& method) {
|
||||
assert(has_command_file(), "command file must be specified");
|
||||
fileStream stream(fopen(cc_file(), "at"));
|
||||
stream.print("exclude ");
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1998, 2014, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1998, 2015, 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
|
||||
@ -46,30 +46,30 @@ class CompilerOracle : AllStatic {
|
||||
static void parse_from_file();
|
||||
|
||||
// Tells whether we to exclude compilation of method
|
||||
static bool should_exclude(methodHandle method, bool& quietly);
|
||||
static bool should_exclude(const methodHandle& method, bool& quietly);
|
||||
|
||||
// Tells whether we want to inline this method
|
||||
static bool should_inline(methodHandle method);
|
||||
static bool should_inline(const methodHandle& method);
|
||||
|
||||
// Tells whether we want to disallow inlining of this method
|
||||
static bool should_not_inline(methodHandle method);
|
||||
static bool should_not_inline(const methodHandle& method);
|
||||
|
||||
// Tells whether we should print the assembly for this method
|
||||
static bool should_print(methodHandle method);
|
||||
static bool should_print(const methodHandle& method);
|
||||
|
||||
// Tells whether we should log the compilation data for this method
|
||||
static bool should_log(methodHandle method);
|
||||
static bool should_log(const methodHandle& method);
|
||||
|
||||
// Tells whether to break when compiling method
|
||||
static bool should_break_at(methodHandle method);
|
||||
static bool should_break_at(const methodHandle& method);
|
||||
|
||||
// Check to see if this method has option set for it
|
||||
static bool has_option_string(methodHandle method, const char * option);
|
||||
static bool has_option_string(const methodHandle& method, const char * option);
|
||||
|
||||
// Check if method has option and value set. If yes, overwrite value and return true,
|
||||
// otherwise leave value unchanged and return false.
|
||||
template<typename T>
|
||||
static bool has_option_value(methodHandle method, const char* option, T& value);
|
||||
static bool has_option_value(const methodHandle& method, const char* option, T& value);
|
||||
|
||||
// Reads from string instead of file
|
||||
static void parse_from_string(const char* command_string, void (*parser)(char*));
|
||||
@ -79,7 +79,7 @@ class CompilerOracle : AllStatic {
|
||||
|
||||
// For updating the oracle file
|
||||
static void append_comment_to_file(const char* message);
|
||||
static void append_exclude_to_file(methodHandle method);
|
||||
static void append_exclude_to_file(const methodHandle& method);
|
||||
|
||||
// Tells whether there are any methods to print for print_method_statistics()
|
||||
static bool should_print_methods();
|
||||
|
||||
@ -306,7 +306,7 @@ void MethodMatcher::parse_method_pattern(char*& line, const char*& error_msg, Me
|
||||
}
|
||||
}
|
||||
|
||||
bool MethodMatcher::matches(methodHandle method) const {
|
||||
bool MethodMatcher::matches(const methodHandle& method) const {
|
||||
Symbol* class_name = method->method_holder()->name();
|
||||
Symbol* method_name = method->name();
|
||||
Symbol* signature = method->signature();
|
||||
|
||||
@ -60,7 +60,7 @@ class MethodMatcher : public CHeapObj<mtCompiler> {
|
||||
void init(Symbol* class_name, Mode class_mode, Symbol* method_name, Mode method_mode, Symbol* signature);
|
||||
static void parse_method_pattern(char*& line, const char*& error_msg, MethodMatcher* m);
|
||||
static void print_symbol(outputStream* st, Symbol* h, Mode mode);
|
||||
bool matches(methodHandle method) const;
|
||||
bool matches(const methodHandle& method) const;
|
||||
void print_base(outputStream* st);
|
||||
|
||||
private:
|
||||
@ -101,7 +101,7 @@ public:
|
||||
return bm;
|
||||
}
|
||||
|
||||
bool match(methodHandle method) {
|
||||
bool match(const methodHandle& method) {
|
||||
for (BasicMatcher* current = this; current != NULL; current = current->next()) {
|
||||
if (current->matches(method)) {
|
||||
return true;
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1997, 2015, 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
|
||||
@ -194,7 +194,7 @@ class AbstractInterpreter: AllStatic {
|
||||
bool is_bottom_frame);
|
||||
|
||||
// Runtime support
|
||||
static bool is_not_reached( methodHandle method, int bci);
|
||||
static bool is_not_reached(const methodHandle& method, int bci);
|
||||
// Safepoint support
|
||||
static void notice_safepoints() { ShouldNotReachHere(); } // stops the thread when reaching a safepoint
|
||||
static void ignore_safepoints() { ShouldNotReachHere(); } // ignores safepoints
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1997, 2015, 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
|
||||
@ -179,7 +179,7 @@ class Bytecode_member_ref: public Bytecode {
|
||||
protected:
|
||||
const methodHandle _method; // method containing the bytecode
|
||||
|
||||
Bytecode_member_ref(methodHandle method, int bci) : Bytecode(method(), method()->bcp_from(bci)), _method(method) {}
|
||||
Bytecode_member_ref(const methodHandle& method, int bci) : Bytecode(method(), method()->bcp_from(bci)), _method(method) {}
|
||||
|
||||
methodHandle method() const { return _method; }
|
||||
ConstantPool* constants() const { return _method->constants(); }
|
||||
@ -201,10 +201,10 @@ class Bytecode_member_ref: public Bytecode {
|
||||
class Bytecode_invoke: public Bytecode_member_ref {
|
||||
protected:
|
||||
// Constructor that skips verification
|
||||
Bytecode_invoke(methodHandle method, int bci, bool unused) : Bytecode_member_ref(method, bci) {}
|
||||
Bytecode_invoke(const methodHandle& method, int bci, bool unused) : Bytecode_member_ref(method, bci) {}
|
||||
|
||||
public:
|
||||
Bytecode_invoke(methodHandle method, int bci) : Bytecode_member_ref(method, bci) { verify(); }
|
||||
Bytecode_invoke(const methodHandle& method, int bci) : Bytecode_member_ref(method, bci) { verify(); }
|
||||
void verify() const;
|
||||
|
||||
// Attributes
|
||||
@ -232,10 +232,10 @@ class Bytecode_invoke: public Bytecode_member_ref {
|
||||
|
||||
private:
|
||||
// Helper to skip verification. Used is_valid() to check if the result is really an invoke
|
||||
inline friend Bytecode_invoke Bytecode_invoke_check(methodHandle method, int bci);
|
||||
inline friend Bytecode_invoke Bytecode_invoke_check(const methodHandle& method, int bci);
|
||||
};
|
||||
|
||||
inline Bytecode_invoke Bytecode_invoke_check(methodHandle method, int bci) {
|
||||
inline Bytecode_invoke Bytecode_invoke_check(const methodHandle& method, int bci) {
|
||||
return Bytecode_invoke(method, bci, false);
|
||||
}
|
||||
|
||||
@ -243,7 +243,7 @@ inline Bytecode_invoke Bytecode_invoke_check(methodHandle method, int bci) {
|
||||
// Abstraction for all field accesses (put/get field/static)
|
||||
class Bytecode_field: public Bytecode_member_ref {
|
||||
public:
|
||||
Bytecode_field(methodHandle method, int bci) : Bytecode_member_ref(method, bci) { verify(); }
|
||||
Bytecode_field(const methodHandle& method, int bci) : Bytecode_member_ref(method, bci) { verify(); }
|
||||
|
||||
// Testers
|
||||
bool is_getfield() const { return java_code() == Bytecodes::_getfield; }
|
||||
@ -316,7 +316,7 @@ class Bytecode_loadconstant: public Bytecode {
|
||||
int raw_index() const;
|
||||
|
||||
public:
|
||||
Bytecode_loadconstant(methodHandle method, int bci): Bytecode(method(), method->bcp_from(bci)), _method(method) { verify(); }
|
||||
Bytecode_loadconstant(const methodHandle& method, int bci): Bytecode(method(), method->bcp_from(bci)), _method(method) { verify(); }
|
||||
|
||||
void verify() const {
|
||||
assert(_method.not_null(), "must supply method");
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1997, 2015, 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
|
||||
@ -63,7 +63,7 @@ class BaseBytecodeStream: StackObj {
|
||||
bool _is_raw; // false in 'cooked' BytecodeStream
|
||||
|
||||
// Construction
|
||||
BaseBytecodeStream(methodHandle method) : _method(method) {
|
||||
BaseBytecodeStream(const methodHandle& method) : _method(method) {
|
||||
set_interval(0, _method->code_size());
|
||||
_is_raw = false;
|
||||
}
|
||||
@ -118,7 +118,7 @@ class BaseBytecodeStream: StackObj {
|
||||
class RawBytecodeStream: public BaseBytecodeStream {
|
||||
public:
|
||||
// Construction
|
||||
RawBytecodeStream(methodHandle method) : BaseBytecodeStream(method) {
|
||||
RawBytecodeStream(const methodHandle& method) : BaseBytecodeStream(method) {
|
||||
_is_raw = true;
|
||||
}
|
||||
|
||||
@ -169,7 +169,7 @@ class BytecodeStream: public BaseBytecodeStream {
|
||||
|
||||
public:
|
||||
// Construction
|
||||
BytecodeStream(methodHandle method) : BaseBytecodeStream(method) { }
|
||||
BytecodeStream(const methodHandle& method) : BaseBytecodeStream(method) { }
|
||||
|
||||
// Iteration
|
||||
Bytecodes::Code next() {
|
||||
|
||||
@ -84,7 +84,7 @@ class BytecodePrinter: public BytecodeClosure {
|
||||
|
||||
// This method is called while executing the raw bytecodes, so none of
|
||||
// the adjustments that BytecodeStream performs applies.
|
||||
void trace(methodHandle method, address bcp, uintptr_t tos, uintptr_t tos2, outputStream* st) {
|
||||
void trace(const methodHandle& method, address bcp, uintptr_t tos, uintptr_t tos2, outputStream* st) {
|
||||
ResourceMark rm;
|
||||
if (_current_method != method()) {
|
||||
// Note 1: This code will not work as expected with true MT/MP.
|
||||
@ -126,7 +126,7 @@ class BytecodePrinter: public BytecodeClosure {
|
||||
|
||||
// Used for Method*::print_codes(). The input bcp comes from
|
||||
// BytecodeStream, which will skip wide bytecodes.
|
||||
void trace(methodHandle method, address bcp, outputStream* st) {
|
||||
void trace(const methodHandle& method, address bcp, outputStream* st) {
|
||||
_current_method = method();
|
||||
ResourceMark rm;
|
||||
Bytecodes::Code code = Bytecodes::code_at(method(), bcp);
|
||||
@ -166,7 +166,7 @@ BytecodeClosure* BytecodeTracer::std_closure() {
|
||||
}
|
||||
|
||||
|
||||
void BytecodeTracer::trace(methodHandle method, address bcp, uintptr_t tos, uintptr_t tos2, outputStream* st) {
|
||||
void BytecodeTracer::trace(const methodHandle& method, address bcp, uintptr_t tos, uintptr_t tos2, outputStream* st) {
|
||||
if (TraceBytecodes && BytecodeCounter::counter_value() >= TraceBytecodesAt) {
|
||||
ttyLocker ttyl; // 5065316: keep the following output coherent
|
||||
// The ttyLocker also prevents races between two threads
|
||||
@ -185,7 +185,7 @@ void BytecodeTracer::trace(methodHandle method, address bcp, uintptr_t tos, uint
|
||||
}
|
||||
}
|
||||
|
||||
void BytecodeTracer::trace(methodHandle method, address bcp, outputStream* st) {
|
||||
void BytecodeTracer::trace(const methodHandle& method, address bcp, outputStream* st) {
|
||||
ttyLocker ttyl; // 5065316: keep the following output coherent
|
||||
_closure->trace(method, bcp, st);
|
||||
}
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1997, 2015, 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
|
||||
@ -46,8 +46,8 @@ class BytecodeTracer: AllStatic {
|
||||
static BytecodeClosure* closure() { return _closure; }
|
||||
static void set_closure(BytecodeClosure* closure) { _closure = closure; }
|
||||
|
||||
static void trace(methodHandle method, address bcp, uintptr_t tos, uintptr_t tos2, outputStream* st = tty);
|
||||
static void trace(methodHandle method, address bcp, outputStream* st = tty);
|
||||
static void trace(const methodHandle& method, address bcp, uintptr_t tos, uintptr_t tos2, outputStream* st = tty);
|
||||
static void trace(const methodHandle& method, address bcp, outputStream* st = tty);
|
||||
};
|
||||
|
||||
|
||||
@ -55,8 +55,8 @@ class BytecodeTracer: AllStatic {
|
||||
|
||||
class BytecodeClosure {
|
||||
public:
|
||||
virtual void trace(methodHandle method, address bcp, uintptr_t tos, uintptr_t tos2, outputStream* st) = 0;
|
||||
virtual void trace(methodHandle method, address bcp, outputStream* st) = 0;
|
||||
virtual void trace(const methodHandle& method, address bcp, uintptr_t tos, uintptr_t tos2, outputStream* st) = 0;
|
||||
virtual void trace(const methodHandle& method, address bcp, outputStream* st) = 0;
|
||||
};
|
||||
|
||||
#endif // SHARE_VM_INTERPRETER_BYTECODETRACER_HPP
|
||||
|
||||
@ -320,7 +320,7 @@ void AbstractInterpreter::set_entry_for_kind(AbstractInterpreter::MethodKind kin
|
||||
|
||||
// Return true if the interpreter can prove that the given bytecode has
|
||||
// not yet been executed (in Java semantics, not in actual operation).
|
||||
bool AbstractInterpreter::is_not_reached(methodHandle method, int bci) {
|
||||
bool AbstractInterpreter::is_not_reached(const methodHandle& method, int bci) {
|
||||
Bytecodes::Code code = method()->code_at(bci);
|
||||
|
||||
if (!Bytecodes::must_rewrite(code)) {
|
||||
|
||||
@ -1192,7 +1192,7 @@ address SignatureHandlerLibrary::set_handler(CodeBuffer* buffer) {
|
||||
return handler;
|
||||
}
|
||||
|
||||
void SignatureHandlerLibrary::add(methodHandle method) {
|
||||
void SignatureHandlerLibrary::add(const methodHandle& method) {
|
||||
if (method->signature_handler() == NULL) {
|
||||
// use slow signature handler if we can't do better
|
||||
int handler_index = -1;
|
||||
|
||||
@ -218,7 +218,7 @@ class SignatureHandlerLibrary: public AllStatic {
|
||||
static void pd_set_handler(address handler);
|
||||
|
||||
public:
|
||||
static void add(methodHandle method);
|
||||
static void add(const methodHandle& method);
|
||||
static void add(uint64_t fingerprint, address handler);
|
||||
};
|
||||
|
||||
|
||||
@ -237,7 +237,7 @@ void CallInfo::print() {
|
||||
//------------------------------------------------------------------------------------------------------------------------
|
||||
// Implementation of LinkInfo
|
||||
|
||||
LinkInfo::LinkInfo(constantPoolHandle pool, int index, TRAPS) {
|
||||
LinkInfo::LinkInfo(const constantPoolHandle& pool, int index, TRAPS) {
|
||||
// resolve klass
|
||||
Klass* result = pool->klass_ref_at(index, CHECK);
|
||||
_resolved_klass = KlassHandle(THREAD, result);
|
||||
@ -559,7 +559,7 @@ void LinkResolver::check_method_accessability(KlassHandle ref_klass,
|
||||
}
|
||||
|
||||
methodHandle LinkResolver::resolve_method_statically(Bytecodes::Code code,
|
||||
constantPoolHandle pool, int index, TRAPS) {
|
||||
const constantPoolHandle& pool, int index, TRAPS) {
|
||||
// This method is used only
|
||||
// (1) in C2 from InlineTree::ok_to_inline (via ciMethod::check_call),
|
||||
// and
|
||||
@ -816,7 +816,7 @@ void LinkResolver::check_field_accessability(KlassHandle ref_klass,
|
||||
}
|
||||
}
|
||||
|
||||
void LinkResolver::resolve_field_access(fieldDescriptor& fd, constantPoolHandle pool, int index, Bytecodes::Code byte, TRAPS) {
|
||||
void LinkResolver::resolve_field_access(fieldDescriptor& fd, const constantPoolHandle& pool, int index, Bytecodes::Code byte, TRAPS) {
|
||||
LinkInfo link_info(pool, index, CHECK);
|
||||
resolve_field(fd, link_info, byte, true, CHECK);
|
||||
}
|
||||
@ -1442,7 +1442,7 @@ methodHandle LinkResolver::resolve_special_call_or_null(const LinkInfo& link_inf
|
||||
//------------------------------------------------------------------------------------------------------------------------
|
||||
// ConstantPool entries
|
||||
|
||||
void LinkResolver::resolve_invoke(CallInfo& result, Handle recv, constantPoolHandle pool, int index, Bytecodes::Code byte, TRAPS) {
|
||||
void LinkResolver::resolve_invoke(CallInfo& result, Handle recv, const constantPoolHandle& pool, int index, Bytecodes::Code byte, TRAPS) {
|
||||
switch (byte) {
|
||||
case Bytecodes::_invokestatic : resolve_invokestatic (result, pool, index, CHECK); break;
|
||||
case Bytecodes::_invokespecial : resolve_invokespecial (result, pool, index, CHECK); break;
|
||||
@ -1454,20 +1454,20 @@ void LinkResolver::resolve_invoke(CallInfo& result, Handle recv, constantPoolHan
|
||||
return;
|
||||
}
|
||||
|
||||
void LinkResolver::resolve_invokestatic(CallInfo& result, constantPoolHandle pool, int index, TRAPS) {
|
||||
void LinkResolver::resolve_invokestatic(CallInfo& result, const constantPoolHandle& pool, int index, TRAPS) {
|
||||
LinkInfo link_info(pool, index, CHECK);
|
||||
resolve_static_call(result, link_info, /*initialize_class*/true, CHECK);
|
||||
}
|
||||
|
||||
|
||||
void LinkResolver::resolve_invokespecial(CallInfo& result, constantPoolHandle pool, int index, TRAPS) {
|
||||
void LinkResolver::resolve_invokespecial(CallInfo& result, const constantPoolHandle& pool, int index, TRAPS) {
|
||||
LinkInfo link_info(pool, index, CHECK);
|
||||
resolve_special_call(result, link_info, CHECK);
|
||||
}
|
||||
|
||||
|
||||
void LinkResolver::resolve_invokevirtual(CallInfo& result, Handle recv,
|
||||
constantPoolHandle pool, int index,
|
||||
const constantPoolHandle& pool, int index,
|
||||
TRAPS) {
|
||||
|
||||
LinkInfo link_info(pool, index, CHECK);
|
||||
@ -1476,14 +1476,14 @@ void LinkResolver::resolve_invokevirtual(CallInfo& result, Handle recv,
|
||||
}
|
||||
|
||||
|
||||
void LinkResolver::resolve_invokeinterface(CallInfo& result, Handle recv, constantPoolHandle pool, int index, TRAPS) {
|
||||
void LinkResolver::resolve_invokeinterface(CallInfo& result, Handle recv, const constantPoolHandle& pool, int index, TRAPS) {
|
||||
LinkInfo link_info(pool, index, CHECK);
|
||||
KlassHandle recvrKlass (THREAD, recv.is_null() ? (Klass*)NULL : recv->klass());
|
||||
resolve_interface_call(result, recv, recvrKlass, link_info, true, CHECK);
|
||||
}
|
||||
|
||||
|
||||
void LinkResolver::resolve_invokehandle(CallInfo& result, constantPoolHandle pool, int index, TRAPS) {
|
||||
void LinkResolver::resolve_invokehandle(CallInfo& result, const constantPoolHandle& pool, int index, TRAPS) {
|
||||
// This guy is reached from InterpreterRuntime::resolve_invokehandle.
|
||||
LinkInfo link_info(pool, index, CHECK);
|
||||
if (TraceMethodHandles) {
|
||||
@ -1528,7 +1528,7 @@ static void wrap_invokedynamic_exception(TRAPS) {
|
||||
}
|
||||
}
|
||||
|
||||
void LinkResolver::resolve_invokedynamic(CallInfo& result, constantPoolHandle pool, int index, TRAPS) {
|
||||
void LinkResolver::resolve_invokedynamic(CallInfo& result, const constantPoolHandle& pool, int index, TRAPS) {
|
||||
Symbol* method_name = pool->name_ref_at(index);
|
||||
Symbol* method_signature = pool->signature_ref_at(index);
|
||||
KlassHandle current_klass = KlassHandle(THREAD, pool->pool_holder());
|
||||
|
||||
@ -136,7 +136,7 @@ class LinkInfo : public StackObj {
|
||||
KlassHandle _current_klass; // class that owns the constant pool
|
||||
bool _check_access;
|
||||
public:
|
||||
LinkInfo(constantPoolHandle pool, int index, TRAPS);
|
||||
LinkInfo(const constantPoolHandle& pool, int index, TRAPS);
|
||||
// Condensed information from other call sites within the vm.
|
||||
LinkInfo(KlassHandle resolved_klass, Symbol* name, Symbol* signature,
|
||||
KlassHandle current_klass, bool check_access = true) :
|
||||
@ -226,17 +226,17 @@ class LinkResolver: AllStatic {
|
||||
|
||||
// runtime resolving from constant pool
|
||||
static void resolve_invokestatic (CallInfo& result,
|
||||
constantPoolHandle pool, int index, TRAPS);
|
||||
const constantPoolHandle& pool, int index, TRAPS);
|
||||
static void resolve_invokespecial (CallInfo& result,
|
||||
constantPoolHandle pool, int index, TRAPS);
|
||||
const constantPoolHandle& pool, int index, TRAPS);
|
||||
static void resolve_invokevirtual (CallInfo& result, Handle recv,
|
||||
constantPoolHandle pool, int index, TRAPS);
|
||||
const constantPoolHandle& pool, int index, TRAPS);
|
||||
static void resolve_invokeinterface(CallInfo& result, Handle recv,
|
||||
constantPoolHandle pool, int index, TRAPS);
|
||||
const constantPoolHandle& pool, int index, TRAPS);
|
||||
static void resolve_invokedynamic (CallInfo& result,
|
||||
constantPoolHandle pool, int index, TRAPS);
|
||||
const constantPoolHandle& pool, int index, TRAPS);
|
||||
static void resolve_invokehandle (CallInfo& result,
|
||||
constantPoolHandle pool, int index, TRAPS);
|
||||
const constantPoolHandle& pool, int index, TRAPS);
|
||||
public:
|
||||
// constant pool resolving
|
||||
static void check_klass_accessability(KlassHandle ref_klass, KlassHandle sel_klass, TRAPS);
|
||||
@ -244,11 +244,11 @@ class LinkResolver: AllStatic {
|
||||
// static resolving calls (will not run any Java code);
|
||||
// used only from Bytecode_invoke::static_target
|
||||
static methodHandle resolve_method_statically(Bytecodes::Code code,
|
||||
constantPoolHandle pool,
|
||||
const constantPoolHandle& pool,
|
||||
int index, TRAPS);
|
||||
|
||||
static void resolve_field_access(fieldDescriptor& result,
|
||||
constantPoolHandle pool,
|
||||
const constantPoolHandle& pool,
|
||||
int index, Bytecodes::Code byte, TRAPS);
|
||||
static void resolve_field(fieldDescriptor& result, const LinkInfo& link_info,
|
||||
Bytecodes::Code access_kind,
|
||||
@ -293,7 +293,7 @@ class LinkResolver: AllStatic {
|
||||
|
||||
// runtime resolving from constant pool
|
||||
static void resolve_invoke(CallInfo& result, Handle recv,
|
||||
constantPoolHandle pool, int index,
|
||||
const constantPoolHandle& pool, int index,
|
||||
Bytecodes::Code byte, TRAPS);
|
||||
private:
|
||||
static void trace_method_resolution(const char* prefix, KlassHandle klass,
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1997, 2015, 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
|
||||
@ -426,7 +426,7 @@ void InterpreterOopMap::resource_copy(OopMapCacheEntry* from) {
|
||||
}
|
||||
}
|
||||
|
||||
inline unsigned int OopMapCache::hash_value_for(methodHandle method, int bci) const {
|
||||
inline unsigned int OopMapCache::hash_value_for(const methodHandle& method, int bci) const {
|
||||
// We use method->code_size() rather than method->identity_hash() below since
|
||||
// the mark may not be present if a pointer to the method is already reversed.
|
||||
return ((unsigned int) bci)
|
||||
@ -477,7 +477,7 @@ void OopMapCache::flush_obsolete_entries() {
|
||||
}
|
||||
}
|
||||
|
||||
void OopMapCache::lookup(methodHandle method,
|
||||
void OopMapCache::lookup(const methodHandle& method,
|
||||
int bci,
|
||||
InterpreterOopMap* entry_for) const {
|
||||
MutexLocker x(&_mut);
|
||||
@ -558,7 +558,7 @@ void OopMapCache::lookup(methodHandle method,
|
||||
return;
|
||||
}
|
||||
|
||||
void OopMapCache::compute_one_oop_map(methodHandle method, int bci, InterpreterOopMap* entry) {
|
||||
void OopMapCache::compute_one_oop_map(const methodHandle& method, int bci, InterpreterOopMap* entry) {
|
||||
// Due to the invariants above it's tricky to allocate a temporary OopMapCacheEntry on the stack
|
||||
OopMapCacheEntry* tmp = NEW_C_HEAP_ARRAY(OopMapCacheEntry, 1, mtClass);
|
||||
tmp->initialize();
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1997, 2015, 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
|
||||
@ -116,7 +116,7 @@ class InterpreterOopMap: ResourceObj {
|
||||
void set_expression_stack_size(int sz) { _expression_stack_size = sz; }
|
||||
|
||||
// Lookup
|
||||
bool match(methodHandle method, int bci) const { return _method == method() && _bci == bci; }
|
||||
bool match(const methodHandle& method, int bci) const { return _method == method() && _bci == bci; }
|
||||
bool is_empty() const;
|
||||
|
||||
// Initialization
|
||||
@ -151,7 +151,7 @@ class OopMapCache : public CHeapObj<mtClass> {
|
||||
|
||||
OopMapCacheEntry* _array;
|
||||
|
||||
unsigned int hash_value_for(methodHandle method, int bci) const;
|
||||
unsigned int hash_value_for(const methodHandle& method, int bci) const;
|
||||
OopMapCacheEntry* entry_at(int i) const;
|
||||
|
||||
mutable Mutex _mut;
|
||||
@ -167,10 +167,10 @@ class OopMapCache : public CHeapObj<mtClass> {
|
||||
|
||||
// Returns the oopMap for (method, bci) in parameter "entry".
|
||||
// Returns false if an oop map was not found.
|
||||
void lookup(methodHandle method, int bci, InterpreterOopMap* entry) const;
|
||||
void lookup(const methodHandle& method, int bci, InterpreterOopMap* entry) const;
|
||||
|
||||
// Compute an oop map without updating the cache or grabbing any locks (for debugging)
|
||||
static void compute_one_oop_map(methodHandle method, int bci, InterpreterOopMap* entry);
|
||||
static void compute_one_oop_map(const methodHandle& method, int bci, InterpreterOopMap* entry);
|
||||
|
||||
// Returns total no. of bytes allocated as part of OopMapCache's
|
||||
static long memory_usage() PRODUCT_RETURN0;
|
||||
|
||||
@ -509,7 +509,7 @@ void Rewriter::rewrite(instanceKlassHandle klass, TRAPS) {
|
||||
// (That's all, folks.)
|
||||
}
|
||||
|
||||
Rewriter::Rewriter(instanceKlassHandle klass, constantPoolHandle cpool, Array<Method*>* methods, TRAPS)
|
||||
Rewriter::Rewriter(instanceKlassHandle klass, const constantPoolHandle& cpool, Array<Method*>* methods, TRAPS)
|
||||
: _klass(klass),
|
||||
_pool(cpool),
|
||||
_methods(methods)
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1998, 2014, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1998, 2015, 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
|
||||
@ -185,7 +185,7 @@ class Rewriter: public StackObj {
|
||||
}
|
||||
|
||||
// All the work goes in here:
|
||||
Rewriter(instanceKlassHandle klass, constantPoolHandle cpool, Array<Method*>* methods, TRAPS);
|
||||
Rewriter(instanceKlassHandle klass, const constantPoolHandle& cpool, Array<Method*>* methods, TRAPS);
|
||||
|
||||
void compute_index_maps();
|
||||
void make_constant_pool_cache(TRAPS);
|
||||
|
||||
@ -60,7 +60,7 @@
|
||||
|
||||
#define C2V_END }
|
||||
|
||||
oop CompilerToVM::get_jvmci_method(methodHandle method, TRAPS) {
|
||||
oop CompilerToVM::get_jvmci_method(const methodHandle& method, TRAPS) {
|
||||
if (method() != NULL) {
|
||||
JavaValue result(T_OBJECT);
|
||||
JavaCallArguments args;
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2011, 2015, 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
|
||||
@ -94,7 +94,7 @@ public:
|
||||
return (MethodData*) (address) metaspaceMethodData;
|
||||
}
|
||||
|
||||
static oop get_jvmci_method(methodHandle method, TRAPS);
|
||||
static oop get_jvmci_method(const methodHandle& method, TRAPS);
|
||||
|
||||
static oop get_jvmci_type(KlassHandle klass, TRAPS);
|
||||
};
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1999, 2015, 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
|
||||
@ -83,7 +83,7 @@ bool JVMCIEnv::check_klass_accessibility(KlassHandle accessing_klass, KlassHandl
|
||||
|
||||
// ------------------------------------------------------------------
|
||||
KlassHandle JVMCIEnv::get_klass_by_name_impl(KlassHandle& accessing_klass,
|
||||
constantPoolHandle& cpool,
|
||||
const constantPoolHandle& cpool,
|
||||
Symbol* sym,
|
||||
bool require_local) {
|
||||
JVMCI_EXCEPTION_CONTEXT;
|
||||
@ -174,7 +174,7 @@ KlassHandle JVMCIEnv::get_klass_by_name(KlassHandle& accessing_klass,
|
||||
|
||||
// ------------------------------------------------------------------
|
||||
// Implementation of get_klass_by_index.
|
||||
KlassHandle JVMCIEnv::get_klass_by_index_impl(constantPoolHandle& cpool,
|
||||
KlassHandle JVMCIEnv::get_klass_by_index_impl(const constantPoolHandle& cpool,
|
||||
int index,
|
||||
bool& is_accessible,
|
||||
KlassHandle& accessor) {
|
||||
@ -215,7 +215,7 @@ KlassHandle JVMCIEnv::get_klass_by_index_impl(constantPoolHandle& cpool,
|
||||
|
||||
// ------------------------------------------------------------------
|
||||
// Get a klass from the constant pool.
|
||||
KlassHandle JVMCIEnv::get_klass_by_index(constantPoolHandle& cpool,
|
||||
KlassHandle JVMCIEnv::get_klass_by_index(const constantPoolHandle& cpool,
|
||||
int index,
|
||||
bool& is_accessible,
|
||||
KlassHandle& accessor) {
|
||||
@ -312,7 +312,7 @@ methodHandle JVMCIEnv::lookup_method(instanceKlassHandle& h_accessor,
|
||||
|
||||
|
||||
// ------------------------------------------------------------------
|
||||
methodHandle JVMCIEnv::get_method_by_index_impl(constantPoolHandle& cpool,
|
||||
methodHandle JVMCIEnv::get_method_by_index_impl(const constantPoolHandle& cpool,
|
||||
int index, Bytecodes::Code bc,
|
||||
instanceKlassHandle& accessor) {
|
||||
if (bc == Bytecodes::_invokedynamic) {
|
||||
@ -395,7 +395,7 @@ instanceKlassHandle JVMCIEnv::get_instance_klass_for_declared_method_holder(Klas
|
||||
|
||||
|
||||
// ------------------------------------------------------------------
|
||||
methodHandle JVMCIEnv::get_method_by_index(constantPoolHandle& cpool,
|
||||
methodHandle JVMCIEnv::get_method_by_index(const constantPoolHandle& cpool,
|
||||
int index, Bytecodes::Code bc,
|
||||
instanceKlassHandle& accessor) {
|
||||
ResourceMark rm;
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1999, 2015, 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
|
||||
@ -83,13 +83,13 @@ public:
|
||||
bool require_local);
|
||||
|
||||
// Constant pool access.
|
||||
static KlassHandle get_klass_by_index(constantPoolHandle& cpool,
|
||||
static KlassHandle get_klass_by_index(const constantPoolHandle& cpool,
|
||||
int klass_index,
|
||||
bool& is_accessible,
|
||||
KlassHandle& loading_klass);
|
||||
static void get_field_by_index(instanceKlassHandle& loading_klass, fieldDescriptor& fd,
|
||||
int field_index);
|
||||
static methodHandle get_method_by_index(constantPoolHandle& cpool,
|
||||
static methodHandle get_method_by_index(const constantPoolHandle& cpool,
|
||||
int method_index, Bytecodes::Code bc,
|
||||
instanceKlassHandle& loading_klass);
|
||||
|
||||
@ -106,16 +106,16 @@ private:
|
||||
|
||||
// Implementation methods for loading and constant pool access.
|
||||
static KlassHandle get_klass_by_name_impl(KlassHandle& accessing_klass,
|
||||
constantPoolHandle& cpool,
|
||||
const constantPoolHandle& cpool,
|
||||
Symbol* klass_name,
|
||||
bool require_local);
|
||||
static KlassHandle get_klass_by_index_impl(constantPoolHandle& cpool,
|
||||
static KlassHandle get_klass_by_index_impl(const constantPoolHandle& cpool,
|
||||
int klass_index,
|
||||
bool& is_accessible,
|
||||
KlassHandle& loading_klass);
|
||||
static void get_field_by_index_impl(instanceKlassHandle& loading_klass, fieldDescriptor& fd,
|
||||
int field_index);
|
||||
static methodHandle get_method_by_index_impl(constantPoolHandle& cpool,
|
||||
static methodHandle get_method_by_index_impl(const constantPoolHandle& cpool,
|
||||
int method_index, Bytecodes::Code bc,
|
||||
instanceKlassHandle& loading_klass);
|
||||
|
||||
|
||||
@ -178,7 +178,7 @@ int ConstantPool::cp_to_object_index(int cp_index) {
|
||||
return (i < 0) ? _no_index_sentinel : i;
|
||||
}
|
||||
|
||||
void ConstantPool::trace_class_resolution(constantPoolHandle this_cp, KlassHandle k) {
|
||||
void ConstantPool::trace_class_resolution(const constantPoolHandle& this_cp, KlassHandle k) {
|
||||
ResourceMark rm;
|
||||
int line_number = -1;
|
||||
const char * source_file = NULL;
|
||||
@ -207,7 +207,7 @@ void ConstantPool::trace_class_resolution(constantPoolHandle this_cp, KlassHandl
|
||||
}
|
||||
}
|
||||
|
||||
Klass* ConstantPool::klass_at_impl(constantPoolHandle this_cp, int which,
|
||||
Klass* ConstantPool::klass_at_impl(const constantPoolHandle& this_cp, int which,
|
||||
bool save_resolution_error, TRAPS) {
|
||||
assert(THREAD->is_Java_thread(), "must be a Java thread");
|
||||
|
||||
@ -288,7 +288,7 @@ Klass* ConstantPool::klass_at_impl(constantPoolHandle this_cp, int which,
|
||||
// by compiler and exception handling. Also used to avoid classloads for
|
||||
// instanceof operations. Returns NULL if the class has not been loaded or
|
||||
// if the verification of constant pool failed
|
||||
Klass* ConstantPool::klass_at_if_loaded(constantPoolHandle this_cp, int which) {
|
||||
Klass* ConstantPool::klass_at_if_loaded(const constantPoolHandle& this_cp, int which) {
|
||||
CPSlot entry = this_cp->slot_at(which);
|
||||
if (entry.is_resolved()) {
|
||||
assert(entry.get_klass()->is_klass(), "must be");
|
||||
@ -321,12 +321,12 @@ Klass* ConstantPool::klass_at_if_loaded(constantPoolHandle this_cp, int which) {
|
||||
}
|
||||
|
||||
|
||||
Klass* ConstantPool::klass_ref_at_if_loaded(constantPoolHandle this_cp, int which) {
|
||||
Klass* ConstantPool::klass_ref_at_if_loaded(const constantPoolHandle& this_cp, int which) {
|
||||
return klass_at_if_loaded(this_cp, this_cp->klass_ref_index_at(which));
|
||||
}
|
||||
|
||||
|
||||
Method* ConstantPool::method_at_if_loaded(constantPoolHandle cpool,
|
||||
Method* ConstantPool::method_at_if_loaded(const constantPoolHandle& cpool,
|
||||
int which) {
|
||||
if (cpool->cache() == NULL) return NULL; // nothing to load yet
|
||||
int cache_index = decode_cpcache_index(which, true);
|
||||
@ -342,14 +342,14 @@ Method* ConstantPool::method_at_if_loaded(constantPoolHandle cpool,
|
||||
}
|
||||
|
||||
|
||||
bool ConstantPool::has_appendix_at_if_loaded(constantPoolHandle cpool, int which) {
|
||||
bool ConstantPool::has_appendix_at_if_loaded(const constantPoolHandle& cpool, int which) {
|
||||
if (cpool->cache() == NULL) return false; // nothing to load yet
|
||||
int cache_index = decode_cpcache_index(which, true);
|
||||
ConstantPoolCacheEntry* e = cpool->cache()->entry_at(cache_index);
|
||||
return e->has_appendix();
|
||||
}
|
||||
|
||||
oop ConstantPool::appendix_at_if_loaded(constantPoolHandle cpool, int which) {
|
||||
oop ConstantPool::appendix_at_if_loaded(const constantPoolHandle& cpool, int which) {
|
||||
if (cpool->cache() == NULL) return NULL; // nothing to load yet
|
||||
int cache_index = decode_cpcache_index(which, true);
|
||||
ConstantPoolCacheEntry* e = cpool->cache()->entry_at(cache_index);
|
||||
@ -357,14 +357,14 @@ oop ConstantPool::appendix_at_if_loaded(constantPoolHandle cpool, int which) {
|
||||
}
|
||||
|
||||
|
||||
bool ConstantPool::has_method_type_at_if_loaded(constantPoolHandle cpool, int which) {
|
||||
bool ConstantPool::has_method_type_at_if_loaded(const constantPoolHandle& cpool, int which) {
|
||||
if (cpool->cache() == NULL) return false; // nothing to load yet
|
||||
int cache_index = decode_cpcache_index(which, true);
|
||||
ConstantPoolCacheEntry* e = cpool->cache()->entry_at(cache_index);
|
||||
return e->has_method_type();
|
||||
}
|
||||
|
||||
oop ConstantPool::method_type_at_if_loaded(constantPoolHandle cpool, int which) {
|
||||
oop ConstantPool::method_type_at_if_loaded(const constantPoolHandle& cpool, int which) {
|
||||
if (cpool->cache() == NULL) return NULL; // nothing to load yet
|
||||
int cache_index = decode_cpcache_index(which, true);
|
||||
ConstantPoolCacheEntry* e = cpool->cache()->entry_at(cache_index);
|
||||
@ -434,7 +434,7 @@ int ConstantPool::remap_instruction_operand_from_cache(int operand) {
|
||||
}
|
||||
|
||||
|
||||
void ConstantPool::verify_constant_pool_resolve(constantPoolHandle this_cp, KlassHandle k, TRAPS) {
|
||||
void ConstantPool::verify_constant_pool_resolve(const constantPoolHandle& this_cp, KlassHandle k, TRAPS) {
|
||||
if (k->oop_is_instance() || k->oop_is_objArray()) {
|
||||
instanceKlassHandle holder (THREAD, this_cp->pool_holder());
|
||||
Klass* elem = k->oop_is_instance() ? k() : ObjArrayKlass::cast(k())->bottom_klass();
|
||||
@ -502,7 +502,7 @@ BasicType ConstantPool::basic_type_for_signature_at(int which) {
|
||||
}
|
||||
|
||||
|
||||
void ConstantPool::resolve_string_constants_impl(constantPoolHandle this_cp, TRAPS) {
|
||||
void ConstantPool::resolve_string_constants_impl(const constantPoolHandle& this_cp, TRAPS) {
|
||||
for (int index = 1; index < this_cp->length(); index++) { // Index 0 is unused
|
||||
if (this_cp->tag_at(index).is_string()) {
|
||||
this_cp->string_at(index, CHECK);
|
||||
@ -526,7 +526,7 @@ bool ConstantPool::resolve_class_constants(TRAPS) {
|
||||
return true;
|
||||
}
|
||||
|
||||
Symbol* ConstantPool::exception_message(constantPoolHandle this_cp, int which, constantTag tag, oop pending_exception) {
|
||||
Symbol* ConstantPool::exception_message(const constantPoolHandle& this_cp, int which, constantTag tag, oop pending_exception) {
|
||||
// Dig out the detailed message to reuse if possible
|
||||
Symbol* message = java_lang_Throwable::detail_message(pending_exception);
|
||||
if (message != NULL) {
|
||||
@ -554,7 +554,7 @@ Symbol* ConstantPool::exception_message(constantPoolHandle this_cp, int which, c
|
||||
return message;
|
||||
}
|
||||
|
||||
void ConstantPool::throw_resolution_error(constantPoolHandle this_cp, int which, TRAPS) {
|
||||
void ConstantPool::throw_resolution_error(const constantPoolHandle& this_cp, int which, TRAPS) {
|
||||
Symbol* message = NULL;
|
||||
Symbol* error = SystemDictionary::find_resolution_error(this_cp, which, &message);
|
||||
assert(error != NULL && message != NULL, "checking");
|
||||
@ -565,7 +565,7 @@ void ConstantPool::throw_resolution_error(constantPoolHandle this_cp, int which,
|
||||
|
||||
// If resolution for Class, MethodHandle or MethodType fails, save the exception
|
||||
// in the resolution error table, so that the same exception is thrown again.
|
||||
void ConstantPool::save_and_throw_exception(constantPoolHandle this_cp, int which,
|
||||
void ConstantPool::save_and_throw_exception(const constantPoolHandle& this_cp, int which,
|
||||
constantTag tag, TRAPS) {
|
||||
Symbol* error = PENDING_EXCEPTION->klass()->name();
|
||||
|
||||
@ -603,7 +603,7 @@ void ConstantPool::save_and_throw_exception(constantPoolHandle this_cp, int whic
|
||||
// Called to resolve constants in the constant pool and return an oop.
|
||||
// Some constant pool entries cache their resolved oop. This is also
|
||||
// called to create oops from constants to use in arguments for invokedynamic
|
||||
oop ConstantPool::resolve_constant_at_impl(constantPoolHandle this_cp, int index, int cache_index, TRAPS) {
|
||||
oop ConstantPool::resolve_constant_at_impl(const constantPoolHandle& this_cp, int index, int cache_index, TRAPS) {
|
||||
oop result_oop = NULL;
|
||||
Handle throw_exception;
|
||||
|
||||
@ -756,7 +756,7 @@ oop ConstantPool::uncached_string_at(int which, TRAPS) {
|
||||
}
|
||||
|
||||
|
||||
oop ConstantPool::resolve_bootstrap_specifier_at_impl(constantPoolHandle this_cp, int index, TRAPS) {
|
||||
oop ConstantPool::resolve_bootstrap_specifier_at_impl(const constantPoolHandle& this_cp, int index, TRAPS) {
|
||||
assert(this_cp->tag_at(index).is_invoke_dynamic(), "Corrupted constant pool");
|
||||
|
||||
Handle bsm;
|
||||
@ -794,7 +794,7 @@ oop ConstantPool::resolve_bootstrap_specifier_at_impl(constantPoolHandle this_cp
|
||||
return info();
|
||||
}
|
||||
|
||||
oop ConstantPool::string_at_impl(constantPoolHandle this_cp, int which, int obj_index, TRAPS) {
|
||||
oop ConstantPool::string_at_impl(const constantPoolHandle& this_cp, int which, int obj_index, TRAPS) {
|
||||
// If the string has already been interned, this entry will be non-null
|
||||
oop str = this_cp->resolved_references()->obj_at(obj_index);
|
||||
if (str != NULL) return str;
|
||||
@ -830,7 +830,7 @@ void ConstantPool::unreference_symbols() {
|
||||
|
||||
// Compare this constant pool's entry at index1 to the constant pool
|
||||
// cp2's entry at index2.
|
||||
bool ConstantPool::compare_entry_to(int index1, constantPoolHandle cp2,
|
||||
bool ConstantPool::compare_entry_to(int index1, const constantPoolHandle& cp2,
|
||||
int index2, TRAPS) {
|
||||
|
||||
// The error tags are equivalent to non-error tags when comparing
|
||||
@ -1056,7 +1056,7 @@ void ConstantPool::resize_operands(int delta_len, int delta_size, TRAPS) {
|
||||
|
||||
// Extend the operands array with the length and size of the ext_cp operands.
|
||||
// Used in RedefineClasses for CP merge.
|
||||
void ConstantPool::extend_operands(constantPoolHandle ext_cp, TRAPS) {
|
||||
void ConstantPool::extend_operands(const constantPoolHandle& ext_cp, TRAPS) {
|
||||
int delta_len = operand_array_length(ext_cp->operands());
|
||||
if (delta_len == 0) {
|
||||
return; // nothing to do
|
||||
@ -1096,8 +1096,8 @@ void ConstantPool::shrink_operands(int new_len, TRAPS) {
|
||||
} // end shrink_operands()
|
||||
|
||||
|
||||
void ConstantPool::copy_operands(constantPoolHandle from_cp,
|
||||
constantPoolHandle to_cp,
|
||||
void ConstantPool::copy_operands(const constantPoolHandle& from_cp,
|
||||
const constantPoolHandle& to_cp,
|
||||
TRAPS) {
|
||||
|
||||
int from_oplen = operand_array_length(from_cp->operands());
|
||||
@ -1160,8 +1160,8 @@ void ConstantPool::copy_operands(constantPoolHandle from_cp,
|
||||
// Copy this constant pool's entries at start_i to end_i (inclusive)
|
||||
// to the constant pool to_cp's entries starting at to_i. A total of
|
||||
// (end_i - start_i) + 1 entries are copied.
|
||||
void ConstantPool::copy_cp_to_impl(constantPoolHandle from_cp, int start_i, int end_i,
|
||||
constantPoolHandle to_cp, int to_i, TRAPS) {
|
||||
void ConstantPool::copy_cp_to_impl(const constantPoolHandle& from_cp, int start_i, int end_i,
|
||||
const constantPoolHandle& to_cp, int to_i, TRAPS) {
|
||||
|
||||
|
||||
int dest_i = to_i; // leave original alone for debug purposes
|
||||
@ -1191,8 +1191,8 @@ void ConstantPool::copy_cp_to_impl(constantPoolHandle from_cp, int start_i, int
|
||||
|
||||
// Copy this constant pool's entry at from_i to the constant pool
|
||||
// to_cp's entry at to_i.
|
||||
void ConstantPool::copy_entry_to(constantPoolHandle from_cp, int from_i,
|
||||
constantPoolHandle to_cp, int to_i,
|
||||
void ConstantPool::copy_entry_to(const constantPoolHandle& from_cp, int from_i,
|
||||
const constantPoolHandle& to_cp, int to_i,
|
||||
TRAPS) {
|
||||
|
||||
int tag = from_cp->tag_at(from_i).value();
|
||||
@ -1339,7 +1339,7 @@ void ConstantPool::copy_entry_to(constantPoolHandle from_cp, int from_i,
|
||||
// constant pool's entry at pattern_i. Returns the index of a
|
||||
// matching entry or zero (0) if there is no matching entry.
|
||||
int ConstantPool::find_matching_entry(int pattern_i,
|
||||
constantPoolHandle search_cp, TRAPS) {
|
||||
const constantPoolHandle& search_cp, TRAPS) {
|
||||
|
||||
// index zero (0) is not used
|
||||
for (int i = 1; i < search_cp->length(); i++) {
|
||||
@ -1355,7 +1355,7 @@ int ConstantPool::find_matching_entry(int pattern_i,
|
||||
|
||||
// Compare this constant pool's bootstrap specifier at idx1 to the constant pool
|
||||
// cp2's bootstrap specifier at idx2.
|
||||
bool ConstantPool::compare_operand_to(int idx1, constantPoolHandle cp2, int idx2, TRAPS) {
|
||||
bool ConstantPool::compare_operand_to(int idx1, const constantPoolHandle& cp2, int idx2, TRAPS) {
|
||||
int k1 = operand_bootstrap_method_ref_index_at(idx1);
|
||||
int k2 = cp2->operand_bootstrap_method_ref_index_at(idx2);
|
||||
bool match = compare_entry_to(k1, cp2, k2, CHECK_false);
|
||||
@ -1382,7 +1382,7 @@ bool ConstantPool::compare_operand_to(int idx1, constantPoolHandle cp2, int idx2
|
||||
// this constant pool's bootstrap specifier at pattern_i index.
|
||||
// Return the index of a matching bootstrap specifier or (-1) if there is no match.
|
||||
int ConstantPool::find_matching_operand(int pattern_i,
|
||||
constantPoolHandle search_cp, int search_len, TRAPS) {
|
||||
const constantPoolHandle& search_cp, int search_len, TRAPS) {
|
||||
for (int i = 0; i < search_len; i++) {
|
||||
bool found = compare_operand_to(pattern_i, search_cp, i, CHECK_(-1));
|
||||
if (found) {
|
||||
|
||||
@ -604,15 +604,15 @@ class ConstantPool : public Metadata {
|
||||
return offset;
|
||||
}
|
||||
// Compare a bootsrap specifier in the operands arrays
|
||||
bool compare_operand_to(int bootstrap_specifier_index1, constantPoolHandle cp2,
|
||||
bool compare_operand_to(int bootstrap_specifier_index1, const constantPoolHandle& cp2,
|
||||
int bootstrap_specifier_index2, TRAPS);
|
||||
// Find a bootsrap specifier in the operands array
|
||||
int find_matching_operand(int bootstrap_specifier_index, constantPoolHandle search_cp,
|
||||
int find_matching_operand(int bootstrap_specifier_index, const constantPoolHandle& search_cp,
|
||||
int operands_cur_len, TRAPS);
|
||||
// Resize the operands array with delta_len and delta_size
|
||||
void resize_operands(int delta_len, int delta_size, TRAPS);
|
||||
// Extend the operands array with the length and size of the ext_cp operands
|
||||
void extend_operands(constantPoolHandle ext_cp, TRAPS);
|
||||
void extend_operands(const constantPoolHandle& ext_cp, TRAPS);
|
||||
// Shrink the operands array to a smaller array with new_len length
|
||||
void shrink_operands(int new_len, TRAPS);
|
||||
|
||||
@ -735,13 +735,13 @@ class ConstantPool : public Metadata {
|
||||
friend class SystemDictionary;
|
||||
|
||||
// Used by compiler to prevent classloading.
|
||||
static Method* method_at_if_loaded (constantPoolHandle this_cp, int which);
|
||||
static bool has_appendix_at_if_loaded (constantPoolHandle this_cp, int which);
|
||||
static oop appendix_at_if_loaded (constantPoolHandle this_cp, int which);
|
||||
static bool has_method_type_at_if_loaded (constantPoolHandle this_cp, int which);
|
||||
static oop method_type_at_if_loaded (constantPoolHandle this_cp, int which);
|
||||
static Klass* klass_at_if_loaded (constantPoolHandle this_cp, int which);
|
||||
static Klass* klass_ref_at_if_loaded (constantPoolHandle this_cp, int which);
|
||||
static Method* method_at_if_loaded (const constantPoolHandle& this_cp, int which);
|
||||
static bool has_appendix_at_if_loaded (const constantPoolHandle& this_cp, int which);
|
||||
static oop appendix_at_if_loaded (const constantPoolHandle& this_cp, int which);
|
||||
static bool has_method_type_at_if_loaded (const constantPoolHandle& this_cp, int which);
|
||||
static oop method_type_at_if_loaded (const constantPoolHandle& this_cp, int which);
|
||||
static Klass* klass_at_if_loaded (const constantPoolHandle& this_cp, int which);
|
||||
static Klass* klass_ref_at_if_loaded (const constantPoolHandle& this_cp, int which);
|
||||
|
||||
// Routines currently used for annotations (only called by jvm.cpp) but which might be used in the
|
||||
// future by other Java code. These take constant pool indices rather than
|
||||
@ -797,38 +797,38 @@ class ConstantPool : public Metadata {
|
||||
}
|
||||
|
||||
// Performs the LinkResolver checks
|
||||
static void verify_constant_pool_resolve(constantPoolHandle this_cp, KlassHandle klass, TRAPS);
|
||||
static void verify_constant_pool_resolve(const constantPoolHandle& this_cp, KlassHandle klass, TRAPS);
|
||||
|
||||
// Implementation of methods that needs an exposed 'this' pointer, in order to
|
||||
// handle GC while executing the method
|
||||
static Klass* klass_at_impl(constantPoolHandle this_cp, int which,
|
||||
static Klass* klass_at_impl(const constantPoolHandle& this_cp, int which,
|
||||
bool save_resolution_error, TRAPS);
|
||||
static oop string_at_impl(constantPoolHandle this_cp, int which, int obj_index, TRAPS);
|
||||
static oop string_at_impl(const constantPoolHandle& this_cp, int which, int obj_index, TRAPS);
|
||||
|
||||
static void trace_class_resolution(constantPoolHandle this_cp, KlassHandle k);
|
||||
static void trace_class_resolution(const constantPoolHandle& this_cp, KlassHandle k);
|
||||
|
||||
// Resolve string constants (to prevent allocation during compilation)
|
||||
static void resolve_string_constants_impl(constantPoolHandle this_cp, TRAPS);
|
||||
static void resolve_string_constants_impl(const constantPoolHandle& this_cp, TRAPS);
|
||||
|
||||
static oop resolve_constant_at_impl(constantPoolHandle this_cp, int index, int cache_index, TRAPS);
|
||||
static oop resolve_bootstrap_specifier_at_impl(constantPoolHandle this_cp, int index, TRAPS);
|
||||
static oop resolve_constant_at_impl(const constantPoolHandle& this_cp, int index, int cache_index, TRAPS);
|
||||
static oop resolve_bootstrap_specifier_at_impl(const constantPoolHandle& this_cp, int index, TRAPS);
|
||||
|
||||
// Exception handling
|
||||
static void throw_resolution_error(constantPoolHandle this_cp, int which, TRAPS);
|
||||
static Symbol* exception_message(constantPoolHandle this_cp, int which, constantTag tag, oop pending_exception);
|
||||
static void save_and_throw_exception(constantPoolHandle this_cp, int which, constantTag tag, TRAPS);
|
||||
static void throw_resolution_error(const constantPoolHandle& this_cp, int which, TRAPS);
|
||||
static Symbol* exception_message(const constantPoolHandle& this_cp, int which, constantTag tag, oop pending_exception);
|
||||
static void save_and_throw_exception(const constantPoolHandle& this_cp, int which, constantTag tag, TRAPS);
|
||||
|
||||
public:
|
||||
// Merging ConstantPool* support:
|
||||
bool compare_entry_to(int index1, constantPoolHandle cp2, int index2, TRAPS);
|
||||
void copy_cp_to(int start_i, int end_i, constantPoolHandle to_cp, int to_i, TRAPS) {
|
||||
bool compare_entry_to(int index1, const constantPoolHandle& cp2, int index2, TRAPS);
|
||||
void copy_cp_to(int start_i, int end_i, const constantPoolHandle& to_cp, int to_i, TRAPS) {
|
||||
constantPoolHandle h_this(THREAD, this);
|
||||
copy_cp_to_impl(h_this, start_i, end_i, to_cp, to_i, THREAD);
|
||||
}
|
||||
static void copy_cp_to_impl(constantPoolHandle from_cp, int start_i, int end_i, constantPoolHandle to_cp, int to_i, TRAPS);
|
||||
static void copy_entry_to(constantPoolHandle from_cp, int from_i, constantPoolHandle to_cp, int to_i, TRAPS);
|
||||
static void copy_operands(constantPoolHandle from_cp, constantPoolHandle to_cp, TRAPS);
|
||||
int find_matching_entry(int pattern_i, constantPoolHandle search_cp, TRAPS);
|
||||
static void copy_cp_to_impl(const constantPoolHandle& from_cp, int start_i, int end_i, const constantPoolHandle& to_cp, int to_i, TRAPS);
|
||||
static void copy_entry_to(const constantPoolHandle& from_cp, int from_i, const constantPoolHandle& to_cp, int to_i, TRAPS);
|
||||
static void copy_operands(const constantPoolHandle& from_cp, const constantPoolHandle& to_cp, TRAPS);
|
||||
int find_matching_entry(int pattern_i, const constantPoolHandle& search_cp, TRAPS);
|
||||
int version() const { return _saved._version; }
|
||||
void set_version(int version) { _saved._version = version; }
|
||||
void increment_and_save_version(int version) {
|
||||
|
||||
@ -246,7 +246,7 @@ void ConstantPoolCacheEntry::set_vtable_call(Bytecodes::Code invoke_code, method
|
||||
set_direct_or_vtable_call(invoke_code, method, index);
|
||||
}
|
||||
|
||||
void ConstantPoolCacheEntry::set_itable_call(Bytecodes::Code invoke_code, methodHandle method, int index) {
|
||||
void ConstantPoolCacheEntry::set_itable_call(Bytecodes::Code invoke_code, const methodHandle& method, int index) {
|
||||
assert(method->method_holder()->verify_itable_index(index), "");
|
||||
assert(invoke_code == Bytecodes::_invokeinterface, "");
|
||||
InstanceKlass* interf = method->method_holder();
|
||||
@ -261,15 +261,15 @@ void ConstantPoolCacheEntry::set_itable_call(Bytecodes::Code invoke_code, method
|
||||
}
|
||||
|
||||
|
||||
void ConstantPoolCacheEntry::set_method_handle(constantPoolHandle cpool, const CallInfo &call_info) {
|
||||
void ConstantPoolCacheEntry::set_method_handle(const constantPoolHandle& cpool, const CallInfo &call_info) {
|
||||
set_method_handle_common(cpool, Bytecodes::_invokehandle, call_info);
|
||||
}
|
||||
|
||||
void ConstantPoolCacheEntry::set_dynamic_call(constantPoolHandle cpool, const CallInfo &call_info) {
|
||||
void ConstantPoolCacheEntry::set_dynamic_call(const constantPoolHandle& cpool, const CallInfo &call_info) {
|
||||
set_method_handle_common(cpool, Bytecodes::_invokedynamic, call_info);
|
||||
}
|
||||
|
||||
void ConstantPoolCacheEntry::set_method_handle_common(constantPoolHandle cpool,
|
||||
void ConstantPoolCacheEntry::set_method_handle_common(const constantPoolHandle& cpool,
|
||||
Bytecodes::Code invoke_code,
|
||||
const CallInfo &call_info) {
|
||||
// NOTE: This CPCE can be the subject of data races.
|
||||
@ -361,7 +361,7 @@ void ConstantPoolCacheEntry::set_method_handle_common(constantPoolHandle cpool,
|
||||
}
|
||||
}
|
||||
|
||||
Method* ConstantPoolCacheEntry::method_if_resolved(constantPoolHandle cpool) {
|
||||
Method* ConstantPoolCacheEntry::method_if_resolved(const constantPoolHandle& cpool) {
|
||||
// Decode the action of set_method and set_interface_call
|
||||
Bytecodes::Code invoke_code = bytecode_1();
|
||||
if (invoke_code != (Bytecodes::Code)0) {
|
||||
@ -406,7 +406,7 @@ Method* ConstantPoolCacheEntry::method_if_resolved(constantPoolHandle cpool) {
|
||||
}
|
||||
|
||||
|
||||
oop ConstantPoolCacheEntry::appendix_if_resolved(constantPoolHandle cpool) {
|
||||
oop ConstantPoolCacheEntry::appendix_if_resolved(const constantPoolHandle& cpool) {
|
||||
if (!has_appendix())
|
||||
return NULL;
|
||||
const int ref_index = f2_as_index() + _indy_resolved_references_appendix_offset;
|
||||
@ -415,7 +415,7 @@ oop ConstantPoolCacheEntry::appendix_if_resolved(constantPoolHandle cpool) {
|
||||
}
|
||||
|
||||
|
||||
oop ConstantPoolCacheEntry::method_type_if_resolved(constantPoolHandle cpool) {
|
||||
oop ConstantPoolCacheEntry::method_type_if_resolved(const constantPoolHandle& cpool) {
|
||||
if (!has_method_type())
|
||||
return NULL;
|
||||
const int ref_index = f2_as_index() + _indy_resolved_references_method_type_offset;
|
||||
|
||||
@ -246,17 +246,17 @@ class ConstantPoolCacheEntry VALUE_OBJ_CLASS_SPEC {
|
||||
|
||||
void set_itable_call(
|
||||
Bytecodes::Code invoke_code, // the bytecode used; must be invokeinterface
|
||||
methodHandle method, // the resolved interface method
|
||||
const methodHandle& method, // the resolved interface method
|
||||
int itable_index // index into itable for the method
|
||||
);
|
||||
|
||||
void set_method_handle(
|
||||
constantPoolHandle cpool, // holding constant pool (required for locking)
|
||||
const constantPoolHandle& cpool, // holding constant pool (required for locking)
|
||||
const CallInfo &call_info // Call link information
|
||||
);
|
||||
|
||||
void set_dynamic_call(
|
||||
constantPoolHandle cpool, // holding constant pool (required for locking)
|
||||
const constantPoolHandle& cpool, // holding constant pool (required for locking)
|
||||
const CallInfo &call_info // Call link information
|
||||
);
|
||||
|
||||
@ -276,7 +276,7 @@ class ConstantPoolCacheEntry VALUE_OBJ_CLASS_SPEC {
|
||||
// resolution logic needs to make slightly different assessments about the
|
||||
// number and types of arguments.
|
||||
void set_method_handle_common(
|
||||
constantPoolHandle cpool, // holding constant pool (required for locking)
|
||||
const constantPoolHandle& cpool, // holding constant pool (required for locking)
|
||||
Bytecodes::Code invoke_code, // _invokehandle or _invokedynamic
|
||||
const CallInfo &call_info // Call link information
|
||||
);
|
||||
@ -291,9 +291,9 @@ class ConstantPoolCacheEntry VALUE_OBJ_CLASS_SPEC {
|
||||
_indy_resolved_references_entries
|
||||
};
|
||||
|
||||
Method* method_if_resolved(constantPoolHandle cpool);
|
||||
oop appendix_if_resolved(constantPoolHandle cpool);
|
||||
oop method_type_if_resolved(constantPoolHandle cpool);
|
||||
Method* method_if_resolved(const constantPoolHandle& cpool);
|
||||
oop appendix_if_resolved(const constantPoolHandle& cpool);
|
||||
oop method_type_if_resolved(const constantPoolHandle& cpool);
|
||||
|
||||
void set_parameter_size(int value);
|
||||
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2011, 2015, 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
|
||||
@ -176,7 +176,7 @@ class FieldInfo VALUE_OBJ_CLASS_SPEC {
|
||||
return (_shorts[low_packed_offset] & FIELDINFO_TAG_MASK) == FIELDINFO_TAG_OFFSET;
|
||||
}
|
||||
|
||||
Symbol* name(constantPoolHandle cp) const {
|
||||
Symbol* name(const constantPoolHandle& cp) const {
|
||||
int index = name_index();
|
||||
if (is_internal()) {
|
||||
return lookup_symbol(index);
|
||||
@ -184,7 +184,7 @@ class FieldInfo VALUE_OBJ_CLASS_SPEC {
|
||||
return cp->symbol_at(index);
|
||||
}
|
||||
|
||||
Symbol* signature(constantPoolHandle cp) const {
|
||||
Symbol* signature(const constantPoolHandle& cp) const {
|
||||
int index = signature_index();
|
||||
if (is_internal()) {
|
||||
return lookup_symbol(index);
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2011, 2015, 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 @@ class FieldStreamBase : public StackObj {
|
||||
return num_fields;
|
||||
}
|
||||
|
||||
FieldStreamBase(Array<u2>* fields, constantPoolHandle constants, int start, int limit) {
|
||||
FieldStreamBase(Array<u2>* fields, const constantPoolHandle& constants, int start, int limit) {
|
||||
_fields = fields;
|
||||
_constants = constants;
|
||||
_index = start;
|
||||
@ -91,7 +91,7 @@ class FieldStreamBase : public StackObj {
|
||||
}
|
||||
}
|
||||
|
||||
FieldStreamBase(Array<u2>* fields, constantPoolHandle constants) {
|
||||
FieldStreamBase(Array<u2>* fields, const constantPoolHandle& constants) {
|
||||
_fields = fields;
|
||||
_constants = constants;
|
||||
_index = 0;
|
||||
@ -251,7 +251,7 @@ class InternalFieldStream : public FieldStreamBase {
|
||||
|
||||
class AllFieldStream : public FieldStreamBase {
|
||||
public:
|
||||
AllFieldStream(Array<u2>* fields, constantPoolHandle constants): FieldStreamBase(fields, constants) {}
|
||||
AllFieldStream(Array<u2>* fields, const constantPoolHandle& constants): FieldStreamBase(fields, constants) {}
|
||||
AllFieldStream(InstanceKlass* k): FieldStreamBase(k->fields(), k->constants()) {}
|
||||
AllFieldStream(instanceKlassHandle k): FieldStreamBase(k->fields(), k->constants()) {}
|
||||
};
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1997, 2015, 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
|
||||
@ -222,7 +222,7 @@ void RetTableEntry::add_delta(int bci, int delta) {
|
||||
}
|
||||
}
|
||||
|
||||
void RetTable::compute_ret_table(methodHandle method) {
|
||||
void RetTable::compute_ret_table(const methodHandle& method) {
|
||||
BytecodeStream i(method);
|
||||
Bytecodes::Code bytecode;
|
||||
|
||||
@ -2039,7 +2039,7 @@ void GenerateOopMap::print_time() {
|
||||
//
|
||||
// ============ Main Entry Point ===========
|
||||
//
|
||||
GenerateOopMap::GenerateOopMap(methodHandle method) {
|
||||
GenerateOopMap::GenerateOopMap(const methodHandle& method) {
|
||||
// We have to initialize all variables here, that can be queried directly
|
||||
_method = method;
|
||||
_max_locals=0;
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1997, 2015, 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
|
||||
@ -78,7 +78,7 @@ class RetTable VALUE_OBJ_CLASS_SPEC {
|
||||
void add_jsr(int return_bci, int target_bci); // Adds entry to list
|
||||
public:
|
||||
RetTable() { _first = NULL; }
|
||||
void compute_ret_table(methodHandle method);
|
||||
void compute_ret_table(const methodHandle& method);
|
||||
void update_ret_table(int bci, int delta);
|
||||
RetTableEntry* find_jsrs_for_target(int targBci);
|
||||
};
|
||||
@ -462,7 +462,7 @@ class GenerateOopMap VALUE_OBJ_CLASS_SPEC {
|
||||
|
||||
friend class RelocCallback;
|
||||
public:
|
||||
GenerateOopMap(methodHandle method);
|
||||
GenerateOopMap(const methodHandle& method);
|
||||
|
||||
// Compute the map.
|
||||
void compute_map(TRAPS);
|
||||
@ -537,7 +537,7 @@ class ResolveOopMapConflicts: public GenerateOopMap {
|
||||
#endif
|
||||
|
||||
public:
|
||||
ResolveOopMapConflicts(methodHandle method) : GenerateOopMap(method) { _must_clear_locals = false; };
|
||||
ResolveOopMapConflicts(const methodHandle& method) : GenerateOopMap(method) { _must_clear_locals = false; };
|
||||
|
||||
methodHandle do_potential_rewrite(TRAPS);
|
||||
bool must_clear_locals() const { return _must_clear_locals; }
|
||||
@ -562,7 +562,7 @@ class GeneratePairingInfo: public GenerateOopMap {
|
||||
int stack_top) {}
|
||||
virtual void fill_init_vars (GrowableArray<intptr_t> *init_vars) {}
|
||||
public:
|
||||
GeneratePairingInfo(methodHandle method) : GenerateOopMap(method) {};
|
||||
GeneratePairingInfo(const methodHandle& method) : GenerateOopMap(method) {};
|
||||
|
||||
// Call compute_map(CHECK) to generate info.
|
||||
};
|
||||
|
||||
@ -1141,7 +1141,7 @@ void InstanceKlass::call_class_initializer_impl(instanceKlassHandle this_k, TRAP
|
||||
}
|
||||
|
||||
|
||||
void InstanceKlass::mask_for(methodHandle method, int bci,
|
||||
void InstanceKlass::mask_for(const methodHandle& method, int bci,
|
||||
InterpreterOopMap* entry_for) {
|
||||
// Dirty read, then double-check under a lock.
|
||||
if (_oop_map_cache == NULL) {
|
||||
@ -1645,7 +1645,7 @@ void InstanceKlass::set_enclosing_method_indices(u2 class_index,
|
||||
// locking has to be done very carefully to avoid deadlocks
|
||||
// and/or other cache consistency problems.
|
||||
//
|
||||
jmethodID InstanceKlass::get_jmethod_id(instanceKlassHandle ik_h, methodHandle method_h) {
|
||||
jmethodID InstanceKlass::get_jmethod_id(instanceKlassHandle ik_h, const methodHandle& method_h) {
|
||||
size_t idnum = (size_t)method_h->method_idnum();
|
||||
jmethodID* jmeths = ik_h->methods_jmethod_ids_acquire();
|
||||
size_t length = 0;
|
||||
@ -2413,7 +2413,7 @@ bool InstanceKlass::is_same_class_package(oop class_loader1, Symbol* class_name1
|
||||
// Assumes name-signature match
|
||||
// "this" is InstanceKlass of super_method which must exist
|
||||
// note that the InstanceKlass of the method in the targetclassname has not always been created yet
|
||||
bool InstanceKlass::is_override(methodHandle super_method, Handle targetclassloader, Symbol* targetclassname, TRAPS) {
|
||||
bool InstanceKlass::is_override(const methodHandle& super_method, Handle targetclassloader, Symbol* targetclassname, TRAPS) {
|
||||
// Private methods can not be overridden
|
||||
if (super_method->is_private()) {
|
||||
return false;
|
||||
|
||||
@ -414,7 +414,7 @@ class InstanceKlass: public Klass {
|
||||
};
|
||||
|
||||
// method override check
|
||||
bool is_override(methodHandle super_method, Handle targetclassloader, Symbol* targetclassname, TRAPS);
|
||||
bool is_override(const methodHandle& super_method, Handle targetclassloader, Symbol* targetclassname, TRAPS);
|
||||
|
||||
// package
|
||||
bool is_same_class_package(Klass* class2);
|
||||
@ -780,7 +780,7 @@ public:
|
||||
|
||||
// jmethodID support
|
||||
static jmethodID get_jmethod_id(instanceKlassHandle ik_h,
|
||||
methodHandle method_h);
|
||||
const methodHandle& method_h);
|
||||
static jmethodID get_jmethod_id_fetch_or_update(instanceKlassHandle ik_h,
|
||||
size_t idnum, jmethodID new_id, jmethodID* new_jmeths,
|
||||
jmethodID* to_dealloc_id_p,
|
||||
@ -827,7 +827,7 @@ public:
|
||||
// OopMapCache support
|
||||
OopMapCache* oop_map_cache() { return _oop_map_cache; }
|
||||
void set_oop_map_cache(OopMapCache *cache) { _oop_map_cache = cache; }
|
||||
void mask_for(methodHandle method, int bci, InterpreterOopMap* entry);
|
||||
void mask_for(const methodHandle& method, int bci, InterpreterOopMap* entry);
|
||||
|
||||
// JNI identifier support (for static fields - for jni performance)
|
||||
JNIid* jni_ids() { return _jni_ids; }
|
||||
|
||||
@ -366,7 +366,7 @@ void Method::print_invocation_count() {
|
||||
|
||||
// Build a MethodData* object to hold information about this method
|
||||
// collected in the interpreter.
|
||||
void Method::build_interpreter_method_data(methodHandle method, TRAPS) {
|
||||
void Method::build_interpreter_method_data(const methodHandle& method, TRAPS) {
|
||||
// Do not profile the method if metaspace has hit an OOM previously
|
||||
// allocating profiling data. Callers clear pending exception so don't
|
||||
// add one here.
|
||||
@ -897,7 +897,7 @@ void Method::unlink_method() {
|
||||
|
||||
// Called when the method_holder is getting linked. Setup entrypoints so the method
|
||||
// is ready to be called from interpreter, compiler, and vtables.
|
||||
void Method::link_method(methodHandle h_method, TRAPS) {
|
||||
void Method::link_method(const methodHandle& h_method, TRAPS) {
|
||||
// If the code cache is full, we may reenter this function for the
|
||||
// leftover methods that weren't linked.
|
||||
if (_i2i_entry != NULL) return;
|
||||
|
||||
@ -393,7 +393,7 @@ class Method : public Metadata {
|
||||
bool was_executed_more_than(int n);
|
||||
bool was_never_executed() { return !was_executed_more_than(0); }
|
||||
|
||||
static void build_interpreter_method_data(methodHandle method, TRAPS);
|
||||
static void build_interpreter_method_data(const methodHandle& method, TRAPS);
|
||||
|
||||
static MethodCounters* build_method_counters(Method* m, TRAPS);
|
||||
|
||||
@ -435,7 +435,7 @@ class Method : public Metadata {
|
||||
address get_c2i_unverified_entry();
|
||||
AdapterHandlerEntry* adapter() { return _adapter; }
|
||||
// setup entry points
|
||||
void link_method(methodHandle method, TRAPS);
|
||||
void link_method(const methodHandle& method, TRAPS);
|
||||
// clear entry points. Used by sharing code
|
||||
void unlink_method();
|
||||
|
||||
|
||||
@ -708,7 +708,7 @@ void SpeculativeTrapData::print_data_on(outputStream* st, const char* extra) con
|
||||
// A MethodData* holds information which has been collected about
|
||||
// a method.
|
||||
|
||||
MethodData* MethodData::allocate(ClassLoaderData* loader_data, methodHandle method, TRAPS) {
|
||||
MethodData* MethodData::allocate(ClassLoaderData* loader_data, const methodHandle& method, TRAPS) {
|
||||
int size = MethodData::compute_allocation_size_in_words(method);
|
||||
|
||||
return new (loader_data, size, false, MetaspaceObj::MethodDataType, THREAD)
|
||||
@ -898,7 +898,7 @@ int MethodData::compute_extra_data_count(int data_size, int empty_bc_count, bool
|
||||
|
||||
// Compute the size of the MethodData* necessary to store
|
||||
// profiling information about a given method. Size is in bytes.
|
||||
int MethodData::compute_allocation_size_in_bytes(methodHandle method) {
|
||||
int MethodData::compute_allocation_size_in_bytes(const methodHandle& method) {
|
||||
int data_size = 0;
|
||||
BytecodeStream stream(method);
|
||||
Bytecodes::Code c;
|
||||
@ -931,7 +931,7 @@ int MethodData::compute_allocation_size_in_bytes(methodHandle method) {
|
||||
|
||||
// Compute the size of the MethodData* necessary to store
|
||||
// profiling information about a given method. Size is in words
|
||||
int MethodData::compute_allocation_size_in_words(methodHandle method) {
|
||||
int MethodData::compute_allocation_size_in_words(const methodHandle& method) {
|
||||
int byte_size = compute_allocation_size_in_bytes(method);
|
||||
int word_size = align_size_up(byte_size, BytesPerWord) / BytesPerWord;
|
||||
return align_object_size(word_size);
|
||||
@ -1129,7 +1129,7 @@ void MethodData::post_initialize(BytecodeStream* stream) {
|
||||
}
|
||||
|
||||
// Initialize the MethodData* corresponding to a given method.
|
||||
MethodData::MethodData(methodHandle method, int size, TRAPS)
|
||||
MethodData::MethodData(const methodHandle& method, int size, TRAPS)
|
||||
: _extra_data_lock(Monitor::leaf, "MDO extra data lock"),
|
||||
_parameters_type_data_di(parameters_uninitialized) {
|
||||
// Set the method back-pointer.
|
||||
@ -1513,7 +1513,7 @@ void MethodData::verify_data_on(outputStream* st) {
|
||||
// not yet implemented.
|
||||
}
|
||||
|
||||
bool MethodData::profile_jsr292(methodHandle m, int bci) {
|
||||
bool MethodData::profile_jsr292(const methodHandle& m, int bci) {
|
||||
if (m->is_compiled_lambda_form()) {
|
||||
return true;
|
||||
}
|
||||
@ -1538,7 +1538,7 @@ bool MethodData::profile_all_arguments() {
|
||||
return profile_arguments_flag() == type_profile_all;
|
||||
}
|
||||
|
||||
bool MethodData::profile_arguments_for_invoke(methodHandle m, int bci) {
|
||||
bool MethodData::profile_arguments_for_invoke(const methodHandle& m, int bci) {
|
||||
if (!profile_arguments()) {
|
||||
return false;
|
||||
}
|
||||
@ -1567,7 +1567,7 @@ bool MethodData::profile_all_return() {
|
||||
return profile_return_flag() == type_profile_all;
|
||||
}
|
||||
|
||||
bool MethodData::profile_return_for_invoke(methodHandle m, int bci) {
|
||||
bool MethodData::profile_return_for_invoke(const methodHandle& m, int bci) {
|
||||
if (!profile_return()) {
|
||||
return false;
|
||||
}
|
||||
@ -1596,7 +1596,7 @@ bool MethodData::profile_all_parameters() {
|
||||
return profile_parameters_flag() == type_profile_all;
|
||||
}
|
||||
|
||||
bool MethodData::profile_parameters_for_method(methodHandle m) {
|
||||
bool MethodData::profile_parameters_for_method(const methodHandle& m) {
|
||||
if (!profile_parameters()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2000, 2015, 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
|
||||
@ -2145,9 +2145,9 @@ private:
|
||||
|
||||
Mutex _extra_data_lock;
|
||||
|
||||
MethodData(methodHandle method, int size, TRAPS);
|
||||
MethodData(const methodHandle& method, int size, TRAPS);
|
||||
public:
|
||||
static MethodData* allocate(ClassLoaderData* loader_data, methodHandle method, TRAPS);
|
||||
static MethodData* allocate(ClassLoaderData* loader_data, const methodHandle& method, TRAPS);
|
||||
MethodData() : _extra_data_lock(Monitor::leaf, "MDO extra data lock") {}; // For ciMethodData
|
||||
|
||||
bool is_methodData() const volatile { return true; }
|
||||
@ -2283,13 +2283,13 @@ private:
|
||||
type_profile_all = 2
|
||||
};
|
||||
|
||||
static bool profile_jsr292(methodHandle m, int bci);
|
||||
static bool profile_jsr292(const methodHandle& m, int bci);
|
||||
static int profile_arguments_flag();
|
||||
static bool profile_all_arguments();
|
||||
static bool profile_arguments_for_invoke(methodHandle m, int bci);
|
||||
static bool profile_arguments_for_invoke(const methodHandle& m, int bci);
|
||||
static int profile_return_flag();
|
||||
static bool profile_all_return();
|
||||
static bool profile_return_for_invoke(methodHandle m, int bci);
|
||||
static bool profile_return_for_invoke(const methodHandle& m, int bci);
|
||||
static int profile_parameters_flag();
|
||||
static bool profile_parameters_jsr292_only();
|
||||
static bool profile_all_parameters();
|
||||
@ -2304,8 +2304,8 @@ public:
|
||||
}
|
||||
|
||||
// Compute the size of a MethodData* before it is created.
|
||||
static int compute_allocation_size_in_bytes(methodHandle method);
|
||||
static int compute_allocation_size_in_words(methodHandle method);
|
||||
static int compute_allocation_size_in_bytes(const methodHandle& method);
|
||||
static int compute_allocation_size_in_words(const methodHandle& method);
|
||||
static int compute_extra_data_count(int data_size, int empty_bc_count, bool needs_speculative_traps);
|
||||
|
||||
// Determine if a given bytecode can have profile information.
|
||||
@ -2589,7 +2589,7 @@ public:
|
||||
void verify_on(outputStream* st);
|
||||
void verify_data_on(outputStream* st);
|
||||
|
||||
static bool profile_parameters_for_method(methodHandle m);
|
||||
static bool profile_parameters_for_method(const methodHandle& m);
|
||||
static bool profile_arguments();
|
||||
static bool profile_arguments_jsr292_only();
|
||||
static bool profile_return();
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1999, 2015, 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
|
||||
@ -157,7 +157,7 @@ void C2Compiler::print_timers() {
|
||||
Compile::print_timers();
|
||||
}
|
||||
|
||||
bool C2Compiler::is_intrinsic_supported(methodHandle method, bool is_virtual) {
|
||||
bool C2Compiler::is_intrinsic_supported(const methodHandle& method, bool is_virtual) {
|
||||
vmIntrinsics::ID id = method->intrinsic_id();
|
||||
assert(id != vmIntrinsics::_none, "must be a VM intrinsic");
|
||||
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1999, 2015, 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
|
||||
@ -56,13 +56,13 @@ public:
|
||||
// possible for only a limited set of available intrinsics whereas
|
||||
// a non-virtual dispatch is possible for all available intrinsics.)
|
||||
// Return false otherwise.
|
||||
virtual bool is_intrinsic_supported(methodHandle method) {
|
||||
virtual bool is_intrinsic_supported(const methodHandle& method) {
|
||||
return is_intrinsic_supported(method, false);
|
||||
}
|
||||
|
||||
// Check if the compiler supports an intrinsic for 'method' given the
|
||||
// the dispatch mode specified by the 'is_virtual' parameter.
|
||||
virtual bool is_intrinsic_supported(methodHandle method, bool is_virtual);
|
||||
virtual bool is_intrinsic_supported(const methodHandle& method, bool is_virtual);
|
||||
|
||||
// Initial size of the code buffer (may be increased at runtime)
|
||||
static int initial_code_buffer_size();
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2005, 2014, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2005, 2015, 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
|
||||
@ -125,7 +125,7 @@ void JvmtiClassFileReconstituter::write_field_infos() {
|
||||
// JVMSpec| u2 attributes_count;
|
||||
// JVMSpec| attribute_info attributes[attributes_count];
|
||||
// JVMSpec| }
|
||||
void JvmtiClassFileReconstituter::write_code_attribute(methodHandle method) {
|
||||
void JvmtiClassFileReconstituter::write_code_attribute(const methodHandle& method) {
|
||||
ConstMethod* const_method = method->constMethod();
|
||||
u2 line_num_cnt = 0;
|
||||
int stackmap_len = 0;
|
||||
@ -415,7 +415,7 @@ void JvmtiClassFileReconstituter::write_synthetic_attribute() {
|
||||
}
|
||||
|
||||
// Compute size of LineNumberTable
|
||||
u2 JvmtiClassFileReconstituter::line_number_table_entries(methodHandle method) {
|
||||
u2 JvmtiClassFileReconstituter::line_number_table_entries(const methodHandle& method) {
|
||||
// The line number table is compressed so we don't know how big it is until decompressed.
|
||||
// Decompression is really fast so we just do it twice.
|
||||
u2 num_entries = 0;
|
||||
@ -435,7 +435,7 @@ u2 JvmtiClassFileReconstituter::line_number_table_entries(methodHandle method) {
|
||||
// JVMSpec| u2 line_number;
|
||||
// JVMSpec| } line_number_table[line_number_table_length];
|
||||
// JVMSpec| }
|
||||
void JvmtiClassFileReconstituter::write_line_number_table_attribute(methodHandle method,
|
||||
void JvmtiClassFileReconstituter::write_line_number_table_attribute(const methodHandle& method,
|
||||
u2 num_entries) {
|
||||
|
||||
write_attribute_name_index("LineNumberTable");
|
||||
@ -461,7 +461,7 @@ void JvmtiClassFileReconstituter::write_line_number_table_attribute(methodHandle
|
||||
// JVMSpec| u2 index;
|
||||
// JVMSpec| } local_variable_table[local_variable_table_length];
|
||||
// JVMSpec| }
|
||||
void JvmtiClassFileReconstituter::write_local_variable_table_attribute(methodHandle method, u2 num_entries) {
|
||||
void JvmtiClassFileReconstituter::write_local_variable_table_attribute(const methodHandle& method, u2 num_entries) {
|
||||
write_attribute_name_index("LocalVariableTable");
|
||||
write_u4(2 + num_entries * (2 + 2 + 2 + 2 + 2));
|
||||
write_u2(num_entries);
|
||||
@ -491,7 +491,7 @@ void JvmtiClassFileReconstituter::write_local_variable_table_attribute(methodHan
|
||||
// JVMSpec| u2 index;
|
||||
// JVMSpec| } local_variable_type_table[local_variable_type_table_length];
|
||||
// JVMSpec| }
|
||||
void JvmtiClassFileReconstituter::write_local_variable_type_table_attribute(methodHandle method, u2 num_entries) {
|
||||
void JvmtiClassFileReconstituter::write_local_variable_type_table_attribute(const methodHandle& method, u2 num_entries) {
|
||||
write_attribute_name_index("LocalVariableTypeTable");
|
||||
write_u4(2 + num_entries * (2 + 2 + 2 + 2 + 2));
|
||||
write_u2(num_entries);
|
||||
@ -519,7 +519,7 @@ void JvmtiClassFileReconstituter::write_local_variable_type_table_attribute(meth
|
||||
// JSR-202| u2 number_of_entries;
|
||||
// JSR-202| stack_map_frame_entries[number_of_entries];
|
||||
// JSR-202| }
|
||||
void JvmtiClassFileReconstituter::write_stackmap_table_attribute(methodHandle method,
|
||||
void JvmtiClassFileReconstituter::write_stackmap_table_attribute(const methodHandle& method,
|
||||
int stackmap_len) {
|
||||
|
||||
write_attribute_name_index("StackMapTable");
|
||||
@ -538,7 +538,7 @@ void JvmtiClassFileReconstituter::write_stackmap_table_attribute(methodHandle me
|
||||
// JVMSpec| u2 attributes_count;
|
||||
// JVMSpec| attribute_info attributes[attributes_count];
|
||||
// JVMSpec| }
|
||||
void JvmtiClassFileReconstituter::write_method_info(methodHandle method) {
|
||||
void JvmtiClassFileReconstituter::write_method_info(const methodHandle& method) {
|
||||
AccessFlags access_flags = method->access_flags();
|
||||
ConstMethod* const_method = method->constMethod();
|
||||
u2 generic_signature_index = const_method->generic_signature_index();
|
||||
@ -813,7 +813,7 @@ void JvmtiClassFileReconstituter::write_u8(u8 x) {
|
||||
Bytes::put_Java_u8(writeable_address(8), x);
|
||||
}
|
||||
|
||||
void JvmtiClassFileReconstituter::copy_bytecodes(methodHandle mh,
|
||||
void JvmtiClassFileReconstituter::copy_bytecodes(const methodHandle& mh,
|
||||
unsigned char* bytecodes) {
|
||||
// use a BytecodeStream to iterate over the bytecodes. JVM/fast bytecodes
|
||||
// and the breakpoint bytecode are converted to their original bytecodes.
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2005, 2014, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2005, 2015, 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
|
||||
@ -110,18 +110,18 @@ class JvmtiClassFileReconstituter : public JvmtiConstantPoolReconstituter {
|
||||
void write_class_file_format();
|
||||
void write_field_infos();
|
||||
void write_method_infos();
|
||||
void write_method_info(methodHandle method);
|
||||
void write_code_attribute(methodHandle method);
|
||||
void write_method_info(const methodHandle& method);
|
||||
void write_code_attribute(const methodHandle& method);
|
||||
void write_exceptions_attribute(ConstMethod* const_method);
|
||||
void write_synthetic_attribute();
|
||||
void write_class_attributes();
|
||||
void write_source_file_attribute();
|
||||
void write_source_debug_extension_attribute();
|
||||
u2 line_number_table_entries(methodHandle method);
|
||||
void write_line_number_table_attribute(methodHandle method, u2 num_entries);
|
||||
void write_local_variable_table_attribute(methodHandle method, u2 num_entries);
|
||||
void write_local_variable_type_table_attribute(methodHandle method, u2 num_entries);
|
||||
void write_stackmap_table_attribute(methodHandle method, int stackmap_table_len);
|
||||
u2 line_number_table_entries(const methodHandle& method);
|
||||
void write_line_number_table_attribute(const methodHandle& method, u2 num_entries);
|
||||
void write_local_variable_table_attribute(const methodHandle& method, u2 num_entries);
|
||||
void write_local_variable_type_table_attribute(const methodHandle& method, u2 num_entries);
|
||||
void write_stackmap_table_attribute(const methodHandle& method, int stackmap_table_len);
|
||||
u2 inner_classes_attribute_length();
|
||||
void write_inner_classes_attribute(int length);
|
||||
void write_signature_attribute(u2 generic_signaure_index);
|
||||
@ -150,7 +150,7 @@ class JvmtiClassFileReconstituter : public JvmtiConstantPoolReconstituter {
|
||||
|
||||
u1* class_file_bytes() { return _buffer; }
|
||||
|
||||
static void copy_bytecodes(methodHandle method, unsigned char* bytecodes);
|
||||
static void copy_bytecodes(const methodHandle& method, unsigned char* bytecodes);
|
||||
};
|
||||
|
||||
#endif // SHARE_VM_PRIMS_JVMTICLASSFILERECONSTITUTER_HPP
|
||||
|
||||
@ -216,7 +216,7 @@ bool VM_RedefineClasses::is_modifiable_class(oop klass_mirror) {
|
||||
// referenced CP entries may already exist in *merge_cp_p in which case
|
||||
// there is nothing extra to append and only the current entry is
|
||||
// appended.
|
||||
void VM_RedefineClasses::append_entry(constantPoolHandle scratch_cp,
|
||||
void VM_RedefineClasses::append_entry(const constantPoolHandle& scratch_cp,
|
||||
int scratch_i, constantPoolHandle *merge_cp_p, int *merge_cp_length_p,
|
||||
TRAPS) {
|
||||
|
||||
@ -475,7 +475,7 @@ void VM_RedefineClasses::append_entry(constantPoolHandle scratch_cp,
|
||||
} // end append_entry()
|
||||
|
||||
|
||||
int VM_RedefineClasses::find_or_append_indirect_entry(constantPoolHandle scratch_cp,
|
||||
int VM_RedefineClasses::find_or_append_indirect_entry(const constantPoolHandle& scratch_cp,
|
||||
int ref_i, constantPoolHandle *merge_cp_p, int *merge_cp_length_p, TRAPS) {
|
||||
|
||||
int new_ref_i = ref_i;
|
||||
@ -507,7 +507,7 @@ int VM_RedefineClasses::find_or_append_indirect_entry(constantPoolHandle scratch
|
||||
// Append a bootstrap specifier into the merge_cp operands that is semantically equal
|
||||
// to the scratch_cp operands bootstrap specifier passed by the old_bs_i index.
|
||||
// Recursively append new merge_cp entries referenced by the new bootstrap specifier.
|
||||
void VM_RedefineClasses::append_operand(constantPoolHandle scratch_cp, int old_bs_i,
|
||||
void VM_RedefineClasses::append_operand(const constantPoolHandle& scratch_cp, int old_bs_i,
|
||||
constantPoolHandle *merge_cp_p, int *merge_cp_length_p, TRAPS) {
|
||||
|
||||
int old_ref_i = scratch_cp->operand_bootstrap_method_ref_index_at(old_bs_i);
|
||||
@ -551,7 +551,7 @@ void VM_RedefineClasses::append_operand(constantPoolHandle scratch_cp, int old_b
|
||||
} // end append_operand()
|
||||
|
||||
|
||||
int VM_RedefineClasses::find_or_append_operand(constantPoolHandle scratch_cp,
|
||||
int VM_RedefineClasses::find_or_append_operand(const constantPoolHandle& scratch_cp,
|
||||
int old_bs_i, constantPoolHandle *merge_cp_p, int *merge_cp_length_p, TRAPS) {
|
||||
|
||||
int new_bs_i = old_bs_i; // bootstrap specifier index
|
||||
@ -577,7 +577,7 @@ int VM_RedefineClasses::find_or_append_operand(constantPoolHandle scratch_cp,
|
||||
} // end find_or_append_operand()
|
||||
|
||||
|
||||
void VM_RedefineClasses::finalize_operands_merge(constantPoolHandle merge_cp, TRAPS) {
|
||||
void VM_RedefineClasses::finalize_operands_merge(const constantPoolHandle& merge_cp, TRAPS) {
|
||||
if (merge_cp->operands() == NULL) {
|
||||
return;
|
||||
}
|
||||
@ -910,8 +910,8 @@ int VM_RedefineClasses::find_new_operand_index(int old_index) {
|
||||
|
||||
// Returns true if the current mismatch is due to a resolved/unresolved
|
||||
// class pair. Otherwise, returns false.
|
||||
bool VM_RedefineClasses::is_unresolved_class_mismatch(constantPoolHandle cp1,
|
||||
int index1, constantPoolHandle cp2, int index2) {
|
||||
bool VM_RedefineClasses::is_unresolved_class_mismatch(const constantPoolHandle& cp1,
|
||||
int index1, const constantPoolHandle& cp2, int index2) {
|
||||
|
||||
jbyte t1 = cp1->tag_at(index1).value();
|
||||
if (t1 != JVM_CONSTANT_Class && t1 != JVM_CONSTANT_UnresolvedClass) {
|
||||
@ -1149,7 +1149,7 @@ jvmtiError VM_RedefineClasses::load_new_class_versions(TRAPS) {
|
||||
|
||||
// Map old_index to new_index as needed. scratch_cp is only needed
|
||||
// for RC_TRACE() calls.
|
||||
void VM_RedefineClasses::map_index(constantPoolHandle scratch_cp,
|
||||
void VM_RedefineClasses::map_index(const constantPoolHandle& scratch_cp,
|
||||
int old_index, int new_index) {
|
||||
if (find_new_index(old_index) != 0) {
|
||||
// old_index is already mapped
|
||||
@ -1195,8 +1195,8 @@ void VM_RedefineClasses::map_operand_index(int old_index, int new_index) {
|
||||
// scratch_cp to the corresponding entry in *merge_cp_p. Index map
|
||||
// entries are only created for entries in scratch_cp that occupy a
|
||||
// different location in *merged_cp_p.
|
||||
bool VM_RedefineClasses::merge_constant_pools(constantPoolHandle old_cp,
|
||||
constantPoolHandle scratch_cp, constantPoolHandle *merge_cp_p,
|
||||
bool VM_RedefineClasses::merge_constant_pools(const constantPoolHandle& old_cp,
|
||||
const constantPoolHandle& scratch_cp, constantPoolHandle *merge_cp_p,
|
||||
int *merge_cp_length_p, TRAPS) {
|
||||
|
||||
if (merge_cp_p == NULL) {
|
||||
@ -2867,7 +2867,7 @@ bool VM_RedefineClasses::skip_type_annotation_type_path(
|
||||
// }
|
||||
//
|
||||
void VM_RedefineClasses::rewrite_cp_refs_in_stack_map_table(
|
||||
methodHandle method, TRAPS) {
|
||||
const methodHandle& method, TRAPS) {
|
||||
|
||||
if (!method->has_stackmap_table()) {
|
||||
return;
|
||||
|
||||
@ -420,23 +420,23 @@ class VM_RedefineClasses: public VM_Operation {
|
||||
void increment_class_counter(InstanceKlass *ik, TRAPS);
|
||||
|
||||
// Support for constant pool merging (these routines are in alpha order):
|
||||
void append_entry(constantPoolHandle scratch_cp, int scratch_i,
|
||||
void append_entry(const constantPoolHandle& scratch_cp, int scratch_i,
|
||||
constantPoolHandle *merge_cp_p, int *merge_cp_length_p, TRAPS);
|
||||
void append_operand(constantPoolHandle scratch_cp, int scratch_bootstrap_spec_index,
|
||||
void append_operand(const constantPoolHandle& scratch_cp, int scratch_bootstrap_spec_index,
|
||||
constantPoolHandle *merge_cp_p, int *merge_cp_length_p, TRAPS);
|
||||
void finalize_operands_merge(constantPoolHandle merge_cp, TRAPS);
|
||||
int find_or_append_indirect_entry(constantPoolHandle scratch_cp, int scratch_i,
|
||||
void finalize_operands_merge(const constantPoolHandle& merge_cp, TRAPS);
|
||||
int find_or_append_indirect_entry(const constantPoolHandle& scratch_cp, int scratch_i,
|
||||
constantPoolHandle *merge_cp_p, int *merge_cp_length_p, TRAPS);
|
||||
int find_or_append_operand(constantPoolHandle scratch_cp, int scratch_bootstrap_spec_index,
|
||||
int find_or_append_operand(const constantPoolHandle& scratch_cp, int scratch_bootstrap_spec_index,
|
||||
constantPoolHandle *merge_cp_p, int *merge_cp_length_p, TRAPS);
|
||||
int find_new_index(int old_index);
|
||||
int find_new_operand_index(int old_bootstrap_spec_index);
|
||||
bool is_unresolved_class_mismatch(constantPoolHandle cp1, int index1,
|
||||
constantPoolHandle cp2, int index2);
|
||||
void map_index(constantPoolHandle scratch_cp, int old_index, int new_index);
|
||||
bool is_unresolved_class_mismatch(const constantPoolHandle& cp1, int index1,
|
||||
const constantPoolHandle& cp2, int index2);
|
||||
void map_index(const constantPoolHandle& scratch_cp, int old_index, int new_index);
|
||||
void map_operand_index(int old_bootstrap_spec_index, int new_bootstrap_spec_index);
|
||||
bool merge_constant_pools(constantPoolHandle old_cp,
|
||||
constantPoolHandle scratch_cp, constantPoolHandle *merge_cp_p,
|
||||
bool merge_constant_pools(const constantPoolHandle& old_cp,
|
||||
const constantPoolHandle& scratch_cp, constantPoolHandle *merge_cp_p,
|
||||
int *merge_cp_length_p, TRAPS);
|
||||
jvmtiError merge_cp_and_rewrite(instanceKlassHandle the_class,
|
||||
instanceKlassHandle scratch_class, TRAPS);
|
||||
@ -480,7 +480,7 @@ class VM_RedefineClasses: public VM_Operation {
|
||||
instanceKlassHandle scratch_class, TRAPS);
|
||||
bool rewrite_cp_refs_in_methods_type_annotations(
|
||||
instanceKlassHandle scratch_class, TRAPS);
|
||||
void rewrite_cp_refs_in_stack_map_table(methodHandle method, TRAPS);
|
||||
void rewrite_cp_refs_in_stack_map_table(const methodHandle& method, TRAPS);
|
||||
void rewrite_cp_refs_in_verification_type_info(
|
||||
address& stackmap_addr_ref, address stackmap_end, u2 frame_i,
|
||||
u1 frame_size, TRAPS);
|
||||
|
||||
@ -67,7 +67,7 @@ static void mangle_name_on(outputStream* st, Symbol* name) {
|
||||
}
|
||||
|
||||
|
||||
char* NativeLookup::pure_jni_name(methodHandle method) {
|
||||
char* NativeLookup::pure_jni_name(const methodHandle& method) {
|
||||
stringStream st;
|
||||
// Prefix
|
||||
st.print("Java_");
|
||||
@ -80,7 +80,7 @@ char* NativeLookup::pure_jni_name(methodHandle method) {
|
||||
}
|
||||
|
||||
|
||||
char* NativeLookup::critical_jni_name(methodHandle method) {
|
||||
char* NativeLookup::critical_jni_name(const methodHandle& method) {
|
||||
stringStream st;
|
||||
// Prefix
|
||||
st.print("JavaCritical_");
|
||||
@ -93,7 +93,7 @@ char* NativeLookup::critical_jni_name(methodHandle method) {
|
||||
}
|
||||
|
||||
|
||||
char* NativeLookup::long_jni_name(methodHandle method) {
|
||||
char* NativeLookup::long_jni_name(const methodHandle& method) {
|
||||
// Signature ignore the wrapping parenteses and the trailing return type
|
||||
stringStream st;
|
||||
Symbol* signature = method->signature();
|
||||
@ -142,7 +142,7 @@ static address lookup_special_native(char* jni_name) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
address NativeLookup::lookup_style(methodHandle method, char* pure_name, const char* long_name, int args_size, bool os_style, bool& in_base_library, TRAPS) {
|
||||
address NativeLookup::lookup_style(const methodHandle& method, char* pure_name, const char* long_name, int args_size, bool os_style, bool& in_base_library, TRAPS) {
|
||||
address entry;
|
||||
// Compute complete JNI name for style
|
||||
stringStream st;
|
||||
@ -199,7 +199,7 @@ address NativeLookup::lookup_style(methodHandle method, char* pure_name, const c
|
||||
}
|
||||
|
||||
|
||||
address NativeLookup::lookup_critical_style(methodHandle method, char* pure_name, const char* long_name, int args_size, bool os_style) {
|
||||
address NativeLookup::lookup_critical_style(const methodHandle& method, char* pure_name, const char* long_name, int args_size, bool os_style) {
|
||||
if (!method->has_native_function()) {
|
||||
return NULL;
|
||||
}
|
||||
@ -229,7 +229,7 @@ address NativeLookup::lookup_critical_style(methodHandle method, char* pure_name
|
||||
|
||||
// Check all the formats of native implementation name to see if there is one
|
||||
// for the specified method.
|
||||
address NativeLookup::lookup_entry(methodHandle method, bool& in_base_library, TRAPS) {
|
||||
address NativeLookup::lookup_entry(const methodHandle& method, bool& in_base_library, TRAPS) {
|
||||
address entry = NULL;
|
||||
in_base_library = false;
|
||||
// Compute pure name
|
||||
@ -264,7 +264,7 @@ address NativeLookup::lookup_entry(methodHandle method, bool& in_base_library, T
|
||||
|
||||
// Check all the formats of native implementation name to see if there is one
|
||||
// for the specified method.
|
||||
address NativeLookup::lookup_critical_entry(methodHandle method) {
|
||||
address NativeLookup::lookup_critical_entry(const methodHandle& method) {
|
||||
if (!CriticalJNINatives) return NULL;
|
||||
|
||||
if (method->is_synchronized() ||
|
||||
@ -318,7 +318,7 @@ address NativeLookup::lookup_critical_entry(methodHandle method) {
|
||||
// If any are found, remove them before attemping the look up of the
|
||||
// native implementation again.
|
||||
// See SetNativeMethodPrefix in the JVM TI Spec for more details.
|
||||
address NativeLookup::lookup_entry_prefixed(methodHandle method, bool& in_base_library, TRAPS) {
|
||||
address NativeLookup::lookup_entry_prefixed(const methodHandle& method, bool& in_base_library, TRAPS) {
|
||||
#if INCLUDE_JVMTI
|
||||
ResourceMark rm(THREAD);
|
||||
|
||||
@ -354,7 +354,7 @@ address NativeLookup::lookup_entry_prefixed(methodHandle method, bool& in_base_l
|
||||
return NULL;
|
||||
}
|
||||
|
||||
address NativeLookup::lookup_base(methodHandle method, bool& in_base_library, TRAPS) {
|
||||
address NativeLookup::lookup_base(const methodHandle& method, bool& in_base_library, TRAPS) {
|
||||
address entry = NULL;
|
||||
ResourceMark rm(THREAD);
|
||||
|
||||
@ -372,7 +372,7 @@ address NativeLookup::lookup_base(methodHandle method, bool& in_base_library, TR
|
||||
}
|
||||
|
||||
|
||||
address NativeLookup::lookup(methodHandle method, bool& in_base_library, TRAPS) {
|
||||
address NativeLookup::lookup(const methodHandle& method, bool& in_base_library, TRAPS) {
|
||||
if (!method->has_native_function()) {
|
||||
address entry = lookup_base(method, in_base_library, CHECK_NULL);
|
||||
method->set_native_function(entry,
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1997, 2015, 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
|
||||
@ -34,20 +34,20 @@
|
||||
class NativeLookup : AllStatic {
|
||||
private:
|
||||
// JNI name computation
|
||||
static char* pure_jni_name(methodHandle method);
|
||||
static char* long_jni_name(methodHandle method);
|
||||
static char* critical_jni_name(methodHandle method);
|
||||
static char* pure_jni_name(const methodHandle& method);
|
||||
static char* long_jni_name(const methodHandle& method);
|
||||
static char* critical_jni_name(const methodHandle& method);
|
||||
|
||||
// Style specific lookup
|
||||
static address lookup_style(methodHandle method, char* pure_name, const char* long_name, int args_size, bool os_style, bool& in_base_library, TRAPS);
|
||||
static address lookup_critical_style(methodHandle method, char* pure_name, const char* long_name, int args_size, bool os_style);
|
||||
static address lookup_base (methodHandle method, bool& in_base_library, TRAPS);
|
||||
static address lookup_entry(methodHandle method, bool& in_base_library, TRAPS);
|
||||
static address lookup_entry_prefixed(methodHandle method, bool& in_base_library, TRAPS);
|
||||
static address lookup_style(const methodHandle& method, char* pure_name, const char* long_name, int args_size, bool os_style, bool& in_base_library, TRAPS);
|
||||
static address lookup_critical_style(const methodHandle& method, char* pure_name, const char* long_name, int args_size, bool os_style);
|
||||
static address lookup_base (const methodHandle& method, bool& in_base_library, TRAPS);
|
||||
static address lookup_entry(const methodHandle& method, bool& in_base_library, TRAPS);
|
||||
static address lookup_entry_prefixed(const methodHandle& method, bool& in_base_library, TRAPS);
|
||||
public:
|
||||
// Lookup native function. May throw UnsatisfiedLinkError.
|
||||
static address lookup(methodHandle method, bool& in_base_library, TRAPS);
|
||||
static address lookup_critical_entry(methodHandle method);
|
||||
static address lookup(const methodHandle& method, bool& in_base_library, TRAPS);
|
||||
static address lookup_critical_entry(const methodHandle& method);
|
||||
|
||||
// Lookup native functions in base library.
|
||||
static address base_library_lookup(const char* class_name, const char* method_name, const char* signature);
|
||||
|
||||
@ -467,14 +467,14 @@ CompLevel AdvancedThresholdPolicy::loop_event(Method* method, CompLevel cur_leve
|
||||
}
|
||||
|
||||
// Update the rate and submit compile
|
||||
void AdvancedThresholdPolicy::submit_compile(methodHandle mh, int bci, CompLevel level, JavaThread* thread) {
|
||||
void AdvancedThresholdPolicy::submit_compile(const methodHandle& mh, int bci, CompLevel level, JavaThread* thread) {
|
||||
int hot_count = (bci == InvocationEntryBci) ? mh->invocation_count() : mh->backedge_count();
|
||||
update_rate(os::javaTimeMillis(), mh());
|
||||
CompileBroker::compile_method(mh, bci, level, mh, hot_count, "tiered", thread);
|
||||
}
|
||||
|
||||
// Handle the invocation event.
|
||||
void AdvancedThresholdPolicy::method_invocation_event(methodHandle mh, methodHandle imh,
|
||||
void AdvancedThresholdPolicy::method_invocation_event(const methodHandle& mh, const methodHandle& imh,
|
||||
CompLevel level, nmethod* nm, JavaThread* thread) {
|
||||
if (should_create_mdo(mh(), level)) {
|
||||
create_mdo(mh, thread);
|
||||
@ -489,7 +489,7 @@ void AdvancedThresholdPolicy::method_invocation_event(methodHandle mh, methodHan
|
||||
|
||||
// Handle the back branch event. Notice that we can compile the method
|
||||
// with a regular entry from here.
|
||||
void AdvancedThresholdPolicy::method_back_branch_event(methodHandle mh, methodHandle imh,
|
||||
void AdvancedThresholdPolicy::method_back_branch_event(const methodHandle& mh, const methodHandle& imh,
|
||||
int bci, CompLevel level, nmethod* nm, JavaThread* thread) {
|
||||
if (should_create_mdo(mh(), level)) {
|
||||
create_mdo(mh, thread);
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2010, 2015, 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
|
||||
@ -213,11 +213,11 @@ protected:
|
||||
jlong start_time() const { return _start_time; }
|
||||
|
||||
// Submit a given method for compilation (and update the rate).
|
||||
virtual void submit_compile(methodHandle mh, int bci, CompLevel level, JavaThread* thread);
|
||||
virtual void submit_compile(const methodHandle& mh, int bci, CompLevel level, JavaThread* thread);
|
||||
// event() from SimpleThresholdPolicy would call these.
|
||||
virtual void method_invocation_event(methodHandle method, methodHandle inlinee,
|
||||
virtual void method_invocation_event(const methodHandle& method, const methodHandle& inlinee,
|
||||
CompLevel level, nmethod* nm, JavaThread* thread);
|
||||
virtual void method_back_branch_event(methodHandle method, methodHandle inlinee,
|
||||
virtual void method_back_branch_event(const methodHandle& method, const methodHandle& inlinee,
|
||||
int bci, CompLevel level, nmethod* nm, JavaThread* thread);
|
||||
public:
|
||||
AdvancedThresholdPolicy() : _start_time(0) { }
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2000, 2015, 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
|
||||
@ -218,7 +218,7 @@ int NonTieredCompPolicy::compiler_count(CompLevel comp_level) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
void NonTieredCompPolicy::reset_counter_for_invocation_event(methodHandle m) {
|
||||
void NonTieredCompPolicy::reset_counter_for_invocation_event(const methodHandle& m) {
|
||||
// Make sure invocation and backedge counter doesn't overflow again right away
|
||||
// as would be the case for native methods.
|
||||
|
||||
@ -232,7 +232,7 @@ void NonTieredCompPolicy::reset_counter_for_invocation_event(methodHandle m) {
|
||||
assert(!m->was_never_executed(), "don't reset to 0 -- could be mistaken for never-executed");
|
||||
}
|
||||
|
||||
void NonTieredCompPolicy::reset_counter_for_back_branch_event(methodHandle m) {
|
||||
void NonTieredCompPolicy::reset_counter_for_back_branch_event(const methodHandle& m) {
|
||||
// Delay next back-branch event but pump up invocation counter to trigger
|
||||
// whole method compilation.
|
||||
MethodCounters* mcs = m->method_counters();
|
||||
@ -357,7 +357,7 @@ bool NonTieredCompPolicy::is_mature(Method* method) {
|
||||
return (current >= initial + target);
|
||||
}
|
||||
|
||||
nmethod* NonTieredCompPolicy::event(methodHandle method, methodHandle inlinee, int branch_bci,
|
||||
nmethod* NonTieredCompPolicy::event(const methodHandle& method, const methodHandle& inlinee, int branch_bci,
|
||||
int bci, CompLevel comp_level, nmethod* nm, JavaThread* thread) {
|
||||
assert(comp_level == CompLevel_none, "This should be only called from the interpreter");
|
||||
NOT_PRODUCT(trace_frequency_counter_overflow(method, branch_bci, bci));
|
||||
@ -417,7 +417,7 @@ nmethod* NonTieredCompPolicy::event(methodHandle method, methodHandle inlinee, i
|
||||
|
||||
#ifndef PRODUCT
|
||||
PRAGMA_FORMAT_NONLITERAL_IGNORED_EXTERNAL
|
||||
void NonTieredCompPolicy::trace_frequency_counter_overflow(methodHandle m, int branch_bci, int bci) {
|
||||
void NonTieredCompPolicy::trace_frequency_counter_overflow(const methodHandle& m, int branch_bci, int bci) {
|
||||
if (TraceInvocationCounterOverflow) {
|
||||
MethodCounters* mcs = m->method_counters();
|
||||
assert(mcs != NULL, "MethodCounters cannot be NULL for profiling");
|
||||
@ -448,7 +448,7 @@ PRAGMA_DIAG_POP
|
||||
}
|
||||
}
|
||||
|
||||
void NonTieredCompPolicy::trace_osr_request(methodHandle method, nmethod* osr, int bci) {
|
||||
void NonTieredCompPolicy::trace_osr_request(const methodHandle& method, nmethod* osr, int bci) {
|
||||
if (TraceOnStackReplacement) {
|
||||
ResourceMark rm;
|
||||
tty->print(osr != NULL ? "Reused OSR entry for " : "Requesting OSR entry for ");
|
||||
@ -460,7 +460,7 @@ void NonTieredCompPolicy::trace_osr_request(methodHandle method, nmethod* osr, i
|
||||
|
||||
// SimpleCompPolicy - compile current method
|
||||
|
||||
void SimpleCompPolicy::method_invocation_event(methodHandle m, JavaThread* thread) {
|
||||
void SimpleCompPolicy::method_invocation_event(const methodHandle& m, JavaThread* thread) {
|
||||
const int comp_level = CompLevel_highest_tier;
|
||||
const int hot_count = m->invocation_count();
|
||||
reset_counter_for_invocation_event(m);
|
||||
@ -474,7 +474,7 @@ void SimpleCompPolicy::method_invocation_event(methodHandle m, JavaThread* threa
|
||||
}
|
||||
}
|
||||
|
||||
void SimpleCompPolicy::method_back_branch_event(methodHandle m, int bci, JavaThread* thread) {
|
||||
void SimpleCompPolicy::method_back_branch_event(const methodHandle& m, int bci, JavaThread* thread) {
|
||||
const int comp_level = CompLevel_highest_tier;
|
||||
const int hot_count = m->backedge_count();
|
||||
const char* comment = "backedge_count";
|
||||
@ -491,7 +491,7 @@ const char* StackWalkCompPolicy::_msg = NULL;
|
||||
|
||||
|
||||
// Consider m for compilation
|
||||
void StackWalkCompPolicy::method_invocation_event(methodHandle m, JavaThread* thread) {
|
||||
void StackWalkCompPolicy::method_invocation_event(const methodHandle& m, JavaThread* thread) {
|
||||
const int comp_level = CompLevel_highest_tier;
|
||||
const int hot_count = m->invocation_count();
|
||||
reset_counter_for_invocation_event(m);
|
||||
@ -530,7 +530,7 @@ void StackWalkCompPolicy::method_invocation_event(methodHandle m, JavaThread* th
|
||||
}
|
||||
}
|
||||
|
||||
void StackWalkCompPolicy::method_back_branch_event(methodHandle m, int bci, JavaThread* thread) {
|
||||
void StackWalkCompPolicy::method_back_branch_event(const methodHandle& m, int bci, JavaThread* thread) {
|
||||
const int comp_level = CompLevel_highest_tier;
|
||||
const int hot_count = m->backedge_count();
|
||||
const char* comment = "backedge_count";
|
||||
@ -663,7 +663,7 @@ RFrame* StackWalkCompPolicy::senderOf(RFrame* rf, GrowableArray<RFrame*>* stack)
|
||||
}
|
||||
|
||||
|
||||
const char* StackWalkCompPolicy::shouldInline(methodHandle m, float freq, int cnt) {
|
||||
const char* StackWalkCompPolicy::shouldInline(const methodHandle& m, float freq, int cnt) {
|
||||
// Allows targeted inlining
|
||||
// positive filter: should send be inlined? returns NULL (--> yes)
|
||||
// or rejection msg
|
||||
@ -690,7 +690,7 @@ const char* StackWalkCompPolicy::shouldInline(methodHandle m, float freq, int cn
|
||||
}
|
||||
|
||||
|
||||
const char* StackWalkCompPolicy::shouldNotInline(methodHandle m) {
|
||||
const char* StackWalkCompPolicy::shouldNotInline(const methodHandle& m) {
|
||||
// negative filter: should send NOT be inlined? returns NULL (--> inline) or rejection msg
|
||||
if (m->is_abstract()) return (_msg = "abstract method");
|
||||
// note: we allow ik->is_abstract()
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2000, 2015, 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
|
||||
@ -66,7 +66,7 @@ public:
|
||||
virtual int compiler_count(CompLevel comp_level) = 0;
|
||||
// main notification entry, return a pointer to an nmethod if the OSR is required,
|
||||
// returns NULL otherwise.
|
||||
virtual nmethod* event(methodHandle method, methodHandle inlinee, int branch_bci, int bci, CompLevel comp_level, nmethod* nm, JavaThread* thread) = 0;
|
||||
virtual nmethod* event(const methodHandle& method, const methodHandle& inlinee, int branch_bci, int bci, CompLevel comp_level, nmethod* nm, JavaThread* thread) = 0;
|
||||
// safepoint() is called at the end of the safepoint
|
||||
virtual void do_safepoint_work() = 0;
|
||||
// reprofile request
|
||||
@ -91,11 +91,11 @@ public:
|
||||
class NonTieredCompPolicy : public CompilationPolicy {
|
||||
int _compiler_count;
|
||||
protected:
|
||||
static void trace_frequency_counter_overflow(methodHandle m, int branch_bci, int bci);
|
||||
static void trace_osr_request(methodHandle method, nmethod* osr, int bci);
|
||||
static void trace_frequency_counter_overflow(const methodHandle& m, int branch_bci, int bci);
|
||||
static void trace_osr_request(const methodHandle& method, nmethod* osr, int bci);
|
||||
static void trace_osr_completion(nmethod* osr_nm);
|
||||
void reset_counter_for_invocation_event(methodHandle method);
|
||||
void reset_counter_for_back_branch_event(methodHandle method);
|
||||
void reset_counter_for_invocation_event(const methodHandle& method);
|
||||
void reset_counter_for_back_branch_event(const methodHandle& method);
|
||||
public:
|
||||
NonTieredCompPolicy() : _compiler_count(0) { }
|
||||
virtual CompLevel initial_compile_level() { return CompLevel_highest_tier; }
|
||||
@ -107,15 +107,15 @@ public:
|
||||
virtual bool is_mature(Method* method);
|
||||
virtual void initialize();
|
||||
virtual CompileTask* select_task(CompileQueue* compile_queue);
|
||||
virtual nmethod* event(methodHandle method, methodHandle inlinee, int branch_bci, int bci, CompLevel comp_level, nmethod* nm, JavaThread* thread);
|
||||
virtual void method_invocation_event(methodHandle m, JavaThread* thread) = 0;
|
||||
virtual void method_back_branch_event(methodHandle m, int bci, JavaThread* thread) = 0;
|
||||
virtual nmethod* event(const methodHandle& method, const methodHandle& inlinee, int branch_bci, int bci, CompLevel comp_level, nmethod* nm, JavaThread* thread);
|
||||
virtual void method_invocation_event(const methodHandle& m, JavaThread* thread) = 0;
|
||||
virtual void method_back_branch_event(const methodHandle& m, int bci, JavaThread* thread) = 0;
|
||||
};
|
||||
|
||||
class SimpleCompPolicy : public NonTieredCompPolicy {
|
||||
public:
|
||||
virtual void method_invocation_event(methodHandle m, JavaThread* thread);
|
||||
virtual void method_back_branch_event(methodHandle m, int bci, JavaThread* thread);
|
||||
virtual void method_invocation_event(const methodHandle& m, JavaThread* thread);
|
||||
virtual void method_back_branch_event(const methodHandle& m, int bci, JavaThread* thread);
|
||||
};
|
||||
|
||||
// StackWalkCompPolicy - existing C2 policy
|
||||
@ -123,8 +123,8 @@ class SimpleCompPolicy : public NonTieredCompPolicy {
|
||||
#ifdef COMPILER2
|
||||
class StackWalkCompPolicy : public NonTieredCompPolicy {
|
||||
public:
|
||||
virtual void method_invocation_event(methodHandle m, JavaThread* thread);
|
||||
virtual void method_back_branch_event(methodHandle m, int bci, JavaThread* thread);
|
||||
virtual void method_invocation_event(const methodHandle& m, JavaThread* thread);
|
||||
virtual void method_back_branch_event(const methodHandle& m, int bci, JavaThread* thread);
|
||||
|
||||
private:
|
||||
RFrame* findTopInlinableFrame(GrowableArray<RFrame*>* stack);
|
||||
@ -134,9 +134,9 @@ class StackWalkCompPolicy : public NonTieredCompPolicy {
|
||||
// they are used for performance debugging only (print better messages)
|
||||
static const char* _msg; // reason for not inlining
|
||||
|
||||
static const char* shouldInline (methodHandle callee, float frequency, int cnt);
|
||||
static const char* shouldInline (const methodHandle& callee, float frequency, int cnt);
|
||||
// positive filter: should send be inlined? returns NULL (--> yes) or rejection msg
|
||||
static const char* shouldNotInline(methodHandle callee);
|
||||
static const char* shouldNotInline(const methodHandle& callee);
|
||||
// negative filter: should send NOT be inlined? returns NULL (--> inline) or rejection msg
|
||||
|
||||
};
|
||||
|
||||
@ -1345,7 +1345,7 @@ Deoptimization::get_method_data(JavaThread* thread, methodHandle m,
|
||||
}
|
||||
|
||||
#if defined(COMPILER2) || defined(SHARK) || INCLUDE_JVMCI
|
||||
void Deoptimization::load_class_by_index(constantPoolHandle constant_pool, int index, TRAPS) {
|
||||
void Deoptimization::load_class_by_index(const constantPoolHandle& constant_pool, int index, TRAPS) {
|
||||
// in case of an unresolved klass entry, load the class.
|
||||
if (constant_pool->tag_at(index).is_unresolved_klass()) {
|
||||
Klass* tk = constant_pool->klass_at_ignore_error(index, CHECK);
|
||||
@ -1376,7 +1376,7 @@ void Deoptimization::load_class_by_index(constantPoolHandle constant_pool, int i
|
||||
}
|
||||
|
||||
|
||||
void Deoptimization::load_class_by_index(constantPoolHandle constant_pool, int index) {
|
||||
void Deoptimization::load_class_by_index(const constantPoolHandle& constant_pool, int index) {
|
||||
EXCEPTION_MARK;
|
||||
load_class_by_index(constant_pool, index, THREAD);
|
||||
if (HAS_PENDING_EXCEPTION) {
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1997, 2015, 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
|
||||
@ -420,8 +420,8 @@ JVMCI_ONLY(public:)
|
||||
bool& ret_maybe_prior_trap,
|
||||
bool& ret_maybe_prior_recompile);
|
||||
// class loading support for uncommon trap
|
||||
static void load_class_by_index(constantPoolHandle constant_pool, int index, TRAPS);
|
||||
static void load_class_by_index(constantPoolHandle constant_pool, int index);
|
||||
static void load_class_by_index(const constantPoolHandle& constant_pool, int index, TRAPS);
|
||||
static void load_class_by_index(const constantPoolHandle& constant_pool, int index);
|
||||
|
||||
static UnrollBlock* fetch_unroll_info_helper(JavaThread* thread);
|
||||
|
||||
|
||||
@ -289,21 +289,20 @@ void JavaCalls::call_static(JavaValue* result, KlassHandle klass, Symbol* name,
|
||||
// Implementation of JavaCalls (low level)
|
||||
|
||||
|
||||
void JavaCalls::call(JavaValue* result, methodHandle method, JavaCallArguments* args, TRAPS) {
|
||||
void JavaCalls::call(JavaValue* result, const methodHandle& method, JavaCallArguments* args, TRAPS) {
|
||||
// Check if we need to wrap a potential OS exception handler around thread
|
||||
// This is used for e.g. Win32 structured exception handlers
|
||||
assert(THREAD->is_Java_thread(), "only JavaThreads can make JavaCalls");
|
||||
// Need to wrap each and every time, since there might be native code down the
|
||||
// stack that has installed its own exception handlers
|
||||
os::os_exception_wrapper(call_helper, result, &method, args, THREAD);
|
||||
os::os_exception_wrapper(call_helper, result, method, args, THREAD);
|
||||
}
|
||||
|
||||
void JavaCalls::call_helper(JavaValue* result, methodHandle* m, JavaCallArguments* args, TRAPS) {
|
||||
void JavaCalls::call_helper(JavaValue* result, const methodHandle& method, JavaCallArguments* args, TRAPS) {
|
||||
// During dumping, Java execution environment is not fully initialized. Also, Java execution
|
||||
// may cause undesirable side-effects in the class metadata.
|
||||
assert(!DumpSharedSpaces, "must not execute Java bytecodes when dumping");
|
||||
|
||||
methodHandle method = *m;
|
||||
JavaThread* thread = (JavaThread*)THREAD;
|
||||
assert(thread->is_Java_thread(), "must be called by a java thread");
|
||||
assert(method.not_null(), "must have a method to call");
|
||||
@ -546,7 +545,7 @@ class SignatureChekker : public SignatureIterator {
|
||||
};
|
||||
|
||||
|
||||
void JavaCallArguments::verify(methodHandle method, BasicType return_type,
|
||||
void JavaCallArguments::verify(const methodHandle& method, BasicType return_type,
|
||||
Thread *thread) {
|
||||
guarantee(method->size_of_parameters() == size_of_parameters(), "wrong no. of arguments pushed");
|
||||
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1997, 2015, 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
|
||||
@ -189,7 +189,7 @@ class JavaCallArguments : public StackObj {
|
||||
int size_of_parameters() const { return _size; }
|
||||
|
||||
// Verify that pushed arguments fits a given method
|
||||
void verify(methodHandle method, BasicType return_type, Thread *thread);
|
||||
void verify(const methodHandle& method, BasicType return_type, Thread *thread);
|
||||
};
|
||||
|
||||
// All calls to Java have to go via JavaCalls. Sets up the stack frame
|
||||
@ -197,7 +197,7 @@ class JavaCallArguments : public StackObj {
|
||||
//
|
||||
|
||||
class JavaCalls: AllStatic {
|
||||
static void call_helper(JavaValue* result, methodHandle* method, JavaCallArguments* args, TRAPS);
|
||||
static void call_helper(JavaValue* result, const methodHandle& method, JavaCallArguments* args, TRAPS);
|
||||
public:
|
||||
// call_special
|
||||
// ------------
|
||||
@ -227,7 +227,7 @@ class JavaCalls: AllStatic {
|
||||
static void call_static(JavaValue* result, KlassHandle klass, Symbol* name, Symbol* signature, Handle arg1, Handle arg2, TRAPS);
|
||||
|
||||
// Low-level interface
|
||||
static void call(JavaValue* result, methodHandle method, JavaCallArguments* args, TRAPS);
|
||||
static void call(JavaValue* result, const methodHandle& method, JavaCallArguments* args, TRAPS);
|
||||
};
|
||||
|
||||
#endif // SHARE_VM_RUNTIME_JAVACALLS_HPP
|
||||
|
||||
@ -1394,7 +1394,7 @@ void os::serialize_thread_states() {
|
||||
// Returns true if the current stack pointer is above the stack shadow
|
||||
// pages, false otherwise.
|
||||
|
||||
bool os::stack_shadow_pages_available(Thread *thread, methodHandle method) {
|
||||
bool os::stack_shadow_pages_available(Thread *thread, const methodHandle& method) {
|
||||
assert(StackRedPages > 0 && StackYellowPages > 0,"Sanity check");
|
||||
address sp = current_stack_pointer();
|
||||
// Check if we have StackShadowPages above the yellow zone. This parameter
|
||||
|
||||
@ -96,7 +96,7 @@ enum ThreadPriority { // JLS 20.20.1-3
|
||||
const bool ExecMem = true;
|
||||
|
||||
// Typedef for structured exception handling support
|
||||
typedef void (*java_call_t)(JavaValue* value, methodHandle* method, JavaCallArguments* args, Thread* thread);
|
||||
typedef void (*java_call_t)(JavaValue* value, const methodHandle& method, JavaCallArguments* args, Thread* thread);
|
||||
|
||||
class MallocTracker;
|
||||
|
||||
@ -263,7 +263,7 @@ class os: AllStatic {
|
||||
static bool uses_stack_guard_pages();
|
||||
static bool allocate_stack_guard_pages();
|
||||
static void bang_stack_shadow_pages();
|
||||
static bool stack_shadow_pages_available(Thread *thread, methodHandle method);
|
||||
static bool stack_shadow_pages_available(Thread *thread, const methodHandle& method);
|
||||
|
||||
// OS interface to Virtual Memory
|
||||
|
||||
@ -722,7 +722,7 @@ class os: AllStatic {
|
||||
static void init_random(long initval); // initialize random sequence
|
||||
|
||||
// Structured OS Exception support
|
||||
static void os_exception_wrapper(java_call_t f, JavaValue* value, methodHandle* method, JavaCallArguments* args, Thread* thread);
|
||||
static void os_exception_wrapper(java_call_t f, JavaValue* value, const methodHandle& method, JavaCallArguments* args, Thread* thread);
|
||||
|
||||
// On Posix compatible OS it will simply check core dump limits while on Windows
|
||||
// it will check if dump file can be created. Check or prepare a core dump to be
|
||||
|
||||
@ -612,7 +612,7 @@ oop get_mirror_from_signature(methodHandle method, SignatureStream* ss, TRAPS) {
|
||||
}
|
||||
|
||||
|
||||
objArrayHandle Reflection::get_parameter_types(methodHandle method, int parameter_count, oop* return_type, TRAPS) {
|
||||
objArrayHandle Reflection::get_parameter_types(const methodHandle& method, int parameter_count, oop* return_type, TRAPS) {
|
||||
// Allocate array holding parameter types (java.lang.Class instances)
|
||||
objArrayOop m = oopFactory::new_objArray(SystemDictionary::Class_klass(), parameter_count, CHECK_(objArrayHandle()));
|
||||
objArrayHandle mirrors (THREAD, m);
|
||||
@ -635,7 +635,7 @@ objArrayHandle Reflection::get_parameter_types(methodHandle method, int paramete
|
||||
return mirrors;
|
||||
}
|
||||
|
||||
objArrayHandle Reflection::get_exception_types(methodHandle method, TRAPS) {
|
||||
objArrayHandle Reflection::get_exception_types(const methodHandle& method, TRAPS) {
|
||||
return method->resolved_checked_exceptions(THREAD);
|
||||
}
|
||||
|
||||
@ -663,7 +663,7 @@ Handle Reflection::new_type(Symbol* signature, KlassHandle k, TRAPS) {
|
||||
}
|
||||
|
||||
|
||||
oop Reflection::new_method(methodHandle method, bool for_constant_pool_access, TRAPS) {
|
||||
oop Reflection::new_method(const methodHandle& method, bool for_constant_pool_access, TRAPS) {
|
||||
// Allow sun.reflect.ConstantPool to refer to <clinit> methods as java.lang.reflect.Methods.
|
||||
assert(!method()->is_initializer() ||
|
||||
(for_constant_pool_access && method()->is_static()),
|
||||
@ -726,7 +726,7 @@ oop Reflection::new_method(methodHandle method, bool for_constant_pool_access, T
|
||||
}
|
||||
|
||||
|
||||
oop Reflection::new_constructor(methodHandle method, TRAPS) {
|
||||
oop Reflection::new_constructor(const methodHandle& method, TRAPS) {
|
||||
assert(method()->is_initializer(), "should call new_method instead");
|
||||
|
||||
instanceKlassHandle holder (THREAD, method->method_holder());
|
||||
@ -824,7 +824,7 @@ oop Reflection::new_parameter(Handle method, int index, Symbol* sym,
|
||||
}
|
||||
|
||||
|
||||
methodHandle Reflection::resolve_interface_call(instanceKlassHandle klass, methodHandle method,
|
||||
methodHandle Reflection::resolve_interface_call(instanceKlassHandle klass, const methodHandle& method,
|
||||
KlassHandle recv_klass, Handle receiver, TRAPS) {
|
||||
assert(!method.is_null() , "method should not be null");
|
||||
|
||||
@ -839,7 +839,7 @@ methodHandle Reflection::resolve_interface_call(instanceKlassHandle klass, metho
|
||||
}
|
||||
|
||||
|
||||
oop Reflection::invoke(instanceKlassHandle klass, methodHandle reflected_method,
|
||||
oop Reflection::invoke(instanceKlassHandle klass, const methodHandle& reflected_method,
|
||||
Handle receiver, bool override, objArrayHandle ptypes,
|
||||
BasicType rtype, objArrayHandle args, bool is_method_invoke, TRAPS) {
|
||||
ResourceMark rm(THREAD);
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1997, 2015, 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
|
||||
@ -48,8 +48,8 @@ class Reflection: public AllStatic {
|
||||
static Klass* basic_type_mirror_to_arrayklass(oop basic_type_mirror, TRAPS);
|
||||
static oop basic_type_arrayklass_to_mirror(Klass* basic_type_arrayklass, TRAPS);
|
||||
|
||||
static objArrayHandle get_parameter_types(methodHandle method, int parameter_count, oop* return_type, TRAPS);
|
||||
static objArrayHandle get_exception_types(methodHandle method, TRAPS);
|
||||
static objArrayHandle get_parameter_types(const methodHandle& method, int parameter_count, oop* return_type, TRAPS);
|
||||
static objArrayHandle get_exception_types(const methodHandle& method, TRAPS);
|
||||
// Creating new java.lang.reflect.xxx wrappers
|
||||
static Handle new_type(Symbol* signature, KlassHandle k, TRAPS);
|
||||
|
||||
@ -110,9 +110,9 @@ class Reflection: public AllStatic {
|
||||
//
|
||||
|
||||
// Create a java.lang.reflect.Method object based on a method
|
||||
static oop new_method(methodHandle method, bool for_constant_pool_access, TRAPS);
|
||||
static oop new_method(const methodHandle& method, bool for_constant_pool_access, TRAPS);
|
||||
// Create a java.lang.reflect.Constructor object based on a method
|
||||
static oop new_constructor(methodHandle method, TRAPS);
|
||||
static oop new_constructor(const methodHandle& method, TRAPS);
|
||||
// Create a java.lang.reflect.Field object based on a field descriptor
|
||||
static oop new_field(fieldDescriptor* fd, TRAPS);
|
||||
// Create a java.lang.reflect.Parameter object based on a
|
||||
@ -122,9 +122,16 @@ class Reflection: public AllStatic {
|
||||
|
||||
private:
|
||||
// method resolution for invoke
|
||||
static methodHandle resolve_interface_call(instanceKlassHandle klass, methodHandle method, KlassHandle recv_klass, Handle receiver, TRAPS);
|
||||
static methodHandle resolve_interface_call(instanceKlassHandle klass, const methodHandle& method, KlassHandle recv_klass, Handle receiver, TRAPS);
|
||||
// Method call (shared by invoke_method and invoke_constructor)
|
||||
static oop invoke(instanceKlassHandle klass, methodHandle method, Handle receiver, bool override, objArrayHandle ptypes, BasicType rtype, objArrayHandle args, bool is_method_invoke, TRAPS);
|
||||
static oop invoke(instanceKlassHandle klass,
|
||||
const methodHandle& method,
|
||||
Handle receiver,
|
||||
bool override,
|
||||
objArrayHandle ptypes,
|
||||
BasicType rtype,
|
||||
objArrayHandle args,
|
||||
bool is_method_invoke, TRAPS);
|
||||
|
||||
// Narrowing of basic types. Used to create correct jvalues for
|
||||
// boolean, byte, char and short return return values from interpreter
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user