comparison src/share/vm/opto/graphKit.hpp @ 14422:2b8e28fdf503

Merge
author kvn
date Tue, 05 Nov 2013 17:38:04 -0800
parents b2ee5dc63353
children de6a9e811145 2113136690bc
comparison
equal deleted inserted replaced
14421:3068270ba476 14422:2b8e28fdf503
376 376
377 // Null check oop. Return null-path control into (*null_control). 377 // Null check oop. Return null-path control into (*null_control).
378 // Return a cast-not-null node which depends on the not-null control. 378 // Return a cast-not-null node which depends on the not-null control.
379 // If never_see_null, use an uncommon trap (*null_control sees a top). 379 // If never_see_null, use an uncommon trap (*null_control sees a top).
380 // The cast is not valid along the null path; keep a copy of the original. 380 // The cast is not valid along the null path; keep a copy of the original.
381 // If safe_for_replace, then we can replace the value with the cast
382 // in the parsing map (the cast is guaranteed to dominate the map)
381 Node* null_check_oop(Node* value, Node* *null_control, 383 Node* null_check_oop(Node* value, Node* *null_control,
382 bool never_see_null = false); 384 bool never_see_null = false, bool safe_for_replace = false);
383 385
384 // Check the null_seen bit. 386 // Check the null_seen bit.
385 bool seems_never_null(Node* obj, ciProfileData* data); 387 bool seems_never_null(Node* obj, ciProfileData* data);
386 388
389 // Check for unique class for receiver at call
390 ciKlass* profile_has_unique_klass() {
391 ciCallProfile profile = method()->call_profile_at_bci(bci());
392 if (profile.count() >= 0 && // no cast failures here
393 profile.has_receiver(0) &&
394 profile.morphism() == 1) {
395 return profile.receiver(0);
396 }
397 return NULL;
398 }
399
400 // record type from profiling with the type system
401 Node* record_profile_for_speculation(Node* n, ciKlass* exact_kls);
402 Node* record_profiled_receiver_for_speculation(Node* n);
403 void record_profiled_arguments_for_speculation(ciMethod* dest_method, Bytecodes::Code bc);
404 void record_profiled_parameters_for_speculation();
405
387 // Use the type profile to narrow an object type. 406 // Use the type profile to narrow an object type.
388 Node* maybe_cast_profiled_receiver(Node* not_null_obj, 407 Node* maybe_cast_profiled_receiver(Node* not_null_obj,
389 ciProfileData* data, 408 ciKlass* require_klass,
390 ciKlass* require_klass); 409 ciKlass* spec,
410 bool safe_for_replace);
411
412 // Cast obj to type and emit guard unless we had too many traps here already
413 Node* maybe_cast_profiled_obj(Node* obj,
414 ciKlass* type,
415 bool not_null = false);
391 416
392 // Cast obj to not-null on this path 417 // Cast obj to not-null on this path
393 Node* cast_not_null(Node* obj, bool do_replace_in_map = true); 418 Node* cast_not_null(Node* obj, bool do_replace_in_map = true);
394 // Replace all occurrences of one node by another. 419 // Replace all occurrences of one node by another.
395 void replace_in_map(Node* old, Node* neww); 420 void replace_in_map(Node* old, Node* neww);
692 void final_sync(IdealKit& ideal); 717 void final_sync(IdealKit& ideal);
693 718
694 // vanilla/CMS post barrier 719 // vanilla/CMS post barrier
695 void write_barrier_post(Node *store, Node* obj, 720 void write_barrier_post(Node *store, Node* obj,
696 Node* adr, uint adr_idx, Node* val, bool use_precise); 721 Node* adr, uint adr_idx, Node* val, bool use_precise);
722
723 // Allow reordering of pre-barrier with oop store and/or post-barrier.
724 // Used for load_store operations which loads old value.
725 bool can_move_pre_barrier() const;
697 726
698 // G1 pre/post barriers 727 // G1 pre/post barriers
699 void g1_write_barrier_pre(bool do_load, 728 void g1_write_barrier_pre(bool do_load,
700 Node* obj, 729 Node* obj,
701 Node* adr, 730 Node* adr,
767 // helper functions for the fast path/slow path idioms 796 // helper functions for the fast path/slow path idioms
768 Node* fast_and_slow(Node* in, const Type *result_type, Node* null_result, IfNode* fast_test, Node* fast_result, address slow_call, const TypeFunc *slow_call_type, Node* slow_arg, Klass* ex_klass, Node* slow_result); 797 Node* fast_and_slow(Node* in, const Type *result_type, Node* null_result, IfNode* fast_test, Node* fast_result, address slow_call, const TypeFunc *slow_call_type, Node* slow_arg, Klass* ex_klass, Node* slow_result);
769 798
770 // Generate an instance-of idiom. Used by both the instance-of bytecode 799 // Generate an instance-of idiom. Used by both the instance-of bytecode
771 // and the reflective instance-of call. 800 // and the reflective instance-of call.
772 Node* gen_instanceof( Node *subobj, Node* superkls ); 801 Node* gen_instanceof(Node *subobj, Node* superkls, bool safe_for_replace = false);
773 802
774 // Generate a check-cast idiom. Used by both the check-cast bytecode 803 // Generate a check-cast idiom. Used by both the check-cast bytecode
775 // and the array-store bytecode 804 // and the array-store bytecode
776 Node* gen_checkcast( Node *subobj, Node* superkls, 805 Node* gen_checkcast( Node *subobj, Node* superkls,
777 Node* *failure_control = NULL ); 806 Node* *failure_control = NULL );
830 } 859 }
831 860
832 // Insert a loop predicate into the graph 861 // Insert a loop predicate into the graph
833 void add_predicate(int nargs = 0); 862 void add_predicate(int nargs = 0);
834 void add_predicate_impl(Deoptimization::DeoptReason reason, int nargs); 863 void add_predicate_impl(Deoptimization::DeoptReason reason, int nargs);
864
865 // Produce new array node of stable type
866 Node* cast_array_to_stable(Node* ary, const TypeAryPtr* ary_type);
835 }; 867 };
836 868
837 // Helper class to support building of control flow branches. Upon 869 // Helper class to support building of control flow branches. Upon
838 // creation the map and sp at bci are cloned and restored upon de- 870 // creation the map and sp at bci are cloned and restored upon de-
839 // struction. Typical use: 871 // struction. Typical use: