comparison src/share/vm/opto/graphKit.hpp @ 18041:52b4284cb496

Merge with jdk8u20-b26
author Gilles Duboscq <duboscq@ssw.jku.at>
date Wed, 15 Oct 2014 16:02:50 +0200
parents 89152779163c 00c8a1255912
children 7848fc12602b
comparison
equal deleted inserted replaced
17606:45d7b2c7029d 18041:52b4284cb496
336 Node* AddP(Node* b, Node* a, Node* o) { return _gvn.transform(new (C) AddPNode(b, a, o)); } 336 Node* AddP(Node* b, Node* a, Node* o) { return _gvn.transform(new (C) AddPNode(b, a, o)); }
337 337
338 // Convert between int and long, and size_t. 338 // Convert between int and long, and size_t.
339 // (See macros ConvI2X, etc., in type.hpp for ConvI2X, etc.) 339 // (See macros ConvI2X, etc., in type.hpp for ConvI2X, etc.)
340 Node* ConvI2L(Node* offset); 340 Node* ConvI2L(Node* offset);
341 Node* ConvI2UL(Node* offset);
341 Node* ConvL2I(Node* offset); 342 Node* ConvL2I(Node* offset);
342 // Find out the klass of an object. 343 // Find out the klass of an object.
343 Node* load_object_klass(Node* object); 344 Node* load_object_klass(Node* object);
344 // Find out the length of an array. 345 // Find out the length of an array.
345 Node* load_array_length(Node* array); 346 Node* load_array_length(Node* array);
404 void record_profiled_parameters_for_speculation(); 405 void record_profiled_parameters_for_speculation();
405 406
406 // Use the type profile to narrow an object type. 407 // Use the type profile to narrow an object type.
407 Node* maybe_cast_profiled_receiver(Node* not_null_obj, 408 Node* maybe_cast_profiled_receiver(Node* not_null_obj,
408 ciKlass* require_klass, 409 ciKlass* require_klass,
409 ciKlass* spec, 410 ciKlass* spec,
410 bool safe_for_replace); 411 bool safe_for_replace);
411 412
412 // Cast obj to type and emit guard unless we had too many traps here already 413 // Cast obj to type and emit guard unless we had too many traps here already
413 Node* maybe_cast_profiled_obj(Node* obj, 414 Node* maybe_cast_profiled_obj(Node* obj,
414 ciKlass* type, 415 ciKlass* type,
508 // Create a memory projection from the call, then set_all_memory. 509 // Create a memory projection from the call, then set_all_memory.
509 void set_all_memory_call(Node* call, bool separate_io_proj = false); 510 void set_all_memory_call(Node* call, bool separate_io_proj = false);
510 511
511 // Create a LoadNode, reading from the parser's memory state. 512 // Create a LoadNode, reading from the parser's memory state.
512 // (Note: require_atomic_access is useful only with T_LONG.) 513 // (Note: require_atomic_access is useful only with T_LONG.)
514 //
515 // We choose the unordered semantics by default because we have
516 // adapted the `do_put_xxx' and `do_get_xxx' procedures for the case
517 // of volatile fields.
513 Node* make_load(Node* ctl, Node* adr, const Type* t, BasicType bt, 518 Node* make_load(Node* ctl, Node* adr, const Type* t, BasicType bt,
514 bool require_atomic_access = false) { 519 MemNode::MemOrd mo, bool require_atomic_access = false) {
515 // This version computes alias_index from bottom_type 520 // This version computes alias_index from bottom_type
516 return make_load(ctl, adr, t, bt, adr->bottom_type()->is_ptr(), 521 return make_load(ctl, adr, t, bt, adr->bottom_type()->is_ptr(),
517 require_atomic_access); 522 mo, require_atomic_access);
518 } 523 }
519 Node* make_load(Node* ctl, Node* adr, const Type* t, BasicType bt, const TypePtr* adr_type, bool require_atomic_access = false) { 524 Node* make_load(Node* ctl, Node* adr, const Type* t, BasicType bt, const TypePtr* adr_type,
525 MemNode::MemOrd mo, bool require_atomic_access = false) {
520 // This version computes alias_index from an address type 526 // This version computes alias_index from an address type
521 assert(adr_type != NULL, "use other make_load factory"); 527 assert(adr_type != NULL, "use other make_load factory");
522 return make_load(ctl, adr, t, bt, C->get_alias_index(adr_type), 528 return make_load(ctl, adr, t, bt, C->get_alias_index(adr_type),
523 require_atomic_access); 529 mo, require_atomic_access);
524 } 530 }
525 // This is the base version which is given an alias index. 531 // This is the base version which is given an alias index.
526 Node* make_load(Node* ctl, Node* adr, const Type* t, BasicType bt, int adr_idx, bool require_atomic_access = false); 532 Node* make_load(Node* ctl, Node* adr, const Type* t, BasicType bt, int adr_idx,
533 MemNode::MemOrd mo, bool require_atomic_access = false);
527 534
528 // Create & transform a StoreNode and store the effect into the 535 // Create & transform a StoreNode and store the effect into the
529 // parser's memory state. 536 // parser's memory state.
537 //
538 // We must ensure that stores of object references will be visible
539 // only after the object's initialization. So the clients of this
540 // procedure must indicate that the store requires `release'
541 // semantics, if the stored value is an object reference that might
542 // point to a new object and may become externally visible.
530 Node* store_to_memory(Node* ctl, Node* adr, Node* val, BasicType bt, 543 Node* store_to_memory(Node* ctl, Node* adr, Node* val, BasicType bt,
531 const TypePtr* adr_type, 544 const TypePtr* adr_type,
545 MemNode::MemOrd mo,
532 bool require_atomic_access = false) { 546 bool require_atomic_access = false) {
533 // This version computes alias_index from an address type 547 // This version computes alias_index from an address type
534 assert(adr_type != NULL, "use other store_to_memory factory"); 548 assert(adr_type != NULL, "use other store_to_memory factory");
535 return store_to_memory(ctl, adr, val, bt, 549 return store_to_memory(ctl, adr, val, bt,
536 C->get_alias_index(adr_type), 550 C->get_alias_index(adr_type),
537 require_atomic_access); 551 mo, require_atomic_access);
538 } 552 }
539 // This is the base version which is given alias index 553 // This is the base version which is given alias index
540 // Return the new StoreXNode 554 // Return the new StoreXNode
541 Node* store_to_memory(Node* ctl, Node* adr, Node* val, BasicType bt, 555 Node* store_to_memory(Node* ctl, Node* adr, Node* val, BasicType bt,
542 int adr_idx, 556 int adr_idx,
557 MemNode::MemOrd,
543 bool require_atomic_access = false); 558 bool require_atomic_access = false);
544 559
545 560
546 // All in one pre-barrier, store, post_barrier 561 // All in one pre-barrier, store, post_barrier
547 // Insert a write-barrier'd store. This is to let generational GC 562 // Insert a write-barrier'd store. This is to let generational GC
555 // 570 //
556 // If val==NULL, it is taken to be a completely unknown value. QQQ 571 // If val==NULL, it is taken to be a completely unknown value. QQQ
557 572
558 Node* store_oop(Node* ctl, 573 Node* store_oop(Node* ctl,
559 Node* obj, // containing obj 574 Node* obj, // containing obj
560 Node* adr, // actual adress to store val at 575 Node* adr, // actual adress to store val at
561 const TypePtr* adr_type, 576 const TypePtr* adr_type,
562 Node* val, 577 Node* val,
563 const TypeOopPtr* val_type, 578 const TypeOopPtr* val_type,
564 BasicType bt, 579 BasicType bt,
565 bool use_precise); 580 bool use_precise,
581 MemNode::MemOrd mo);
566 582
567 Node* store_oop_to_object(Node* ctl, 583 Node* store_oop_to_object(Node* ctl,
568 Node* obj, // containing obj 584 Node* obj, // containing obj
569 Node* adr, // actual adress to store val at 585 Node* adr, // actual adress to store val at
570 const TypePtr* adr_type, 586 const TypePtr* adr_type,
571 Node* val, 587 Node* val,
572 const TypeOopPtr* val_type, 588 const TypeOopPtr* val_type,
573 BasicType bt) { 589 BasicType bt,
574 return store_oop(ctl, obj, adr, adr_type, val, val_type, bt, false); 590 MemNode::MemOrd mo) {
591 return store_oop(ctl, obj, adr, adr_type, val, val_type, bt, false, mo);
575 } 592 }
576 593
577 Node* store_oop_to_array(Node* ctl, 594 Node* store_oop_to_array(Node* ctl,
578 Node* obj, // containing obj 595 Node* obj, // containing obj
579 Node* adr, // actual adress to store val at 596 Node* adr, // actual adress to store val at
580 const TypePtr* adr_type, 597 const TypePtr* adr_type,
581 Node* val, 598 Node* val,
582 const TypeOopPtr* val_type, 599 const TypeOopPtr* val_type,
583 BasicType bt) { 600 BasicType bt,
584 return store_oop(ctl, obj, adr, adr_type, val, val_type, bt, true); 601 MemNode::MemOrd mo) {
602 return store_oop(ctl, obj, adr, adr_type, val, val_type, bt, true, mo);
585 } 603 }
586 604
587 // Could be an array or object we don't know at compile time (unsafe ref.) 605 // Could be an array or object we don't know at compile time (unsafe ref.)
588 Node* store_oop_to_unknown(Node* ctl, 606 Node* store_oop_to_unknown(Node* ctl,
589 Node* obj, // containing obj 607 Node* obj, // containing obj
590 Node* adr, // actual adress to store val at 608 Node* adr, // actual adress to store val at
591 const TypePtr* adr_type, 609 const TypePtr* adr_type,
592 Node* val, 610 Node* val,
593 BasicType bt); 611 BasicType bt,
612 MemNode::MemOrd mo);
594 613
595 // For the few case where the barriers need special help 614 // For the few case where the barriers need special help
596 void pre_barrier(bool do_load, Node* ctl, 615 void pre_barrier(bool do_load, Node* ctl,
597 Node* obj, Node* adr, uint adr_idx, Node* val, const TypeOopPtr* val_type, 616 Node* obj, Node* adr, uint adr_idx, Node* val, const TypeOopPtr* val_type,
598 Node* pre_val, 617 Node* pre_val,
781 RC_LEAF = 0 // null value: no flags set 800 RC_LEAF = 0 // null value: no flags set
782 }; 801 };
783 802
784 // merge in all memory slices from new_mem, along the given path 803 // merge in all memory slices from new_mem, along the given path
785 void merge_memory(Node* new_mem, Node* region, int new_path); 804 void merge_memory(Node* new_mem, Node* region, int new_path);
786 void make_slow_call_ex(Node* call, ciInstanceKlass* ex_klass, bool separate_io_proj); 805 void make_slow_call_ex(Node* call, ciInstanceKlass* ex_klass, bool separate_io_proj, bool deoptimize = false);
787 806
788 // Helper functions to build synchronizations 807 // Helper functions to build synchronizations
789 int next_monitor(); 808 int next_monitor();
790 Node* insert_mem_bar(int opcode, Node* precedent = NULL); 809 Node* insert_mem_bar(int opcode, Node* precedent = NULL);
791 Node* insert_mem_bar_volatile(int opcode, int alias_idx, Node* precedent = NULL); 810 Node* insert_mem_bar_volatile(int opcode, int alias_idx, Node* precedent = NULL);
823 Node* type_check_receiver(Node* receiver, ciKlass* klass, float prob, 842 Node* type_check_receiver(Node* receiver, ciKlass* klass, float prob,
824 Node* *casted_receiver); 843 Node* *casted_receiver);
825 844
826 // implementation of object creation 845 // implementation of object creation
827 Node* set_output_for_allocation(AllocateNode* alloc, 846 Node* set_output_for_allocation(AllocateNode* alloc,
828 const TypeOopPtr* oop_type); 847 const TypeOopPtr* oop_type,
848 bool deoptimize_on_exception=false);
829 Node* get_layout_helper(Node* klass_node, jint& constant_value); 849 Node* get_layout_helper(Node* klass_node, jint& constant_value);
830 Node* new_instance(Node* klass_node, 850 Node* new_instance(Node* klass_node,
831 Node* slow_test = NULL, 851 Node* slow_test = NULL,
832 Node* *return_size_val = NULL); 852 Node* *return_size_val = NULL,
853 bool deoptimize_on_exception = false);
833 Node* new_array(Node* klass_node, Node* count_val, int nargs, 854 Node* new_array(Node* klass_node, Node* count_val, int nargs,
834 Node* *return_size_val = NULL); 855 Node* *return_size_val = NULL,
856 bool deoptimize_on_exception = false);
835 857
836 // java.lang.String helpers 858 // java.lang.String helpers
837 Node* load_String_offset(Node* ctrl, Node* str); 859 Node* load_String_offset(Node* ctrl, Node* str);
838 Node* load_String_length(Node* ctrl, Node* str); 860 Node* load_String_length(Node* ctrl, Node* str);
839 Node* load_String_value(Node* ctrl, Node* str); 861 Node* load_String_value(Node* ctrl, Node* str);