src/share/vm/opto/graphKit.cpp

changeset 5017
d50cc62e94ff
parent 4868
30f42e691e70
child 5110
6f3fd5150b67
     1.1 --- a/src/share/vm/opto/graphKit.cpp	Wed Apr 24 19:55:02 2013 +0200
     1.2 +++ b/src/share/vm/opto/graphKit.cpp	Wed Apr 24 14:48:43 2013 -0700
     1.3 @@ -3564,7 +3564,8 @@
     1.4  
     1.5    Node* no_ctrl = NULL;
     1.6    Node* no_base = __ top();
     1.7 -  Node* zero = __ ConI(0);
     1.8 +  Node* zero  = __ ConI(0);
     1.9 +  Node* zeroX = __ ConX(0);
    1.10  
    1.11    float likely  = PROB_LIKELY(0.999);
    1.12    float unlikely  = PROB_UNLIKELY(0.999);
    1.13 @@ -3590,7 +3591,9 @@
    1.14  
    1.15    // if (!marking)
    1.16    __ if_then(marking, BoolTest::ne, zero); {
    1.17 -    Node* index   = __ load(__ ctrl(), index_adr, TypeInt::INT, T_INT, Compile::AliasIdxRaw);
    1.18 +    BasicType index_bt = TypeX_X->basic_type();
    1.19 +    assert(sizeof(size_t) == type2aelembytes(index_bt), "Loading G1 PtrQueue::_index with wrong size.");
    1.20 +    Node* index   = __ load(__ ctrl(), index_adr, TypeX_X, index_bt, Compile::AliasIdxRaw);
    1.21  
    1.22      if (do_load) {
    1.23        // load original value
    1.24 @@ -3603,22 +3606,16 @@
    1.25        Node* buffer  = __ load(__ ctrl(), buffer_adr, TypeRawPtr::NOTNULL, T_ADDRESS, Compile::AliasIdxRaw);
    1.26  
    1.27        // is the queue for this thread full?
    1.28 -      __ if_then(index, BoolTest::ne, zero, likely); {
    1.29 +      __ if_then(index, BoolTest::ne, zeroX, likely); {
    1.30  
    1.31          // decrement the index
    1.32 -        Node* next_index = __ SubI(index,  __ ConI(sizeof(intptr_t)));
    1.33 -        Node* next_indexX = next_index;
    1.34 -#ifdef _LP64
    1.35 -        // We could refine the type for what it's worth
    1.36 -        // const TypeLong* lidxtype = TypeLong::make(CONST64(0), get_size_from_queue);
    1.37 -        next_indexX = _gvn.transform( new (C) ConvI2LNode(next_index, TypeLong::make(0, max_jlong, Type::WidenMax)) );
    1.38 -#endif
    1.39 +        Node* next_index = _gvn.transform(new (C) SubXNode(index, __ ConX(sizeof(intptr_t))));
    1.40  
    1.41          // Now get the buffer location we will log the previous value into and store it
    1.42 -        Node *log_addr = __ AddP(no_base, buffer, next_indexX);
    1.43 +        Node *log_addr = __ AddP(no_base, buffer, next_index);
    1.44          __ store(__ ctrl(), log_addr, pre_val, T_OBJECT, Compile::AliasIdxRaw);
    1.45          // update the index
    1.46 -        __ store(__ ctrl(), index_adr, next_index, T_INT, Compile::AliasIdxRaw);
    1.47 +        __ store(__ ctrl(), index_adr, next_index, index_bt, Compile::AliasIdxRaw);
    1.48  
    1.49        } __ else_(); {
    1.50  
    1.51 @@ -3645,26 +3642,21 @@
    1.52                              Node* buffer,
    1.53                              const TypeFunc* tf) {
    1.54  
    1.55 -  Node* zero = __ ConI(0);
    1.56 +  Node* zero  = __ ConI(0);
    1.57 +  Node* zeroX = __ ConX(0);
    1.58    Node* no_base = __ top();
    1.59    BasicType card_bt = T_BYTE;
    1.60    // Smash zero into card. MUST BE ORDERED WRT TO STORE
    1.61    __ storeCM(__ ctrl(), card_adr, zero, oop_store, oop_alias_idx, card_bt, Compile::AliasIdxRaw);
    1.62  
    1.63    //  Now do the queue work
    1.64 -  __ if_then(index, BoolTest::ne, zero); {
    1.65 -
    1.66 -    Node* next_index = __ SubI(index, __ ConI(sizeof(intptr_t)));
    1.67 -    Node* next_indexX = next_index;
    1.68 -#ifdef _LP64
    1.69 -    // We could refine the type for what it's worth
    1.70 -    // const TypeLong* lidxtype = TypeLong::make(CONST64(0), get_size_from_queue);
    1.71 -    next_indexX = _gvn.transform( new (C) ConvI2LNode(next_index, TypeLong::make(0, max_jlong, Type::WidenMax)) );
    1.72 -#endif // _LP64
    1.73 -    Node* log_addr = __ AddP(no_base, buffer, next_indexX);
    1.74 +  __ if_then(index, BoolTest::ne, zeroX); {
    1.75 +
    1.76 +    Node* next_index = _gvn.transform(new (C) SubXNode(index, __ ConX(sizeof(intptr_t))));
    1.77 +    Node* log_addr = __ AddP(no_base, buffer, next_index);
    1.78  
    1.79      __ store(__ ctrl(), log_addr, card_adr, T_ADDRESS, Compile::AliasIdxRaw);
    1.80 -    __ store(__ ctrl(), index_adr, next_index, T_INT, Compile::AliasIdxRaw);
    1.81 +    __ store(__ ctrl(), index_adr, next_index, TypeX_X->basic_type(), Compile::AliasIdxRaw);
    1.82  
    1.83    } __ else_(); {
    1.84      __ make_leaf_call(tf, CAST_FROM_FN_PTR(address, SharedRuntime::g1_wb_post), "g1_wb_post", card_adr, __ thread());
    1.85 @@ -3725,7 +3717,7 @@
    1.86    // Now some values
    1.87    // Use ctrl to avoid hoisting these values past a safepoint, which could
    1.88    // potentially reset these fields in the JavaThread.
    1.89 -  Node* index  = __ load(__ ctrl(), index_adr, TypeInt::INT, T_INT, Compile::AliasIdxRaw);
    1.90 +  Node* index  = __ load(__ ctrl(), index_adr, TypeX_X, TypeX_X->basic_type(), Compile::AliasIdxRaw);
    1.91    Node* buffer = __ load(__ ctrl(), buffer_adr, TypeRawPtr::NOTNULL, T_ADDRESS, Compile::AliasIdxRaw);
    1.92  
    1.93    // Convert the store obj pointer to an int prior to doing math on it

mercurial