< prev index next >

src/share/vm/opto/graphKit.cpp

Print this page
rev 14419 : Remove obsolete and unused reduce-storeval-barrier optimization code.

*** 1550,1560 **** return st; } ! Node* GraphKit::pre_barrier(bool do_load, Node* ctl, Node* obj, Node* adr, uint adr_idx, Node* val, --- 1550,1560 ---- return st; } ! void GraphKit::pre_barrier(bool do_load, Node* ctl, Node* obj, Node* adr, uint adr_idx, Node* val,
*** 1565,1588 **** BarrierSet* bs = Universe::heap()->barrier_set(); set_control(ctl); switch (bs->kind()) { case BarrierSet::G1SATBCTLogging: g1_write_barrier_pre(do_load, obj, adr, adr_idx, val, val_type, pre_val, bt); ! return val; case BarrierSet::ShenandoahBarrierSet: ! return shenandoah_write_barrier_pre(do_load, obj, adr, adr_idx, val, val_type, pre_val, bt); ! case BarrierSet::CardTableForRS: case BarrierSet::CardTableExtension: case BarrierSet::ModRef: break; default : ShouldNotReachHere(); } - return val; } bool GraphKit::can_move_pre_barrier() const { BarrierSet* bs = Universe::heap()->barrier_set(); switch (bs->kind()) { --- 1565,1587 ---- BarrierSet* bs = Universe::heap()->barrier_set(); set_control(ctl); switch (bs->kind()) { case BarrierSet::G1SATBCTLogging: g1_write_barrier_pre(do_load, obj, adr, adr_idx, val, val_type, pre_val, bt); ! break; case BarrierSet::ShenandoahBarrierSet: ! shenandoah_write_barrier_pre(do_load, obj, adr, adr_idx, val, val_type, pre_val, bt); ! break; case BarrierSet::CardTableForRS: case BarrierSet::CardTableExtension: case BarrierSet::ModRef: break; default : ShouldNotReachHere(); } } bool GraphKit::can_move_pre_barrier() const { BarrierSet* bs = Universe::heap()->barrier_set(); switch (bs->kind()) {
*** 1690,1700 **** assert(bt == T_OBJECT, "sanity"); assert(val != NULL, "not dead path"); uint adr_idx = C->get_alias_index(adr_type); assert(adr_idx != Compile::AliasIdxTop, "use other store_to_memory factory" ); ! val = pre_barrier(true /* do_load */, control(), obj, adr, adr_idx, val, val_type, NULL /* pre_val */, bt); Node* store = store_to_memory(control(), adr, val, bt, adr_idx, mo, mismatched); --- 1689,1699 ---- assert(bt == T_OBJECT, "sanity"); assert(val != NULL, "not dead path"); uint adr_idx = C->get_alias_index(adr_type); assert(adr_idx != Compile::AliasIdxTop, "use other store_to_memory factory" ); ! pre_barrier(true /* do_load */, control(), obj, adr, adr_idx, val, val_type, NULL /* pre_val */, bt); Node* store = store_to_memory(control(), adr, val, bt, adr_idx, mo, mismatched);
*** 4199,4209 **** // Final sync IdealKit and GraphKit. final_sync(ideal); g1_write_barrier_pre_helper(*this, adr); } ! Node* GraphKit::shenandoah_write_barrier_pre(bool do_load, Node* obj, Node* adr, uint alias_idx, Node* val, const TypeOopPtr* val_type, --- 4198,4208 ---- // Final sync IdealKit and GraphKit. final_sync(ideal); g1_write_barrier_pre_helper(*this, adr); } ! void GraphKit::shenandoah_write_barrier_pre(bool do_load, Node* obj, Node* adr, uint alias_idx, Node* val, const TypeOopPtr* val_type,
*** 4211,4353 **** BasicType bt) { // Some sanity checks // Note: val is unused in this routine. - if (!ShenandoahSATBBarrier) { if (val != NULL) { shenandoah_update_matrix(adr, val); } ! return val; ! } ! ! if (val == NULL) { ! g1_write_barrier_pre(do_load, obj, adr, alias_idx, val, val_type, pre_val, bt); ! return NULL; } - if (! ShenandoahReduceStoreValBarrier) { - val = shenandoah_storeval_barrier(val); - shenandoah_update_matrix(adr, val); g1_write_barrier_pre(do_load, obj, adr, alias_idx, val, val_type, pre_val, bt); - return val; - } - - if (do_load) { - // We need to generate the load of the previous value - assert(obj != NULL, "must have a base"); - assert(adr != NULL, "where are loading from?"); - assert(pre_val == NULL, "loaded already?"); - assert(val_type != NULL, "need a type"); - - if (use_ReduceInitialCardMarks() - && g1_can_remove_pre_barrier(&_gvn, adr, bt, alias_idx)) { - return shenandoah_storeval_barrier(val); - } - - } else { - // In this case both val_type and alias_idx are unused. - assert(pre_val != NULL, "must be loaded already"); - // Nothing to be done if pre_val is null. - if (pre_val->bottom_type() == TypePtr::NULL_PTR) return val; - assert(pre_val->bottom_type()->basic_type() == T_OBJECT, "or we shouldn't be here"); - } - assert(bt == T_OBJECT, "or we shouldn't be here"); - - IdealKit ideal(this, true, true); - IdealVariable ival(ideal); - __ declarations_done(); - __ set(ival, val); - Node* tls = __ thread(); // ThreadLocalStorage - - Node* no_ctrl = NULL; - Node* no_base = __ top(); - Node* zero = __ ConI(0); - Node* zeroX = __ ConX(0); - - float likely = PROB_LIKELY(0.999); - float unlikely = PROB_UNLIKELY(0.999); - - BasicType active_type = in_bytes(SATBMarkQueue::byte_width_of_active()) == 4 ? T_INT : T_BYTE; - assert(in_bytes(SATBMarkQueue::byte_width_of_active()) == 4 || in_bytes(SATBMarkQueue::byte_width_of_active()) == 1, "flag width"); - - // Offsets into the thread - const int marking_offset = in_bytes(JavaThread::satb_mark_queue_offset() + // 648 - SATBMarkQueue::byte_offset_of_active()); - const int index_offset = in_bytes(JavaThread::satb_mark_queue_offset() + // 656 - SATBMarkQueue::byte_offset_of_index()); - const int buffer_offset = in_bytes(JavaThread::satb_mark_queue_offset() + // 652 - SATBMarkQueue::byte_offset_of_buf()); - - // Now the actual pointers into the thread - Node* marking_adr = __ AddP(no_base, tls, __ ConX(marking_offset)); - Node* buffer_adr = __ AddP(no_base, tls, __ ConX(buffer_offset)); - Node* index_adr = __ AddP(no_base, tls, __ ConX(index_offset)); - - // Now some of the values - Node* marking = __ load(__ ctrl(), marking_adr, TypeInt::INT, active_type, Compile::AliasIdxRaw); - - // if (!marking) - __ if_then(marking, BoolTest::ne, zero, unlikely); { - - Node* storeval = ideal.value(ival); - sync_kit(ideal); - storeval = shenandoah_storeval_barrier(storeval); - __ sync_kit(this); - __ set(ival, storeval); - - BasicType index_bt = TypeX_X->basic_type(); - assert(sizeof(size_t) == type2aelembytes(index_bt), "Loading G1 SATBMarkQueue::_index with wrong size."); - Node* index = __ load(__ ctrl(), index_adr, TypeX_X, index_bt, Compile::AliasIdxRaw); - - if (do_load) { - // load original value - // alias_idx correct?? - pre_val = __ load(__ ctrl(), adr, val_type, bt, alias_idx); - } - - // if (pre_val != NULL) - __ if_then(pre_val, BoolTest::ne, null()); { - Node* buffer = __ load(__ ctrl(), buffer_adr, TypeRawPtr::NOTNULL, T_ADDRESS, Compile::AliasIdxRaw); - - // is the queue for this thread full? - __ if_then(index, BoolTest::ne, zeroX, likely); { - - // decrement the index - Node* next_index = _gvn.transform(new SubXNode(index, __ ConX(sizeof(intptr_t)))); - - // Now get the buffer location we will log the previous value into and store it - Node *log_addr = __ AddP(no_base, buffer, next_index); - __ store(__ ctrl(), log_addr, pre_val, T_OBJECT, Compile::AliasIdxRaw, MemNode::unordered); - // update the index - __ store(__ ctrl(), index_adr, next_index, index_bt, Compile::AliasIdxRaw, MemNode::unordered); - - } __ else_(); { - - // logging buffer is full, call the runtime - const TypeFunc *tf = OptoRuntime::g1_wb_pre_Type(); - __ make_leaf_call(tf, CAST_FROM_FN_PTR(address, SharedRuntime::g1_wb_pre), "g1_wb_pre", pre_val, tls); - } __ end_if(); // (!index) - } __ end_if(); // (pre_val != NULL) - } __ end_if(); // (!marking) - Node* new_val = __ value(ival); - // IdealKit generates a Phi with very conservative type, and even - // turns array types into TypeInstPtr (see type.cpp, _const_basic_type[T_ARRAY]). - // We're forcing the result to be the original type. - if (new_val != val) { - const Type* t = _gvn.type(val); - if (new_val->isa_Type()) { - new_val->as_Type()->set_type(t); - } - _gvn.set_type(new_val, t); - } - val = new_val; - __ dead(ival); - // Final sync IdealKit and GraphKit. - final_sync(ideal); - g1_write_barrier_pre_helper(*this, adr); - return val; } void GraphKit::shenandoah_update_matrix(Node* adr, Node* val) { if (!UseShenandoahMatrix) { return; --- 4210,4227 ---- BasicType bt) { // Some sanity checks // Note: val is unused in this routine. if (val != NULL) { shenandoah_update_matrix(adr, val); } ! if (!ShenandoahSATBBarrier) { ! return; } g1_write_barrier_pre(do_load, obj, adr, alias_idx, val, val_type, pre_val, bt); } void GraphKit::shenandoah_update_matrix(Node* adr, Node* val) { if (!UseShenandoahMatrix) { return;
*** 4714,4723 **** --- 4588,4598 ---- int value_offset = java_lang_String::value_offset_in_bytes(); const TypeInstPtr* string_type = TypeInstPtr::make(TypePtr::NotNull, C->env()->String_klass(), false, NULL, 0); const TypePtr* value_field_type = string_type->add_offset(value_offset); + value = shenandoah_storeval_barrier(value); str = shenandoah_write_barrier(str); store_oop_to_object(control(), str, basic_plus_adr(str, value_offset), value_field_type, value, TypeAryPtr::BYTES, T_OBJECT, MemNode::unordered); }
< prev index next >