--- old/src/share/vm/opto/runtime.cpp 2017-04-25 16:45:38.467172982 +0200 +++ new/src/share/vm/opto/runtime.cpp 2017-04-25 16:45:38.323172987 +0200 @@ -34,7 +34,6 @@ #include "code/vtableStubs.hpp" #include "compiler/compileBroker.hpp" #include "compiler/oopMap.hpp" -#include "gc/g1/g1SATBCardTableModRefBS.hpp" #include "gc/g1/heapRegion.hpp" #include "gc/shared/barrierSet.hpp" #include "gc/shared/collectedHeap.hpp" @@ -94,8 +93,6 @@ address OptoRuntime::_multianewarray4_Java = NULL; address OptoRuntime::_multianewarray5_Java = NULL; address OptoRuntime::_multianewarrayN_Java = NULL; -address OptoRuntime::_g1_wb_pre_Java = NULL; -address OptoRuntime::_g1_wb_post_Java = NULL; address OptoRuntime::_vtable_must_compile_Java = NULL; address OptoRuntime::_complete_monitor_locking_Java = NULL; address OptoRuntime::_monitor_notify_Java = NULL; @@ -140,8 +137,6 @@ 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, _g1_wb_pre_Java , g1_wb_pre_Type , SharedRuntime::g1_wb_pre , 0 , false, false, false); - gen(env, _g1_wb_post_Java , g1_wb_post_Type , SharedRuntime::g1_wb_post , 0 , false, false, false); gen(env, _complete_monitor_locking_Java , complete_monitor_enter_Type , SharedRuntime::complete_monitor_locking_C, 0, false, false, false); gen(env, _monitor_notify_Java , monitor_notify_Type , monitor_notify_C , 0 , false, false, false); gen(env, _monitor_notifyAll_Java , monitor_notify_Type , monitor_notifyAll_C , 0 , false, false, false); @@ -194,23 +189,6 @@ // We failed the fast-path allocation. Now we need to do a scavenge or GC // and try allocation again. -void OptoRuntime::new_store_pre_barrier(JavaThread* thread) { - // After any safepoint, just before going back to compiled code, - // we inform the GC that we will be doing initializing writes to - // this object in the future without emitting card-marks, so - // GC may take any compensating steps. - // NOTE: Keep this code consistent with GraphKit::store_barrier. - - oop new_obj = thread->vm_result(); - if (new_obj == NULL) return; - - assert(Universe::heap()->can_elide_tlab_store_barriers(), - "compiler must check this first"); - // GC may decide to give back a safer copy of new_obj. - new_obj = Universe::heap()->new_store_pre_barrier(thread, new_obj); - thread->set_vm_result(new_obj); -} - // object allocation JRT_BLOCK_ENTRY(void, OptoRuntime::new_instance_C(Klass* klass, JavaThread* thread)) JRT_BLOCK; @@ -244,10 +222,8 @@ deoptimize_caller_frame(thread, HAS_PENDING_EXCEPTION); JRT_BLOCK_END; - if (GraphKit::use_ReduceInitialCardMarks()) { - // inform GC that we won't do card marks for initializing writes. - new_store_pre_barrier(thread); - } + // inform GC that we won't do card marks for initializing writes. + SharedRuntime::on_slowpath_allocation(thread); JRT_END @@ -284,10 +260,8 @@ thread->set_vm_result(result); JRT_BLOCK_END; - if (GraphKit::use_ReduceInitialCardMarks()) { - // inform GC that we won't do card marks for initializing writes. - new_store_pre_barrier(thread); - } + // inform GC that we won't do card marks for initializing writes. + SharedRuntime::on_slowpath_allocation(thread); JRT_END // array allocation without zeroing @@ -314,10 +288,9 @@ thread->set_vm_result(result); JRT_BLOCK_END; - if (GraphKit::use_ReduceInitialCardMarks()) { - // inform GC that we won't do card marks for initializing writes. - new_store_pre_barrier(thread); - } + + // inform GC that we won't do card marks for initializing writes. + SharedRuntime::on_slowpath_allocation(thread); oop result = thread->vm_result(); if ((len > 0) && (result != NULL) && @@ -562,33 +535,6 @@ return TypeFunc::make(domain, range); } - -const TypeFunc *OptoRuntime::g1_wb_pre_Type() { - const Type **fields = TypeTuple::fields(2); - fields[TypeFunc::Parms+0] = TypeInstPtr::NOTNULL; // original field value - fields[TypeFunc::Parms+1] = TypeRawPtr::NOTNULL; // thread - const TypeTuple *domain = TypeTuple::make(TypeFunc::Parms+2, fields); - - // create result type (range) - fields = TypeTuple::fields(0); - const TypeTuple *range = TypeTuple::make(TypeFunc::Parms+0, fields); - - return TypeFunc::make(domain, range); -} - -const TypeFunc *OptoRuntime::g1_wb_post_Type() { - - const Type **fields = TypeTuple::fields(2); - fields[TypeFunc::Parms+0] = TypeRawPtr::NOTNULL; // Card addr - fields[TypeFunc::Parms+1] = TypeRawPtr::NOTNULL; // thread - const TypeTuple *domain = TypeTuple::make(TypeFunc::Parms+2, fields); - - // create result type (range) - fields = TypeTuple::fields(0); - const TypeTuple *range = TypeTuple::make(TypeFunc::Parms, fields); - - return TypeFunc::make(domain, range); -} const TypeFunc *OptoRuntime::uncommon_trap_Type() { // create input type (domain)