comparison src/share/vm/opto/macro.cpp @ 342:37f87013dfd8

6711316: Open source the Garbage-First garbage collector Summary: First mercurial integration of the code for the Garbage-First garbage collector. Reviewed-by: apetrusenko, iveresov, jmasa, sgoldman, tonyp, ysr
author ysr
date Thu, 05 Jun 2008 15:57:56 -0700
parents b130b98db9cf
children 6aae2f9d0294
comparison
equal deleted inserted replaced
189:0b27f3512f9e 342:37f87013dfd8
921 921
922 Node* eden_top_adr; 922 Node* eden_top_adr;
923 Node* eden_end_adr; 923 Node* eden_end_adr;
924 set_eden_pointers(eden_top_adr, eden_end_adr); 924 set_eden_pointers(eden_top_adr, eden_end_adr);
925 925
926 uint raw_idx = C->get_alias_index(TypeRawPtr::BOTTOM);
927 assert(ctrl != NULL, "must have control"); 926 assert(ctrl != NULL, "must have control");
928
929 // Load Eden::end. Loop invariant and hoisted.
930 //
931 // Note: We set the control input on "eden_end" and "old_eden_top" when using
932 // a TLAB to work around a bug where these values were being moved across
933 // a safepoint. These are not oops, so they cannot be include in the oop
934 // map, but the can be changed by a GC. The proper way to fix this would
935 // be to set the raw memory state when generating a SafepointNode. However
936 // this will require extensive changes to the loop optimization in order to
937 // prevent a degradation of the optimization.
938 // See comment in memnode.hpp, around line 227 in class LoadPNode.
939 Node* eden_end = make_load(ctrl, mem, eden_end_adr, 0, TypeRawPtr::BOTTOM, T_ADDRESS);
940
941 // We need a Region and corresponding Phi's to merge the slow-path and fast-path results. 927 // We need a Region and corresponding Phi's to merge the slow-path and fast-path results.
942 // they will not be used if "always_slow" is set 928 // they will not be used if "always_slow" is set
943 enum { slow_result_path = 1, fast_result_path = 2 }; 929 enum { slow_result_path = 1, fast_result_path = 2 };
944 Node *result_region; 930 Node *result_region;
945 Node *result_phi_rawmem; 931 Node *result_phi_rawmem;
955 initial_slow_test = NULL; 941 initial_slow_test = NULL;
956 } else { 942 } else {
957 initial_slow_test = BoolNode::make_predicate(initial_slow_test, &_igvn); 943 initial_slow_test = BoolNode::make_predicate(initial_slow_test, &_igvn);
958 } 944 }
959 945
960 if (DTraceAllocProbes) { 946 if (DTraceAllocProbes ||
947 !UseTLAB && (!Universe::heap()->supports_inline_contig_alloc() ||
948 (UseConcMarkSweepGC && CMSIncrementalMode))) {
961 // Force slow-path allocation 949 // Force slow-path allocation
962 always_slow = true; 950 always_slow = true;
963 initial_slow_test = NULL; 951 initial_slow_test = NULL;
964 } 952 }
953
965 954
966 enum { too_big_or_final_path = 1, need_gc_path = 2 }; 955 enum { too_big_or_final_path = 1, need_gc_path = 2 };
967 Node *slow_region = NULL; 956 Node *slow_region = NULL;
968 Node *toobig_false = ctrl; 957 Node *toobig_false = ctrl;
969 958
989 } 978 }
990 979
991 Node *slow_mem = mem; // save the current memory state for slow path 980 Node *slow_mem = mem; // save the current memory state for slow path
992 // generate the fast allocation code unless we know that the initial test will always go slow 981 // generate the fast allocation code unless we know that the initial test will always go slow
993 if (!always_slow) { 982 if (!always_slow) {
983 Node* eden_top_adr;
984 Node* eden_end_adr;
985
986 set_eden_pointers(eden_top_adr, eden_end_adr);
987
988 // Load Eden::end. Loop invariant and hoisted.
989 //
990 // Note: We set the control input on "eden_end" and "old_eden_top" when using
991 // a TLAB to work around a bug where these values were being moved across
992 // a safepoint. These are not oops, so they cannot be include in the oop
993 // map, but the can be changed by a GC. The proper way to fix this would
994 // be to set the raw memory state when generating a SafepointNode. However
995 // this will require extensive changes to the loop optimization in order to
996 // prevent a degradation of the optimization.
997 // See comment in memnode.hpp, around line 227 in class LoadPNode.
998 Node *eden_end = make_load(ctrl, mem, eden_end_adr, 0, TypeRawPtr::BOTTOM, T_ADDRESS);
999
994 // allocate the Region and Phi nodes for the result 1000 // allocate the Region and Phi nodes for the result
995 result_region = new (C, 3) RegionNode(3); 1001 result_region = new (C, 3) RegionNode(3);
996 result_phi_rawmem = new (C, 3) PhiNode( result_region, Type::MEMORY, TypeRawPtr::BOTTOM ); 1002 result_phi_rawmem = new (C, 3) PhiNode( result_region, Type::MEMORY, TypeRawPtr::BOTTOM );
997 result_phi_rawoop = new (C, 3) PhiNode( result_region, TypeRawPtr::BOTTOM ); 1003 result_phi_rawoop = new (C, 3) PhiNode( result_region, TypeRawPtr::BOTTOM );
998 result_phi_i_o = new (C, 3) PhiNode( result_region, Type::ABIO ); // I/O is used for Prefetch 1004 result_phi_i_o = new (C, 3) PhiNode( result_region, Type::ABIO ); // I/O is used for Prefetch