mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-27 06:45:07 +02:00
8256254: Convert vmIntrinsics::ID to enum class
Reviewed-by: redestad, kvn
This commit is contained in:
parent
b5ce8af3d7
commit
f48737c7b3
52 changed files with 199 additions and 124 deletions
|
@ -1783,7 +1783,7 @@ void InterpreterMacroAssembler::profile_return_type(Register mdp, Register ret,
|
||||||
br(Assembler::EQ, do_profile);
|
br(Assembler::EQ, do_profile);
|
||||||
get_method(tmp);
|
get_method(tmp);
|
||||||
ldrh(rscratch1, Address(tmp, Method::intrinsic_id_offset_in_bytes()));
|
ldrh(rscratch1, Address(tmp, Method::intrinsic_id_offset_in_bytes()));
|
||||||
subs(zr, rscratch1, vmIntrinsics::_compiledLambdaForm);
|
subs(zr, rscratch1, static_cast<int>(vmIntrinsics::_compiledLambdaForm));
|
||||||
br(Assembler::NE, profile_continue);
|
br(Assembler::NE, profile_continue);
|
||||||
|
|
||||||
bind(do_profile);
|
bind(do_profile);
|
||||||
|
|
|
@ -424,7 +424,7 @@ void MethodHandles::generate_method_handle_dispatch(MacroAssembler* _masm,
|
||||||
}
|
}
|
||||||
|
|
||||||
default:
|
default:
|
||||||
fatal("unexpected intrinsic %d: %s", iid, vmIntrinsics::name_at(iid));
|
fatal("unexpected intrinsic %d: %s", vmIntrinsics::as_int(iid), vmIntrinsics::name_at(iid));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1198,7 +1198,7 @@ static void gen_special_dispatch(MacroAssembler* masm,
|
||||||
} else if (iid == vmIntrinsics::_invokeBasic || iid == vmIntrinsics::_linkToNative) {
|
} else if (iid == vmIntrinsics::_invokeBasic || iid == vmIntrinsics::_linkToNative) {
|
||||||
has_receiver = true;
|
has_receiver = true;
|
||||||
} else {
|
} else {
|
||||||
fatal("unexpected intrinsic id %d", iid);
|
fatal("unexpected intrinsic id %d", vmIntrinsics::as_int(iid));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (member_reg != noreg) {
|
if (member_reg != noreg) {
|
||||||
|
|
|
@ -435,7 +435,7 @@ void MethodHandles::generate_method_handle_dispatch(MacroAssembler* _masm,
|
||||||
}
|
}
|
||||||
|
|
||||||
default:
|
default:
|
||||||
fatal("unexpected intrinsic %d: %s", iid, vmIntrinsics::name_at(iid));
|
fatal("unexpected intrinsic %d: %s", vmIntrinsics::as_int(iid), vmIntrinsics::name_at(iid));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -701,7 +701,7 @@ static void gen_special_dispatch(MacroAssembler* masm,
|
||||||
} else if (iid == vmIntrinsics::_invokeBasic) {
|
} else if (iid == vmIntrinsics::_invokeBasic) {
|
||||||
has_receiver = true;
|
has_receiver = true;
|
||||||
} else {
|
} else {
|
||||||
fatal("unexpected intrinsic id %d", iid);
|
fatal("unexpected intrinsic id %d", vmIntrinsics::as_int(iid));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (member_reg != noreg) {
|
if (member_reg != noreg) {
|
||||||
|
|
|
@ -1919,7 +1919,7 @@ void InterpreterMacroAssembler::profile_return_type(Register ret, Register tmp1,
|
||||||
cmpwi(CCR0, tmp1, Bytecodes::_invokedynamic);
|
cmpwi(CCR0, tmp1, Bytecodes::_invokedynamic);
|
||||||
cmpwi(CCR1, tmp1, Bytecodes::_invokehandle);
|
cmpwi(CCR1, tmp1, Bytecodes::_invokehandle);
|
||||||
cror(CCR0, Assembler::equal, CCR1, Assembler::equal);
|
cror(CCR0, Assembler::equal, CCR1, Assembler::equal);
|
||||||
cmpwi(CCR1, tmp2, vmIntrinsics::_compiledLambdaForm);
|
cmpwi(CCR1, tmp2, static_cast<int>(vmIntrinsics::_compiledLambdaForm));
|
||||||
cror(CCR0, Assembler::equal, CCR1, Assembler::equal);
|
cror(CCR0, Assembler::equal, CCR1, Assembler::equal);
|
||||||
bne(CCR0, profile_continue);
|
bne(CCR0, profile_continue);
|
||||||
}
|
}
|
||||||
|
|
|
@ -458,7 +458,7 @@ void MethodHandles::generate_method_handle_dispatch(MacroAssembler* _masm,
|
||||||
}
|
}
|
||||||
|
|
||||||
default:
|
default:
|
||||||
fatal("unexpected intrinsic %d: %s", iid, vmIntrinsics::name_at(iid));
|
fatal("unexpected intrinsic %d: %s", vmIntrinsics::as_int(iid), vmIntrinsics::name_at(iid));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1621,7 +1621,7 @@ static void gen_special_dispatch(MacroAssembler* masm,
|
||||||
} else if (iid == vmIntrinsics::_invokeBasic || iid == vmIntrinsics::_linkToNative) {
|
} else if (iid == vmIntrinsics::_invokeBasic || iid == vmIntrinsics::_linkToNative) {
|
||||||
has_receiver = true;
|
has_receiver = true;
|
||||||
} else {
|
} else {
|
||||||
fatal("unexpected intrinsic id %d", iid);
|
fatal("unexpected intrinsic id %d", vmIntrinsics::as_int(iid));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (member_reg != noreg) {
|
if (member_reg != noreg) {
|
||||||
|
|
|
@ -1806,11 +1806,11 @@ void InterpreterMacroAssembler::profile_return_type(Register mdp, Register ret,
|
||||||
get_method(tmp);
|
get_method(tmp);
|
||||||
// Supplement to 8139891: _intrinsic_id exceeded 1-byte size limit.
|
// Supplement to 8139891: _intrinsic_id exceeded 1-byte size limit.
|
||||||
if (Method::intrinsic_id_size_in_bytes() == 1) {
|
if (Method::intrinsic_id_size_in_bytes() == 1) {
|
||||||
z_cli(Method::intrinsic_id_offset_in_bytes(), tmp, vmIntrinsics::_compiledLambdaForm);
|
z_cli(Method::intrinsic_id_offset_in_bytes(), tmp, static_cast<int>(vmIntrinsics::_compiledLambdaForm));
|
||||||
} else {
|
} else {
|
||||||
assert(Method::intrinsic_id_size_in_bytes() == 2, "size error: check Method::_intrinsic_id");
|
assert(Method::intrinsic_id_size_in_bytes() == 2, "size error: check Method::_intrinsic_id");
|
||||||
z_lh(tmp, Method::intrinsic_id_offset_in_bytes(), Z_R0, tmp);
|
z_lh(tmp, Method::intrinsic_id_offset_in_bytes(), Z_R0, tmp);
|
||||||
z_chi(tmp, vmIntrinsics::_compiledLambdaForm);
|
z_chi(tmp, static_cast<int>(vmIntrinsics::_compiledLambdaForm));
|
||||||
}
|
}
|
||||||
z_brne(profile_continue);
|
z_brne(profile_continue);
|
||||||
|
|
||||||
|
|
|
@ -532,7 +532,7 @@ void MethodHandles::generate_method_handle_dispatch(MacroAssembler* _masm,
|
||||||
}
|
}
|
||||||
|
|
||||||
default:
|
default:
|
||||||
fatal("unexpected intrinsic %d: %s", iid, vmIntrinsics::name_at(iid));
|
fatal("unexpected intrinsic %d: %s", vmIntrinsics::as_int(iid), vmIntrinsics::name_at(iid));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -190,7 +190,7 @@ void InterpreterMacroAssembler::profile_return_type(Register mdp, Register ret,
|
||||||
cmpb(Address(_bcp_register, 0), Bytecodes::_invokehandle);
|
cmpb(Address(_bcp_register, 0), Bytecodes::_invokehandle);
|
||||||
jcc(Assembler::equal, do_profile);
|
jcc(Assembler::equal, do_profile);
|
||||||
get_method(tmp);
|
get_method(tmp);
|
||||||
cmpw(Address(tmp, Method::intrinsic_id_offset_in_bytes()), vmIntrinsics::_compiledLambdaForm);
|
cmpw(Address(tmp, Method::intrinsic_id_offset_in_bytes()), static_cast<int>(vmIntrinsics::_compiledLambdaForm));
|
||||||
jcc(Assembler::notEqual, profile_continue);
|
jcc(Assembler::notEqual, profile_continue);
|
||||||
|
|
||||||
bind(do_profile);
|
bind(do_profile);
|
||||||
|
|
|
@ -478,7 +478,7 @@ void MethodHandles::generate_method_handle_dispatch(MacroAssembler* _masm,
|
||||||
}
|
}
|
||||||
|
|
||||||
default:
|
default:
|
||||||
fatal("unexpected intrinsic %d: %s", iid, vmIntrinsics::name_at(iid));
|
fatal("unexpected intrinsic %d: %s", vmIntrinsics::as_int(iid), vmIntrinsics::name_at(iid));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1646,7 +1646,7 @@ static void gen_special_dispatch(MacroAssembler* masm,
|
||||||
} else if (iid == vmIntrinsics::_invokeBasic || iid == vmIntrinsics::_linkToNative) {
|
} else if (iid == vmIntrinsics::_invokeBasic || iid == vmIntrinsics::_linkToNative) {
|
||||||
has_receiver = true;
|
has_receiver = true;
|
||||||
} else {
|
} else {
|
||||||
fatal("unexpected intrinsic id %d", iid);
|
fatal("unexpected intrinsic id %d", vmIntrinsics::as_int(iid));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (member_reg != noreg) {
|
if (member_reg != noreg) {
|
||||||
|
|
|
@ -4133,7 +4133,7 @@ bool GraphBuilder::try_method_handle_inline(ciMethod* callee, bool ignore_return
|
||||||
break; // TODO: NYI
|
break; // TODO: NYI
|
||||||
|
|
||||||
default:
|
default:
|
||||||
fatal("unexpected intrinsic %d: %s", iid, vmIntrinsics::name_at(iid));
|
fatal("unexpected intrinsic %d: %s", vmIntrinsics::as_int(iid), vmIntrinsics::name_at(iid));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
set_state(state_before->copy_for_parsing());
|
set_state(state_before->copy_for_parsing());
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 1999, 2019, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 1999, 2020, Oracle and/or its affiliates. All rights reserved.
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
|
@ -1102,13 +1102,13 @@ void NullCheckEliminator::handle_Intrinsic(Intrinsic* x) {
|
||||||
if (set_contains(recv)) {
|
if (set_contains(recv)) {
|
||||||
// Value is non-null => update Intrinsic
|
// Value is non-null => update Intrinsic
|
||||||
if (PrintNullCheckElimination) {
|
if (PrintNullCheckElimination) {
|
||||||
tty->print_cr("Eliminated Intrinsic %d's null check for value %d", x->id(), recv->id());
|
tty->print_cr("Eliminated Intrinsic %d's null check for value %d", vmIntrinsics::as_int(x->id()), recv->id());
|
||||||
}
|
}
|
||||||
x->set_needs_null_check(false);
|
x->set_needs_null_check(false);
|
||||||
} else {
|
} else {
|
||||||
set_put(recv);
|
set_put(recv);
|
||||||
if (PrintNullCheckElimination) {
|
if (PrintNullCheckElimination) {
|
||||||
tty->print_cr("Intrinsic %d of value %d proves value to be non-null", x->id(), recv->id());
|
tty->print_cr("Intrinsic %d of value %d proves value to be non-null", vmIntrinsics::as_int(x->id()), recv->id());
|
||||||
}
|
}
|
||||||
// Ensure previous passes do not cause wrong state
|
// Ensure previous passes do not cause wrong state
|
||||||
x->set_needs_null_check(true);
|
x->set_needs_null_check(true);
|
||||||
|
|
|
@ -26,6 +26,7 @@
|
||||||
#include "classfile/classFileParser.hpp"
|
#include "classfile/classFileParser.hpp"
|
||||||
#include "classfile/stackMapTable.hpp"
|
#include "classfile/stackMapTable.hpp"
|
||||||
#include "classfile/verifier.hpp"
|
#include "classfile/verifier.hpp"
|
||||||
|
#include "classfile/vmSymbols.hpp"
|
||||||
#include "memory/resourceArea.hpp"
|
#include "memory/resourceArea.hpp"
|
||||||
|
|
||||||
// Keep these in a separate file to prevent inlining
|
// Keep these in a separate file to prevent inlining
|
||||||
|
|
|
@ -5287,7 +5287,8 @@ static void check_methods_for_intrinsics(const InstanceKlass* ik,
|
||||||
// The check is potentially expensive, therefore it is available
|
// The check is potentially expensive, therefore it is available
|
||||||
// only in debug builds.
|
// only in debug builds.
|
||||||
|
|
||||||
for (int id = vmIntrinsics::FIRST_ID; id < (int)vmIntrinsics::ID_LIMIT; ++id) {
|
for (vmIntrinsicsIterator it = vmIntrinsicsRange.begin(); it != vmIntrinsicsRange.end(); ++it) {
|
||||||
|
vmIntrinsicID id = *it;
|
||||||
if (vmIntrinsics::_compiledLambdaForm == id) {
|
if (vmIntrinsics::_compiledLambdaForm == id) {
|
||||||
// The _compiledLamdbdaForm intrinsic is a special marker for bytecode
|
// The _compiledLamdbdaForm intrinsic is a special marker for bytecode
|
||||||
// generated for the JVM from a LambdaForm and therefore no method
|
// generated for the JVM from a LambdaForm and therefore no method
|
||||||
|
@ -5295,7 +5296,7 @@ static void check_methods_for_intrinsics(const InstanceKlass* ik,
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (vmIntrinsics::class_for(vmIntrinsics::ID_from(id)) == klass_id) {
|
if (vmIntrinsics::class_for(id) == klass_id) {
|
||||||
// Check if the current class contains a method with the same
|
// Check if the current class contains a method with the same
|
||||||
// name, flags, signature.
|
// name, flags, signature.
|
||||||
bool match = false;
|
bool match = false;
|
||||||
|
@ -5311,8 +5312,7 @@ static void check_methods_for_intrinsics(const InstanceKlass* ik,
|
||||||
char buf[1000];
|
char buf[1000];
|
||||||
tty->print("Compiler intrinsic is defined for method [%s], "
|
tty->print("Compiler intrinsic is defined for method [%s], "
|
||||||
"but the method is not available in class [%s].%s",
|
"but the method is not available in class [%s].%s",
|
||||||
vmIntrinsics::short_name_as_C_string(vmIntrinsics::ID_from(id),
|
vmIntrinsics::short_name_as_C_string(id, buf, sizeof(buf)),
|
||||||
buf, sizeof(buf)),
|
|
||||||
ik->name()->as_C_string(),
|
ik->name()->as_C_string(),
|
||||||
NOT_DEBUG("") DEBUG_ONLY(" Exiting.")
|
NOT_DEBUG("") DEBUG_ONLY(" Exiting.")
|
||||||
);
|
);
|
||||||
|
|
|
@ -32,6 +32,7 @@
|
||||||
#include "classfile/symbolTable.hpp"
|
#include "classfile/symbolTable.hpp"
|
||||||
#include "classfile/systemDictionary.hpp"
|
#include "classfile/systemDictionary.hpp"
|
||||||
#include "classfile/systemDictionaryShared.hpp"
|
#include "classfile/systemDictionaryShared.hpp"
|
||||||
|
#include "classfile/vmSymbols.hpp"
|
||||||
#include "interpreter/bytecode.hpp"
|
#include "interpreter/bytecode.hpp"
|
||||||
#include "interpreter/bytecodeStream.hpp"
|
#include "interpreter/bytecodeStream.hpp"
|
||||||
#include "interpreter/linkResolver.hpp"
|
#include "interpreter/linkResolver.hpp"
|
||||||
|
|
|
@ -27,6 +27,7 @@
|
||||||
#include "classfile/defaultMethods.hpp"
|
#include "classfile/defaultMethods.hpp"
|
||||||
#include "classfile/symbolTable.hpp"
|
#include "classfile/symbolTable.hpp"
|
||||||
#include "classfile/systemDictionary.hpp"
|
#include "classfile/systemDictionary.hpp"
|
||||||
|
#include "classfile/vmSymbols.hpp"
|
||||||
#include "logging/log.hpp"
|
#include "logging/log.hpp"
|
||||||
#include "logging/logStream.hpp"
|
#include "logging/logStream.hpp"
|
||||||
#include "memory/allocation.hpp"
|
#include "memory/allocation.hpp"
|
||||||
|
|
|
@ -25,6 +25,7 @@
|
||||||
#include "precompiled.hpp"
|
#include "precompiled.hpp"
|
||||||
#include "classfile/moduleEntry.hpp"
|
#include "classfile/moduleEntry.hpp"
|
||||||
#include "classfile/packageEntry.hpp"
|
#include "classfile/packageEntry.hpp"
|
||||||
|
#include "classfile/vmSymbols.hpp"
|
||||||
#include "logging/log.hpp"
|
#include "logging/log.hpp"
|
||||||
#include "memory/archiveBuilder.hpp"
|
#include "memory/archiveBuilder.hpp"
|
||||||
#include "memory/archiveUtils.hpp"
|
#include "memory/archiveUtils.hpp"
|
||||||
|
|
|
@ -25,6 +25,7 @@
|
||||||
#include "precompiled.hpp"
|
#include "precompiled.hpp"
|
||||||
#include "classfile/stackMapFrame.hpp"
|
#include "classfile/stackMapFrame.hpp"
|
||||||
#include "classfile/verifier.hpp"
|
#include "classfile/verifier.hpp"
|
||||||
|
#include "classfile/vmSymbols.hpp"
|
||||||
#include "memory/resourceArea.hpp"
|
#include "memory/resourceArea.hpp"
|
||||||
#include "oops/oop.inline.hpp"
|
#include "oops/oop.inline.hpp"
|
||||||
#include "oops/symbol.hpp"
|
#include "oops/symbol.hpp"
|
||||||
|
|
|
@ -2518,18 +2518,19 @@ Symbol* SystemDictionary::check_signature_loaders(Symbol* signature,
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
Method* SystemDictionary::find_method_handle_intrinsic(vmIntrinsics::ID iid,
|
Method* SystemDictionary::find_method_handle_intrinsic(vmIntrinsicID iid,
|
||||||
Symbol* signature,
|
Symbol* signature,
|
||||||
TRAPS) {
|
TRAPS) {
|
||||||
methodHandle empty;
|
methodHandle empty;
|
||||||
|
const int iid_as_int = vmIntrinsics::as_int(iid);
|
||||||
assert(MethodHandles::is_signature_polymorphic(iid) &&
|
assert(MethodHandles::is_signature_polymorphic(iid) &&
|
||||||
MethodHandles::is_signature_polymorphic_intrinsic(iid) &&
|
MethodHandles::is_signature_polymorphic_intrinsic(iid) &&
|
||||||
iid != vmIntrinsics::_invokeGeneric,
|
iid != vmIntrinsics::_invokeGeneric,
|
||||||
"must be a known MH intrinsic iid=%d: %s", iid, vmIntrinsics::name_at(iid));
|
"must be a known MH intrinsic iid=%d: %s", iid_as_int, vmIntrinsics::name_at(iid));
|
||||||
|
|
||||||
unsigned int hash = invoke_method_table()->compute_hash(signature, iid);
|
unsigned int hash = invoke_method_table()->compute_hash(signature, iid_as_int);
|
||||||
int index = invoke_method_table()->hash_to_index(hash);
|
int index = invoke_method_table()->hash_to_index(hash);
|
||||||
SymbolPropertyEntry* spe = invoke_method_table()->find_entry(index, hash, signature, iid);
|
SymbolPropertyEntry* spe = invoke_method_table()->find_entry(index, hash, signature, iid_as_int);
|
||||||
methodHandle m;
|
methodHandle m;
|
||||||
if (spe == NULL || spe->method() == NULL) {
|
if (spe == NULL || spe->method() == NULL) {
|
||||||
spe = NULL;
|
spe = NULL;
|
||||||
|
@ -2548,9 +2549,9 @@ Method* SystemDictionary::find_method_handle_intrinsic(vmIntrinsics::ID iid,
|
||||||
// if a racing thread has managed to install one at the same time.
|
// if a racing thread has managed to install one at the same time.
|
||||||
{
|
{
|
||||||
MutexLocker ml(THREAD, SystemDictionary_lock);
|
MutexLocker ml(THREAD, SystemDictionary_lock);
|
||||||
spe = invoke_method_table()->find_entry(index, hash, signature, iid);
|
spe = invoke_method_table()->find_entry(index, hash, signature, iid_as_int);
|
||||||
if (spe == NULL)
|
if (spe == NULL)
|
||||||
spe = invoke_method_table()->add_entry(index, hash, signature, iid);
|
spe = invoke_method_table()->add_entry(index, hash, signature, iid_as_int);
|
||||||
if (spe->method() == NULL)
|
if (spe->method() == NULL)
|
||||||
spe->set_method(m());
|
spe->set_method(m());
|
||||||
}
|
}
|
||||||
|
@ -2701,7 +2702,7 @@ Handle SystemDictionary::find_method_handle_type(Symbol* signature,
|
||||||
Klass* accessing_klass,
|
Klass* accessing_klass,
|
||||||
TRAPS) {
|
TRAPS) {
|
||||||
Handle empty;
|
Handle empty;
|
||||||
vmIntrinsics::ID null_iid = vmIntrinsics::_none; // distinct from all method handle invoker intrinsics
|
int null_iid = vmIntrinsics::as_int(vmIntrinsics::_none); // distinct from all method handle invoker intrinsics
|
||||||
unsigned int hash = invoke_method_table()->compute_hash(signature, null_iid);
|
unsigned int hash = invoke_method_table()->compute_hash(signature, null_iid);
|
||||||
int index = invoke_method_table()->hash_to_index(hash);
|
int index = invoke_method_table()->hash_to_index(hash);
|
||||||
SymbolPropertyEntry* spe = invoke_method_table()->find_entry(index, hash, signature, null_iid);
|
SymbolPropertyEntry* spe = invoke_method_table()->find_entry(index, hash, signature, null_iid);
|
||||||
|
|
|
@ -28,6 +28,7 @@
|
||||||
#include "oops/oopHandle.hpp"
|
#include "oops/oopHandle.hpp"
|
||||||
#include "runtime/handles.hpp"
|
#include "runtime/handles.hpp"
|
||||||
#include "runtime/signature.hpp"
|
#include "runtime/signature.hpp"
|
||||||
|
#include "utilities/vmEnums.hpp"
|
||||||
|
|
||||||
// The dictionary in each ClassLoaderData stores all loaded classes, either
|
// The dictionary in each ClassLoaderData stores all loaded classes, either
|
||||||
// initiatied by its class loader or defined by its class loader:
|
// initiatied by its class loader or defined by its class loader:
|
||||||
|
@ -463,7 +464,7 @@ public:
|
||||||
TRAPS);
|
TRAPS);
|
||||||
// for a given signature, find the internal MethodHandle method (linkTo* or invokeBasic)
|
// for a given signature, find the internal MethodHandle method (linkTo* or invokeBasic)
|
||||||
// (does not ask Java, since this is a low-level intrinsic defined by the JVM)
|
// (does not ask Java, since this is a low-level intrinsic defined by the JVM)
|
||||||
static Method* find_method_handle_intrinsic(vmIntrinsics::ID iid,
|
static Method* find_method_handle_intrinsic(vmIntrinsicID iid,
|
||||||
Symbol* signature,
|
Symbol* signature,
|
||||||
TRAPS);
|
TRAPS);
|
||||||
|
|
||||||
|
|
|
@ -27,6 +27,7 @@
|
||||||
#include "classfile/systemDictionaryShared.hpp"
|
#include "classfile/systemDictionaryShared.hpp"
|
||||||
#include "classfile/verificationType.hpp"
|
#include "classfile/verificationType.hpp"
|
||||||
#include "classfile/verifier.hpp"
|
#include "classfile/verifier.hpp"
|
||||||
|
#include "classfile/vmSymbols.hpp"
|
||||||
#include "logging/log.hpp"
|
#include "logging/log.hpp"
|
||||||
#include "oops/klass.inline.hpp"
|
#include "oops/klass.inline.hpp"
|
||||||
#include "runtime/arguments.hpp"
|
#include "runtime/arguments.hpp"
|
||||||
|
|
|
@ -566,42 +566,45 @@ static const char* vm_intrinsic_name_bodies =
|
||||||
VM_INTRINSICS_DO(VM_INTRINSIC_INITIALIZE,
|
VM_INTRINSICS_DO(VM_INTRINSIC_INITIALIZE,
|
||||||
VM_SYMBOL_IGNORE, VM_SYMBOL_IGNORE, VM_SYMBOL_IGNORE, VM_ALIAS_IGNORE);
|
VM_SYMBOL_IGNORE, VM_SYMBOL_IGNORE, VM_SYMBOL_IGNORE, VM_ALIAS_IGNORE);
|
||||||
|
|
||||||
static const char* vm_intrinsic_name_table[vmIntrinsics::ID_LIMIT];
|
static const char* vm_intrinsic_name_table[vmIntrinsics::number_of_intrinsics()];
|
||||||
static TriBoolArray<vmIntrinsics::ID_LIMIT, int> vm_intrinsic_control_words;
|
static TriBoolArray<(size_t)vmIntrinsics::number_of_intrinsics(), int> vm_intrinsic_control_words;
|
||||||
|
|
||||||
static void init_vm_intrinsic_name_table() {
|
void vmIntrinsics::init_vm_intrinsic_name_table() {
|
||||||
const char** nt = &vm_intrinsic_name_table[0];
|
const char** nt = &vm_intrinsic_name_table[0];
|
||||||
char* string = (char*) &vm_intrinsic_name_bodies[0];
|
char* string = (char*) &vm_intrinsic_name_bodies[0];
|
||||||
for (int index = vmIntrinsics::FIRST_ID; index < vmIntrinsics::ID_LIMIT; index++) {
|
|
||||||
nt[index] = string;
|
for (vmIntrinsicsIterator it = vmIntrinsicsRange.begin(); it != vmIntrinsicsRange.end(); ++it) {
|
||||||
|
vmIntrinsicID index = *it;
|
||||||
|
nt[as_int(index)] = string;
|
||||||
string += strlen(string); // skip string body
|
string += strlen(string); // skip string body
|
||||||
string += 1; // skip trailing null
|
string += 1; // skip trailing null
|
||||||
}
|
}
|
||||||
assert(!strcmp(nt[vmIntrinsics::_hashCode], "_hashCode"), "lined up");
|
assert(!strcmp(nt[as_int(vmIntrinsics::_hashCode)], "_hashCode"), "lined up");
|
||||||
nt[vmIntrinsics::_none] = "_none";
|
nt[as_int(vmIntrinsics::_none)] = "_none";
|
||||||
}
|
}
|
||||||
|
|
||||||
const char* vmIntrinsics::name_at(vmIntrinsics::ID id) {
|
const char* vmIntrinsics::name_at(vmIntrinsics::ID id) {
|
||||||
const char** nt = &vm_intrinsic_name_table[0];
|
const char** nt = &vm_intrinsic_name_table[0];
|
||||||
if (nt[_none] == NULL) {
|
if (nt[as_int(_none)] == NULL) {
|
||||||
init_vm_intrinsic_name_table();
|
init_vm_intrinsic_name_table();
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((uint)id < (uint)ID_LIMIT)
|
if (id < ID_LIMIT)
|
||||||
return vm_intrinsic_name_table[(uint)id];
|
return vm_intrinsic_name_table[as_int(id)];
|
||||||
else
|
else
|
||||||
return "(unknown intrinsic)";
|
return "(unknown intrinsic)";
|
||||||
}
|
}
|
||||||
|
|
||||||
vmIntrinsics::ID vmIntrinsics::find_id(const char* name) {
|
vmIntrinsics::ID vmIntrinsics::find_id(const char* name) {
|
||||||
const char** nt = &vm_intrinsic_name_table[0];
|
const char** nt = &vm_intrinsic_name_table[0];
|
||||||
if (nt[_none] == NULL) {
|
if (nt[as_int(_none)] == NULL) {
|
||||||
init_vm_intrinsic_name_table();
|
init_vm_intrinsic_name_table();
|
||||||
}
|
}
|
||||||
|
|
||||||
for (int index = FIRST_ID; index < ID_LIMIT; ++index) {
|
for (vmIntrinsicsIterator it = vmIntrinsicsRange.begin(); it != vmIntrinsicsRange.end(); ++it) {
|
||||||
if (0 == strcmp(name, nt[index])) {
|
vmIntrinsicID index = *it;
|
||||||
return ID_from(index);
|
if (0 == strcmp(name, nt[as_int(index)])) {
|
||||||
|
return index;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -617,12 +620,12 @@ bool vmIntrinsics::is_disabled_by_flags(vmIntrinsics::ID id) {
|
||||||
assert(id > _none && id < ID_LIMIT, "must be a VM intrinsic");
|
assert(id > _none && id < ID_LIMIT, "must be a VM intrinsic");
|
||||||
|
|
||||||
// not initialized yet, process Control/DisableIntrinsic
|
// not initialized yet, process Control/DisableIntrinsic
|
||||||
if (vm_intrinsic_control_words[_none].is_default()) {
|
if (vm_intrinsic_control_words[as_int(_none)].is_default()) {
|
||||||
for (ControlIntrinsicIter iter(ControlIntrinsic); *iter != NULL; ++iter) {
|
for (ControlIntrinsicIter iter(ControlIntrinsic); *iter != NULL; ++iter) {
|
||||||
vmIntrinsics::ID id = vmIntrinsics::find_id(*iter);
|
vmIntrinsics::ID id = vmIntrinsics::find_id(*iter);
|
||||||
|
|
||||||
if (id != vmIntrinsics::_none) {
|
if (id != vmIntrinsics::_none) {
|
||||||
vm_intrinsic_control_words[id] = iter.is_enabled() && !disabled_by_jvm_flags(id);
|
vm_intrinsic_control_words[as_int(id)] = iter.is_enabled() && !disabled_by_jvm_flags(id);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -631,17 +634,17 @@ bool vmIntrinsics::is_disabled_by_flags(vmIntrinsics::ID id) {
|
||||||
vmIntrinsics::ID id = vmIntrinsics::find_id(*iter);
|
vmIntrinsics::ID id = vmIntrinsics::find_id(*iter);
|
||||||
|
|
||||||
if (id != vmIntrinsics::_none) {
|
if (id != vmIntrinsics::_none) {
|
||||||
vm_intrinsic_control_words[id] = false;
|
vm_intrinsic_control_words[as_int(id)] = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
vm_intrinsic_control_words[_none] = true;
|
vm_intrinsic_control_words[as_int(_none)] = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
TriBool b = vm_intrinsic_control_words[id];
|
TriBool b = vm_intrinsic_control_words[as_int(id)];
|
||||||
if (b.is_default()) {
|
if (b.is_default()) {
|
||||||
// unknown yet, query and cache it
|
// unknown yet, query and cache it
|
||||||
b = vm_intrinsic_control_words[id] = !disabled_by_jvm_flags(id);
|
b = vm_intrinsic_control_words[as_int(id)] = !disabled_by_jvm_flags(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
return !b;
|
return !b;
|
||||||
|
@ -706,18 +709,18 @@ const char* vmIntrinsics::short_name_as_C_string(vmIntrinsics::ID id, char* buf,
|
||||||
#define ID4(x, y, z, f) ((ID3(x, y, z) << vmIntrinsics::log2_FLAG_LIMIT) | (jlong) (f))
|
#define ID4(x, y, z, f) ((ID3(x, y, z) << vmIntrinsics::log2_FLAG_LIMIT) | (jlong) (f))
|
||||||
|
|
||||||
#ifndef PRODUCT
|
#ifndef PRODUCT
|
||||||
static const jlong intrinsic_info_array[vmIntrinsics::ID_LIMIT+1] = {
|
static const jlong intrinsic_info_array[vmIntrinsics::number_of_intrinsics()+1] = {
|
||||||
#define VM_INTRINSIC_INFO(ignore_id, klass, name, sig, fcode) \
|
#define VM_INTRINSIC_INFO(ignore_id, klass, name, sig, fcode) \
|
||||||
ID4(SID_ENUM(klass), SID_ENUM(name), SID_ENUM(sig), vmIntrinsics::fcode),
|
ID4(SID_ENUM(klass), SID_ENUM(name), SID_ENUM(sig), vmIntrinsics::fcode),
|
||||||
|
|
||||||
0, VM_INTRINSICS_DO(VM_INTRINSIC_INFO,
|
0, VM_INTRINSICS_DO(VM_INTRINSIC_INFO,
|
||||||
VM_SYMBOL_IGNORE, VM_SYMBOL_IGNORE, VM_SYMBOL_IGNORE, VM_ALIAS_IGNORE)
|
VM_SYMBOL_IGNORE, VM_SYMBOL_IGNORE, VM_SYMBOL_IGNORE, VM_ALIAS_IGNORE)
|
||||||
0
|
0
|
||||||
#undef VM_INTRINSIC_INFO
|
#undef VM_INTRINSIC_INFO
|
||||||
};
|
};
|
||||||
|
|
||||||
inline jlong intrinsic_info(vmIntrinsics::ID id) {
|
inline jlong intrinsic_info(vmIntrinsics::ID id) {
|
||||||
return intrinsic_info_array[vmIntrinsics::ID_from((int)id)];
|
return intrinsic_info_array[vmIntrinsics::as_int(id)];
|
||||||
}
|
}
|
||||||
|
|
||||||
vmSymbolID vmIntrinsics::class_for(vmIntrinsics::ID id) {
|
vmSymbolID vmIntrinsics::class_for(vmIntrinsics::ID id) {
|
||||||
|
|
|
@ -28,6 +28,7 @@
|
||||||
#include "jfr/support/jfrIntrinsics.hpp"
|
#include "jfr/support/jfrIntrinsics.hpp"
|
||||||
#include "memory/allStatic.hpp"
|
#include "memory/allStatic.hpp"
|
||||||
#include "utilities/globalDefinitions.hpp"
|
#include "utilities/globalDefinitions.hpp"
|
||||||
|
#include "utilities/enumIterator.hpp"
|
||||||
#include "utilities/vmEnums.hpp"
|
#include "utilities/vmEnums.hpp"
|
||||||
|
|
||||||
class Method;
|
class Method;
|
||||||
|
@ -1014,38 +1015,52 @@ class methodHandle;
|
||||||
|
|
||||||
/*end*/
|
/*end*/
|
||||||
|
|
||||||
|
#define VM_INTRINSIC_ID_ENUM(id, klass, name, sig, flags) id,
|
||||||
|
#define VM_INTRINSICS_CONST(id, klass, name, sig, flags) static const vmIntrinsicID id = vmIntrinsicID::id;
|
||||||
|
#define __IGNORE_CLASS(id, name) /*ignored*/
|
||||||
|
#define __IGNORE_NAME(id, name) /*ignored*/
|
||||||
|
#define __IGNORE_SIGNATURE(id, name) /*ignored*/
|
||||||
|
#define __IGNORE_ALIAS(id, name) /*ignored*/
|
||||||
|
|
||||||
// VM Intrinsic ID's uniquely identify some very special methods
|
// VM Intrinsic ID's uniquely identify some very special methods
|
||||||
|
enum class vmIntrinsicID : int {
|
||||||
|
_none = 0, // not an intrinsic (default answer)
|
||||||
|
|
||||||
|
VM_INTRINSICS_DO(VM_INTRINSIC_ID_ENUM,
|
||||||
|
__IGNORE_CLASS, __IGNORE_NAME, __IGNORE_SIGNATURE, __IGNORE_ALIAS)
|
||||||
|
|
||||||
|
ID_LIMIT,
|
||||||
|
LAST_COMPILER_INLINE = _VectorScatterOp,
|
||||||
|
FIRST_MH_SIG_POLY = _invokeGeneric,
|
||||||
|
FIRST_MH_STATIC = _linkToVirtual,
|
||||||
|
LAST_MH_SIG_POLY = _linkToNative,
|
||||||
|
|
||||||
|
FIRST_ID = _none + 1,
|
||||||
|
LAST_ID = ID_LIMIT - 1,
|
||||||
|
};
|
||||||
|
|
||||||
|
ENUMERATOR_RANGE(vmIntrinsicID, vmIntrinsicID::FIRST_ID, vmIntrinsicID::LAST_ID)
|
||||||
|
constexpr EnumRange<vmIntrinsicID> vmIntrinsicsRange; // the default range of all valid vmIntrinsicIDs
|
||||||
|
using vmIntrinsicsIterator = EnumIterator<vmIntrinsicID>; // convenience
|
||||||
|
|
||||||
class vmIntrinsics : AllStatic {
|
class vmIntrinsics : AllStatic {
|
||||||
friend class vmSymbols;
|
friend class vmSymbols;
|
||||||
friend class ciObjectFactory;
|
friend class ciObjectFactory;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
// Accessing
|
typedef vmIntrinsicID ID;
|
||||||
enum ID {
|
|
||||||
_none = 0, // not an intrinsic (default answer)
|
|
||||||
|
|
||||||
#define VM_INTRINSIC_ENUM(id, klass, name, sig, flags) id,
|
// Convenient access of vmIntrinsicID::FOO as vmIntrinsics::FOO
|
||||||
#define __IGNORE_CLASS(id, name) /*ignored*/
|
static const ID _none = vmIntrinsicID::_none;
|
||||||
#define __IGNORE_NAME(id, name) /*ignored*/
|
static const ID ID_LIMIT = vmIntrinsicID::ID_LIMIT;
|
||||||
#define __IGNORE_SIGNATURE(id, name) /*ignored*/
|
static const ID LAST_COMPILER_INLINE = vmIntrinsicID::LAST_COMPILER_INLINE;
|
||||||
#define __IGNORE_ALIAS(id, name) /*ignored*/
|
static const ID FIRST_MH_SIG_POLY = vmIntrinsicID::FIRST_MH_SIG_POLY;
|
||||||
|
static const ID FIRST_MH_STATIC = vmIntrinsicID::FIRST_MH_STATIC;
|
||||||
|
static const ID LAST_MH_SIG_POLY = vmIntrinsicID::LAST_MH_SIG_POLY;
|
||||||
|
static const ID FIRST_ID = vmIntrinsicID::FIRST_ID;
|
||||||
|
|
||||||
VM_INTRINSICS_DO(VM_INTRINSIC_ENUM,
|
VM_INTRINSICS_DO(VM_INTRINSICS_CONST,
|
||||||
__IGNORE_CLASS, __IGNORE_NAME, __IGNORE_SIGNATURE, __IGNORE_ALIAS)
|
__IGNORE_CLASS, __IGNORE_NAME, __IGNORE_SIGNATURE, __IGNORE_ALIAS)
|
||||||
#undef VM_INTRINSIC_ENUM
|
|
||||||
#undef __IGNORE_CLASS
|
|
||||||
#undef __IGNORE_NAME
|
|
||||||
#undef __IGNORE_SIGNATURE
|
|
||||||
#undef __IGNORE_ALIAS
|
|
||||||
|
|
||||||
ID_LIMIT,
|
|
||||||
LAST_COMPILER_INLINE = _VectorScatterOp,
|
|
||||||
FIRST_MH_SIG_POLY = _invokeGeneric,
|
|
||||||
FIRST_MH_STATIC = _linkToVirtual,
|
|
||||||
LAST_MH_SIG_POLY = _linkToNative,
|
|
||||||
|
|
||||||
FIRST_ID = _none + 1
|
|
||||||
};
|
|
||||||
|
|
||||||
enum Flags {
|
enum Flags {
|
||||||
// AccessFlags syndromes relevant to intrinsics.
|
// AccessFlags syndromes relevant to intrinsics.
|
||||||
|
@ -1062,11 +1077,32 @@ class vmIntrinsics : AllStatic {
|
||||||
log2_FLAG_LIMIT = 3 // checked by an assert at start-up
|
log2_FLAG_LIMIT = 3 // checked by an assert at start-up
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
// Convert an arbitrary vmIntrinsicID to int (checks validity):
|
||||||
|
// vmIntrinsicID x = ...; int n = vmIntrinsics::as_int(x);
|
||||||
|
// Convert a known vmIntrinsicID to int (no need for validity check):
|
||||||
|
// int n = static_cast<int>(vmIntrinsicID::_invokeGeneric);
|
||||||
|
static constexpr int as_int(vmIntrinsicID id) {
|
||||||
|
assert(is_valid_id(id), "must be");
|
||||||
|
return static_cast<int>(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
static constexpr int number_of_intrinsics() {
|
||||||
|
return static_cast<int>(ID_LIMIT);
|
||||||
|
}
|
||||||
|
|
||||||
public:
|
public:
|
||||||
static ID ID_from(int raw_id) {
|
static constexpr bool is_valid_id(int raw_id) {
|
||||||
assert(raw_id >= (int)_none && raw_id < (int)ID_LIMIT,
|
return (raw_id >= static_cast<int>(_none) && raw_id < static_cast<int>(ID_LIMIT));
|
||||||
"must be a valid intrinsic ID");
|
}
|
||||||
return (ID)raw_id;
|
|
||||||
|
static constexpr bool is_valid_id(ID id) {
|
||||||
|
return is_valid_id(static_cast<int>(id));
|
||||||
|
}
|
||||||
|
|
||||||
|
static constexpr ID ID_from(int raw_id) {
|
||||||
|
assert(is_valid_id(raw_id), "must be a valid intrinsic ID");
|
||||||
|
return static_cast<ID>(raw_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
static const char* name_at(ID id);
|
static const char* name_at(ID id);
|
||||||
|
@ -1079,6 +1115,7 @@ private:
|
||||||
|
|
||||||
// check if the intrinsic is disabled by course-grained flags.
|
// check if the intrinsic is disabled by course-grained flags.
|
||||||
static bool disabled_by_jvm_flags(vmIntrinsics::ID id);
|
static bool disabled_by_jvm_flags(vmIntrinsics::ID id);
|
||||||
|
static void init_vm_intrinsic_name_table();
|
||||||
public:
|
public:
|
||||||
static ID find_id(const char* name);
|
static ID find_id(const char* name);
|
||||||
// Given a method's class, name, signature, and access flags, report its ID.
|
// Given a method's class, name, signature, and access flags, report its ID.
|
||||||
|
@ -1144,4 +1181,11 @@ public:
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#undef VM_INTRINSIC_ENUM
|
||||||
|
#undef VM_INTRINSICS_CONST
|
||||||
|
#undef __IGNORE_CLASS
|
||||||
|
#undef __IGNORE_NAME
|
||||||
|
#undef __IGNORE_SIGNATURE
|
||||||
|
#undef __IGNORE_ALIAS
|
||||||
|
|
||||||
#endif // SHARE_CLASSFILE_VMINTRINSICS_HPP
|
#endif // SHARE_CLASSFILE_VMINTRINSICS_HPP
|
||||||
|
|
|
@ -241,7 +241,7 @@ void DirectiveSet::init_control_intrinsic() {
|
||||||
vmIntrinsics::ID id = vmIntrinsics::find_id(*iter);
|
vmIntrinsics::ID id = vmIntrinsics::find_id(*iter);
|
||||||
|
|
||||||
if (id != vmIntrinsics::_none) {
|
if (id != vmIntrinsics::_none) {
|
||||||
_intrinsic_control_words[id] = iter.is_enabled();
|
_intrinsic_control_words[vmIntrinsics::as_int(id)] = iter.is_enabled();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -250,7 +250,7 @@ void DirectiveSet::init_control_intrinsic() {
|
||||||
vmIntrinsics::ID id = vmIntrinsics::find_id(*iter);
|
vmIntrinsics::ID id = vmIntrinsics::find_id(*iter);
|
||||||
|
|
||||||
if (id != vmIntrinsics::_none) {
|
if (id != vmIntrinsics::_none) {
|
||||||
_intrinsic_control_words[id] = false;
|
_intrinsic_control_words[vmIntrinsics::as_int(id)] = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -380,7 +380,7 @@ DirectiveSet* DirectiveSet::compilecommand_compatibility_init(const methodHandle
|
||||||
while (*iter != NULL) {
|
while (*iter != NULL) {
|
||||||
vmIntrinsics::ID id = vmIntrinsics::find_id(*iter);
|
vmIntrinsics::ID id = vmIntrinsics::find_id(*iter);
|
||||||
if (id != vmIntrinsics::_none) {
|
if (id != vmIntrinsics::_none) {
|
||||||
set.cloned()->_intrinsic_control_words[id] = iter.is_enabled();
|
set.cloned()->_intrinsic_control_words[vmIntrinsics::as_int(id)] = iter.is_enabled();
|
||||||
}
|
}
|
||||||
|
|
||||||
++iter;
|
++iter;
|
||||||
|
@ -400,7 +400,7 @@ DirectiveSet* DirectiveSet::compilecommand_compatibility_init(const methodHandle
|
||||||
while (*iter != NULL) {
|
while (*iter != NULL) {
|
||||||
vmIntrinsics::ID id = vmIntrinsics::find_id(*iter);
|
vmIntrinsics::ID id = vmIntrinsics::find_id(*iter);
|
||||||
if (id != vmIntrinsics::_none) {
|
if (id != vmIntrinsics::_none) {
|
||||||
set.cloned()->_intrinsic_control_words[id] = false;
|
set.cloned()->_intrinsic_control_words[vmIntrinsics::as_int(id)] = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
++iter;
|
++iter;
|
||||||
|
@ -499,7 +499,7 @@ bool DirectiveSet::is_intrinsic_disabled(const methodHandle& method) {
|
||||||
vmIntrinsics::ID id = method->intrinsic_id();
|
vmIntrinsics::ID id = method->intrinsic_id();
|
||||||
assert(id > vmIntrinsics::_none && id < vmIntrinsics::ID_LIMIT, "invalid intrinsic_id!");
|
assert(id > vmIntrinsics::_none && id < vmIntrinsics::ID_LIMIT, "invalid intrinsic_id!");
|
||||||
|
|
||||||
TriBool b = _intrinsic_control_words[id];
|
TriBool b = _intrinsic_control_words[vmIntrinsics::as_int(id)];
|
||||||
if (b.is_default()) {
|
if (b.is_default()) {
|
||||||
return false; // if unset, every intrinsic is enabled.
|
return false; // if unset, every intrinsic is enabled.
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -102,7 +102,7 @@ class DirectiveSet : public CHeapObj<mtCompiler> {
|
||||||
private:
|
private:
|
||||||
InlineMatcher* _inlinematchers;
|
InlineMatcher* _inlinematchers;
|
||||||
CompilerDirectives* _directive;
|
CompilerDirectives* _directive;
|
||||||
TriBoolArray<vmIntrinsics::ID_LIMIT, int> _intrinsic_control_words;
|
TriBoolArray<(size_t)vmIntrinsics::number_of_intrinsics(), int> _intrinsic_control_words;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
DirectiveSet(CompilerDirectives* directive);
|
DirectiveSet(CompilerDirectives* directive);
|
||||||
|
|
|
@ -24,6 +24,7 @@
|
||||||
|
|
||||||
#include "precompiled.hpp"
|
#include "precompiled.hpp"
|
||||||
#include "classfile/symbolTable.hpp"
|
#include "classfile/symbolTable.hpp"
|
||||||
|
#include "classfile/vmSymbols.hpp"
|
||||||
#include "compiler/methodMatcher.hpp"
|
#include "compiler/methodMatcher.hpp"
|
||||||
#include "memory/oopFactory.hpp"
|
#include "memory/oopFactory.hpp"
|
||||||
#include "memory/resourceArea.hpp"
|
#include "memory/resourceArea.hpp"
|
||||||
|
|
|
@ -114,8 +114,9 @@ AbstractInterpreter::MethodKind AbstractInterpreter::method_kind(const methodHan
|
||||||
if (m->is_method_handle_intrinsic()) {
|
if (m->is_method_handle_intrinsic()) {
|
||||||
vmIntrinsics::ID id = m->intrinsic_id();
|
vmIntrinsics::ID id = m->intrinsic_id();
|
||||||
assert(MethodHandles::is_signature_polymorphic(id), "must match an intrinsic");
|
assert(MethodHandles::is_signature_polymorphic(id), "must match an intrinsic");
|
||||||
MethodKind kind = (MethodKind)( method_handle_invoke_FIRST +
|
MethodKind kind = (MethodKind)(method_handle_invoke_FIRST +
|
||||||
((int)id - vmIntrinsics::FIRST_MH_SIG_POLY) );
|
vmIntrinsics::as_int(id) -
|
||||||
|
static_cast<int>(vmIntrinsics::FIRST_MH_SIG_POLY));
|
||||||
assert(kind <= method_handle_invoke_LAST, "parallel enum ranges");
|
assert(kind <= method_handle_invoke_LAST, "parallel enum ranges");
|
||||||
return kind;
|
return kind;
|
||||||
}
|
}
|
||||||
|
|
|
@ -26,6 +26,7 @@
|
||||||
#define SHARE_INTERPRETER_ABSTRACTINTERPRETER_HPP
|
#define SHARE_INTERPRETER_ABSTRACTINTERPRETER_HPP
|
||||||
|
|
||||||
#include "asm/macroAssembler.hpp"
|
#include "asm/macroAssembler.hpp"
|
||||||
|
#include "classfile/vmIntrinsics.hpp"
|
||||||
#include "code/stubs.hpp"
|
#include "code/stubs.hpp"
|
||||||
#include "interpreter/bytecodes.hpp"
|
#include "interpreter/bytecodes.hpp"
|
||||||
#include "runtime/frame.hpp"
|
#include "runtime/frame.hpp"
|
||||||
|
@ -65,8 +66,8 @@ class AbstractInterpreter: AllStatic {
|
||||||
abstract, // abstract method (throws an AbstractMethodException)
|
abstract, // abstract method (throws an AbstractMethodException)
|
||||||
method_handle_invoke_FIRST, // java.lang.invoke.MethodHandles::invokeExact, etc.
|
method_handle_invoke_FIRST, // java.lang.invoke.MethodHandles::invokeExact, etc.
|
||||||
method_handle_invoke_LAST = (method_handle_invoke_FIRST
|
method_handle_invoke_LAST = (method_handle_invoke_FIRST
|
||||||
+ (vmIntrinsics::LAST_MH_SIG_POLY
|
+ (static_cast<int>(vmIntrinsics::LAST_MH_SIG_POLY)
|
||||||
- vmIntrinsics::FIRST_MH_SIG_POLY)),
|
- static_cast<int>(vmIntrinsics::FIRST_MH_SIG_POLY))),
|
||||||
java_lang_math_sin, // implementation of java.lang.Math.sin (x)
|
java_lang_math_sin, // implementation of java.lang.Math.sin (x)
|
||||||
java_lang_math_cos, // implementation of java.lang.Math.cos (x)
|
java_lang_math_cos, // implementation of java.lang.Math.cos (x)
|
||||||
java_lang_math_tan, // implementation of java.lang.Math.tan (x)
|
java_lang_math_tan, // implementation of java.lang.Math.tan (x)
|
||||||
|
@ -95,7 +96,7 @@ class AbstractInterpreter: AllStatic {
|
||||||
// Conversion from the part of the above enum to vmIntrinsics::_invokeExact, etc.
|
// Conversion from the part of the above enum to vmIntrinsics::_invokeExact, etc.
|
||||||
static vmIntrinsics::ID method_handle_intrinsic(MethodKind kind) {
|
static vmIntrinsics::ID method_handle_intrinsic(MethodKind kind) {
|
||||||
if (kind >= method_handle_invoke_FIRST && kind <= method_handle_invoke_LAST)
|
if (kind >= method_handle_invoke_FIRST && kind <= method_handle_invoke_LAST)
|
||||||
return (vmIntrinsics::ID)( vmIntrinsics::FIRST_MH_SIG_POLY + (kind - method_handle_invoke_FIRST) );
|
return vmIntrinsics::ID_from(static_cast<int>(vmIntrinsics::FIRST_MH_SIG_POLY) + (kind - method_handle_invoke_FIRST));
|
||||||
else
|
else
|
||||||
return vmIntrinsics::_none;
|
return vmIntrinsics::_none;
|
||||||
}
|
}
|
||||||
|
|
|
@ -25,6 +25,7 @@
|
||||||
|
|
||||||
#include "precompiled.hpp"
|
#include "precompiled.hpp"
|
||||||
#include "classfile/systemDictionary.hpp"
|
#include "classfile/systemDictionary.hpp"
|
||||||
|
#include "classfile/vmSymbols.hpp"
|
||||||
#include "gc/shared/gcLocker.hpp"
|
#include "gc/shared/gcLocker.hpp"
|
||||||
#include "interpreter/bytecodeUtils.hpp"
|
#include "interpreter/bytecodeUtils.hpp"
|
||||||
#include "memory/resourceArea.hpp"
|
#include "memory/resourceArea.hpp"
|
||||||
|
|
|
@ -26,6 +26,7 @@
|
||||||
#include "classfile/javaClasses.inline.hpp"
|
#include "classfile/javaClasses.inline.hpp"
|
||||||
#include "classfile/symbolTable.hpp"
|
#include "classfile/symbolTable.hpp"
|
||||||
#include "classfile/systemDictionary.hpp"
|
#include "classfile/systemDictionary.hpp"
|
||||||
|
#include "classfile/vmSymbols.hpp"
|
||||||
#include "jfr/leakprofiler/checkpoint/objectSampleDescription.hpp"
|
#include "jfr/leakprofiler/checkpoint/objectSampleDescription.hpp"
|
||||||
#include "jfr/recorder/checkpoint/jfrCheckpointWriter.hpp"
|
#include "jfr/recorder/checkpoint/jfrCheckpointWriter.hpp"
|
||||||
#include "oops/oop.inline.hpp"
|
#include "oops/oop.inline.hpp"
|
||||||
|
|
|
@ -27,6 +27,7 @@
|
||||||
#include "classfile/javaClasses.hpp"
|
#include "classfile/javaClasses.hpp"
|
||||||
#include "classfile/symbolTable.hpp"
|
#include "classfile/symbolTable.hpp"
|
||||||
#include "classfile/systemDictionary.hpp"
|
#include "classfile/systemDictionary.hpp"
|
||||||
|
#include "classfile/vmSymbols.hpp"
|
||||||
#include "jfr/jfr.hpp"
|
#include "jfr/jfr.hpp"
|
||||||
#include "jfr/jni/jfrJavaSupport.hpp"
|
#include "jfr/jni/jfrJavaSupport.hpp"
|
||||||
#include "jfr/recorder/jfrRecorder.hpp"
|
#include "jfr/recorder/jfrRecorder.hpp"
|
||||||
|
|
|
@ -161,7 +161,8 @@ void CompilerToVM::Data::initialize(JVMCI_TRAPS) {
|
||||||
}
|
}
|
||||||
|
|
||||||
JVMCIObjectArray CompilerToVM::initialize_intrinsics(JVMCI_TRAPS) {
|
JVMCIObjectArray CompilerToVM::initialize_intrinsics(JVMCI_TRAPS) {
|
||||||
JVMCIObjectArray vmIntrinsics = JVMCIENV->new_VMIntrinsicMethod_array(vmIntrinsics::ID_LIMIT - 1, JVMCI_CHECK_NULL);
|
int len = vmIntrinsics::number_of_intrinsics() - 1; // Exclude vmIntrinsics::_none, which is 0
|
||||||
|
JVMCIObjectArray vmIntrinsics = JVMCIENV->new_VMIntrinsicMethod_array(len, JVMCI_CHECK_NULL);
|
||||||
int index = 0;
|
int index = 0;
|
||||||
vmSymbolID kls_sid = vmSymbolID::NO_SID;
|
vmSymbolID kls_sid = vmSymbolID::NO_SID;
|
||||||
JVMCIObject kls_str;
|
JVMCIObject kls_str;
|
||||||
|
@ -179,11 +180,12 @@ JVMCIObjectArray CompilerToVM::initialize_intrinsics(JVMCI_TRAPS) {
|
||||||
JVMCIENV->put_object_at(vmIntrinsics, index++, vmIntrinsicMethod); \
|
JVMCIENV->put_object_at(vmIntrinsics, index++, vmIntrinsicMethod); \
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// VM_INTRINSICS_DO does *not* iterate over vmIntrinsics::_none
|
||||||
VM_INTRINSICS_DO(VM_INTRINSIC_INFO, VM_SYMBOL_IGNORE, VM_SYMBOL_IGNORE, VM_SYMBOL_IGNORE, VM_ALIAS_IGNORE)
|
VM_INTRINSICS_DO(VM_INTRINSIC_INFO, VM_SYMBOL_IGNORE, VM_SYMBOL_IGNORE, VM_SYMBOL_IGNORE, VM_ALIAS_IGNORE)
|
||||||
#undef VM_SYMBOL_TO_STRING
|
#undef VM_SYMBOL_TO_STRING
|
||||||
#undef VM_INTRINSIC_INFO
|
#undef VM_INTRINSIC_INFO
|
||||||
assert(index == vmIntrinsics::ID_LIMIT - 1, "must be");
|
|
||||||
|
|
||||||
|
assert(index == len, "must be");
|
||||||
return vmIntrinsics;
|
return vmIntrinsics;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -24,13 +24,14 @@
|
||||||
|
|
||||||
#include "precompiled.hpp"
|
#include "precompiled.hpp"
|
||||||
#include "jvm.h"
|
#include "jvm.h"
|
||||||
|
#include "classfile/altHashing.hpp"
|
||||||
#include "classfile/classFileStream.hpp"
|
#include "classfile/classFileStream.hpp"
|
||||||
#include "classfile/classLoader.inline.hpp"
|
#include "classfile/classLoader.inline.hpp"
|
||||||
#include "classfile/classLoaderData.inline.hpp"
|
#include "classfile/classLoaderData.inline.hpp"
|
||||||
#include "classfile/classLoaderExt.hpp"
|
#include "classfile/classLoaderExt.hpp"
|
||||||
#include "classfile/symbolTable.hpp"
|
#include "classfile/symbolTable.hpp"
|
||||||
#include "classfile/systemDictionaryShared.hpp"
|
#include "classfile/systemDictionaryShared.hpp"
|
||||||
#include "classfile/altHashing.hpp"
|
#include "classfile/vmSymbols.hpp"
|
||||||
#include "logging/log.hpp"
|
#include "logging/log.hpp"
|
||||||
#include "logging/logStream.hpp"
|
#include "logging/logStream.hpp"
|
||||||
#include "logging/logMessage.hpp"
|
#include "logging/logMessage.hpp"
|
||||||
|
|
|
@ -35,6 +35,7 @@
|
||||||
#include "classfile/stringTable.hpp"
|
#include "classfile/stringTable.hpp"
|
||||||
#include "classfile/systemDictionary.hpp"
|
#include "classfile/systemDictionary.hpp"
|
||||||
#include "classfile/systemDictionaryShared.hpp"
|
#include "classfile/systemDictionaryShared.hpp"
|
||||||
|
#include "classfile/vmSymbols.hpp"
|
||||||
#include "code/codeCache.hpp"
|
#include "code/codeCache.hpp"
|
||||||
#include "interpreter/abstractInterpreter.hpp"
|
#include "interpreter/abstractInterpreter.hpp"
|
||||||
#include "interpreter/bytecodeStream.hpp"
|
#include "interpreter/bytecodeStream.hpp"
|
||||||
|
|
|
@ -23,6 +23,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "precompiled.hpp"
|
#include "precompiled.hpp"
|
||||||
|
#include "classfile/vmSymbols.hpp"
|
||||||
#include "interpreter/bytecodeStream.hpp"
|
#include "interpreter/bytecodeStream.hpp"
|
||||||
#include "logging/log.hpp"
|
#include "logging/log.hpp"
|
||||||
#include "logging/logStream.hpp"
|
#include "logging/logStream.hpp"
|
||||||
|
|
|
@ -25,6 +25,7 @@
|
||||||
#ifndef SHARE_OOPS_INSTANCEKLASS_INLINE_HPP
|
#ifndef SHARE_OOPS_INSTANCEKLASS_INLINE_HPP
|
||||||
#define SHARE_OOPS_INSTANCEKLASS_INLINE_HPP
|
#define SHARE_OOPS_INSTANCEKLASS_INLINE_HPP
|
||||||
|
|
||||||
|
#include "classfile/vmSymbols.hpp"
|
||||||
#include "memory/iterator.hpp"
|
#include "memory/iterator.hpp"
|
||||||
#include "memory/resourceArea.hpp"
|
#include "memory/resourceArea.hpp"
|
||||||
#include "oops/instanceKlass.hpp"
|
#include "oops/instanceKlass.hpp"
|
||||||
|
|
|
@ -1635,7 +1635,7 @@ vmSymbolID Method::klass_id_for_intrinsics(const Klass* holder) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void Method::init_intrinsic_id() {
|
void Method::init_intrinsic_id() {
|
||||||
assert(_intrinsic_id == vmIntrinsics::_none, "do this just once");
|
assert(_intrinsic_id == static_cast<int>(vmIntrinsics::_none), "do this just once");
|
||||||
const uintptr_t max_id_uint = right_n_bits((int)(sizeof(_intrinsic_id) * BitsPerByte));
|
const uintptr_t max_id_uint = right_n_bits((int)(sizeof(_intrinsic_id) * BitsPerByte));
|
||||||
assert((uintptr_t)vmIntrinsics::ID_LIMIT <= max_id_uint, "else fix size");
|
assert((uintptr_t)vmIntrinsics::ID_LIMIT <= max_id_uint, "else fix size");
|
||||||
assert(intrinsic_id_size_in_bytes() == sizeof(_intrinsic_id), "");
|
assert(intrinsic_id_size_in_bytes() == sizeof(_intrinsic_id), "");
|
||||||
|
@ -2362,7 +2362,7 @@ void Method::print_on(outputStream* st) const {
|
||||||
st->print_cr(" - size of params: %d", size_of_parameters());
|
st->print_cr(" - size of params: %d", size_of_parameters());
|
||||||
st->print_cr(" - method size: %d", method_size());
|
st->print_cr(" - method size: %d", method_size());
|
||||||
if (intrinsic_id() != vmIntrinsics::_none)
|
if (intrinsic_id() != vmIntrinsics::_none)
|
||||||
st->print_cr(" - intrinsic id: %d %s", intrinsic_id(), vmIntrinsics::name_at(intrinsic_id()));
|
st->print_cr(" - intrinsic id: %d %s", vmIntrinsics::as_int(intrinsic_id()), vmIntrinsics::name_at(intrinsic_id()));
|
||||||
if (highest_comp_level() != CompLevel_none)
|
if (highest_comp_level() != CompLevel_none)
|
||||||
st->print_cr(" - highest level: %d", highest_comp_level());
|
st->print_cr(" - highest level: %d", highest_comp_level());
|
||||||
st->print_cr(" - vtable index: %d", _vtable_index);
|
st->print_cr(" - vtable index: %d", _vtable_index);
|
||||||
|
|
|
@ -25,7 +25,6 @@
|
||||||
#ifndef SHARE_OOPS_METHOD_HPP
|
#ifndef SHARE_OOPS_METHOD_HPP
|
||||||
#define SHARE_OOPS_METHOD_HPP
|
#define SHARE_OOPS_METHOD_HPP
|
||||||
|
|
||||||
#include "classfile/vmSymbols.hpp"
|
|
||||||
#include "code/compressedStream.hpp"
|
#include "code/compressedStream.hpp"
|
||||||
#include "compiler/compilerDefinitions.hpp"
|
#include "compiler/compilerDefinitions.hpp"
|
||||||
#include "compiler/oopMap.hpp"
|
#include "compiler/oopMap.hpp"
|
||||||
|
@ -769,7 +768,7 @@ public:
|
||||||
bool is_method_handle_intrinsic() const; // MethodHandles::is_signature_polymorphic_intrinsic(intrinsic_id)
|
bool is_method_handle_intrinsic() const; // MethodHandles::is_signature_polymorphic_intrinsic(intrinsic_id)
|
||||||
bool is_compiled_lambda_form() const; // intrinsic_id() == vmIntrinsics::_compiledLambdaForm
|
bool is_compiled_lambda_form() const; // intrinsic_id() == vmIntrinsics::_compiledLambdaForm
|
||||||
bool has_member_arg() const; // intrinsic_id() == vmIntrinsics::_linkToSpecial, etc.
|
bool has_member_arg() const; // intrinsic_id() == vmIntrinsics::_linkToSpecial, etc.
|
||||||
static methodHandle make_method_handle_intrinsic(vmIntrinsics::ID iid, // _invokeBasic, _linkToVirtual
|
static methodHandle make_method_handle_intrinsic(vmIntrinsicID iid, // _invokeBasic, _linkToVirtual
|
||||||
Symbol* signature, //anything at all
|
Symbol* signature, //anything at all
|
||||||
TRAPS);
|
TRAPS);
|
||||||
static Klass* check_non_bcp_klass(Klass* klass);
|
static Klass* check_non_bcp_klass(Klass* klass);
|
||||||
|
@ -866,8 +865,8 @@ public:
|
||||||
jmethodID find_jmethod_id_or_null() { return method_holder()->jmethod_id_or_null(this); }
|
jmethodID find_jmethod_id_or_null() { return method_holder()->jmethod_id_or_null(this); }
|
||||||
|
|
||||||
// Support for inlining of intrinsic methods
|
// Support for inlining of intrinsic methods
|
||||||
vmIntrinsics::ID intrinsic_id() const { return (vmIntrinsics::ID) _intrinsic_id; }
|
vmIntrinsicID intrinsic_id() const { return (vmIntrinsicID) _intrinsic_id; }
|
||||||
void set_intrinsic_id(vmIntrinsics::ID id) { _intrinsic_id = (u2) id; }
|
void set_intrinsic_id(vmIntrinsicID id) { _intrinsic_id = (u2) id; }
|
||||||
|
|
||||||
// Helper routines for intrinsic_id() and vmIntrinsics::method().
|
// Helper routines for intrinsic_id() and vmIntrinsics::method().
|
||||||
void init_intrinsic_id(); // updates from _none if a match
|
void init_intrinsic_id(); // updates from _none if a match
|
||||||
|
|
|
@ -1031,7 +1031,7 @@ CallGenerator* CallGenerator::for_method_handle_inline(JVMState* jvms, ciMethod*
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
fatal("unexpected intrinsic %d: %s", iid, vmIntrinsics::name_at(iid));
|
fatal("unexpected intrinsic %d: %s", vmIntrinsics::as_int(iid), vmIntrinsics::name_at(iid));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
|
@ -169,24 +169,28 @@ CallGenerator* Compile::find_intrinsic(ciMethod* m, bool is_virtual) {
|
||||||
#ifndef PRODUCT
|
#ifndef PRODUCT
|
||||||
// statistics gathering...
|
// statistics gathering...
|
||||||
|
|
||||||
juint Compile::_intrinsic_hist_count[vmIntrinsics::ID_LIMIT] = {0};
|
juint Compile::_intrinsic_hist_count[vmIntrinsics::number_of_intrinsics()] = {0};
|
||||||
jubyte Compile::_intrinsic_hist_flags[vmIntrinsics::ID_LIMIT] = {0};
|
jubyte Compile::_intrinsic_hist_flags[vmIntrinsics::number_of_intrinsics()] = {0};
|
||||||
|
|
||||||
|
inline int as_int(vmIntrinsics::ID id) {
|
||||||
|
return vmIntrinsics::as_int(id);
|
||||||
|
}
|
||||||
|
|
||||||
bool Compile::gather_intrinsic_statistics(vmIntrinsics::ID id, bool is_virtual, int flags) {
|
bool Compile::gather_intrinsic_statistics(vmIntrinsics::ID id, bool is_virtual, int flags) {
|
||||||
assert(id > vmIntrinsics::_none && id < vmIntrinsics::ID_LIMIT, "oob");
|
assert(id > vmIntrinsics::_none && id < vmIntrinsics::ID_LIMIT, "oob");
|
||||||
int oflags = _intrinsic_hist_flags[id];
|
int oflags = _intrinsic_hist_flags[as_int(id)];
|
||||||
assert(flags != 0, "what happened?");
|
assert(flags != 0, "what happened?");
|
||||||
if (is_virtual) {
|
if (is_virtual) {
|
||||||
flags |= _intrinsic_virtual;
|
flags |= _intrinsic_virtual;
|
||||||
}
|
}
|
||||||
bool changed = (flags != oflags);
|
bool changed = (flags != oflags);
|
||||||
if ((flags & _intrinsic_worked) != 0) {
|
if ((flags & _intrinsic_worked) != 0) {
|
||||||
juint count = (_intrinsic_hist_count[id] += 1);
|
juint count = (_intrinsic_hist_count[as_int(id)] += 1);
|
||||||
if (count == 1) {
|
if (count == 1) {
|
||||||
changed = true; // first time
|
changed = true; // first time
|
||||||
}
|
}
|
||||||
// increment the overall count also:
|
// increment the overall count also:
|
||||||
_intrinsic_hist_count[vmIntrinsics::_none] += 1;
|
_intrinsic_hist_count[as_int(vmIntrinsics::_none)] += 1;
|
||||||
}
|
}
|
||||||
if (changed) {
|
if (changed) {
|
||||||
if (((oflags ^ flags) & _intrinsic_virtual) != 0) {
|
if (((oflags ^ flags) & _intrinsic_virtual) != 0) {
|
||||||
|
@ -202,10 +206,10 @@ bool Compile::gather_intrinsic_statistics(vmIntrinsics::ID id, bool is_virtual,
|
||||||
flags |= _intrinsic_both;
|
flags |= _intrinsic_both;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
_intrinsic_hist_flags[id] = (jubyte) (oflags | flags);
|
_intrinsic_hist_flags[as_int(id)] = (jubyte) (oflags | flags);
|
||||||
}
|
}
|
||||||
// update the overall flags also:
|
// update the overall flags also:
|
||||||
_intrinsic_hist_flags[vmIntrinsics::_none] |= (jubyte) flags;
|
_intrinsic_hist_flags[as_int(vmIntrinsics::_none)] |= (jubyte) flags;
|
||||||
return changed;
|
return changed;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -226,19 +230,19 @@ void Compile::print_intrinsic_statistics() {
|
||||||
ttyLocker ttyl;
|
ttyLocker ttyl;
|
||||||
if (xtty != NULL) xtty->head("statistics type='intrinsic'");
|
if (xtty != NULL) xtty->head("statistics type='intrinsic'");
|
||||||
tty->print_cr("Compiler intrinsic usage:");
|
tty->print_cr("Compiler intrinsic usage:");
|
||||||
juint total = _intrinsic_hist_count[vmIntrinsics::_none];
|
juint total = _intrinsic_hist_count[as_int(vmIntrinsics::_none)];
|
||||||
if (total == 0) total = 1; // avoid div0 in case of no successes
|
if (total == 0) total = 1; // avoid div0 in case of no successes
|
||||||
#define PRINT_STAT_LINE(name, c, f) \
|
#define PRINT_STAT_LINE(name, c, f) \
|
||||||
tty->print_cr(" %4d (%4.1f%%) %s (%s)", (int)(c), ((c) * 100.0) / total, name, f);
|
tty->print_cr(" %4d (%4.1f%%) %s (%s)", (int)(c), ((c) * 100.0) / total, name, f);
|
||||||
for (int index = 1 + (int)vmIntrinsics::_none; index < (int)vmIntrinsics::ID_LIMIT; index++) {
|
for (vmIntrinsicsIterator it = vmIntrinsicsRange.begin(); it != vmIntrinsicsRange.end(); ++it) {
|
||||||
vmIntrinsics::ID id = (vmIntrinsics::ID) index;
|
vmIntrinsicID id = *it;
|
||||||
int flags = _intrinsic_hist_flags[id];
|
int flags = _intrinsic_hist_flags[as_int(id)];
|
||||||
juint count = _intrinsic_hist_count[id];
|
juint count = _intrinsic_hist_count[as_int(id)];
|
||||||
if ((flags | count) != 0) {
|
if ((flags | count) != 0) {
|
||||||
PRINT_STAT_LINE(vmIntrinsics::name_at(id), count, format_flags(flags, flagsbuf));
|
PRINT_STAT_LINE(vmIntrinsics::name_at(id), count, format_flags(flags, flagsbuf));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
PRINT_STAT_LINE("total", total, format_flags(_intrinsic_hist_flags[vmIntrinsics::_none], flagsbuf));
|
PRINT_STAT_LINE("total", total, format_flags(_intrinsic_hist_flags[as_int(vmIntrinsics::_none)], flagsbuf));
|
||||||
if (xtty != NULL) xtty->tail("statistics");
|
if (xtty != NULL) xtty->tail("statistics");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -253,7 +257,7 @@ void Compile::print_statistics() {
|
||||||
PhaseIdealLoop::print_statistics();
|
PhaseIdealLoop::print_statistics();
|
||||||
if (xtty != NULL) xtty->tail("statistics");
|
if (xtty != NULL) xtty->tail("statistics");
|
||||||
}
|
}
|
||||||
if (_intrinsic_hist_flags[vmIntrinsics::_none] != 0) {
|
if (_intrinsic_hist_flags[as_int(vmIntrinsics::_none)] != 0) {
|
||||||
// put this under its own <statistics> element.
|
// put this under its own <statistics> element.
|
||||||
print_intrinsic_statistics();
|
print_intrinsic_statistics();
|
||||||
}
|
}
|
||||||
|
|
|
@ -1083,8 +1083,8 @@ class Compile : public Phase {
|
||||||
void register_intrinsic(CallGenerator* cg); // update fn
|
void register_intrinsic(CallGenerator* cg); // update fn
|
||||||
|
|
||||||
#ifndef PRODUCT
|
#ifndef PRODUCT
|
||||||
static juint _intrinsic_hist_count[vmIntrinsics::ID_LIMIT];
|
static juint _intrinsic_hist_count[];
|
||||||
static jubyte _intrinsic_hist_flags[vmIntrinsics::ID_LIMIT];
|
static jubyte _intrinsic_hist_flags[];
|
||||||
#endif
|
#endif
|
||||||
// Function calls made by the public function final_graph_reshaping.
|
// Function calls made by the public function final_graph_reshaping.
|
||||||
// No need to be made public as they are not called elsewhere.
|
// No need to be made public as they are not called elsewhere.
|
||||||
|
|
|
@ -673,7 +673,7 @@ bool LibraryCallKit::try_to_inline(int predicate) {
|
||||||
#ifndef PRODUCT
|
#ifndef PRODUCT
|
||||||
if ((PrintMiscellaneous && (Verbose || WizardMode)) || PrintOpto) {
|
if ((PrintMiscellaneous && (Verbose || WizardMode)) || PrintOpto) {
|
||||||
tty->print_cr("*** Warning: Unimplemented intrinsic %s(%d)",
|
tty->print_cr("*** Warning: Unimplemented intrinsic %s(%d)",
|
||||||
vmIntrinsics::name_at(intrinsic_id()), intrinsic_id());
|
vmIntrinsics::name_at(intrinsic_id()), vmIntrinsics::as_int(intrinsic_id()));
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
return false;
|
return false;
|
||||||
|
@ -709,7 +709,7 @@ Node* LibraryCallKit::try_to_predicate(int predicate) {
|
||||||
#ifndef PRODUCT
|
#ifndef PRODUCT
|
||||||
if ((PrintMiscellaneous && (Verbose || WizardMode)) || PrintOpto) {
|
if ((PrintMiscellaneous && (Verbose || WizardMode)) || PrintOpto) {
|
||||||
tty->print_cr("*** Warning: Unimplemented predicate for intrinsic %s(%d)",
|
tty->print_cr("*** Warning: Unimplemented predicate for intrinsic %s(%d)",
|
||||||
vmIntrinsics::name_at(intrinsic_id()), intrinsic_id());
|
vmIntrinsics::name_at(intrinsic_id()), vmIntrinsics::as_int(intrinsic_id()));
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
Node* slow_ctl = control();
|
Node* slow_ctl = control();
|
||||||
|
|
|
@ -113,7 +113,7 @@ class LibraryCallKit : public GraphKit {
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void fatal_unexpected_iid(vmIntrinsics::ID iid) {
|
void fatal_unexpected_iid(vmIntrinsics::ID iid) {
|
||||||
fatal("unexpected intrinsic %d: %s", iid, vmIntrinsics::name_at(iid));
|
fatal("unexpected intrinsic %d: %s", vmIntrinsics::as_int(iid), vmIntrinsics::name_at(iid));
|
||||||
}
|
}
|
||||||
|
|
||||||
void set_result(Node* n) { assert(_result == NULL, "only set once"); _result = n; }
|
void set_result(Node* n) { assert(_result == NULL, "only set once"); _result = n; }
|
||||||
|
|
|
@ -25,6 +25,7 @@
|
||||||
#include "foreign_globals.hpp"
|
#include "foreign_globals.hpp"
|
||||||
#include "classfile/symbolTable.hpp"
|
#include "classfile/symbolTable.hpp"
|
||||||
#include "classfile/systemDictionary.hpp"
|
#include "classfile/systemDictionary.hpp"
|
||||||
|
#include "classfile/vmSymbols.hpp"
|
||||||
#include "memory/resourceArea.hpp"
|
#include "memory/resourceArea.hpp"
|
||||||
#include "runtime/fieldDescriptor.hpp"
|
#include "runtime/fieldDescriptor.hpp"
|
||||||
#include "runtime/fieldDescriptor.inline.hpp"
|
#include "runtime/fieldDescriptor.inline.hpp"
|
||||||
|
|
|
@ -419,7 +419,7 @@ bool MethodHandles::is_method_handle_invoke_name(Klass* klass, Symbol* name) {
|
||||||
|
|
||||||
|
|
||||||
Symbol* MethodHandles::signature_polymorphic_intrinsic_name(vmIntrinsics::ID iid) {
|
Symbol* MethodHandles::signature_polymorphic_intrinsic_name(vmIntrinsics::ID iid) {
|
||||||
assert(is_signature_polymorphic_intrinsic(iid), "%d %s", iid, vmIntrinsics::name_at(iid));
|
assert(is_signature_polymorphic_intrinsic(iid), "%d %s", vmIntrinsics::as_int(iid), vmIntrinsics::name_at(iid));
|
||||||
switch (iid) {
|
switch (iid) {
|
||||||
case vmIntrinsics::_invokeBasic: return vmSymbols::invokeBasic_name();
|
case vmIntrinsics::_invokeBasic: return vmSymbols::invokeBasic_name();
|
||||||
case vmIntrinsics::_linkToVirtual: return vmSymbols::linkToVirtual_name();
|
case vmIntrinsics::_linkToVirtual: return vmSymbols::linkToVirtual_name();
|
||||||
|
@ -428,7 +428,7 @@ Symbol* MethodHandles::signature_polymorphic_intrinsic_name(vmIntrinsics::ID iid
|
||||||
case vmIntrinsics::_linkToInterface: return vmSymbols::linkToInterface_name();
|
case vmIntrinsics::_linkToInterface: return vmSymbols::linkToInterface_name();
|
||||||
case vmIntrinsics::_linkToNative: return vmSymbols::linkToNative_name();
|
case vmIntrinsics::_linkToNative: return vmSymbols::linkToNative_name();
|
||||||
default:
|
default:
|
||||||
fatal("unexpected intrinsic id: %d %s", iid, vmIntrinsics::name_at(iid));
|
fatal("unexpected intrinsic id: %d %s", vmIntrinsics::as_int(iid), vmIntrinsics::name_at(iid));
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -455,7 +455,7 @@ int MethodHandles::signature_polymorphic_intrinsic_ref_kind(vmIntrinsics::ID iid
|
||||||
case vmIntrinsics::_linkToSpecial: return JVM_REF_invokeSpecial;
|
case vmIntrinsics::_linkToSpecial: return JVM_REF_invokeSpecial;
|
||||||
case vmIntrinsics::_linkToInterface: return JVM_REF_invokeInterface;
|
case vmIntrinsics::_linkToInterface: return JVM_REF_invokeInterface;
|
||||||
default:
|
default:
|
||||||
fatal("unexpected intrinsic id: %d %s", iid, vmIntrinsics::name_at(iid));
|
fatal("unexpected intrinsic id: %d %s", vmIntrinsics::as_int(iid), vmIntrinsics::name_at(iid));
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -26,6 +26,7 @@
|
||||||
#include "jni.h"
|
#include "jni.h"
|
||||||
#include "jvm.h"
|
#include "jvm.h"
|
||||||
#include "classfile/javaClasses.inline.hpp"
|
#include "classfile/javaClasses.inline.hpp"
|
||||||
|
#include "classfile/vmSymbols.hpp"
|
||||||
#include "code/location.hpp"
|
#include "code/location.hpp"
|
||||||
#include "prims/vectorSupport.hpp"
|
#include "prims/vectorSupport.hpp"
|
||||||
#include "runtime/fieldDescriptor.inline.hpp"
|
#include "runtime/fieldDescriptor.inline.hpp"
|
||||||
|
|
|
@ -24,6 +24,7 @@
|
||||||
|
|
||||||
#include "precompiled.hpp"
|
#include "precompiled.hpp"
|
||||||
#include "classfile/javaClasses.hpp"
|
#include "classfile/javaClasses.hpp"
|
||||||
|
#include "classfile/vmSymbols.hpp"
|
||||||
#include "memory/universe.hpp"
|
#include "memory/universe.hpp"
|
||||||
#include "runtime/interfaceSupport.inline.hpp"
|
#include "runtime/interfaceSupport.inline.hpp"
|
||||||
#include "runtime/java.hpp"
|
#include "runtime/java.hpp"
|
||||||
|
|
|
@ -25,6 +25,7 @@
|
||||||
#include "precompiled.hpp"
|
#include "precompiled.hpp"
|
||||||
#include "classfile/symbolTable.hpp"
|
#include "classfile/symbolTable.hpp"
|
||||||
#include "classfile/systemDictionary.hpp"
|
#include "classfile/systemDictionary.hpp"
|
||||||
|
#include "classfile/vmSymbols.hpp"
|
||||||
#include "memory/oopFactory.hpp"
|
#include "memory/oopFactory.hpp"
|
||||||
#include "memory/resourceArea.hpp"
|
#include "memory/resourceArea.hpp"
|
||||||
#include "memory/universe.hpp"
|
#include "memory/universe.hpp"
|
||||||
|
|
|
@ -32,6 +32,7 @@
|
||||||
enum class JavaThreadStatus : int;
|
enum class JavaThreadStatus : int;
|
||||||
enum class JVMFlagOrigin : int;
|
enum class JVMFlagOrigin : int;
|
||||||
enum JVMFlagsEnum : int;
|
enum JVMFlagsEnum : int;
|
||||||
|
enum class vmIntrinsicID : int;
|
||||||
enum class vmSymbolID : int;
|
enum class vmSymbolID : int;
|
||||||
|
|
||||||
#endif // SHARE_UTILITIES_VMENUMS_HPP
|
#endif // SHARE_UTILITIES_VMENUMS_HPP
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue