< prev index next >

src/hotspot/share/opto/runtime.cpp

RFE_8195103_reduce_initial_card_marks

*** 1,7 **** /* ! * 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 * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. --- 1,7 ---- /* ! * Copyright (c) 1998, 2018, 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 * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. ***************
*** 192,218 **** //=============================allocation====================================== // 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; #ifndef PRODUCT SharedRuntime::_new_instance_ctr++; // new instance requires GC --- 192,201 ---- ***************
*** 242,255 **** } 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); ! } JRT_END // array allocation JRT_BLOCK_ENTRY(void, OptoRuntime::new_array_C(Klass* array_type, int len, JavaThread *thread)) --- 225,236 ---- } deoptimize_caller_frame(thread, HAS_PENDING_EXCEPTION); JRT_BLOCK_END; ! // inform GC that we won't do card marks for initializing writes. ! SharedRuntime::on_slowpath_allocation_exit(thread); JRT_END // array allocation JRT_BLOCK_ENTRY(void, OptoRuntime::new_array_C(Klass* array_type, int len, JavaThread *thread)) ***************
*** 282,295 **** // fetch the oop from TLS after any possible GC. deoptimize_caller_frame(thread, HAS_PENDING_EXCEPTION); 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); ! } JRT_END // array allocation without zeroing JRT_BLOCK_ENTRY(void, OptoRuntime::new_array_nozero_C(Klass* array_type, int len, JavaThread *thread)) JRT_BLOCK; --- 263,274 ---- // fetch the oop from TLS after any possible GC. deoptimize_caller_frame(thread, HAS_PENDING_EXCEPTION); thread->set_vm_result(result); JRT_BLOCK_END; ! // inform GC that we won't do card marks for initializing writes. ! SharedRuntime::on_slowpath_allocation_exit(thread); JRT_END // array allocation without zeroing JRT_BLOCK_ENTRY(void, OptoRuntime::new_array_nozero_C(Klass* array_type, int len, JavaThread *thread)) JRT_BLOCK; ***************
*** 312,325 **** // fetch the oop from TLS after any possible GC. deoptimize_caller_frame(thread, HAS_PENDING_EXCEPTION); 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); ! } oop result = thread->vm_result(); if ((len > 0) && (result != NULL) && is_deoptimized_caller_frame(thread)) { // Zero array here if the caller is deoptimized. --- 291,303 ---- // fetch the oop from TLS after any possible GC. deoptimize_caller_frame(thread, HAS_PENDING_EXCEPTION); thread->set_vm_result(result); JRT_BLOCK_END; ! ! // inform GC that we won't do card marks for initializing writes. ! SharedRuntime::on_slowpath_allocation_exit(thread); oop result = thread->vm_result(); if ((len > 0) && (result != NULL) && is_deoptimized_caller_frame(thread)) { // Zero array here if the caller is deoptimized.
< prev index next >