runtime.cpp revision 2630
1472N/A * or visit www.oracle.com if you need additional information or have any
1879N/A#include "precompiled.hpp"
1879N/A#include "classfile/systemDictionary.hpp"
1879N/A#include "classfile/vmSymbols.hpp"
0N/A#include "code/compiledIC.hpp"
0N/A#include "code/icBuffer.hpp"
0N/A#include "code/nmethod.hpp"
0N/A#include "code/pcDesc.hpp"
0N/A#include "code/scopeDesc.hpp"
0N/A#include "code/vtableStubs.hpp"
0N/A#include "compiler/compileBroker.hpp"
0N/A#include "compiler/compilerOracle.hpp"
0N/A#include "compiler/oopMap.hpp"
0N/A#include "gc_implementation/g1/g1SATBCardTableModRefBS.hpp"
0N/A#include "gc_implementation/g1/heapRegion.hpp"
0N/A#include "gc_interface/collectedHeap.hpp"
0N/A#include "interpreter/bytecode.hpp"
0N/A#include "interpreter/interpreter.hpp"
0N/A#include "interpreter/linkResolver.hpp"
0N/A#include "memory/barrierSet.hpp"
0N/A#include "memory/gcLocker.inline.hpp"
0N/A#include "memory/oopFactory.hpp"
0N/A#include "oops/objArrayKlass.hpp"
0N/A#include "oops/oop.inline.hpp"
0N/A#include "opto/addnode.hpp"
0N/A#include "opto/callnode.hpp"
0N/A#include "opto/cfgnode.hpp"
0N/A#include "opto/connode.hpp"
0N/A#include "opto/graphKit.hpp"
0N/A#include "opto/machnode.hpp"
0N/A#include "opto/matcher.hpp"
610N/A#include "opto/memnode.hpp"
610N/A#include "opto/mulnode.hpp"
4185N/A#include "opto/runtime.hpp"
0N/A#include "opto/subnode.hpp"
0N/A#include "runtime/fprofiler.hpp"
0N/A#include "runtime/handles.inline.hpp"
0N/A#include "runtime/interfaceSupport.hpp"
0N/A#include "runtime/javaCalls.hpp"
0N/A#include "runtime/sharedRuntime.hpp"
0N/A#include "runtime/signature.hpp"
0N/A#include "runtime/threadCritical.hpp"
0N/A#include "runtime/vframe.hpp"
0N/A#include "runtime/vframeArray.hpp"
0N/A#include "runtime/vframe_hp.hpp"
48N/A#include "utilities/preserveException.hpp"
0N/A#ifdef TARGET_ARCH_MODEL_x86_32
0N/A# include "adfiles/ad_x86_32.hpp"
0N/A#ifdef TARGET_ARCH_MODEL_x86_64
0N/A# include "adfiles/ad_x86_64.hpp"
0N/A#ifdef TARGET_ARCH_MODEL_sparc
0N/A# include "adfiles/ad_sparc.hpp"
0N/A#ifdef TARGET_ARCH_MODEL_zero
0N/A# include "adfiles/ad_zero.hpp"
0N/A#ifdef TARGET_ARCH_MODEL_arm
0N/A# include "adfiles/ad_arm.hpp"
4185N/A#ifdef TARGET_ARCH_MODEL_ppc
4185N/A# include "adfiles/ad_ppc.hpp"
0N/A# ifdef ENABLE_ZAP_DEAD_LOCALS
0N/A assert(thread->last_frame().is_runtime_frame(), "cannot call runtime directly from compiled code");
var = generate_stub(env, type_func_gen, CAST_FROM_FN_PTR(address, c_func), #var, fancy_jump, pass_tls, save_arg_regs, return_pc)
// -------------------------------------------------------------------------------------------------------------------------------
gen(env, _multianewarray2_Java , multianewarray2_Type , multianewarray2_C , 0 , true , false, false);
gen(env, _multianewarray3_Java , multianewarray3_Type , multianewarray3_C , 0 , true , false, false);
gen(env, _multianewarray4_Java , multianewarray4_Type , multianewarray4_C , 0 , true , false, false);
gen(env, _multianewarray5_Java , multianewarray5_Type , multianewarray5_C , 0 , true , false, false);
gen(env, _multianewarrayN_Java , multianewarrayN_Type , multianewarrayN_C , 0 , true , false, false);
gen(env, _complete_monitor_locking_Java , complete_monitor_enter_Type , SharedRuntime::complete_monitor_locking_C , 0 , false, false, false);
gen(env, _slow_arraycopy_Java , slow_arraycopy_Type , SharedRuntime::slow_arraycopy_C , 0 , false, false, false);
gen(env, _register_finalizer_Java , register_finalizer_Type , register_finalizer , 0 , false, false, false);
# ifdef ENABLE_ZAP_DEAD_LOCALS
gen(env, _zap_dead_Java_locals_Java , zap_dead_locals_Type , zap_dead_Java_locals_C , 0 , false, true , false );
gen(env, _zap_dead_native_locals_Java , zap_dead_locals_Type , zap_dead_native_locals_C , 0 , false, true , false );
bool pass_tls,
bool save_argument_registers,
bool return_pc ) {
Compile C( env, gen, C_function, name, is_fancy_jump, pass_tls, save_argument_registers, return_pc );
return C.stub_entry_point();
#ifndef PRODUCT
#ifndef PRODUCT
if (!HAS_PENDING_EXCEPTION) {
if (!HAS_PENDING_EXCEPTION) {
JRT_BLOCK_ENTRY(void, OptoRuntime::new_array_C(klassOopDesc* array_type, int len, JavaThread *thread))
#ifndef PRODUCT
JRT_ENTRY(void, OptoRuntime::multianewarray2_C(klassOopDesc* elem_type, int len1, int len2, JavaThread *thread))
#ifndef PRODUCT
JRT_ENTRY(void, OptoRuntime::multianewarray3_C(klassOopDesc* elem_type, int len1, int len2, int len3, JavaThread *thread))
#ifndef PRODUCT
JRT_ENTRY(void, OptoRuntime::multianewarray4_C(klassOopDesc* elem_type, int len1, int len2, int len3, int len4, JavaThread *thread))
#ifndef PRODUCT
JRT_ENTRY(void, OptoRuntime::multianewarray5_C(klassOopDesc* elem_type, int len1, int len2, int len3, int len4, int len5, JavaThread *thread))
#ifndef PRODUCT
JRT_ENTRY(void, OptoRuntime::multianewarrayN_C(klassOopDesc* elem_type, arrayOopDesc* dims, JavaThread *thread))
# ifdef ENABLE_ZAP_DEAD_LOCALS
enum ArrayCopyType {
if (num_size_args == 0) {
if (num_size_args == 0) {
while (num_size_args-- > 0) {
if (retcnt == 0)
} else if (row_recv == 0) {
if (n != NULL) {
if (n->is_nmethod()) {
tty->print_cr("# Method where it happened %s.%s ", Klass::cast(method->method_holder())->name()->as_C_string(), method->name()->as_C_string());
CompilerOracle::append_comment_to_file("Null exception in compiled code resulted in the following exclude");
n->print();
static void trace_exception(oop exception_oop, address exception_pc, const char* msg) PRODUCT_RETURN;
JRT_ENTRY_NO_ASYNC(address, OptoRuntime::handle_exception_C_helper(JavaThread* thread, nmethod* &nm))
if (TraceExceptions) {
#ifdef ASSERT
// instead in exception handler of caller_frame.sender()
bool deopting = false;
deopting = true;
handler_address = SharedRuntime::compute_compiled_exc_handler(nm, pc, exception, force_unwind, true);
if (!force_unwind) {
assert(handler_address == SharedRuntime::compute_compiled_exc_handler(nm, pc, exception, force_unwind, true), "Must be the same");
return handler_address;
#ifndef PRODUCT
#ifdef ASSERT
return handler_address;
#ifndef PRODUCT
#ifdef ASSERT
if (doit) {
assert(stub_frame.is_runtime_frame() || exception_blob()->contains(stub_frame.pc()), "sanity check");
int total_lock_count = 0;
int eliminated_lock_count = 0;
if (count > 0) {
if (Verbose) {
if (eliminated) {
c = c->next();
if (total_lock_count > 0) {
if (eliminated_lock_count) {
NamedCounter* OptoRuntime::new_named_counter(JVMState* youngest_jvms, NamedCounter::CounterTag tag) {
bool first = true;
if (!first) {
first = false;
NamedCounter* c;
#ifndef PRODUCT
int trace_exception_counter = 0;
# ifdef ENABLE_ZAP_DEAD_LOCALS
if ( !ZapDeadCompiledLocals ) return;
bool skip = false;
if ( skip ) return;