runtime.cpp revision 2797
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"
1879N/A#include "code/compiledIC.hpp"
1879N/A#include "code/icBuffer.hpp"
1879N/A#include "code/nmethod.hpp"
1879N/A#include "code/pcDesc.hpp"
1879N/A#include "code/scopeDesc.hpp"
1879N/A#include "code/vtableStubs.hpp"
1879N/A#include "compiler/compileBroker.hpp"
1879N/A#include "compiler/compilerOracle.hpp"
1879N/A#include "compiler/oopMap.hpp"
1879N/A#include "gc_implementation/g1/heapRegion.hpp"
1879N/A#include "gc_interface/collectedHeap.hpp"
1879N/A#include "interpreter/bytecode.hpp"
1879N/A#include "interpreter/interpreter.hpp"
1879N/A#include "interpreter/linkResolver.hpp"
1879N/A#include "memory/barrierSet.hpp"
1879N/A#include "memory/gcLocker.inline.hpp"
1879N/A#include "memory/oopFactory.hpp"
1879N/A#include "oops/objArrayKlass.hpp"
1879N/A#include "oops/oop.inline.hpp"
1879N/A#include "opto/addnode.hpp"
1879N/A#include "opto/callnode.hpp"
1879N/A#include "opto/cfgnode.hpp"
1879N/A#include "opto/connode.hpp"
1879N/A#include "opto/graphKit.hpp"
1879N/A#include "opto/machnode.hpp"
1879N/A#include "opto/matcher.hpp"
1879N/A#include "opto/memnode.hpp"
1879N/A#include "opto/mulnode.hpp"
1879N/A#include "opto/runtime.hpp"
1879N/A#include "opto/subnode.hpp"
1879N/A#include "runtime/fprofiler.hpp"
1879N/A#include "runtime/handles.inline.hpp"
1879N/A#include "runtime/interfaceSupport.hpp"
1879N/A#include "runtime/javaCalls.hpp"
1879N/A#include "runtime/sharedRuntime.hpp"
1879N/A#include "runtime/signature.hpp"
1879N/A#include "runtime/threadCritical.hpp"
1879N/A#include "runtime/vframe.hpp"
1879N/A#include "runtime/vframeArray.hpp"
1879N/A#include "runtime/vframe_hp.hpp"
1879N/A#include "utilities/preserveException.hpp"
1879N/A# include "adfiles/ad_x86_32.hpp"
1879N/A# include "adfiles/ad_x86_64.hpp"
1879N/A# include "adfiles/ad_sparc.hpp"
1879N/A# include "adfiles/ad_zero.hpp"
2073N/A#ifdef TARGET_ARCH_MODEL_arm
2073N/A# include "adfiles/ad_arm.hpp"
2073N/A#ifdef TARGET_ARCH_MODEL_ppc
2073N/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");
0N/A var = generate_stub(env, type_func_gen, CAST_FROM_FN_PTR(address, c_func), #var, fancy_jump, pass_tls, save_arg_regs, return_pc)
0N/A // -------------------------------------------------------------------------------------------------------------------------------
2797N/A gen(env, _new_array_nozero_Java , new_array_Type , new_array_nozero_C , 0 , true , false, false);
0N/A gen(env, _multianewarray2_Java , multianewarray2_Type , multianewarray2_C , 0 , true , false, false);
0N/A gen(env, _multianewarray3_Java , multianewarray3_Type , multianewarray3_C , 0 , true , false, false);
0N/A gen(env, _multianewarray4_Java , multianewarray4_Type , multianewarray4_C , 0 , true , false, false);
0N/A gen(env, _multianewarray5_Java , multianewarray5_Type , multianewarray5_C , 0 , true , false, false);
2630N/A gen(env, _multianewarrayN_Java , multianewarrayN_Type , multianewarrayN_C , 0 , true , false, false);
342N/A gen(env, _g1_wb_pre_Java , g1_wb_pre_Type , SharedRuntime::g1_wb_pre , 0 , false, false, false);
342N/A gen(env, _g1_wb_post_Java , g1_wb_post_Type , SharedRuntime::g1_wb_post , 0 , false, false, false);
0N/A gen(env, _complete_monitor_locking_Java , complete_monitor_enter_Type , SharedRuntime::complete_monitor_locking_C , 0 , false, false, false);
0N/A gen(env, _slow_arraycopy_Java , slow_arraycopy_Type , SharedRuntime::slow_arraycopy_C , 0 , false, false, false);
0N/A gen(env, _register_finalizer_Java , register_finalizer_Type , register_finalizer , 0 , false, false, false);
0N/A# ifdef ENABLE_ZAP_DEAD_LOCALS
0N/A gen(env, _zap_dead_Java_locals_Java , zap_dead_locals_Type , zap_dead_Java_locals_C , 0 , false, true , false );
0N/A gen(env, _zap_dead_native_locals_Java , zap_dead_locals_Type , zap_dead_native_locals_C , 0 , false, true , false );
0N/A bool save_argument_registers,
0N/A Compile C( env, gen, C_function, name, is_fancy_jump, pass_tls, save_argument_registers, return_pc );
0N/A return C.stub_entry_point();
0N/A if (!HAS_PENDING_EXCEPTION) {
0N/A if (!HAS_PENDING_EXCEPTION) {
0N/AJRT_BLOCK_ENTRY(void, OptoRuntime::new_array_C(klassOopDesc* array_type, int len, JavaThread *thread))
2797N/AJRT_BLOCK_ENTRY(void, OptoRuntime::new_array_nozero_C(klassOopDesc* array_type, int len, JavaThread *thread))
2797N/A assert(Klass::cast(array_type)->oop_is_typeArray(), "should be called only for type array");
0N/AJRT_ENTRY(void, OptoRuntime::multianewarray2_C(klassOopDesc* elem_type, int len1, int len2, JavaThread *thread))
0N/AJRT_ENTRY(void, OptoRuntime::multianewarray3_C(klassOopDesc* elem_type, int len1, int len2, int len3, JavaThread *thread))
0N/AJRT_ENTRY(void, OptoRuntime::multianewarray4_C(klassOopDesc* elem_type, int len1, int len2, int len3, int len4, JavaThread *thread))
0N/AJRT_ENTRY(void, OptoRuntime::multianewarray5_C(klassOopDesc* elem_type, int len1, int len2, int len3, int len4, int len5, JavaThread *thread))
2630N/AJRT_ENTRY(void, OptoRuntime::multianewarrayN_C(klassOopDesc* elem_type, arrayOopDesc* dims, JavaThread *thread))
0N/A# ifdef ENABLE_ZAP_DEAD_LOCALS
0N/Aenum ArrayCopyType {
0N/A if (num_size_args == 0) {
0N/A if (num_size_args == 0) {
0N/A while (num_size_args-- > 0) {
0N/A if (n->is_nmethod()) {
0N/A tty->print_cr("# Method where it happened %s.%s ", Klass::cast(method->method_holder())->name()->as_C_string(), method->name()->as_C_string());
0N/A CompilerOracle::append_comment_to_file("Null exception in compiled code resulted in the following exclude");
0N/Astatic void trace_exception(oop exception_oop, address exception_pc, const char* msg) PRODUCT_RETURN;
0N/AJRT_ENTRY_NO_ASYNC(address, OptoRuntime::handle_exception_C_helper(JavaThread* thread, nmethod* &nm))
0N/A if (TraceExceptions) {
0N/A // instead in exception handler of caller_frame.sender()
0N/A handler_address = SharedRuntime::compute_compiled_exc_handler(nm, pc, exception, force_unwind, true);
0N/A if (!force_unwind) {
0N/A assert(handler_address == SharedRuntime::compute_compiled_exc_handler(nm, pc, exception, force_unwind, true), "Must be the same");
0N/A return handler_address;
0N/A return handler_address;
0N/A assert(stub_frame.is_runtime_frame() || exception_blob()->contains(stub_frame.pc()), "sanity check");
0N/A int total_lock_count = 0;
0N/A int eliminated_lock_count = 0;
0N/A if (c->tag() == NamedCounter::LockCounter || c->tag() == NamedCounter::EliminatedLockCounter) {
0N/A if (eliminated) {
0N/A if (total_lock_count > 0) {
0N/A if (eliminated_lock_count) {
0N/ANamedCounter* OptoRuntime::new_named_counter(JVMState* youngest_jvms, NamedCounter::CounterTag tag) {
0N/A NamedCounter* c;
0N/Aint trace_exception_counter = 0;
0N/A# ifdef ENABLE_ZAP_DEAD_LOCALS
0N/A if ( !ZapDeadCompiledLocals ) return;