comparison src/share/vm/c1/c1_LIR.hpp @ 6795:7eca5de9e0b6

7023898: Intrinsify AtomicLongFieldUpdater.getAndIncrement() Summary: use shorter instruction sequences for atomic add and atomic exchange when possible. Reviewed-by: kvn, jrose
author roland
date Thu, 20 Sep 2012 16:49:17 +0200
parents 8a02ca5e5576
children 608b2e8a0063
comparison
equal deleted inserted replaced
6794:8ae8f9dd7099 6795:7eca5de9e0b6
961 , lir_shr 961 , lir_shr
962 , lir_ushr 962 , lir_ushr
963 , lir_alloc_array 963 , lir_alloc_array
964 , lir_throw 964 , lir_throw
965 , lir_compare_to 965 , lir_compare_to
966 , lir_xadd
967 , lir_xchg
966 , end_op2 968 , end_op2
967 , begin_op3 969 , begin_op3
968 , lir_idiv 970 , lir_idiv
969 , lir_irem 971 , lir_irem
970 , end_op3 972 , end_op3
2189 ciMethod* profiled_method, int profiled_bci); 2191 ciMethod* profiled_method, int profiled_bci);
2190 // MethodData* profiling 2192 // MethodData* profiling
2191 void profile_call(ciMethod* method, int bci, ciMethod* callee, LIR_Opr mdo, LIR_Opr recv, LIR_Opr t1, ciKlass* cha_klass) { 2193 void profile_call(ciMethod* method, int bci, ciMethod* callee, LIR_Opr mdo, LIR_Opr recv, LIR_Opr t1, ciKlass* cha_klass) {
2192 append(new LIR_OpProfileCall(lir_profile_call, method, bci, callee, mdo, recv, t1, cha_klass)); 2194 append(new LIR_OpProfileCall(lir_profile_call, method, bci, callee, mdo, recv, t1, cha_klass));
2193 } 2195 }
2196
2197 void xadd(LIR_Opr src, LIR_Opr add, LIR_Opr res, LIR_Opr tmp) { append(new LIR_Op2(lir_xadd, src, add, res, tmp)); }
2198 void xchg(LIR_Opr src, LIR_Opr set, LIR_Opr res, LIR_Opr tmp) { append(new LIR_Op2(lir_xchg, src, set, res, tmp)); }
2194 }; 2199 };
2195 2200
2196 void print_LIR(BlockList* blocks); 2201 void print_LIR(BlockList* blocks);
2197 2202
2198 class LIR_InsertionBuffer : public CompilationResourceObj { 2203 class LIR_InsertionBuffer : public CompilationResourceObj {
2285 2290
2286 } else if (opr->is_pointer()) { 2291 } else if (opr->is_pointer()) {
2287 LIR_Address* address = opr->as_address_ptr(); 2292 LIR_Address* address = opr->as_address_ptr();
2288 if (address != NULL) { 2293 if (address != NULL) {
2289 // special handling for addresses: add base and index register of the address 2294 // special handling for addresses: add base and index register of the address
2290 // both are always input operands! 2295 // both are always input operands or temp if we want to extend
2296 // their liveness!
2297 if (mode == outputMode) {
2298 mode = inputMode;
2299 }
2300 assert (mode == inputMode || mode == tempMode, "input or temp only for addresses");
2291 if (address->_base->is_valid()) { 2301 if (address->_base->is_valid()) {
2292 assert(address->_base->is_register(), "must be"); 2302 assert(address->_base->is_register(), "must be");
2293 assert(_oprs_len[inputMode] < maxNumberOfOperands, "array overflow"); 2303 assert(_oprs_len[mode] < maxNumberOfOperands, "array overflow");
2294 _oprs_new[inputMode][_oprs_len[inputMode]++] = &address->_base; 2304 _oprs_new[mode][_oprs_len[mode]++] = &address->_base;
2295 } 2305 }
2296 if (address->_index->is_valid()) { 2306 if (address->_index->is_valid()) {
2297 assert(address->_index->is_register(), "must be"); 2307 assert(address->_index->is_register(), "must be");
2298 assert(_oprs_len[inputMode] < maxNumberOfOperands, "array overflow"); 2308 assert(_oprs_len[mode] < maxNumberOfOperands, "array overflow");
2299 _oprs_new[inputMode][_oprs_len[inputMode]++] = &address->_index; 2309 _oprs_new[mode][_oprs_len[mode]++] = &address->_index;
2300 } 2310 }
2301 2311
2302 } else { 2312 } else {
2303 assert(opr->is_constant(), "constant operands are not processed"); 2313 assert(opr->is_constant(), "constant operands are not processed");
2304 } 2314 }