Mercurial > hg > graal-compiler
comparison src/share/vm/opto/parse2.cpp @ 254:3e333d6f35dd
6730192: expression stack wrong at deoptimization point
Summary: add safepoint before popping expression stack, not after
Reviewed-by: kvn
author | rasbold |
---|---|
date | Tue, 29 Jul 2008 14:48:25 -0700 |
parents | 18aab3cdd513 |
children | 8261ee795323 |
comparison
equal
deleted
inserted
replaced
253:b0fe4deeb9fb | 254:3e333d6f35dd |
---|---|
923 next_block->next_path_num(); | 923 next_block->next_path_num(); |
924 } | 924 } |
925 return; | 925 return; |
926 } | 926 } |
927 | 927 |
928 // If this is a backwards branch in the bytecodes, add Safepoint | |
929 maybe_add_safepoint(target_bci); | |
930 | |
931 explicit_null_checks_inserted++; | 928 explicit_null_checks_inserted++; |
932 | 929 |
933 // Generate real control flow | 930 // Generate real control flow |
934 Node *tst = _gvn.transform( new (C, 2) BoolNode( c, btest ) ); | 931 Node *tst = _gvn.transform( new (C, 2) BoolNode( c, btest ) ); |
935 | 932 |
1006 branch_block->next_path_num(); | 1003 branch_block->next_path_num(); |
1007 next_block->next_path_num(); | 1004 next_block->next_path_num(); |
1008 } | 1005 } |
1009 return; | 1006 return; |
1010 } | 1007 } |
1011 | |
1012 // If this is a backwards branch in the bytecodes, add Safepoint | |
1013 maybe_add_safepoint(target_bci); | |
1014 | 1008 |
1015 // Sanity check the probability value | 1009 // Sanity check the probability value |
1016 assert(0.0f < prob && prob < 1.0f,"Bad probability in Parser"); | 1010 assert(0.0f < prob && prob < 1.0f,"Bad probability in Parser"); |
1017 | 1011 |
1018 bool taken_if_true = true; | 1012 bool taken_if_true = true; |
2098 } | 2092 } |
2099 | 2093 |
2100 case Bytecodes::_ifnull: btest = BoolTest::eq; goto handle_if_null; | 2094 case Bytecodes::_ifnull: btest = BoolTest::eq; goto handle_if_null; |
2101 case Bytecodes::_ifnonnull: btest = BoolTest::ne; goto handle_if_null; | 2095 case Bytecodes::_ifnonnull: btest = BoolTest::ne; goto handle_if_null; |
2102 handle_if_null: | 2096 handle_if_null: |
2097 // If this is a backwards branch in the bytecodes, add Safepoint | |
2098 maybe_add_safepoint(iter().get_dest()); | |
2103 a = null(); | 2099 a = null(); |
2104 b = pop(); | 2100 b = pop(); |
2105 c = _gvn.transform( new (C, 3) CmpPNode(b, a) ); | 2101 c = _gvn.transform( new (C, 3) CmpPNode(b, a) ); |
2106 do_ifnull(btest, c); | 2102 do_ifnull(btest, c); |
2107 break; | 2103 break; |
2108 | 2104 |
2109 case Bytecodes::_if_acmpeq: btest = BoolTest::eq; goto handle_if_acmp; | 2105 case Bytecodes::_if_acmpeq: btest = BoolTest::eq; goto handle_if_acmp; |
2110 case Bytecodes::_if_acmpne: btest = BoolTest::ne; goto handle_if_acmp; | 2106 case Bytecodes::_if_acmpne: btest = BoolTest::ne; goto handle_if_acmp; |
2111 handle_if_acmp: | 2107 handle_if_acmp: |
2108 // If this is a backwards branch in the bytecodes, add Safepoint | |
2109 maybe_add_safepoint(iter().get_dest()); | |
2112 a = pop(); | 2110 a = pop(); |
2113 b = pop(); | 2111 b = pop(); |
2114 c = _gvn.transform( new (C, 3) CmpPNode(b, a) ); | 2112 c = _gvn.transform( new (C, 3) CmpPNode(b, a) ); |
2115 do_if(btest, c); | 2113 do_if(btest, c); |
2116 break; | 2114 break; |
2120 case Bytecodes::_iflt: btest = BoolTest::lt; goto handle_ifxx; | 2118 case Bytecodes::_iflt: btest = BoolTest::lt; goto handle_ifxx; |
2121 case Bytecodes::_ifle: btest = BoolTest::le; goto handle_ifxx; | 2119 case Bytecodes::_ifle: btest = BoolTest::le; goto handle_ifxx; |
2122 case Bytecodes::_ifgt: btest = BoolTest::gt; goto handle_ifxx; | 2120 case Bytecodes::_ifgt: btest = BoolTest::gt; goto handle_ifxx; |
2123 case Bytecodes::_ifge: btest = BoolTest::ge; goto handle_ifxx; | 2121 case Bytecodes::_ifge: btest = BoolTest::ge; goto handle_ifxx; |
2124 handle_ifxx: | 2122 handle_ifxx: |
2123 // If this is a backwards branch in the bytecodes, add Safepoint | |
2124 maybe_add_safepoint(iter().get_dest()); | |
2125 a = _gvn.intcon(0); | 2125 a = _gvn.intcon(0); |
2126 b = pop(); | 2126 b = pop(); |
2127 c = _gvn.transform( new (C, 3) CmpINode(b, a) ); | 2127 c = _gvn.transform( new (C, 3) CmpINode(b, a) ); |
2128 do_if(btest, c); | 2128 do_if(btest, c); |
2129 break; | 2129 break; |
2133 case Bytecodes::_if_icmplt: btest = BoolTest::lt; goto handle_if_icmp; | 2133 case Bytecodes::_if_icmplt: btest = BoolTest::lt; goto handle_if_icmp; |
2134 case Bytecodes::_if_icmple: btest = BoolTest::le; goto handle_if_icmp; | 2134 case Bytecodes::_if_icmple: btest = BoolTest::le; goto handle_if_icmp; |
2135 case Bytecodes::_if_icmpgt: btest = BoolTest::gt; goto handle_if_icmp; | 2135 case Bytecodes::_if_icmpgt: btest = BoolTest::gt; goto handle_if_icmp; |
2136 case Bytecodes::_if_icmpge: btest = BoolTest::ge; goto handle_if_icmp; | 2136 case Bytecodes::_if_icmpge: btest = BoolTest::ge; goto handle_if_icmp; |
2137 handle_if_icmp: | 2137 handle_if_icmp: |
2138 // If this is a backwards branch in the bytecodes, add Safepoint | |
2139 maybe_add_safepoint(iter().get_dest()); | |
2138 a = pop(); | 2140 a = pop(); |
2139 b = pop(); | 2141 b = pop(); |
2140 c = _gvn.transform( new (C, 3) CmpINode( b, a ) ); | 2142 c = _gvn.transform( new (C, 3) CmpINode( b, a ) ); |
2141 do_if(btest, c); | 2143 do_if(btest, c); |
2142 break; | 2144 break; |