comparison src/share/vm/opto/library_call.cpp @ 851:fc4be448891f

6851742: (EA) allocation elimination doesn't work with UseG1GC Summary: Fix eliminate_card_mark() to eliminate G1 pre/post barriers. Reviewed-by: never
author kvn
date Thu, 16 Jul 2009 14:10:42 -0700
parents 4325cdaa78ad
children 75596850f863 94b6d06fd759
comparison
equal deleted inserted replaced
850:fd50a67f97d1 851:fc4be448891f
1028 Node* target = _gvn.transform( makecon(TypeOopPtr::make_from_constant(target_array)) ); 1028 Node* target = _gvn.transform( makecon(TypeOopPtr::make_from_constant(target_array)) );
1029 jint target_length = target_array->length(); 1029 jint target_length = target_array->length();
1030 const TypeAry* target_array_type = TypeAry::make(TypeInt::CHAR, TypeInt::make(0, target_length, Type::WidenMin)); 1030 const TypeAry* target_array_type = TypeAry::make(TypeInt::CHAR, TypeInt::make(0, target_length, Type::WidenMin));
1031 const TypeAryPtr* target_type = TypeAryPtr::make(TypePtr::BotPTR, target_array_type, target_array->klass(), true, Type::OffsetBot); 1031 const TypeAryPtr* target_type = TypeAryPtr::make(TypePtr::BotPTR, target_array_type, target_array->klass(), true, Type::OffsetBot);
1032 1032
1033 IdealKit kit(gvn(), control(), merged_memory()); 1033 IdealKit kit(gvn(), control(), merged_memory(), false, true);
1034 #define __ kit. 1034 #define __ kit.
1035 Node* zero = __ ConI(0); 1035 Node* zero = __ ConI(0);
1036 Node* one = __ ConI(1); 1036 Node* one = __ ConI(1);
1037 Node* cache = __ ConI(cache_i); 1037 Node* cache = __ ConI(cache_i);
1038 Node* md2 = __ ConI(md2_i); 1038 Node* md2 = __ ConI(md2_i);
1040 Node* targetCount = __ ConI(target_length); 1040 Node* targetCount = __ ConI(target_length);
1041 Node* targetCountLess1 = __ ConI(target_length - 1); 1041 Node* targetCountLess1 = __ ConI(target_length - 1);
1042 Node* targetOffset = __ ConI(targetOffset_i); 1042 Node* targetOffset = __ ConI(targetOffset_i);
1043 Node* sourceEnd = __ SubI(__ AddI(sourceOffset, sourceCount), targetCountLess1); 1043 Node* sourceEnd = __ SubI(__ AddI(sourceOffset, sourceCount), targetCountLess1);
1044 1044
1045 IdealVariable rtn(kit), i(kit), j(kit); __ declares_done(); 1045 IdealVariable rtn(kit), i(kit), j(kit); __ declarations_done();
1046 Node* outer_loop = __ make_label(2 /* goto */); 1046 Node* outer_loop = __ make_label(2 /* goto */);
1047 Node* return_ = __ make_label(1); 1047 Node* return_ = __ make_label(1);
1048 1048
1049 __ set(rtn,__ ConI(-1)); 1049 __ set(rtn,__ ConI(-1));
1050 __ loop(i, sourceOffset, BoolTest::lt, sourceEnd); { 1050 __ loop(i, sourceOffset, BoolTest::lt, sourceEnd); {
1077 }__ end_if(); 1077 }__ end_if();
1078 __ increment(i, one); 1078 __ increment(i, one);
1079 __ bind(outer_loop); 1079 __ bind(outer_loop);
1080 }__ end_loop(); __ dead(i); 1080 }__ end_loop(); __ dead(i);
1081 __ bind(return_); 1081 __ bind(return_);
1082 __ drain_delay_transform(); 1082
1083 1083 // Final sync IdealKit and GraphKit.
1084 set_control(__ ctrl()); 1084 sync_kit(kit);
1085 Node* result = __ value(rtn); 1085 Node* result = __ value(rtn);
1086 #undef __ 1086 #undef __
1087 C->set_has_loops(true); 1087 C->set_has_loops(true);
1088 return result; 1088 return result;
1089 } 1089 }
2181 } else { 2181 } else {
2182 // We can't tell at compile time if we are storing in the Java heap or outside 2182 // We can't tell at compile time if we are storing in the Java heap or outside
2183 // of it. So we need to emit code to conditionally do the proper type of 2183 // of it. So we need to emit code to conditionally do the proper type of
2184 // store. 2184 // store.
2185 2185
2186 IdealKit kit(gvn(), control(), merged_memory()); 2186 IdealKit ideal(gvn(), control(), merged_memory());
2187 kit.declares_done(); 2187 #define __ ideal.
2188 // QQQ who knows what probability is here?? 2188 // QQQ who knows what probability is here??
2189 kit.if_then(heap_base_oop, BoolTest::ne, null(), PROB_UNLIKELY(0.999)); { 2189 __ if_then(heap_base_oop, BoolTest::ne, null(), PROB_UNLIKELY(0.999)); {
2190 (void) store_oop_to_unknown(control(), heap_base_oop, adr, adr_type, val, type); 2190 // Sync IdealKit and graphKit.
2191 } kit.else_(); { 2191 set_all_memory( __ merged_memory());
2192 (void) store_to_memory(control(), adr, val, type, adr_type, is_volatile); 2192 set_control(__ ctrl());
2193 } kit.end_if(); 2193 Node* st = store_oop_to_unknown(control(), heap_base_oop, adr, adr_type, val, type);
2194 // Update IdealKit memory.
2195 __ set_all_memory(merged_memory());
2196 __ set_ctrl(control());
2197 } __ else_(); {
2198 __ store(__ ctrl(), adr, val, type, alias_type->index(), is_volatile);
2199 } __ end_if();
2200 // Final sync IdealKit and GraphKit.
2201 sync_kit(ideal);
2202 #undef __
2194 } 2203 }
2195 } 2204 }
2196 } 2205 }
2197 2206
2198 if (is_volatile) { 2207 if (is_volatile) {