447 // since we don't know if we have an array or and object or even |
447 // since we don't know if we have an array or and object or even |
448 // where the object starts. |
448 // where the object starts. |
449 // |
449 // |
450 // If val==NULL, it is taken to be a completely unknown value. QQQ |
450 // If val==NULL, it is taken to be a completely unknown value. QQQ |
451 |
451 |
|
452 Node* store_oop(Node* ctl, |
|
453 Node* obj, // containing obj |
|
454 Node* adr, // actual adress to store val at |
|
455 const TypePtr* adr_type, |
|
456 Node* val, |
|
457 const TypeOopPtr* val_type, |
|
458 BasicType bt, |
|
459 bool use_precise); |
|
460 |
452 Node* store_oop_to_object(Node* ctl, |
461 Node* store_oop_to_object(Node* ctl, |
453 Node* obj, // containing obj |
462 Node* obj, // containing obj |
454 Node* adr, // actual adress to store val at |
463 Node* adr, // actual adress to store val at |
455 const TypePtr* adr_type, |
464 const TypePtr* adr_type, |
456 Node* val, |
465 Node* val, |
457 const TypeOopPtr* val_type, |
466 const TypeOopPtr* val_type, |
458 BasicType bt); |
467 BasicType bt) { |
|
468 return store_oop(ctl, obj, adr, adr_type, val, val_type, bt, false); |
|
469 } |
459 |
470 |
460 Node* store_oop_to_array(Node* ctl, |
471 Node* store_oop_to_array(Node* ctl, |
461 Node* obj, // containing obj |
472 Node* obj, // containing obj |
462 Node* adr, // actual adress to store val at |
473 Node* adr, // actual adress to store val at |
463 const TypePtr* adr_type, |
474 const TypePtr* adr_type, |
464 Node* val, |
475 Node* val, |
465 const TypeOopPtr* val_type, |
476 const TypeOopPtr* val_type, |
466 BasicType bt); |
477 BasicType bt) { |
|
478 return store_oop(ctl, obj, adr, adr_type, val, val_type, bt, true); |
|
479 } |
467 |
480 |
468 // Could be an array or object we don't know at compile time (unsafe ref.) |
481 // Could be an array or object we don't know at compile time (unsafe ref.) |
469 Node* store_oop_to_unknown(Node* ctl, |
482 Node* store_oop_to_unknown(Node* ctl, |
470 Node* obj, // containing obj |
483 Node* obj, // containing obj |
471 Node* adr, // actual adress to store val at |
484 Node* adr, // actual adress to store val at |
485 // Optional constraint on the array size: |
498 // Optional constraint on the array size: |
486 const TypeInt* sizetype = NULL); |
499 const TypeInt* sizetype = NULL); |
487 |
500 |
488 // Return a load of array element at idx. |
501 // Return a load of array element at idx. |
489 Node* load_array_element(Node* ctl, Node* ary, Node* idx, const TypeAryPtr* arytype); |
502 Node* load_array_element(Node* ctl, Node* ary, Node* idx, const TypeAryPtr* arytype); |
490 |
|
491 // CMS card-marks have an input from the corresponding oop_store |
|
492 void cms_card_mark(Node* ctl, Node* adr, Node* val, Node* oop_store); |
|
493 |
503 |
494 //---------------- Dtrace support -------------------- |
504 //---------------- Dtrace support -------------------- |
495 void make_dtrace_method_entry_exit(ciMethod* method, bool is_entry); |
505 void make_dtrace_method_entry_exit(ciMethod* method, bool is_entry); |
496 void make_dtrace_method_entry(ciMethod* method) { |
506 void make_dtrace_method_entry(ciMethod* method) { |
497 make_dtrace_method_entry_exit(method, true); |
507 make_dtrace_method_entry_exit(method, true); |
580 // Report if there were too many recompiles at the current method and bci. |
590 // Report if there were too many recompiles at the current method and bci. |
581 bool too_many_recompiles(Deoptimization::DeoptReason reason) { |
591 bool too_many_recompiles(Deoptimization::DeoptReason reason) { |
582 return C->too_many_recompiles(method(), bci(), reason); |
592 return C->too_many_recompiles(method(), bci(), reason); |
583 } |
593 } |
584 |
594 |
585 // vanilla/CMS post barrier |
|
586 void write_barrier_post(Node *store, Node* obj, Node* adr, Node* val, bool use_precise); |
|
587 |
|
588 // Returns the object (if any) which was created the moment before. |
595 // Returns the object (if any) which was created the moment before. |
589 Node* just_allocated_object(Node* current_control); |
596 Node* just_allocated_object(Node* current_control); |
590 |
597 |
591 static bool use_ReduceInitialCardMarks() { |
598 static bool use_ReduceInitialCardMarks() { |
592 return (ReduceInitialCardMarks |
599 return (ReduceInitialCardMarks |
593 && Universe::heap()->can_elide_tlab_store_barriers()); |
600 && Universe::heap()->can_elide_tlab_store_barriers()); |
594 } |
601 } |
|
602 |
|
603 void sync_kit(IdealKit& ideal); |
|
604 |
|
605 // vanilla/CMS post barrier |
|
606 void write_barrier_post(Node *store, Node* obj, Node* adr, Node* val, bool use_precise); |
595 |
607 |
596 // G1 pre/post barriers |
608 // G1 pre/post barriers |
597 void g1_write_barrier_pre(Node* obj, |
609 void g1_write_barrier_pre(Node* obj, |
598 Node* adr, |
610 Node* adr, |
599 uint alias_idx, |
611 uint alias_idx, |
608 Node* val, |
620 Node* val, |
609 BasicType bt, |
621 BasicType bt, |
610 bool use_precise); |
622 bool use_precise); |
611 // Helper function for g1 |
623 // Helper function for g1 |
612 private: |
624 private: |
613 void g1_mark_card(IdealKit* ideal, Node* card_adr, Node* store, Node* index, Node* index_adr, |
625 void g1_mark_card(IdealKit& ideal, Node* card_adr, Node* store, Node* index, Node* index_adr, |
614 Node* buffer, const TypeFunc* tf); |
626 Node* buffer, const TypeFunc* tf); |
615 |
627 |
616 public: |
628 public: |
617 // Helper function to round double arguments before a call |
629 // Helper function to round double arguments before a call |
618 void round_double_arguments(ciMethod* dest_method); |
630 void round_double_arguments(ciMethod* dest_method); |