Mercurial > hg > graal-compiler
comparison src/share/vm/opto/macro.cpp @ 360:5d254928c888
Merge
author | ysr |
---|---|
date | Wed, 27 Aug 2008 11:20:46 -0700 |
parents | 1ee8caae33af |
children | f8199438385b |
comparison
equal
deleted
inserted
replaced
341:d60e4e6d7f72 | 360:5d254928c888 |
---|---|
942 // optimize it to the raw slice. | 942 // optimize it to the raw slice. |
943 if (mem->is_MergeMem()) { | 943 if (mem->is_MergeMem()) { |
944 mem = mem->as_MergeMem()->memory_at(Compile::AliasIdxRaw); | 944 mem = mem->as_MergeMem()->memory_at(Compile::AliasIdxRaw); |
945 } | 945 } |
946 | 946 |
947 Node* eden_top_adr; | |
948 Node* eden_end_adr; | |
949 set_eden_pointers(eden_top_adr, eden_end_adr); | |
950 | |
951 uint raw_idx = C->get_alias_index(TypeRawPtr::BOTTOM); | |
952 assert(ctrl != NULL, "must have control"); | 947 assert(ctrl != NULL, "must have control"); |
953 | |
954 // Load Eden::end. Loop invariant and hoisted. | |
955 // | |
956 // Note: We set the control input on "eden_end" and "old_eden_top" when using | |
957 // a TLAB to work around a bug where these values were being moved across | |
958 // a safepoint. These are not oops, so they cannot be include in the oop | |
959 // map, but the can be changed by a GC. The proper way to fix this would | |
960 // be to set the raw memory state when generating a SafepointNode. However | |
961 // this will require extensive changes to the loop optimization in order to | |
962 // prevent a degradation of the optimization. | |
963 // See comment in memnode.hpp, around line 227 in class LoadPNode. | |
964 Node* eden_end = make_load(ctrl, mem, eden_end_adr, 0, TypeRawPtr::BOTTOM, T_ADDRESS); | |
965 | |
966 // We need a Region and corresponding Phi's to merge the slow-path and fast-path results. | 948 // We need a Region and corresponding Phi's to merge the slow-path and fast-path results. |
967 // they will not be used if "always_slow" is set | 949 // they will not be used if "always_slow" is set |
968 enum { slow_result_path = 1, fast_result_path = 2 }; | 950 enum { slow_result_path = 1, fast_result_path = 2 }; |
969 Node *result_region; | 951 Node *result_region; |
970 Node *result_phi_rawmem; | 952 Node *result_phi_rawmem; |
980 initial_slow_test = NULL; | 962 initial_slow_test = NULL; |
981 } else { | 963 } else { |
982 initial_slow_test = BoolNode::make_predicate(initial_slow_test, &_igvn); | 964 initial_slow_test = BoolNode::make_predicate(initial_slow_test, &_igvn); |
983 } | 965 } |
984 | 966 |
985 if (DTraceAllocProbes) { | 967 if (DTraceAllocProbes || |
968 !UseTLAB && (!Universe::heap()->supports_inline_contig_alloc() || | |
969 (UseConcMarkSweepGC && CMSIncrementalMode))) { | |
986 // Force slow-path allocation | 970 // Force slow-path allocation |
987 always_slow = true; | 971 always_slow = true; |
988 initial_slow_test = NULL; | 972 initial_slow_test = NULL; |
989 } | 973 } |
974 | |
990 | 975 |
991 enum { too_big_or_final_path = 1, need_gc_path = 2 }; | 976 enum { too_big_or_final_path = 1, need_gc_path = 2 }; |
992 Node *slow_region = NULL; | 977 Node *slow_region = NULL; |
993 Node *toobig_false = ctrl; | 978 Node *toobig_false = ctrl; |
994 | 979 |
1014 } | 999 } |
1015 | 1000 |
1016 Node *slow_mem = mem; // save the current memory state for slow path | 1001 Node *slow_mem = mem; // save the current memory state for slow path |
1017 // generate the fast allocation code unless we know that the initial test will always go slow | 1002 // generate the fast allocation code unless we know that the initial test will always go slow |
1018 if (!always_slow) { | 1003 if (!always_slow) { |
1004 Node* eden_top_adr; | |
1005 Node* eden_end_adr; | |
1006 | |
1007 set_eden_pointers(eden_top_adr, eden_end_adr); | |
1008 | |
1009 // Load Eden::end. Loop invariant and hoisted. | |
1010 // | |
1011 // Note: We set the control input on "eden_end" and "old_eden_top" when using | |
1012 // a TLAB to work around a bug where these values were being moved across | |
1013 // a safepoint. These are not oops, so they cannot be include in the oop | |
1014 // map, but the can be changed by a GC. The proper way to fix this would | |
1015 // be to set the raw memory state when generating a SafepointNode. However | |
1016 // this will require extensive changes to the loop optimization in order to | |
1017 // prevent a degradation of the optimization. | |
1018 // See comment in memnode.hpp, around line 227 in class LoadPNode. | |
1019 Node *eden_end = make_load(ctrl, mem, eden_end_adr, 0, TypeRawPtr::BOTTOM, T_ADDRESS); | |
1020 | |
1019 // allocate the Region and Phi nodes for the result | 1021 // allocate the Region and Phi nodes for the result |
1020 result_region = new (C, 3) RegionNode(3); | 1022 result_region = new (C, 3) RegionNode(3); |
1021 result_phi_rawmem = new (C, 3) PhiNode( result_region, Type::MEMORY, TypeRawPtr::BOTTOM ); | 1023 result_phi_rawmem = new (C, 3) PhiNode( result_region, Type::MEMORY, TypeRawPtr::BOTTOM ); |
1022 result_phi_rawoop = new (C, 3) PhiNode( result_region, TypeRawPtr::BOTTOM ); | 1024 result_phi_rawoop = new (C, 3) PhiNode( result_region, TypeRawPtr::BOTTOM ); |
1023 result_phi_i_o = new (C, 3) PhiNode( result_region, Type::ABIO ); // I/O is used for Prefetch | 1025 result_phi_i_o = new (C, 3) PhiNode( result_region, Type::ABIO ); // I/O is used for Prefetch |