mirror of
https://github.com/openjdk/jdk.git
synced 2026-04-07 13:38:49 +00:00
8183039: Re-examine methodHandle methods uninlined by 8144256
Add more const references so out-of-line methodHandle destructor and copy ctor called infrequently Reviewed-by: hseigel, redestad
This commit is contained in:
parent
a4fac2babb
commit
af5c6eefbf
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2014, Red Hat Inc. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
@ -369,7 +369,7 @@ class SlowSignatureHandler
|
||||
}
|
||||
|
||||
public:
|
||||
SlowSignatureHandler(methodHandle method, address from, intptr_t* to)
|
||||
SlowSignatureHandler(const methodHandle& method, address from, intptr_t* to)
|
||||
: NativeSignatureIterator(method)
|
||||
{
|
||||
_from = from;
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1998, 2017, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2014, Red Hat Inc. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
@ -47,7 +47,7 @@ class SignatureHandlerGenerator: public NativeSignatureIterator {
|
||||
|
||||
public:
|
||||
// Creation
|
||||
SignatureHandlerGenerator(methodHandle method, CodeBuffer* buffer) : NativeSignatureIterator(method) {
|
||||
SignatureHandlerGenerator(const methodHandle& method, CodeBuffer* buffer) : NativeSignatureIterator(method) {
|
||||
_masm = new MacroAssembler(buffer);
|
||||
_num_int_args = (method->is_static() ? 1 : 0);
|
||||
_num_fp_args = 0;
|
||||
|
||||
@ -1207,7 +1207,7 @@ static void rt_call(MacroAssembler* masm, address dest, int gpargs, int fpargs,
|
||||
}
|
||||
|
||||
static void verify_oop_args(MacroAssembler* masm,
|
||||
methodHandle method,
|
||||
const methodHandle& method,
|
||||
const BasicType* sig_bt,
|
||||
const VMRegPair* regs) {
|
||||
Register temp_reg = r19; // not part of any compiled calling seq
|
||||
@ -1229,7 +1229,7 @@ static void verify_oop_args(MacroAssembler* masm,
|
||||
}
|
||||
|
||||
static void gen_special_dispatch(MacroAssembler* masm,
|
||||
methodHandle method,
|
||||
const methodHandle& method,
|
||||
const BasicType* sig_bt,
|
||||
const VMRegPair* regs) {
|
||||
verify_oop_args(masm, method, sig_bt, regs);
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2008, 2015, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2008, 2017, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -422,7 +422,7 @@ class SlowSignatureHandler: public NativeSignatureIterator {
|
||||
#endif // !__ABI_HARD__
|
||||
|
||||
public:
|
||||
SlowSignatureHandler(methodHandle method, address from, intptr_t* to) :
|
||||
SlowSignatureHandler(const methodHandle& method, address from, intptr_t* to) :
|
||||
NativeSignatureIterator(method) {
|
||||
_from = from;
|
||||
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2008, 2013, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2008, 2017, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -56,7 +56,7 @@ class SignatureHandlerGenerator: public NativeSignatureIterator {
|
||||
#endif
|
||||
public:
|
||||
// Creation
|
||||
SignatureHandlerGenerator(methodHandle method, CodeBuffer* buffer) : NativeSignatureIterator(method) {
|
||||
SignatureHandlerGenerator(const methodHandle& method, CodeBuffer* buffer) : NativeSignatureIterator(method) {
|
||||
_masm = new MacroAssembler(buffer);
|
||||
_abi_offset = 0;
|
||||
_ireg = is_static() ? 2 : 1;
|
||||
|
||||
@ -1024,7 +1024,7 @@ static int reg2offset_out(VMReg r) {
|
||||
|
||||
|
||||
static void verify_oop_args(MacroAssembler* masm,
|
||||
methodHandle method,
|
||||
const methodHandle& method,
|
||||
const BasicType* sig_bt,
|
||||
const VMRegPair* regs) {
|
||||
Register temp_reg = Rmethod; // not part of any compiled calling seq
|
||||
@ -1045,7 +1045,7 @@ static void verify_oop_args(MacroAssembler* masm,
|
||||
}
|
||||
|
||||
static void gen_special_dispatch(MacroAssembler* masm,
|
||||
methodHandle method,
|
||||
const methodHandle& method,
|
||||
const BasicType* sig_bt,
|
||||
const VMRegPair* regs) {
|
||||
verify_oop_args(masm, method, sig_bt, regs);
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2002, 2014, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2002, 2017, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2012, 2014 SAP SE. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
@ -45,7 +45,7 @@ class SignatureHandlerGenerator: public NativeSignatureIterator {
|
||||
|
||||
public:
|
||||
// Creation
|
||||
SignatureHandlerGenerator(methodHandle method, CodeBuffer* buffer) : NativeSignatureIterator(method) {
|
||||
SignatureHandlerGenerator(const methodHandle& method, CodeBuffer* buffer) : NativeSignatureIterator(method) {
|
||||
_masm = new MacroAssembler(buffer);
|
||||
_num_used_fp_arg_regs = 0;
|
||||
}
|
||||
|
||||
@ -1610,7 +1610,7 @@ static void unpack_array_argument(MacroAssembler* masm, VMRegPair reg, BasicType
|
||||
}
|
||||
|
||||
static void verify_oop_args(MacroAssembler* masm,
|
||||
methodHandle method,
|
||||
const methodHandle& method,
|
||||
const BasicType* sig_bt,
|
||||
const VMRegPair* regs) {
|
||||
Register temp_reg = R19_method; // not part of any compiled calling seq
|
||||
@ -1632,7 +1632,7 @@ static void verify_oop_args(MacroAssembler* masm,
|
||||
}
|
||||
|
||||
static void gen_special_dispatch(MacroAssembler* masm,
|
||||
methodHandle method,
|
||||
const methodHandle& method,
|
||||
const BasicType* sig_bt,
|
||||
const VMRegPair* regs) {
|
||||
verify_oop_args(masm, method, sig_bt, regs);
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2016 SAP SE. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
@ -51,7 +51,7 @@ class SignatureHandlerGenerator: public NativeSignatureIterator {
|
||||
|
||||
public:
|
||||
// creation
|
||||
SignatureHandlerGenerator(methodHandle method, CodeBuffer* buffer) : NativeSignatureIterator(method) {
|
||||
SignatureHandlerGenerator(const methodHandle& method, CodeBuffer* buffer) : NativeSignatureIterator(method) {
|
||||
_masm = new MacroAssembler(buffer);
|
||||
_fp_arg_nr = 0;
|
||||
}
|
||||
|
||||
@ -176,7 +176,7 @@ class SlowSignatureHandler: public NativeSignatureIterator {
|
||||
|
||||
|
||||
public:
|
||||
SlowSignatureHandler(methodHandle method, address from, intptr_t* to, intptr_t *RegArgSig) : NativeSignatureIterator(method) {
|
||||
SlowSignatureHandler(const methodHandle& method, address from, intptr_t* to, intptr_t *RegArgSig) : NativeSignatureIterator(method) {
|
||||
_from = from;
|
||||
_to = to;
|
||||
_RegArgSignature = RegArgSig;
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1998, 2017, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -52,7 +52,7 @@ class SignatureHandlerGenerator: public NativeSignatureIterator {
|
||||
|
||||
public:
|
||||
// Creation
|
||||
SignatureHandlerGenerator(methodHandle method, CodeBuffer* buffer) : NativeSignatureIterator(method) {
|
||||
SignatureHandlerGenerator(const methodHandle& method, CodeBuffer* buffer) : NativeSignatureIterator(method) {
|
||||
_masm = new MacroAssembler(buffer);
|
||||
}
|
||||
|
||||
|
||||
@ -1633,7 +1633,7 @@ static void unpack_array_argument(MacroAssembler* masm, VMRegPair reg, BasicType
|
||||
}
|
||||
|
||||
static void verify_oop_args(MacroAssembler* masm,
|
||||
methodHandle method,
|
||||
const methodHandle& method,
|
||||
const BasicType* sig_bt,
|
||||
const VMRegPair* regs) {
|
||||
Register temp_reg = G5_method; // not part of any compiled calling seq
|
||||
@ -1657,7 +1657,7 @@ static void verify_oop_args(MacroAssembler* masm,
|
||||
}
|
||||
|
||||
static void gen_special_dispatch(MacroAssembler* masm,
|
||||
methodHandle method,
|
||||
const methodHandle& method,
|
||||
const BasicType* sig_bt,
|
||||
const VMRegPair* regs) {
|
||||
verify_oop_args(masm, method, sig_bt, regs);
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1998, 2017, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -55,7 +55,7 @@ class SignatureHandlerGenerator: public NativeSignatureIterator {
|
||||
|
||||
public:
|
||||
// Creation
|
||||
SignatureHandlerGenerator(methodHandle method, CodeBuffer* buffer) : NativeSignatureIterator(method) {
|
||||
SignatureHandlerGenerator(const methodHandle& method, CodeBuffer* buffer) : NativeSignatureIterator(method) {
|
||||
_masm = new MacroAssembler(buffer);
|
||||
#ifdef AMD64
|
||||
#ifdef _WIN64
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1998, 2012, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1998, 2017, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -124,7 +124,7 @@ class SlowSignatureHandler: public NativeSignatureIterator {
|
||||
}
|
||||
|
||||
public:
|
||||
SlowSignatureHandler(methodHandle method, address from, intptr_t* to) :
|
||||
SlowSignatureHandler(const methodHandle& method, address from, intptr_t* to) :
|
||||
NativeSignatureIterator(method) {
|
||||
_from = from;
|
||||
_to = to + (is_static() ? 2 : 1);
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -369,7 +369,7 @@ class SlowSignatureHandler
|
||||
}
|
||||
|
||||
public:
|
||||
SlowSignatureHandler(methodHandle method, address from, intptr_t* to)
|
||||
SlowSignatureHandler(const methodHandle& method, address from, intptr_t* to)
|
||||
: NativeSignatureIterator(method)
|
||||
{
|
||||
_from = from;
|
||||
@ -461,7 +461,7 @@ class SlowSignatureHandler
|
||||
}
|
||||
|
||||
public:
|
||||
SlowSignatureHandler(methodHandle method, address from, intptr_t* to)
|
||||
SlowSignatureHandler(const methodHandle& method, address from, intptr_t* to)
|
||||
: NativeSignatureIterator(method)
|
||||
{
|
||||
_from = from;
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -39,7 +39,7 @@
|
||||
// Since hashCode is usually polymorphic at call sites we can't do this
|
||||
// optimization at the call site without a lot of work.
|
||||
void SharedRuntime::inline_check_hashcode_from_object_header(MacroAssembler* masm,
|
||||
methodHandle method,
|
||||
const methodHandle& method,
|
||||
Register obj_reg,
|
||||
Register result) {
|
||||
Label slowCase;
|
||||
|
||||
@ -1407,7 +1407,7 @@ static void unpack_array_argument(MacroAssembler* masm, VMRegPair reg, BasicType
|
||||
}
|
||||
|
||||
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
|
||||
@ -1429,7 +1429,7 @@ static void verify_oop_args(MacroAssembler* masm,
|
||||
}
|
||||
|
||||
static void gen_special_dispatch(MacroAssembler* masm,
|
||||
methodHandle method,
|
||||
const methodHandle& method,
|
||||
const BasicType* sig_bt,
|
||||
const VMRegPair* regs) {
|
||||
verify_oop_args(masm, method, sig_bt, regs);
|
||||
|
||||
@ -1740,7 +1740,7 @@ static void verify_oop_args(MacroAssembler* masm,
|
||||
}
|
||||
|
||||
static void gen_special_dispatch(MacroAssembler* masm,
|
||||
methodHandle method,
|
||||
const methodHandle& method,
|
||||
const BasicType* sig_bt,
|
||||
const VMRegPair* regs) {
|
||||
verify_oop_args(masm, method, sig_bt, regs);
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright 2007, 2008 Red Hat, Inc.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
@ -67,7 +67,7 @@ class SignatureHandlerGeneratorBase : public NativeSignatureIterator {
|
||||
ffi_cif* _cif;
|
||||
|
||||
protected:
|
||||
SignatureHandlerGeneratorBase(methodHandle method, ffi_cif *cif)
|
||||
SignatureHandlerGeneratorBase(const methodHandle& method, ffi_cif *cif)
|
||||
: NativeSignatureIterator(method), _cif(cif) {
|
||||
_cif->nargs = 0;
|
||||
}
|
||||
@ -96,7 +96,7 @@ class SignatureHandlerGenerator : public SignatureHandlerGeneratorBase {
|
||||
CodeBuffer* _cb;
|
||||
|
||||
public:
|
||||
SignatureHandlerGenerator(methodHandle method, CodeBuffer* buffer)
|
||||
SignatureHandlerGenerator(const methodHandle& method, CodeBuffer* buffer)
|
||||
: SignatureHandlerGeneratorBase(method, (ffi_cif *) buffer->insts_end()),
|
||||
_cb(buffer) {
|
||||
_cb->set_insts_end((address) (cif() + 1));
|
||||
@ -115,7 +115,7 @@ class SlowSignatureHandlerGenerator : public SignatureHandlerGeneratorBase {
|
||||
intptr_t *_dst;
|
||||
|
||||
public:
|
||||
SlowSignatureHandlerGenerator(methodHandle method, intptr_t* buf)
|
||||
SlowSignatureHandlerGenerator(const methodHandle& method, intptr_t* buf)
|
||||
: SignatureHandlerGeneratorBase(method, (ffi_cif *) buf) {
|
||||
_dst = (intptr_t *) (cif() + 1);
|
||||
}
|
||||
|
||||
@ -743,7 +743,7 @@ JRT_END
|
||||
|
||||
#ifndef DEOPTIMIZE_WHEN_PATCHING
|
||||
|
||||
static Klass* resolve_field_return_klass(methodHandle caller, int bci, TRAPS) {
|
||||
static Klass* resolve_field_return_klass(const methodHandle& caller, int bci, TRAPS) {
|
||||
Bytecode_field field_access(caller, bci);
|
||||
// This can be static or non-static field access
|
||||
Bytecodes::Code code = field_access.code();
|
||||
|
||||
@ -68,7 +68,7 @@
|
||||
// ciMethod::ciMethod
|
||||
//
|
||||
// Loaded method.
|
||||
ciMethod::ciMethod(methodHandle h_m, ciInstanceKlass* holder) :
|
||||
ciMethod::ciMethod(const methodHandle& h_m, ciInstanceKlass* holder) :
|
||||
ciMetadata(h_m()),
|
||||
_holder(holder)
|
||||
{
|
||||
@ -979,7 +979,7 @@ bool ciMethod::has_member_arg() const {
|
||||
//
|
||||
// Generate new MethodData* objects at compile time.
|
||||
// Return true if allocation was successful or no MDO is required.
|
||||
bool ciMethod::ensure_method_data(methodHandle h_m) {
|
||||
bool ciMethod::ensure_method_data(const methodHandle& h_m) {
|
||||
EXCEPTION_CONTEXT;
|
||||
if (is_native() || is_abstract() || h_m()->is_accessor()) {
|
||||
return true;
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1999, 2016, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1999, 2017, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -101,7 +101,7 @@ class ciMethod : public ciMetadata {
|
||||
BCEscapeAnalyzer* _bcea;
|
||||
#endif
|
||||
|
||||
ciMethod(methodHandle h_m, ciInstanceKlass* holder);
|
||||
ciMethod(const methodHandle& h_m, ciInstanceKlass* holder);
|
||||
ciMethod(ciInstanceKlass* holder, ciSymbol* name, ciSymbol* signature, ciInstanceKlass* accessor);
|
||||
|
||||
oop loader() const { return _holder->loader(); }
|
||||
@ -112,7 +112,7 @@ class ciMethod : public ciMetadata {
|
||||
|
||||
void load_code();
|
||||
|
||||
bool ensure_method_data(methodHandle h_m);
|
||||
bool ensure_method_data(const methodHandle& h_m);
|
||||
|
||||
void code_at_put(int bci, Bytecodes::Code code) {
|
||||
Bytecodes::check(code);
|
||||
|
||||
@ -1060,7 +1060,7 @@ public:
|
||||
class MethodAnnotationCollector : public AnnotationCollector{
|
||||
public:
|
||||
MethodAnnotationCollector() : AnnotationCollector(_in_method) { }
|
||||
void apply_to(methodHandle m);
|
||||
void apply_to(const methodHandle& m);
|
||||
};
|
||||
|
||||
class ClassFileParser::ClassAnnotationCollector : public AnnotationCollector{
|
||||
@ -2095,7 +2095,7 @@ ClassFileParser::FieldAnnotationCollector::~FieldAnnotationCollector() {
|
||||
MetadataFactory::free_array<u1>(_loader_data, _field_type_annotations);
|
||||
}
|
||||
|
||||
void MethodAnnotationCollector::apply_to(methodHandle m) {
|
||||
void MethodAnnotationCollector::apply_to(const methodHandle& m) {
|
||||
if (has_annotation(_method_CallerSensitive))
|
||||
m->set_caller_sensitive(true);
|
||||
if (has_annotation(_method_ForceInline))
|
||||
@ -3632,7 +3632,7 @@ static unsigned int compute_oop_map_count(const InstanceKlass* super,
|
||||
#ifndef PRODUCT
|
||||
static void print_field_layout(const Symbol* name,
|
||||
Array<u2>* fields,
|
||||
constantPoolHandle cp,
|
||||
const constantPoolHandle& cp,
|
||||
int instance_size,
|
||||
int instance_fields_start,
|
||||
int instance_fields_end,
|
||||
|
||||
@ -1887,7 +1887,7 @@ static void clear_pending_exception_if_not_oom(TRAPS) {
|
||||
*
|
||||
* TODO: This should be a private method in a CompileTheWorld class.
|
||||
*/
|
||||
static bool can_be_compiled(methodHandle m, int comp_level) {
|
||||
static bool can_be_compiled(const methodHandle& m, int comp_level) {
|
||||
assert(CompileTheWorld, "must be");
|
||||
|
||||
// It's not valid to compile a native wrapper for MethodHandle methods
|
||||
|
||||
@ -1285,7 +1285,7 @@ void CodeCache::flush_evol_dependents_on(InstanceKlass* ev_k) {
|
||||
|
||||
|
||||
// Flushes compiled methods dependent on dependee
|
||||
void CodeCache::flush_dependents_on_method(methodHandle m_h) {
|
||||
void CodeCache::flush_dependents_on_method(const methodHandle& m_h) {
|
||||
// --- Compile_lock is not held. However we are at a safepoint.
|
||||
assert_locked_or_safepoint(Compile_lock);
|
||||
|
||||
|
||||
@ -282,7 +282,7 @@ class CodeCache : AllStatic {
|
||||
static void flush_evol_dependents_on(InstanceKlass* dependee);
|
||||
#endif // HOTSWAP
|
||||
// Support for fullspeed debugging
|
||||
static void flush_dependents_on_method(methodHandle dependee);
|
||||
static void flush_dependents_on_method(const methodHandle& dependee);
|
||||
|
||||
// tells how many nmethods have dependencies
|
||||
static int number_of_nmethods_with_dependencies();
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1998, 2016, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1998, 2017, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -123,7 +123,7 @@ CompilerDirectives* CompilerDirectives::next() {
|
||||
return _next;
|
||||
}
|
||||
|
||||
bool CompilerDirectives::match(methodHandle method) {
|
||||
bool CompilerDirectives::match(const methodHandle& method) {
|
||||
if (is_default_directive()) {
|
||||
return true;
|
||||
}
|
||||
@ -232,7 +232,7 @@ DirectiveSet::~DirectiveSet() {
|
||||
// - Need to free copy after use
|
||||
// - Requires a modified bit so we don't overwrite options that is set by directives
|
||||
|
||||
DirectiveSet* DirectiveSet::compilecommand_compatibility_init(methodHandle method) {
|
||||
DirectiveSet* DirectiveSet::compilecommand_compatibility_init(const methodHandle& method) {
|
||||
// Early bail out - checking all options is expensive - we rely on them not being used
|
||||
// Only set a flag if it has not been modified and value changes.
|
||||
// Only copy set if a flag needs to be set
|
||||
@ -307,7 +307,7 @@ CompilerDirectives* DirectiveSet::directive() {
|
||||
return _directive;
|
||||
}
|
||||
|
||||
bool DirectiveSet::matches_inline(methodHandle method, int inline_action) {
|
||||
bool DirectiveSet::matches_inline(const methodHandle& method, int inline_action) {
|
||||
if (_inlinematchers != NULL) {
|
||||
if (_inlinematchers->match(method, inline_action)) {
|
||||
return true;
|
||||
@ -384,7 +384,7 @@ void DirectiveSet::print_inline(outputStream* st) {
|
||||
}
|
||||
}
|
||||
|
||||
bool DirectiveSet::is_intrinsic_disabled(methodHandle method) {
|
||||
bool DirectiveSet::is_intrinsic_disabled(const methodHandle& method) {
|
||||
vmIntrinsics::ID id = method->intrinsic_id();
|
||||
assert(id != vmIntrinsics::_none, "must be a VM intrinsic");
|
||||
|
||||
@ -543,7 +543,7 @@ void DirectivesStack::release(CompilerDirectives* dir) {
|
||||
}
|
||||
}
|
||||
|
||||
DirectiveSet* DirectivesStack::getMatchingDirective(methodHandle method, AbstractCompiler *comp) {
|
||||
DirectiveSet* DirectivesStack::getMatchingDirective(const methodHandle& method, AbstractCompiler *comp) {
|
||||
assert(_depth > 0, "Must never be empty");
|
||||
|
||||
DirectiveSet* match = NULL;
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1998, 2016, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1998, 2017, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -84,7 +84,7 @@ private:
|
||||
static void pop_inner(); // no lock version of pop
|
||||
public:
|
||||
static void init();
|
||||
static DirectiveSet* getMatchingDirective(methodHandle mh, AbstractCompiler* comp);
|
||||
static DirectiveSet* getMatchingDirective(const methodHandle& mh, AbstractCompiler* comp);
|
||||
static DirectiveSet* getDefaultDirective(AbstractCompiler* comp);
|
||||
static void push(CompilerDirectives* directive);
|
||||
static void pop(int count);
|
||||
@ -109,11 +109,11 @@ public:
|
||||
bool should_inline(ciMethod* inlinee);
|
||||
bool should_not_inline(ciMethod* inlinee);
|
||||
void print_inline(outputStream* st);
|
||||
DirectiveSet* compilecommand_compatibility_init(methodHandle method);
|
||||
DirectiveSet* compilecommand_compatibility_init(const methodHandle& method);
|
||||
bool is_exclusive_copy() { return _directive == NULL; }
|
||||
bool matches_inline(methodHandle method, int inline_action);
|
||||
bool matches_inline(const methodHandle& method, int inline_action);
|
||||
static DirectiveSet* clone(DirectiveSet const* src);
|
||||
bool is_intrinsic_disabled(methodHandle method);
|
||||
bool is_intrinsic_disabled(const methodHandle& method);
|
||||
static ccstrlist canonicalize_disableintrinsic(ccstrlist option_value);
|
||||
void finalize(outputStream* st);
|
||||
|
||||
@ -170,7 +170,7 @@ public:
|
||||
CompilerDirectives* next();
|
||||
void set_next(CompilerDirectives* next) {_next = next; }
|
||||
|
||||
bool match(methodHandle method);
|
||||
bool match(const methodHandle& method);
|
||||
BasicMatcher* match() { return _match; }
|
||||
bool add_match(char* str, const char*& error_msg);
|
||||
DirectiveSet* get_for(AbstractCompiler *comp);
|
||||
|
||||
@ -132,7 +132,7 @@ class TypedMethodOptionMatcher : public MethodMatcher {
|
||||
}
|
||||
|
||||
static TypedMethodOptionMatcher* parse_method_pattern(char*& line, const char*& error_msg);
|
||||
TypedMethodOptionMatcher* match(methodHandle method, const char* opt, OptionType type);
|
||||
TypedMethodOptionMatcher* match(const methodHandle& method, const char* opt, OptionType type);
|
||||
|
||||
void init(const char* opt, OptionType type, TypedMethodOptionMatcher* next) {
|
||||
_next = next;
|
||||
@ -261,7 +261,7 @@ TypedMethodOptionMatcher* TypedMethodOptionMatcher::parse_method_pattern(char*&
|
||||
return tom;
|
||||
}
|
||||
|
||||
TypedMethodOptionMatcher* TypedMethodOptionMatcher::match(methodHandle method, const char* opt, OptionType type) {
|
||||
TypedMethodOptionMatcher* TypedMethodOptionMatcher::match(const methodHandle& method, const char* opt, OptionType type) {
|
||||
TypedMethodOptionMatcher* current = this;
|
||||
while (current != NULL) {
|
||||
// Fastest compare first.
|
||||
@ -289,7 +289,7 @@ static void add_option_string(TypedMethodOptionMatcher* matcher,
|
||||
return;
|
||||
}
|
||||
|
||||
static bool check_predicate(OracleCommand command, methodHandle method) {
|
||||
static bool check_predicate(OracleCommand command, const methodHandle& method) {
|
||||
return ((lists[command] != NULL) &&
|
||||
!method.is_null() &&
|
||||
lists[command]->match(method));
|
||||
|
||||
@ -109,7 +109,7 @@ AbstractInterpreterGenerator::AbstractInterpreterGenerator(StubQueue* _code) {
|
||||
//------------------------------------------------------------------------------------------------------------------------
|
||||
// Entry points
|
||||
|
||||
AbstractInterpreter::MethodKind AbstractInterpreter::method_kind(methodHandle m) {
|
||||
AbstractInterpreter::MethodKind AbstractInterpreter::method_kind(const methodHandle& m) {
|
||||
// Abstract method?
|
||||
if (m->is_abstract()) return abstract;
|
||||
|
||||
|
||||
@ -130,11 +130,11 @@ class AbstractInterpreter: AllStatic {
|
||||
|
||||
|
||||
// Method activation
|
||||
static MethodKind method_kind(methodHandle m);
|
||||
static MethodKind method_kind(const methodHandle& m);
|
||||
static address entry_for_kind(MethodKind k) { assert(0 <= k && k < number_of_method_entries, "illegal kind"); return _entry_table[k]; }
|
||||
static address entry_for_method(methodHandle m) { return entry_for_kind(method_kind(m)); }
|
||||
static address entry_for_method(const methodHandle& m) { return entry_for_kind(method_kind(m)); }
|
||||
|
||||
static address entry_for_cds_method(methodHandle m) {
|
||||
static address entry_for_cds_method(const methodHandle& m) {
|
||||
MethodKind k = method_kind(m);
|
||||
assert(0 <= k && k < number_of_method_entries, "illegal kind");
|
||||
return _cds_entry_table[k];
|
||||
|
||||
@ -212,7 +212,7 @@ BasicType Bytecode_loadconstant::result_type() const {
|
||||
}
|
||||
|
||||
oop Bytecode_loadconstant::resolve_constant(TRAPS) const {
|
||||
assert(_method.not_null(), "must supply method to resolve constant");
|
||||
assert(_method != NULL, "must supply method to resolve constant");
|
||||
int index = raw_index();
|
||||
ConstantPool* constants = _method->constants();
|
||||
if (has_cache_index()) {
|
||||
|
||||
@ -178,11 +178,11 @@ class Bytecode_tableswitch: public Bytecode {
|
||||
|
||||
class Bytecode_member_ref: public Bytecode {
|
||||
protected:
|
||||
const methodHandle _method; // method containing the bytecode
|
||||
const Method* _method; // method containing the bytecode
|
||||
|
||||
Bytecode_member_ref(const 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; }
|
||||
const Method* method() const { return _method; }
|
||||
ConstantPool* constants() const { return _method->constants(); }
|
||||
ConstantPoolCache* cpcache() const { return _method->constants()->cache(); }
|
||||
ConstantPoolCacheEntry* cpcache_entry() const;
|
||||
@ -312,15 +312,15 @@ class Bytecode_anewarray: public Bytecode {
|
||||
// Abstraction for ldc, ldc_w and ldc2_w
|
||||
class Bytecode_loadconstant: public Bytecode {
|
||||
private:
|
||||
const methodHandle _method;
|
||||
const Method* _method;
|
||||
|
||||
int raw_index() const;
|
||||
|
||||
public:
|
||||
Bytecode_loadconstant(const 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");
|
||||
assert(_method != NULL, "must supply method");
|
||||
Bytecodes::Code stdc = Bytecodes::java_code(code());
|
||||
assert(stdc == Bytecodes::_ldc ||
|
||||
stdc == Bytecodes::_ldc_w ||
|
||||
|
||||
@ -232,7 +232,7 @@ IRT_END
|
||||
// Exceptions
|
||||
|
||||
void InterpreterRuntime::note_trap_inner(JavaThread* thread, int reason,
|
||||
methodHandle trap_method, int trap_bci, TRAPS) {
|
||||
const methodHandle& trap_method, int trap_bci, TRAPS) {
|
||||
if (trap_method.not_null()) {
|
||||
MethodData* trap_mdo = trap_method->method_data();
|
||||
if (trap_mdo == NULL) {
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -66,7 +66,7 @@ class InterpreterRuntime: AllStatic {
|
||||
static ConstantPoolCacheEntry* cache_entry_at(JavaThread *thread, int i) { return method(thread)->constants()->cache()->entry_at(i); }
|
||||
static ConstantPoolCacheEntry* cache_entry(JavaThread *thread) { return cache_entry_at(thread, Bytes::get_native_u2(bcp(thread) + 1)); }
|
||||
static void note_trap_inner(JavaThread* thread, int reason,
|
||||
methodHandle trap_method, int trap_bci, TRAPS);
|
||||
const methodHandle& trap_method, int trap_bci, TRAPS);
|
||||
static void note_trap(JavaThread *thread, int reason, TRAPS);
|
||||
#ifdef CC_INTERP
|
||||
// Profile traps in C++ interpreter.
|
||||
|
||||
@ -104,7 +104,7 @@ const char* InvocationCounter::state_as_short_string(State state) {
|
||||
}
|
||||
|
||||
|
||||
static address do_nothing(methodHandle method, TRAPS) {
|
||||
static address do_nothing(const methodHandle& method, TRAPS) {
|
||||
// dummy action for inactive invocation counters
|
||||
MethodCounters* mcs = method->method_counters();
|
||||
assert(mcs != NULL, "");
|
||||
@ -114,7 +114,7 @@ static address do_nothing(methodHandle method, TRAPS) {
|
||||
}
|
||||
|
||||
|
||||
static address do_decay(methodHandle method, TRAPS) {
|
||||
static address do_decay(const methodHandle& method, TRAPS) {
|
||||
// decay invocation counters so compilation gets delayed
|
||||
MethodCounters* mcs = method->method_counters();
|
||||
assert(mcs != NULL, "");
|
||||
@ -130,7 +130,7 @@ void InvocationCounter::def(State state, int init, Action action) {
|
||||
_action[state] = action;
|
||||
}
|
||||
|
||||
address dummy_invocation_counter_overflow(methodHandle m, TRAPS) {
|
||||
address dummy_invocation_counter_overflow(const methodHandle& m, TRAPS) {
|
||||
ShouldNotReachHere();
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -62,7 +62,7 @@ class InvocationCounter VALUE_OBJ_CLASS_SPEC {
|
||||
static int InterpreterBackwardBranchLimit; // A separate threshold for on stack replacement
|
||||
static int InterpreterProfileLimit; // Profiling threshold scaled for interpreter use
|
||||
|
||||
typedef address (*Action)(methodHandle method, TRAPS);
|
||||
typedef address (*Action)(const methodHandle& method, TRAPS);
|
||||
|
||||
enum PublicConstants {
|
||||
count_increment = count_grain, // use this value to increment the 32bit _counter word
|
||||
|
||||
@ -235,7 +235,7 @@ void CallInfo::print() {
|
||||
//------------------------------------------------------------------------------------------------------------------------
|
||||
// Implementation of LinkInfo
|
||||
|
||||
LinkInfo::LinkInfo(const constantPoolHandle& pool, int index, methodHandle current_method, TRAPS) {
|
||||
LinkInfo::LinkInfo(const constantPoolHandle& pool, int index, const methodHandle& current_method, TRAPS) {
|
||||
// resolve klass
|
||||
_resolved_klass = pool->klass_ref_at(index, CHECK);
|
||||
|
||||
@ -315,9 +315,11 @@ void LinkResolver::check_klass_accessability(Klass* ref_klass, Klass* sel_klass,
|
||||
|
||||
// Look up method in klasses, including static methods
|
||||
// Then look up local default methods
|
||||
methodHandle LinkResolver::lookup_method_in_klasses(const LinkInfo& link_info,
|
||||
bool checkpolymorphism,
|
||||
bool in_imethod_resolve, TRAPS) {
|
||||
Method* LinkResolver::lookup_method_in_klasses(const LinkInfo& link_info,
|
||||
bool checkpolymorphism,
|
||||
bool in_imethod_resolve) {
|
||||
NoSafepointVerifier nsv; // Method* returned may not be reclaimed
|
||||
|
||||
Klass* klass = link_info.resolved_klass();
|
||||
Symbol* name = link_info.name();
|
||||
Symbol* signature = link_info.signature();
|
||||
@ -327,7 +329,7 @@ methodHandle LinkResolver::lookup_method_in_klasses(const LinkInfo& link_info,
|
||||
|
||||
if (klass->is_array_klass()) {
|
||||
// Only consider klass and super klass for arrays
|
||||
return methodHandle(THREAD, result);
|
||||
return result;
|
||||
}
|
||||
|
||||
InstanceKlass* ik = InstanceKlass::cast(klass);
|
||||
@ -363,7 +365,7 @@ methodHandle LinkResolver::lookup_method_in_klasses(const LinkInfo& link_info,
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
return methodHandle(THREAD, result);
|
||||
return result;
|
||||
}
|
||||
|
||||
// returns first instance method
|
||||
@ -418,15 +420,13 @@ int LinkResolver::vtable_index_of_interface_method(Klass* klass,
|
||||
return vtable_index;
|
||||
}
|
||||
|
||||
methodHandle LinkResolver::lookup_method_in_interfaces(const LinkInfo& cp_info, TRAPS) {
|
||||
Method* LinkResolver::lookup_method_in_interfaces(const LinkInfo& cp_info) {
|
||||
InstanceKlass *ik = InstanceKlass::cast(cp_info.resolved_klass());
|
||||
|
||||
// Specify 'true' in order to skip default methods when searching the
|
||||
// interfaces. Function lookup_method_in_klasses() already looked for
|
||||
// the method in the default methods table.
|
||||
return methodHandle(THREAD,
|
||||
ik->lookup_method_in_all_interfaces(cp_info.name(), cp_info.signature(),
|
||||
Klass::skip_defaults));
|
||||
return ik->lookup_method_in_all_interfaces(cp_info.name(), cp_info.signature(), Klass::skip_defaults);
|
||||
}
|
||||
|
||||
methodHandle LinkResolver::lookup_polymorphic_method(
|
||||
@ -713,13 +713,12 @@ methodHandle LinkResolver::resolve_method(const LinkInfo& link_info,
|
||||
THROW_MSG_NULL(vmSymbols::java_lang_IncompatibleClassChangeError(), buf);
|
||||
}
|
||||
|
||||
|
||||
// 3. lookup method in resolved klass and its super klasses
|
||||
methodHandle resolved_method = lookup_method_in_klasses(link_info, true, false, CHECK_NULL);
|
||||
methodHandle resolved_method(THREAD, lookup_method_in_klasses(link_info, true, false));
|
||||
|
||||
// 4. lookup method in all the interfaces implemented by the resolved klass
|
||||
if (resolved_method.is_null() && !resolved_klass->is_array_klass()) { // not found in the class hierarchy
|
||||
resolved_method = lookup_method_in_interfaces(link_info, CHECK_NULL);
|
||||
resolved_method = methodHandle(THREAD, lookup_method_in_interfaces(link_info));
|
||||
|
||||
if (resolved_method.is_null()) {
|
||||
// JSR 292: see if this is an implicitly generated method MethodHandle.linkToVirtual(*...), etc
|
||||
@ -817,11 +816,11 @@ methodHandle LinkResolver::resolve_interface_method(const LinkInfo& link_info, B
|
||||
|
||||
// lookup method in this interface or its super, java.lang.Object
|
||||
// JDK8: also look for static methods
|
||||
methodHandle resolved_method = lookup_method_in_klasses(link_info, false, true, CHECK_NULL);
|
||||
methodHandle resolved_method(THREAD, lookup_method_in_klasses(link_info, false, true));
|
||||
|
||||
if (resolved_method.is_null() && !resolved_klass->is_array_klass()) {
|
||||
// lookup method in all the super-interfaces
|
||||
resolved_method = lookup_method_in_interfaces(link_info, CHECK_NULL);
|
||||
resolved_method = methodHandle(THREAD, lookup_method_in_interfaces(link_info));
|
||||
}
|
||||
|
||||
if (resolved_method.is_null()) {
|
||||
|
||||
@ -152,7 +152,7 @@ class LinkInfo : public StackObj {
|
||||
skip_access_check
|
||||
};
|
||||
|
||||
LinkInfo(const constantPoolHandle& pool, int index, methodHandle current_method, TRAPS);
|
||||
LinkInfo(const constantPoolHandle& pool, int index, const methodHandle& current_method, TRAPS);
|
||||
LinkInfo(const constantPoolHandle& pool, int index, TRAPS);
|
||||
|
||||
// Condensed information from other call sites within the vm.
|
||||
@ -163,7 +163,7 @@ class LinkInfo : public StackObj {
|
||||
_name(name), _signature(signature), _current_klass(current_klass), _current_method(methodHandle()),
|
||||
_check_access(check_access == needs_access_check), _tag(tag) {}
|
||||
|
||||
LinkInfo(Klass* resolved_klass, Symbol* name, Symbol* signature, methodHandle current_method,
|
||||
LinkInfo(Klass* resolved_klass, Symbol* name, Symbol* signature, const methodHandle& current_method,
|
||||
AccessCheck check_access = needs_access_check,
|
||||
constantTag tag = JVM_CONSTANT_Invalid) :
|
||||
_resolved_klass(resolved_klass),
|
||||
@ -201,10 +201,11 @@ class LinkResolver: AllStatic {
|
||||
|
||||
private:
|
||||
|
||||
static methodHandle lookup_method_in_klasses(const LinkInfo& link_info,
|
||||
bool checkpolymorphism,
|
||||
bool in_imethod_resolve, TRAPS);
|
||||
static methodHandle lookup_method_in_interfaces(const LinkInfo& link_info, TRAPS);
|
||||
static Method* lookup_method_in_klasses(const LinkInfo& link_info,
|
||||
bool checkpolymorphism,
|
||||
bool in_imethod_resolve);
|
||||
static Method* lookup_method_in_interfaces(const LinkInfo& link_info);
|
||||
|
||||
static methodHandle lookup_polymorphic_method(const LinkInfo& link_info,
|
||||
Handle *appendix_result_or_null,
|
||||
Handle *method_type_result, TRAPS);
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -39,9 +39,9 @@ class OopMapCacheEntry: private InterpreterOopMap {
|
||||
|
||||
protected:
|
||||
// Initialization
|
||||
void fill(methodHandle method, int bci);
|
||||
void fill(const methodHandle& method, int bci);
|
||||
// fills the bit mask for native calls
|
||||
void fill_for_native(methodHandle method);
|
||||
void fill_for_native(const methodHandle& method);
|
||||
void set_mask(CellTypeState* vars, CellTypeState* stack, int stack_top);
|
||||
|
||||
// Deallocate bit masks and initialize fields
|
||||
@ -80,7 +80,7 @@ class OopMapForCacheEntry: public GenerateOopMap {
|
||||
virtual void fill_init_vars (GrowableArray<intptr_t> *init_vars);
|
||||
|
||||
public:
|
||||
OopMapForCacheEntry(methodHandle method, int bci, OopMapCacheEntry *entry);
|
||||
OopMapForCacheEntry(const methodHandle& method, int bci, OopMapCacheEntry *entry);
|
||||
|
||||
// Computes stack map for (method,bci) and initialize entry
|
||||
void compute_map(TRAPS);
|
||||
@ -88,7 +88,7 @@ class OopMapForCacheEntry: public GenerateOopMap {
|
||||
};
|
||||
|
||||
|
||||
OopMapForCacheEntry::OopMapForCacheEntry(methodHandle method, int bci, OopMapCacheEntry* entry) : GenerateOopMap(method) {
|
||||
OopMapForCacheEntry::OopMapForCacheEntry(const methodHandle& method, int bci, OopMapCacheEntry* entry) : GenerateOopMap(method) {
|
||||
_bci = bci;
|
||||
_entry = entry;
|
||||
_stack_top = -1;
|
||||
@ -242,7 +242,7 @@ class MaskFillerForNative: public NativeSignatureIterator {
|
||||
void pass_double() { /* ignore */ }
|
||||
void pass_object() { set_one(offset()); }
|
||||
|
||||
MaskFillerForNative(methodHandle method, uintptr_t* mask, int size) : NativeSignatureIterator(method) {
|
||||
MaskFillerForNative(const methodHandle& method, uintptr_t* mask, int size) : NativeSignatureIterator(method) {
|
||||
_mask = mask;
|
||||
_size = size;
|
||||
// initialize with 0
|
||||
@ -301,7 +301,7 @@ void OopMapCacheEntry::deallocate_bit_mask() {
|
||||
}
|
||||
|
||||
|
||||
void OopMapCacheEntry::fill_for_native(methodHandle mh) {
|
||||
void OopMapCacheEntry::fill_for_native(const methodHandle& mh) {
|
||||
assert(mh->is_native(), "method must be native method");
|
||||
set_mask_size(mh->size_of_parameters() * bits_per_entry);
|
||||
allocate_bit_mask();
|
||||
@ -311,7 +311,7 @@ void OopMapCacheEntry::fill_for_native(methodHandle mh) {
|
||||
}
|
||||
|
||||
|
||||
void OopMapCacheEntry::fill(methodHandle method, int bci) {
|
||||
void OopMapCacheEntry::fill(const methodHandle& method, int bci) {
|
||||
HandleMark hm;
|
||||
// Flush entry to deallocate an existing entry
|
||||
flush();
|
||||
|
||||
@ -117,7 +117,7 @@ void Rewriter::make_constant_pool_cache(TRAPS) {
|
||||
// require that local 0 is never overwritten so it's available as an
|
||||
// argument for registration.
|
||||
|
||||
void Rewriter::rewrite_Object_init(methodHandle method, TRAPS) {
|
||||
void Rewriter::rewrite_Object_init(const methodHandle& method, TRAPS) {
|
||||
RawBytecodeStream bcs(method);
|
||||
while (!bcs.is_last_bytecode()) {
|
||||
Bytecodes::Code opcode = bcs.raw_next();
|
||||
@ -491,17 +491,16 @@ void Rewriter::scan_method(Method* method, bool reverse, bool* invokespecial_err
|
||||
}
|
||||
|
||||
// After constant pool is created, revisit methods containing jsrs.
|
||||
methodHandle Rewriter::rewrite_jsrs(methodHandle method, TRAPS) {
|
||||
methodHandle Rewriter::rewrite_jsrs(const methodHandle& method, TRAPS) {
|
||||
ResourceMark rm(THREAD);
|
||||
ResolveOopMapConflicts romc(method);
|
||||
methodHandle original_method = method;
|
||||
method = romc.do_potential_rewrite(CHECK_(methodHandle()));
|
||||
methodHandle new_method = romc.do_potential_rewrite(CHECK_(methodHandle()));
|
||||
// Update monitor matching info.
|
||||
if (romc.monitor_safe()) {
|
||||
method->set_guaranteed_monitor_matching();
|
||||
new_method->set_guaranteed_monitor_matching();
|
||||
}
|
||||
|
||||
return method;
|
||||
return new_method;
|
||||
}
|
||||
|
||||
void Rewriter::rewrite_bytecodes(TRAPS) {
|
||||
|
||||
@ -193,7 +193,7 @@ class Rewriter: public StackObj {
|
||||
void compute_index_maps();
|
||||
void make_constant_pool_cache(TRAPS);
|
||||
void scan_method(Method* m, bool reverse, bool* invokespecial_error);
|
||||
void rewrite_Object_init(methodHandle m, TRAPS);
|
||||
void rewrite_Object_init(const methodHandle& m, TRAPS);
|
||||
void rewrite_member_reference(address bcp, int offset, bool reverse);
|
||||
void maybe_rewrite_invokehandle(address opc, int cp_index, int cache_index, bool reverse);
|
||||
void rewrite_invokedynamic(address bcp, int offset, bool reverse);
|
||||
@ -208,7 +208,7 @@ class Rewriter: public StackObj {
|
||||
// Revert bytecodes in case of an exception.
|
||||
void restore_bytecodes();
|
||||
|
||||
static methodHandle rewrite_jsrs(methodHandle m, TRAPS);
|
||||
static methodHandle rewrite_jsrs(const methodHandle& m, TRAPS);
|
||||
public:
|
||||
// Driver routine:
|
||||
static void rewrite(InstanceKlass* klass, TRAPS);
|
||||
|
||||
@ -194,7 +194,7 @@ void JVMCICompiler::compile_method(const methodHandle& method, int entry_bci, JV
|
||||
}
|
||||
}
|
||||
|
||||
CompLevel JVMCIRuntime::adjust_comp_level(methodHandle method, bool is_osr, CompLevel level, JavaThread* thread) {
|
||||
CompLevel JVMCIRuntime::adjust_comp_level(const methodHandle& method, bool is_osr, CompLevel level, JavaThread* thread) {
|
||||
if (!thread->adjusting_comp_level()) {
|
||||
thread->set_adjusting_comp_level(true);
|
||||
level = adjust_comp_level_inner(method, is_osr, level, thread);
|
||||
|
||||
@ -822,7 +822,7 @@ void JVMCIRuntime::shutdown(TRAPS) {
|
||||
}
|
||||
}
|
||||
|
||||
CompLevel JVMCIRuntime::adjust_comp_level_inner(methodHandle method, bool is_osr, CompLevel level, JavaThread* thread) {
|
||||
CompLevel JVMCIRuntime::adjust_comp_level_inner(const methodHandle& method, bool is_osr, CompLevel level, JavaThread* thread) {
|
||||
JVMCICompiler* compiler = JVMCICompiler::instance(thread);
|
||||
if (compiler != NULL && compiler->is_bootstrapping()) {
|
||||
return level;
|
||||
|
||||
@ -63,7 +63,7 @@ class JVMCIRuntime: public AllStatic {
|
||||
|
||||
static bool _shutdown_called;
|
||||
|
||||
static CompLevel adjust_comp_level_inner(methodHandle method, bool is_osr, CompLevel level, JavaThread* thread);
|
||||
static CompLevel adjust_comp_level_inner(const methodHandle& method, bool is_osr, CompLevel level, JavaThread* thread);
|
||||
|
||||
public:
|
||||
static bool is_HotSpotJVMCIRuntime_initialized() {
|
||||
@ -125,7 +125,7 @@ class JVMCIRuntime: public AllStatic {
|
||||
* @param thread the current thread
|
||||
* @return the compilation level to use for the compilation
|
||||
*/
|
||||
static CompLevel adjust_comp_level(methodHandle method, bool is_osr, CompLevel level, JavaThread* thread);
|
||||
static CompLevel adjust_comp_level(const methodHandle& method, bool is_osr, CompLevel level, JavaThread* thread);
|
||||
|
||||
static BasicType kindToBasicType(Handle kind, TRAPS);
|
||||
|
||||
|
||||
@ -139,7 +139,7 @@ void ConstantPoolCacheEntry::set_parameter_size(int value) {
|
||||
}
|
||||
|
||||
void ConstantPoolCacheEntry::set_direct_or_vtable_call(Bytecodes::Code invoke_code,
|
||||
methodHandle method,
|
||||
const methodHandle& method,
|
||||
int vtable_index,
|
||||
bool sender_is_interface) {
|
||||
bool is_vtable_call = (vtable_index >= 0); // FIXME: split this method on this boolean
|
||||
@ -241,14 +241,14 @@ void ConstantPoolCacheEntry::set_direct_or_vtable_call(Bytecodes::Code invoke_co
|
||||
NOT_PRODUCT(verify(tty));
|
||||
}
|
||||
|
||||
void ConstantPoolCacheEntry::set_direct_call(Bytecodes::Code invoke_code, methodHandle method,
|
||||
void ConstantPoolCacheEntry::set_direct_call(Bytecodes::Code invoke_code, const methodHandle& method,
|
||||
bool sender_is_interface) {
|
||||
int index = Method::nonvirtual_vtable_index;
|
||||
// index < 0; FIXME: inline and customize set_direct_or_vtable_call
|
||||
set_direct_or_vtable_call(invoke_code, method, index, sender_is_interface);
|
||||
}
|
||||
|
||||
void ConstantPoolCacheEntry::set_vtable_call(Bytecodes::Code invoke_code, methodHandle method, int index) {
|
||||
void ConstantPoolCacheEntry::set_vtable_call(Bytecodes::Code invoke_code, const methodHandle& method, int index) {
|
||||
// either the method is a miranda or its holder should accept the given index
|
||||
assert(method->method_holder()->is_interface() || method->method_holder()->verify_vtable_index(index), "");
|
||||
// index >= 0; FIXME: inline and customize set_direct_or_vtable_call
|
||||
|
||||
@ -222,7 +222,7 @@ class ConstantPoolCacheEntry VALUE_OBJ_CLASS_SPEC {
|
||||
int orig_field_index, // the original field index in the field holder
|
||||
int field_offset, // the field offset in words in the field holder
|
||||
TosState field_type, // the (machine) field type
|
||||
bool is_final, // the field is final
|
||||
bool is_final, // the field is final
|
||||
bool is_volatile, // the field is volatile
|
||||
Klass* root_klass // needed by the GC to dirty the klass
|
||||
);
|
||||
@ -230,7 +230,7 @@ class ConstantPoolCacheEntry VALUE_OBJ_CLASS_SPEC {
|
||||
private:
|
||||
void set_direct_or_vtable_call(
|
||||
Bytecodes::Code invoke_code, // the bytecode used for invoking the method
|
||||
methodHandle method, // the method/prototype if any (NULL, otherwise)
|
||||
const methodHandle& method, // the method/prototype if any (NULL, otherwise)
|
||||
int vtable_index, // the vtable index if any, else negative
|
||||
bool sender_is_interface
|
||||
);
|
||||
@ -238,13 +238,13 @@ class ConstantPoolCacheEntry VALUE_OBJ_CLASS_SPEC {
|
||||
public:
|
||||
void set_direct_call( // sets entry to exact concrete method entry
|
||||
Bytecodes::Code invoke_code, // the bytecode used for invoking the method
|
||||
methodHandle method, // the method to call
|
||||
const methodHandle& method, // the method to call
|
||||
bool sender_is_interface
|
||||
);
|
||||
|
||||
void set_vtable_call( // sets entry to vtable index
|
||||
Bytecodes::Code invoke_code, // the bytecode used for invoking the method
|
||||
methodHandle method, // resolved method which declares the vtable index
|
||||
const methodHandle& method, // resolved method which declares the vtable index
|
||||
int vtable_index // the vtable index
|
||||
);
|
||||
|
||||
|
||||
@ -287,7 +287,7 @@ void klassVtable::initialize_vtable(bool checkconstraints, TRAPS) {
|
||||
// Therefore: all package private methods need their own vtable entries for
|
||||
// them to be the root of an inheritance overriding decision
|
||||
// Package private methods may also override other vtable entries
|
||||
InstanceKlass* klassVtable::find_transitive_override(InstanceKlass* initialsuper, methodHandle target_method,
|
||||
InstanceKlass* klassVtable::find_transitive_override(InstanceKlass* initialsuper, const methodHandle& target_method,
|
||||
int vtable_index, Handle target_loader, Symbol* target_classname, Thread * THREAD) {
|
||||
InstanceKlass* superk = initialsuper;
|
||||
while (superk != NULL && superk->super() != NULL) {
|
||||
@ -329,7 +329,7 @@ InstanceKlass* klassVtable::find_transitive_override(InstanceKlass* initialsuper
|
||||
return superk;
|
||||
}
|
||||
|
||||
static void log_vtables(int i, bool overrides, methodHandle target_method,
|
||||
static void log_vtables(int i, bool overrides, const methodHandle& target_method,
|
||||
Klass* target_klass, Method* super_method,
|
||||
Thread* thread) {
|
||||
#ifndef PRODUCT
|
||||
@ -357,7 +357,7 @@ static void log_vtables(int i, bool overrides, methodHandle target_method,
|
||||
// OR return true if a new vtable entry is required.
|
||||
// Only called for InstanceKlass's, i.e. not for arrays
|
||||
// If that changed, could not use _klass as handle for klass
|
||||
bool klassVtable::update_inherited_vtable(InstanceKlass* klass, methodHandle target_method,
|
||||
bool klassVtable::update_inherited_vtable(InstanceKlass* klass, const methodHandle& target_method,
|
||||
int super_vtable_len, int default_index,
|
||||
bool checkconstraints, TRAPS) {
|
||||
ResourceMark rm;
|
||||
@ -576,7 +576,7 @@ void klassVtable::put_method_at(Method* m, int index) {
|
||||
// superclass has been loaded.
|
||||
// However, the vtable entries are filled in at link time, and therefore
|
||||
// the superclass' vtable may not yet have been filled in.
|
||||
bool klassVtable::needs_new_vtable_entry(methodHandle target_method,
|
||||
bool klassVtable::needs_new_vtable_entry(const methodHandle& target_method,
|
||||
const Klass* super,
|
||||
Handle classloader,
|
||||
Symbol* classname,
|
||||
|
||||
@ -128,7 +128,7 @@ class klassVtable VALUE_OBJ_CLASS_SPEC {
|
||||
int initialize_from_super(Klass* super);
|
||||
int index_of(Method* m, int len) const; // same as index_of, but search only up to len
|
||||
void put_method_at(Method* m, int index);
|
||||
static bool needs_new_vtable_entry(methodHandle m,
|
||||
static bool needs_new_vtable_entry(const methodHandle& m,
|
||||
const Klass* super,
|
||||
Handle classloader,
|
||||
Symbol* classname,
|
||||
@ -136,8 +136,8 @@ class klassVtable VALUE_OBJ_CLASS_SPEC {
|
||||
u2 major_version,
|
||||
TRAPS);
|
||||
|
||||
bool update_inherited_vtable(InstanceKlass* klass, methodHandle target_method, int super_vtable_len, int default_index, bool checkconstraints, TRAPS);
|
||||
InstanceKlass* find_transitive_override(InstanceKlass* initialsuper, methodHandle target_method, int vtable_index,
|
||||
bool update_inherited_vtable(InstanceKlass* klass, const methodHandle& target_method, int super_vtable_len, int default_index, bool checkconstraints, TRAPS);
|
||||
InstanceKlass* find_transitive_override(InstanceKlass* initialsuper, const methodHandle& target_method, int vtable_index,
|
||||
Handle target_loader, Symbol* target_classname, Thread* THREAD);
|
||||
|
||||
// support for miranda methods
|
||||
|
||||
@ -175,7 +175,7 @@ char* Method::name_and_sig_as_C_string(Klass* klass, Symbol* method_name, Symbol
|
||||
return buf;
|
||||
}
|
||||
|
||||
int Method::fast_exception_handler_bci_for(methodHandle mh, Klass* ex_klass, int throw_bci, TRAPS) {
|
||||
int Method::fast_exception_handler_bci_for(const methodHandle& mh, Klass* ex_klass, int throw_bci, TRAPS) {
|
||||
// exception table holds quadruple entries of the form (beg_bci, end_bci, handler_bci, klass_index)
|
||||
// access exception table
|
||||
ExceptionTable table(mh());
|
||||
@ -1078,7 +1078,7 @@ void Method::link_method(const methodHandle& h_method, TRAPS) {
|
||||
|
||||
}
|
||||
|
||||
address Method::make_adapters(methodHandle mh, TRAPS) {
|
||||
address Method::make_adapters(const methodHandle& mh, TRAPS) {
|
||||
// Adapters for compiled code are made eagerly here. They are fairly
|
||||
// small (generally < 100 bytes) and quick to make (and cached and shared)
|
||||
// so making them eagerly shouldn't be too expensive.
|
||||
@ -1147,7 +1147,7 @@ bool Method::check_code() const {
|
||||
}
|
||||
|
||||
// Install compiled code. Instantly it can execute.
|
||||
void Method::set_code(methodHandle mh, CompiledMethod *code) {
|
||||
void Method::set_code(const methodHandle& mh, CompiledMethod *code) {
|
||||
MutexLockerEx pl(Patching_lock, Mutex::_no_safepoint_check_flag);
|
||||
assert( code, "use clear_code to remove code" );
|
||||
assert( mh->check_code(), "" );
|
||||
@ -1350,7 +1350,7 @@ Klass* Method::check_non_bcp_klass(Klass* klass) {
|
||||
}
|
||||
|
||||
|
||||
methodHandle Method::clone_with_new_data(methodHandle m, u_char* new_code, int new_code_length,
|
||||
methodHandle Method::clone_with_new_data(const methodHandle& m, u_char* new_code, int new_code_length,
|
||||
u_char* new_compressed_linenumber_table, int new_compressed_linenumber_size, TRAPS) {
|
||||
// Code below does not work for native methods - they should never get rewritten anyway
|
||||
assert(!m->is_native(), "cannot rewrite native methods");
|
||||
@ -1545,7 +1545,7 @@ void Method::init_intrinsic_id() {
|
||||
}
|
||||
|
||||
// These two methods are static since a GC may move the Method
|
||||
bool Method::load_signature_classes(methodHandle m, TRAPS) {
|
||||
bool Method::load_signature_classes(const methodHandle& m, TRAPS) {
|
||||
if (!THREAD->can_call_java()) {
|
||||
// There is nothing useful this routine can do from within the Compile thread.
|
||||
// Hopefully, the signature contains only well-known classes.
|
||||
@ -1579,7 +1579,7 @@ bool Method::load_signature_classes(methodHandle m, TRAPS) {
|
||||
return sig_is_loaded;
|
||||
}
|
||||
|
||||
bool Method::has_unloaded_classes_in_signature(methodHandle m, TRAPS) {
|
||||
bool Method::has_unloaded_classes_in_signature(const methodHandle& m, TRAPS) {
|
||||
Handle class_loader(THREAD, m->method_holder()->class_loader());
|
||||
Handle protection_domain(THREAD, m->method_holder()->protection_domain());
|
||||
ResourceMark rm(THREAD);
|
||||
|
||||
@ -133,7 +133,7 @@ class Method : public Metadata {
|
||||
void set_constMethod(ConstMethod* xconst) { _constMethod = xconst; }
|
||||
|
||||
|
||||
static address make_adapters(methodHandle mh, TRAPS);
|
||||
static address make_adapters(const methodHandle& mh, TRAPS);
|
||||
volatile address from_compiled_entry() const { return (address)OrderAccess::load_ptr_acquire(&_from_compiled_entry); }
|
||||
volatile address from_compiled_entry_no_trampoline() const;
|
||||
volatile address from_interpreted_entry() const{ return (address)OrderAccess::load_ptr_acquire(&_from_interpreted_entry); }
|
||||
@ -324,7 +324,7 @@ class Method : public Metadata {
|
||||
// exception handler which caused the exception to be thrown, which
|
||||
// is needed for proper retries. See, for example,
|
||||
// InterpreterRuntime::exception_handler_for_exception.
|
||||
static int fast_exception_handler_bci_for(methodHandle mh, Klass* ex_klass, int throw_bci, TRAPS);
|
||||
static int fast_exception_handler_bci_for(const methodHandle& mh, Klass* ex_klass, int throw_bci, TRAPS);
|
||||
|
||||
// method data access
|
||||
MethodData* method_data() const {
|
||||
@ -452,7 +452,7 @@ class Method : public Metadata {
|
||||
bool check_code() const; // Not inline to avoid circular ref
|
||||
CompiledMethod* volatile code() const { assert( check_code(), "" ); return (CompiledMethod *)OrderAccess::load_ptr_acquire(&_code); }
|
||||
void clear_code(bool acquire_lock = true); // Clear out any compiled code
|
||||
static void set_code(methodHandle mh, CompiledMethod* code);
|
||||
static void set_code(const methodHandle& mh, CompiledMethod* code);
|
||||
void set_adapter_entry(AdapterHandlerEntry* adapter) {
|
||||
constMethod()->set_adapter_entry(adapter);
|
||||
}
|
||||
@ -776,7 +776,7 @@ class Method : public Metadata {
|
||||
void set_is_prefixed_native() { _access_flags.set_is_prefixed_native(); }
|
||||
|
||||
// Rewriting support
|
||||
static methodHandle clone_with_new_data(methodHandle m, u_char* new_code, int new_code_length,
|
||||
static methodHandle clone_with_new_data(const methodHandle& m, u_char* new_code, int new_code_length,
|
||||
u_char* new_compressed_linenumber_table, int new_compressed_linenumber_size, TRAPS);
|
||||
|
||||
// jmethodID handling
|
||||
@ -954,10 +954,10 @@ class Method : public Metadata {
|
||||
void clear_queued_for_compilation() { _access_flags.clear_queued_for_compilation(); }
|
||||
|
||||
// Resolve all classes in signature, return 'true' if successful
|
||||
static bool load_signature_classes(methodHandle m, TRAPS);
|
||||
static bool load_signature_classes(const methodHandle& m, TRAPS);
|
||||
|
||||
// Return if true if not all classes references in signature, including return type, has been loaded
|
||||
static bool has_unloaded_classes_in_signature(methodHandle m, TRAPS);
|
||||
static bool has_unloaded_classes_in_signature(const methodHandle& m, TRAPS);
|
||||
|
||||
// Printing
|
||||
void print_short_name(outputStream* st = tty); // prints as klassname::methodname; Exposed so field engineers can debug VM
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2013, 2017, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -25,7 +25,7 @@
|
||||
#include "oops/methodCounters.hpp"
|
||||
#include "runtime/handles.inline.hpp"
|
||||
|
||||
MethodCounters* MethodCounters::allocate(methodHandle mh, TRAPS) {
|
||||
MethodCounters* MethodCounters::allocate(const methodHandle& mh, TRAPS) {
|
||||
ClassLoaderData* loader_data = mh->method_holder()->class_loader_data();
|
||||
return new(loader_data, size(), false, MetaspaceObj::MethodCountersType, THREAD) MethodCounters(mh);
|
||||
}
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2013, 2016, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2013, 2017, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -68,7 +68,7 @@ class MethodCounters : public Metadata {
|
||||
u1 _highest_osr_comp_level; // Same for OSR level
|
||||
#endif
|
||||
|
||||
MethodCounters(methodHandle mh) :
|
||||
MethodCounters(const methodHandle& mh) :
|
||||
#if INCLUDE_AOT
|
||||
_method(mh()),
|
||||
#endif
|
||||
@ -112,7 +112,7 @@ class MethodCounters : public Metadata {
|
||||
public:
|
||||
virtual bool is_methodCounters() const volatile { return true; }
|
||||
|
||||
static MethodCounters* allocate(methodHandle mh, TRAPS);
|
||||
static MethodCounters* allocate(const methodHandle& mh, TRAPS);
|
||||
|
||||
void deallocate_contents(ClassLoaderData* loader_data) {}
|
||||
|
||||
|
||||
@ -1686,7 +1686,7 @@ JVM_ENTRY(jbyteArray, JVM_GetFieldTypeAnnotations(JNIEnv *env, jobject field))
|
||||
return (jbyteArray) JNIHandles::make_local(env, Annotations::make_java_array(fd.type_annotations(), THREAD));
|
||||
JVM_END
|
||||
|
||||
static void bounds_check(constantPoolHandle cp, jint index, TRAPS) {
|
||||
static void bounds_check(const constantPoolHandle& cp, jint index, TRAPS) {
|
||||
if (!cp->is_within_bounds(index)) {
|
||||
THROW_MSG(vmSymbols::java_lang_IllegalArgumentException(), "Constant pool index out of bounds");
|
||||
}
|
||||
@ -1794,7 +1794,7 @@ JVM_ENTRY(jobjectArray, JVM_GetClassDeclaredFields(JNIEnv *env, jclass ofClass,
|
||||
}
|
||||
JVM_END
|
||||
|
||||
static bool select_method(methodHandle method, bool want_constructor) {
|
||||
static bool select_method(const methodHandle& method, bool want_constructor) {
|
||||
if (want_constructor) {
|
||||
return (method->is_initializer() && !method->is_static());
|
||||
} else {
|
||||
@ -1963,7 +1963,7 @@ JVM_ENTRY(jclass, JVM_ConstantPoolGetClassAtIfLoaded(JNIEnv *env, jobject obj, j
|
||||
}
|
||||
JVM_END
|
||||
|
||||
static jobject get_method_at_helper(constantPoolHandle cp, jint index, bool force_resolution, TRAPS) {
|
||||
static jobject get_method_at_helper(const constantPoolHandle& cp, jint index, bool force_resolution, TRAPS) {
|
||||
constantTag tag = cp->tag_at(index);
|
||||
if (!tag.is_method() && !tag.is_interface_method()) {
|
||||
THROW_MSG_0(vmSymbols::java_lang_IllegalArgumentException(), "Wrong type at constant pool index");
|
||||
|
||||
@ -195,7 +195,7 @@ public:
|
||||
|
||||
jclass to_jclass(Klass* klass) { return (klass == NULL ? NULL : (jclass)to_jobject(klass->java_mirror())); }
|
||||
|
||||
jmethodID to_jmethodID(methodHandle method) { return method->jmethod_id(); }
|
||||
jmethodID to_jmethodID(const methodHandle& method) { return method->jmethod_id(); }
|
||||
|
||||
JNIEnv* jni_env() { return _jni_env; }
|
||||
};
|
||||
@ -229,7 +229,7 @@ private:
|
||||
jmethodID _mid;
|
||||
|
||||
public:
|
||||
JvmtiMethodEventMark(JavaThread *thread, methodHandle method) :
|
||||
JvmtiMethodEventMark(JavaThread *thread, const methodHandle& method) :
|
||||
JvmtiThreadEventMark(thread),
|
||||
_mid(to_jmethodID(method)) {};
|
||||
jmethodID jni_methodID() { return _mid; }
|
||||
@ -240,7 +240,7 @@ private:
|
||||
jlocation _loc;
|
||||
|
||||
public:
|
||||
JvmtiLocationEventMark(JavaThread *thread, methodHandle method, address location) :
|
||||
JvmtiLocationEventMark(JavaThread *thread, const methodHandle& method, address location) :
|
||||
JvmtiMethodEventMark(thread, method),
|
||||
_loc(location - method->code_base()) {};
|
||||
jlocation location() { return _loc; }
|
||||
@ -251,7 +251,7 @@ private:
|
||||
jobject _exc;
|
||||
|
||||
public:
|
||||
JvmtiExceptionEventMark(JavaThread *thread, methodHandle method, address location, Handle exception) :
|
||||
JvmtiExceptionEventMark(JavaThread *thread, const methodHandle& method, address location, Handle exception) :
|
||||
JvmtiLocationEventMark(thread, method, location),
|
||||
_exc(to_jobject(exception())) {};
|
||||
jobject exception() { return _exc; }
|
||||
|
||||
@ -32,7 +32,7 @@
|
||||
|
||||
#ifdef TIERED
|
||||
// Print an event.
|
||||
void AdvancedThresholdPolicy::print_specific(EventType type, methodHandle mh, methodHandle imh,
|
||||
void AdvancedThresholdPolicy::print_specific(EventType type, const methodHandle& mh, const methodHandle& imh,
|
||||
int bci, CompLevel level) {
|
||||
tty->print(" rate=");
|
||||
if (mh->prev_time() == 0) tty->print("n/a");
|
||||
@ -339,7 +339,7 @@ bool AdvancedThresholdPolicy::should_not_inline(ciEnv* env, ciMethod* callee) {
|
||||
}
|
||||
|
||||
// Create MDO if necessary.
|
||||
void AdvancedThresholdPolicy::create_mdo(methodHandle mh, JavaThread* THREAD) {
|
||||
void AdvancedThresholdPolicy::create_mdo(const methodHandle& mh, JavaThread* THREAD) {
|
||||
if (mh->is_native() ||
|
||||
mh->is_abstract() ||
|
||||
mh->is_accessor() ||
|
||||
@ -546,7 +546,7 @@ void AdvancedThresholdPolicy::submit_compile(const methodHandle& mh, int bci, Co
|
||||
CompileBroker::compile_method(mh, bci, level, mh, hot_count, CompileTask::Reason_Tiered, thread);
|
||||
}
|
||||
|
||||
bool AdvancedThresholdPolicy::maybe_switch_to_aot(methodHandle mh, CompLevel cur_level, CompLevel next_level, JavaThread* thread) {
|
||||
bool AdvancedThresholdPolicy::maybe_switch_to_aot(const methodHandle& mh, CompLevel cur_level, CompLevel next_level, JavaThread* thread) {
|
||||
if (UseAOT && !delay_compilation_during_startup()) {
|
||||
if (cur_level == CompLevel_full_profile || cur_level == CompLevel_none) {
|
||||
// If the current level is full profile or interpreter and we're switching to any other level,
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2010, 2016, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2010, 2017, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -199,16 +199,16 @@ class AdvancedThresholdPolicy : public SimpleThresholdPolicy {
|
||||
// determines whether we should do that.
|
||||
inline bool should_create_mdo(Method* method, CompLevel cur_level);
|
||||
// Create MDO if necessary.
|
||||
void create_mdo(methodHandle mh, JavaThread* thread);
|
||||
void create_mdo(const methodHandle& mh, JavaThread* thread);
|
||||
// Is method profiled enough?
|
||||
bool is_method_profiled(Method* method);
|
||||
|
||||
double _increase_threshold_at_ratio;
|
||||
|
||||
bool maybe_switch_to_aot(methodHandle mh, CompLevel cur_level, CompLevel next_level, JavaThread* thread);
|
||||
bool maybe_switch_to_aot(const methodHandle& mh, CompLevel cur_level, CompLevel next_level, JavaThread* thread);
|
||||
|
||||
protected:
|
||||
void print_specific(EventType type, methodHandle mh, methodHandle imh, int bci, CompLevel level);
|
||||
void print_specific(EventType type, const methodHandle& mh, const methodHandle& imh, int bci, CompLevel level);
|
||||
|
||||
void set_increase_threshold_at_ratio() { _increase_threshold_at_ratio = 100 / (100 - (double)IncreaseFirstTierCompileThresholdAt); }
|
||||
void set_start_time(jlong t) { _start_time = t; }
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -96,7 +96,7 @@ void CompilationPolicy::completed_vm_startup() {
|
||||
// Returns true if m must be compiled before executing it
|
||||
// This is intended to force compiles for methods (usually for
|
||||
// debugging) that would otherwise be interpreted for some reason.
|
||||
bool CompilationPolicy::must_be_compiled(methodHandle m, int comp_level) {
|
||||
bool CompilationPolicy::must_be_compiled(const methodHandle& m, int comp_level) {
|
||||
// Don't allow Xcomp to cause compiles in replay mode
|
||||
if (ReplayCompiles) return false;
|
||||
|
||||
@ -107,7 +107,7 @@ bool CompilationPolicy::must_be_compiled(methodHandle m, int comp_level) {
|
||||
(UseCompiler && AlwaysCompileLoopMethods && m->has_loops() && CompileBroker::should_compile_new_jobs()); // eagerly compile loop methods
|
||||
}
|
||||
|
||||
void CompilationPolicy::compile_if_required(methodHandle selected_method, TRAPS) {
|
||||
void CompilationPolicy::compile_if_required(const methodHandle& selected_method, TRAPS) {
|
||||
if (must_be_compiled(selected_method)) {
|
||||
// This path is unusual, mostly used by the '-Xcomp' stress test mode.
|
||||
|
||||
@ -135,7 +135,7 @@ void CompilationPolicy::compile_if_required(methodHandle selected_method, TRAPS)
|
||||
}
|
||||
|
||||
// Returns true if m is allowed to be compiled
|
||||
bool CompilationPolicy::can_be_compiled(methodHandle m, int comp_level) {
|
||||
bool CompilationPolicy::can_be_compiled(const methodHandle& m, int comp_level) {
|
||||
// allow any levels for WhiteBox
|
||||
assert(WhiteBoxAPI || comp_level == CompLevel_all || is_compile(comp_level), "illegal compilation level");
|
||||
|
||||
@ -166,7 +166,7 @@ bool CompilationPolicy::can_be_compiled(methodHandle m, int comp_level) {
|
||||
}
|
||||
|
||||
// Returns true if m is allowed to be osr compiled
|
||||
bool CompilationPolicy::can_be_osr_compiled(methodHandle m, int comp_level) {
|
||||
bool CompilationPolicy::can_be_osr_compiled(const methodHandle& m, int comp_level) {
|
||||
bool result = false;
|
||||
if (comp_level == CompLevel_all) {
|
||||
if (TieredCompilation) {
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -45,7 +45,7 @@ class CompilationPolicy : public CHeapObj<mtCompiler> {
|
||||
static bool _in_vm_startup;
|
||||
|
||||
// m must be compiled before executing it
|
||||
static bool must_be_compiled(methodHandle m, int comp_level = CompLevel_all);
|
||||
static bool must_be_compiled(const methodHandle& m, int comp_level = CompLevel_all);
|
||||
|
||||
public:
|
||||
static void set_in_vm_startup(bool in_vm_startup) { _in_vm_startup = in_vm_startup; }
|
||||
@ -54,12 +54,12 @@ public:
|
||||
|
||||
// If m must_be_compiled then request a compilation from the CompileBroker.
|
||||
// This supports the -Xcomp option.
|
||||
static void compile_if_required(methodHandle m, TRAPS);
|
||||
static void compile_if_required(const methodHandle& m, TRAPS);
|
||||
|
||||
// m is allowed to be compiled
|
||||
static bool can_be_compiled(methodHandle m, int comp_level = CompLevel_all);
|
||||
static bool can_be_compiled(const methodHandle& m, int comp_level = CompLevel_all);
|
||||
// m is allowed to be osr compiled
|
||||
static bool can_be_osr_compiled(methodHandle m, int comp_level = CompLevel_all);
|
||||
static bool can_be_osr_compiled(const methodHandle& m, int comp_level = CompLevel_all);
|
||||
static bool is_compilation_enabled();
|
||||
static void set_policy(CompilationPolicy* policy) { _policy = policy; }
|
||||
static CompilationPolicy* policy() { return _policy; }
|
||||
|
||||
@ -1408,7 +1408,7 @@ JRT_LEAF(void, Deoptimization::popframe_preserve_args(JavaThread* thread, int by
|
||||
JRT_END
|
||||
|
||||
MethodData*
|
||||
Deoptimization::get_method_data(JavaThread* thread, methodHandle m,
|
||||
Deoptimization::get_method_data(JavaThread* thread, const methodHandle& m,
|
||||
bool create_if_missing) {
|
||||
Thread* THREAD = thread;
|
||||
MethodData* mdo = m()->method_data();
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -417,7 +417,7 @@ JVMCI_ONLY(public:)
|
||||
// returning to a deoptimized caller
|
||||
static void popframe_preserve_args(JavaThread* thread, int bytes_to_save, void* start_address);
|
||||
|
||||
static MethodData* get_method_data(JavaThread* thread, methodHandle m, bool create_if_missing);
|
||||
static MethodData* get_method_data(JavaThread* thread, const methodHandle& m, bool create_if_missing);
|
||||
private:
|
||||
// Update the mdo's count and per-BCI reason bits, returning previous state:
|
||||
static ProfileData* query_update_method_data(MethodData* trap_mdo,
|
||||
|
||||
@ -49,7 +49,7 @@
|
||||
// -----------------------------------------------------
|
||||
// Implementation of JavaCallWrapper
|
||||
|
||||
JavaCallWrapper::JavaCallWrapper(methodHandle callee_method, Handle receiver, JavaValue* result, TRAPS) {
|
||||
JavaCallWrapper::JavaCallWrapper(const methodHandle& callee_method, Handle receiver, JavaValue* result, TRAPS) {
|
||||
JavaThread* thread = (JavaThread *)THREAD;
|
||||
bool clear_pending_exception = true;
|
||||
|
||||
|
||||
@ -53,7 +53,7 @@ class JavaCallWrapper: StackObj {
|
||||
|
||||
public:
|
||||
// Construction/destruction
|
||||
JavaCallWrapper(methodHandle callee_method, Handle receiver, JavaValue* result, TRAPS);
|
||||
JavaCallWrapper(const methodHandle& callee_method, Handle receiver, JavaValue* result, TRAPS);
|
||||
~JavaCallWrapper();
|
||||
|
||||
// Accessors
|
||||
|
||||
@ -762,7 +762,7 @@ void Reflection::check_for_inner_class(const InstanceKlass* outer, const Instanc
|
||||
}
|
||||
|
||||
// Utility method converting a single SignatureStream element into java.lang.Class instance
|
||||
static oop get_mirror_from_signature(methodHandle method,
|
||||
static oop get_mirror_from_signature(const methodHandle& method,
|
||||
SignatureStream* ss,
|
||||
TRAPS) {
|
||||
|
||||
@ -788,7 +788,7 @@ static oop get_mirror_from_signature(methodHandle method,
|
||||
return java_lang_Class::primitive_mirror(ss->type());
|
||||
}
|
||||
|
||||
static objArrayHandle get_parameter_types(methodHandle method,
|
||||
static objArrayHandle get_parameter_types(const methodHandle& method,
|
||||
int parameter_count,
|
||||
oop* return_type,
|
||||
TRAPS) {
|
||||
@ -814,7 +814,7 @@ static objArrayHandle get_parameter_types(methodHandle method,
|
||||
return mirrors;
|
||||
}
|
||||
|
||||
static objArrayHandle get_exception_types(methodHandle method, TRAPS) {
|
||||
static objArrayHandle get_exception_types(const methodHandle& method, TRAPS) {
|
||||
return method->resolved_checked_exceptions(THREAD);
|
||||
}
|
||||
|
||||
@ -1052,7 +1052,7 @@ static void narrow(jvalue* value, BasicType narrow_type, TRAPS) {
|
||||
|
||||
// Method call (shared by invoke_method and invoke_constructor)
|
||||
static oop invoke(InstanceKlass* klass,
|
||||
methodHandle reflected_method,
|
||||
const methodHandle& reflected_method,
|
||||
Handle receiver,
|
||||
bool override,
|
||||
objArrayHandle ptypes,
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -357,7 +357,7 @@ class SharedRuntime: AllStatic {
|
||||
|
||||
#if defined(X86) && defined(COMPILER1)
|
||||
// For Object.hashCode, System.identityHashCode try to pull hashCode from object header if available.
|
||||
static void inline_check_hashcode_from_object_header(MacroAssembler* masm, methodHandle method, Register obj_reg, Register result);
|
||||
static void inline_check_hashcode_from_object_header(MacroAssembler* masm, const methodHandle& method, Register obj_reg, Register result);
|
||||
#endif // X86 && COMPILER1
|
||||
|
||||
public:
|
||||
|
||||
@ -35,7 +35,7 @@
|
||||
|
||||
#ifdef TIERED
|
||||
|
||||
void SimpleThresholdPolicy::print_counters(const char* prefix, methodHandle mh) {
|
||||
void SimpleThresholdPolicy::print_counters(const char* prefix, const methodHandle& mh) {
|
||||
int invocation_count = mh->invocation_count();
|
||||
int backedge_count = mh->backedge_count();
|
||||
MethodData* mdh = mh->method_data();
|
||||
@ -56,7 +56,7 @@ void SimpleThresholdPolicy::print_counters(const char* prefix, methodHandle mh)
|
||||
}
|
||||
|
||||
// Print an event.
|
||||
void SimpleThresholdPolicy::print_event(EventType type, methodHandle mh, methodHandle imh,
|
||||
void SimpleThresholdPolicy::print_event(EventType type, const methodHandle& mh, const methodHandle& imh,
|
||||
int bci, CompLevel level) {
|
||||
bool inlinee_event = mh() != imh();
|
||||
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2010, 2016, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2010, 2017, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -57,7 +57,7 @@ class SimpleThresholdPolicy : public CompilationPolicy {
|
||||
// loop_event checks if a method should be OSR compiled at a different
|
||||
// level.
|
||||
CompLevel loop_event(Method* method, CompLevel cur_level, JavaThread* thread);
|
||||
void print_counters(const char* prefix, methodHandle mh);
|
||||
void print_counters(const char* prefix, const methodHandle& mh);
|
||||
protected:
|
||||
int c1_count() const { return _c1_count; }
|
||||
int c2_count() const { return _c2_count; }
|
||||
@ -65,9 +65,9 @@ protected:
|
||||
void set_c2_count(int x) { _c2_count = x; }
|
||||
|
||||
enum EventType { CALL, LOOP, COMPILE, REMOVE_FROM_QUEUE, UPDATE_IN_QUEUE, REPROFILE, MAKE_NOT_ENTRANT };
|
||||
void print_event(EventType type, methodHandle mh, methodHandle imh, int bci, CompLevel level);
|
||||
void print_event(EventType type, const methodHandle& mh, const methodHandle& imh, int bci, CompLevel level);
|
||||
// Print policy-specific information if necessary
|
||||
virtual void print_specific(EventType type, methodHandle mh, methodHandle imh, int bci, CompLevel level) { }
|
||||
virtual void print_specific(EventType type, const methodHandle& mh, const methodHandle& imh, int bci, CompLevel level) { }
|
||||
// Check if the method can be compiled, change level if necessary
|
||||
void compile(const methodHandle& mh, int bci, CompLevel level, JavaThread* thread);
|
||||
// Submit a given method for compilation
|
||||
|
||||
@ -380,7 +380,7 @@ void xmlStream::stamp() {
|
||||
// ------------------------------------------------------------------
|
||||
// Output a method attribute, in the form " method='pkg/cls name sig'".
|
||||
// This is used only when there is no ciMethod available.
|
||||
void xmlStream::method(methodHandle method) {
|
||||
void xmlStream::method(const methodHandle& method) {
|
||||
assert_if_no_error(inside_attrs(), "printing attributes");
|
||||
if (method.is_null()) return;
|
||||
print_raw(" method='");
|
||||
@ -408,7 +408,7 @@ void xmlStream::method(methodHandle method) {
|
||||
}
|
||||
}
|
||||
|
||||
void xmlStream::method_text(methodHandle method) {
|
||||
void xmlStream::method_text(const methodHandle& method) {
|
||||
ResourceMark rm;
|
||||
assert_if_no_error(inside_attrs(), "printing attributes");
|
||||
if (method.is_null()) return;
|
||||
|
||||
@ -137,14 +137,14 @@ class xmlStream : public outputStream {
|
||||
|
||||
// commonly used XML attributes
|
||||
void stamp(); // stamp='1.234'
|
||||
void method(methodHandle m); // method='k n s' ...
|
||||
void method(const methodHandle& m); // method='k n s' ...
|
||||
void klass(Klass* k); // klass='name'
|
||||
void name(const Symbol* s); // name='name'
|
||||
void object(const char* attr, Metadata* val);
|
||||
void object(const char* attr, Handle val);
|
||||
|
||||
// print the text alone (sans ''):
|
||||
void method_text(methodHandle m);
|
||||
void method_text(const methodHandle& m);
|
||||
void klass_text(Klass* k); // klass='name'
|
||||
void name_text(const Symbol* s); // name='name'
|
||||
void object_text(Metadata* x);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user