comparison src/share/vm/opto/parse3.cpp @ 18041:52b4284cb496

Merge with jdk8u20-b26
author Gilles Duboscq <duboscq@ssw.jku.at>
date Wed, 15 Oct 2014 16:02:50 +0200
parents 4ca6dc0799b6
children
comparison
equal deleted inserted replaced
17606:45d7b2c7029d 18041:52b4284cb496
225 type = TypeOopPtr::make_from_klass(field_klass->as_klass()); 225 type = TypeOopPtr::make_from_klass(field_klass->as_klass());
226 } 226 }
227 } else { 227 } else {
228 type = Type::get_const_basic_type(bt); 228 type = Type::get_const_basic_type(bt);
229 } 229 }
230 if (support_IRIW_for_not_multiple_copy_atomic_cpu && field->is_volatile()) {
231 insert_mem_bar(Op_MemBarVolatile); // StoreLoad barrier
232 }
230 // Build the load. 233 // Build the load.
231 Node* ld = make_load(NULL, adr, type, bt, adr_type, is_vol); 234 //
235 MemNode::MemOrd mo = is_vol ? MemNode::acquire : MemNode::unordered;
236 Node* ld = make_load(NULL, adr, type, bt, adr_type, mo, is_vol);
232 237
233 // Adjust Java stack 238 // Adjust Java stack
234 if (type2size[bt] == 1) 239 if (type2size[bt] == 1)
235 push(ld); 240 push(ld);
236 else 241 else
286 // Value to be stored 291 // Value to be stored
287 Node* val = type2size[bt] == 1 ? pop() : pop_pair(); 292 Node* val = type2size[bt] == 1 ? pop() : pop_pair();
288 // Round doubles before storing 293 // Round doubles before storing
289 if (bt == T_DOUBLE) val = dstore_rounding(val); 294 if (bt == T_DOUBLE) val = dstore_rounding(val);
290 295
296 // Conservatively release stores of object references.
297 const MemNode::MemOrd mo =
298 is_vol ?
299 // Volatile fields need releasing stores.
300 MemNode::release :
301 // Non-volatile fields also need releasing stores if they hold an
302 // object reference, because the object reference might point to
303 // a freshly created object.
304 StoreNode::release_if_reference(bt);
305
291 // Store the value. 306 // Store the value.
292 Node* store; 307 Node* store;
293 if (bt == T_OBJECT) { 308 if (bt == T_OBJECT) {
294 const TypeOopPtr* field_type; 309 const TypeOopPtr* field_type;
295 if (!field->type()->is_loaded()) { 310 if (!field->type()->is_loaded()) {
296 field_type = TypeInstPtr::BOTTOM; 311 field_type = TypeInstPtr::BOTTOM;
297 } else { 312 } else {
298 field_type = TypeOopPtr::make_from_klass(field->type()->as_klass()); 313 field_type = TypeOopPtr::make_from_klass(field->type()->as_klass());
299 } 314 }
300 store = store_oop_to_object( control(), obj, adr, adr_type, val, field_type, bt); 315 store = store_oop_to_object(control(), obj, adr, adr_type, val, field_type, bt, mo);
301 } else { 316 } else {
302 store = store_to_memory( control(), adr, val, bt, adr_type, is_vol ); 317 store = store_to_memory(control(), adr, val, bt, adr_type, mo, is_vol);
303 } 318 }
304 319
305 // If reference is volatile, prevent following volatiles ops from 320 // If reference is volatile, prevent following volatiles ops from
306 // floating up before the volatile write. 321 // floating up before the volatile write.
307 if (is_vol) { 322 if (is_vol) {
308 insert_mem_bar(Op_MemBarVolatile); // Use fat membar 323 // If not multiple copy atomic, we do the MemBarVolatile before the load.
324 if (!support_IRIW_for_not_multiple_copy_atomic_cpu) {
325 insert_mem_bar(Op_MemBarVolatile); // Use fat membar
326 }
327 // Remember we wrote a volatile field.
328 // For not multiple copy atomic cpu (ppc64) a barrier should be issued
329 // in constructors which have such stores. See do_exits() in parse1.cpp.
330 if (is_field) {
331 set_wrote_volatile(true);
332 }
309 } 333 }
310 334
311 // If the field is final, the rules of Java say we are in <init> or <clinit>. 335 // If the field is final, the rules of Java say we are in <init> or <clinit>.
312 // Note the presence of writes to final non-static fields, so that we 336 // Note the presence of writes to final non-static fields, so that we
313 // can insert a memory barrier later on to keep the writes from floating 337 // can insert a memory barrier later on to keep the writes from floating
335 // cases: 359 // cases:
336 // can_be_constant = (oop not scavengable || ScavengeRootsInCode != 0) 360 // can_be_constant = (oop not scavengable || ScavengeRootsInCode != 0)
337 // should_be_constant = (oop not scavengable || ScavengeRootsInCode >= 2) 361 // should_be_constant = (oop not scavengable || ScavengeRootsInCode >= 2)
338 // An oop is not scavengable if it is in the perm gen. 362 // An oop is not scavengable if it is in the perm gen.
339 if (stable_type != NULL && con_type != NULL && con_type->isa_oopptr()) 363 if (stable_type != NULL && con_type != NULL && con_type->isa_oopptr())
340 con_type = con_type->join(stable_type); 364 con_type = con_type->join_speculative(stable_type);
341 break; 365 break;
342 366
343 case T_ILLEGAL: 367 case T_ILLEGAL:
344 // Invalid ciConstant returned due to OutOfMemoryError in the CI 368 // Invalid ciConstant returned due to OutOfMemoryError in the CI
345 assert(C->env()->failing(), "otherwise should not see this"); 369 assert(C->env()->failing(), "otherwise should not see this");
412 const intptr_t header = arrayOopDesc::base_offset_in_bytes(T_OBJECT); 436 const intptr_t header = arrayOopDesc::base_offset_in_bytes(T_OBJECT);
413 for (jint i = 0; i < length_con; i++) { 437 for (jint i = 0; i < length_con; i++) {
414 Node* elem = expand_multianewarray(array_klass_1, &lengths[1], ndimensions-1, nargs); 438 Node* elem = expand_multianewarray(array_klass_1, &lengths[1], ndimensions-1, nargs);
415 intptr_t offset = header + ((intptr_t)i << LogBytesPerHeapOop); 439 intptr_t offset = header + ((intptr_t)i << LogBytesPerHeapOop);
416 Node* eaddr = basic_plus_adr(array, offset); 440 Node* eaddr = basic_plus_adr(array, offset);
417 store_oop_to_array(control(), array, eaddr, adr_type, elem, elemtype, T_OBJECT); 441 store_oop_to_array(control(), array, eaddr, adr_type, elem, elemtype, T_OBJECT, MemNode::unordered);
418 } 442 }
419 } 443 }
420 return array; 444 return array;
421 } 445 }
422 446
501 dims = new_array(dims_array_klass, intcon(ndimensions), 0); 525 dims = new_array(dims_array_klass, intcon(ndimensions), 0);
502 526
503 // Fill-in it with values 527 // Fill-in it with values
504 for (j = 0; j < ndimensions; j++) { 528 for (j = 0; j < ndimensions; j++) {
505 Node *dims_elem = array_element_address(dims, intcon(j), T_INT); 529 Node *dims_elem = array_element_address(dims, intcon(j), T_INT);
506 store_to_memory(control(), dims_elem, length[j], T_INT, TypeAryPtr::INTS); 530 store_to_memory(control(), dims_elem, length[j], T_INT, TypeAryPtr::INTS, MemNode::unordered);
507 } 531 }
508 } 532 }
509 533
510 c = make_runtime_call(RC_NO_LEAF | RC_NO_IO, 534 c = make_runtime_call(RC_NO_LEAF | RC_NO_IO,
511 OptoRuntime::multianewarrayN_Type(), 535 OptoRuntime::multianewarrayN_Type(),