Mercurial > hg > graal-compiler
comparison src/share/vm/opto/parse3.cpp @ 14909:4ca6dc0799b6
Backout jdk9 merge
author | Gilles Duboscq <duboscq@ssw.jku.at> |
---|---|
date | Tue, 01 Apr 2014 13:57:07 +0200 |
parents | 45467c53f178 |
children | 52b4284cb496 |
comparison
equal
deleted
inserted
replaced
14908:8db6e76cb658 | 14909:4ca6dc0799b6 |
---|---|
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 } | |
233 // Build the load. | 230 // Build the load. |
234 // | 231 Node* ld = make_load(NULL, adr, type, bt, adr_type, is_vol); |
235 MemNode::MemOrd mo = is_vol ? MemNode::acquire : MemNode::unordered; | |
236 Node* ld = make_load(NULL, adr, type, bt, adr_type, mo, is_vol); | |
237 | 232 |
238 // Adjust Java stack | 233 // Adjust Java stack |
239 if (type2size[bt] == 1) | 234 if (type2size[bt] == 1) |
240 push(ld); | 235 push(ld); |
241 else | 236 else |
291 // Value to be stored | 286 // Value to be stored |
292 Node* val = type2size[bt] == 1 ? pop() : pop_pair(); | 287 Node* val = type2size[bt] == 1 ? pop() : pop_pair(); |
293 // Round doubles before storing | 288 // Round doubles before storing |
294 if (bt == T_DOUBLE) val = dstore_rounding(val); | 289 if (bt == T_DOUBLE) val = dstore_rounding(val); |
295 | 290 |
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 | |
306 // Store the value. | 291 // Store the value. |
307 Node* store; | 292 Node* store; |
308 if (bt == T_OBJECT) { | 293 if (bt == T_OBJECT) { |
309 const TypeOopPtr* field_type; | 294 const TypeOopPtr* field_type; |
310 if (!field->type()->is_loaded()) { | 295 if (!field->type()->is_loaded()) { |
311 field_type = TypeInstPtr::BOTTOM; | 296 field_type = TypeInstPtr::BOTTOM; |
312 } else { | 297 } else { |
313 field_type = TypeOopPtr::make_from_klass(field->type()->as_klass()); | 298 field_type = TypeOopPtr::make_from_klass(field->type()->as_klass()); |
314 } | 299 } |
315 store = store_oop_to_object(control(), obj, adr, adr_type, val, field_type, bt, mo); | 300 store = store_oop_to_object( control(), obj, adr, adr_type, val, field_type, bt); |
316 } else { | 301 } else { |
317 store = store_to_memory(control(), adr, val, bt, adr_type, mo, is_vol); | 302 store = store_to_memory( control(), adr, val, bt, adr_type, is_vol ); |
318 } | 303 } |
319 | 304 |
320 // If reference is volatile, prevent following volatiles ops from | 305 // If reference is volatile, prevent following volatiles ops from |
321 // floating up before the volatile write. | 306 // floating up before the volatile write. |
322 if (is_vol) { | 307 if (is_vol) { |
323 // If not multiple copy atomic, we do the MemBarVolatile before the load. | 308 insert_mem_bar(Op_MemBarVolatile); // Use fat membar |
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 } | |
333 } | 309 } |
334 | 310 |
335 // If the field is final, the rules of Java say we are in <init> or <clinit>. | 311 // If the field is final, the rules of Java say we are in <init> or <clinit>. |
336 // Note the presence of writes to final non-static fields, so that we | 312 // Note the presence of writes to final non-static fields, so that we |
337 // can insert a memory barrier later on to keep the writes from floating | 313 // can insert a memory barrier later on to keep the writes from floating |
359 // cases: | 335 // cases: |
360 // can_be_constant = (oop not scavengable || ScavengeRootsInCode != 0) | 336 // can_be_constant = (oop not scavengable || ScavengeRootsInCode != 0) |
361 // should_be_constant = (oop not scavengable || ScavengeRootsInCode >= 2) | 337 // should_be_constant = (oop not scavengable || ScavengeRootsInCode >= 2) |
362 // An oop is not scavengable if it is in the perm gen. | 338 // An oop is not scavengable if it is in the perm gen. |
363 if (stable_type != NULL && con_type != NULL && con_type->isa_oopptr()) | 339 if (stable_type != NULL && con_type != NULL && con_type->isa_oopptr()) |
364 con_type = con_type->join_speculative(stable_type); | 340 con_type = con_type->join(stable_type); |
365 break; | 341 break; |
366 | 342 |
367 case T_ILLEGAL: | 343 case T_ILLEGAL: |
368 // Invalid ciConstant returned due to OutOfMemoryError in the CI | 344 // Invalid ciConstant returned due to OutOfMemoryError in the CI |
369 assert(C->env()->failing(), "otherwise should not see this"); | 345 assert(C->env()->failing(), "otherwise should not see this"); |
436 const intptr_t header = arrayOopDesc::base_offset_in_bytes(T_OBJECT); | 412 const intptr_t header = arrayOopDesc::base_offset_in_bytes(T_OBJECT); |
437 for (jint i = 0; i < length_con; i++) { | 413 for (jint i = 0; i < length_con; i++) { |
438 Node* elem = expand_multianewarray(array_klass_1, &lengths[1], ndimensions-1, nargs); | 414 Node* elem = expand_multianewarray(array_klass_1, &lengths[1], ndimensions-1, nargs); |
439 intptr_t offset = header + ((intptr_t)i << LogBytesPerHeapOop); | 415 intptr_t offset = header + ((intptr_t)i << LogBytesPerHeapOop); |
440 Node* eaddr = basic_plus_adr(array, offset); | 416 Node* eaddr = basic_plus_adr(array, offset); |
441 store_oop_to_array(control(), array, eaddr, adr_type, elem, elemtype, T_OBJECT, MemNode::unordered); | 417 store_oop_to_array(control(), array, eaddr, adr_type, elem, elemtype, T_OBJECT); |
442 } | 418 } |
443 } | 419 } |
444 return array; | 420 return array; |
445 } | 421 } |
446 | 422 |
525 dims = new_array(dims_array_klass, intcon(ndimensions), 0); | 501 dims = new_array(dims_array_klass, intcon(ndimensions), 0); |
526 | 502 |
527 // Fill-in it with values | 503 // Fill-in it with values |
528 for (j = 0; j < ndimensions; j++) { | 504 for (j = 0; j < ndimensions; j++) { |
529 Node *dims_elem = array_element_address(dims, intcon(j), T_INT); | 505 Node *dims_elem = array_element_address(dims, intcon(j), T_INT); |
530 store_to_memory(control(), dims_elem, length[j], T_INT, TypeAryPtr::INTS, MemNode::unordered); | 506 store_to_memory(control(), dims_elem, length[j], T_INT, TypeAryPtr::INTS); |
531 } | 507 } |
532 } | 508 } |
533 | 509 |
534 c = make_runtime_call(RC_NO_LEAF | RC_NO_IO, | 510 c = make_runtime_call(RC_NO_LEAF | RC_NO_IO, |
535 OptoRuntime::multianewarrayN_Type(), | 511 OptoRuntime::multianewarrayN_Type(), |