Mercurial > hg > truffle
annotate src/share/vm/opto/rootnode.cpp @ 9126:bc26f978b0ce
HotSpotResolvedObjectType: implement hasFinalizeSubclass() correctly
don't use the (wrong) cached value, but ask the runtime on each request.
Fixes regression on xml.* benchmarks @ specjvm2008. The problem was:
After the constructor of Object was deoptimized due to an assumption violation,
it was recompiled again after some time. However, on recompilation, the value
of hasFinalizeSubclass for the class was not updated and it was compiled again
with a, now wrong, assumption, which then triggers deoptimization again.
This was repeated until it hit the recompilation limit (defined by
PerMethodRecompilationCutoff), and therefore only executed by the interpreter
from now on, causing the performance regression.
author | Bernhard Urban <bernhard.urban@jku.at> |
---|---|
date | Mon, 15 Apr 2013 19:54:58 +0200 |
parents | f95d63e2154a |
children |
rev | line source |
---|---|
0 | 1 /* |
1972 | 2 * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. |
0 | 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 * | |
5 * This code is free software; you can redistribute it and/or modify it | |
6 * under the terms of the GNU General Public License version 2 only, as | |
7 * published by the Free Software Foundation. | |
8 * | |
9 * This code is distributed in the hope that it will be useful, but WITHOUT | |
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | |
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | |
12 * version 2 for more details (a copy is included in the LICENSE file that | |
13 * accompanied this code). | |
14 * | |
15 * You should have received a copy of the GNU General Public License version | |
16 * 2 along with this work; if not, write to the Free Software Foundation, | |
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. | |
18 * | |
1552
c18cbe5936b8
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
0
diff
changeset
|
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
c18cbe5936b8
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
0
diff
changeset
|
20 * or visit www.oracle.com if you need additional information or have any |
c18cbe5936b8
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
0
diff
changeset
|
21 * questions. |
0 | 22 * |
23 */ | |
24 | |
1972 | 25 #include "precompiled.hpp" |
26 #include "memory/allocation.inline.hpp" | |
27 #include "opto/callnode.hpp" | |
28 #include "opto/cfgnode.hpp" | |
29 #include "opto/phaseX.hpp" | |
30 #include "opto/regmask.hpp" | |
31 #include "opto/rootnode.hpp" | |
32 #include "opto/subnode.hpp" | |
33 #include "opto/type.hpp" | |
0 | 34 |
35 //------------------------------Ideal------------------------------------------ | |
36 // Remove dead inputs | |
37 Node *RootNode::Ideal(PhaseGVN *phase, bool can_reshape) { | |
38 for( uint i = 1; i < req(); i++ ) { // For all inputs | |
39 // Check for and remove dead inputs | |
40 if( phase->type(in(i)) == Type::TOP ) { | |
41 del_req(i--); // Delete TOP inputs | |
42 } | |
43 } | |
44 | |
45 // I used to do tail-splitting in the Ideal graph here, but it does not | |
46 // work. The tail-splitting forces values live into the Return to be | |
47 // ready at a point which dominates the split returns. This forces Stores | |
48 // to be hoisted high. The "proper" fix would be to split Stores down | |
49 // each path, but this makes the split unprofitable. If we want to do this | |
50 // optimization, it needs to be done after allocation so we can count all | |
51 // the instructions needing to be cloned in the cost metric. | |
52 | |
53 // There used to be a spoof here for caffeine marks which completely | |
54 // eliminated very simple self-recursion recursions, but it's not worth it. | |
55 // Deep inlining of self-calls gets nearly all of the same benefits. | |
56 // If we want to get the rest of the win later, we should pattern match | |
57 // simple recursive call trees to closed-form solutions. | |
58 | |
59 return NULL; // No further opportunities exposed | |
60 } | |
61 | |
62 //============================================================================= | |
63 HaltNode::HaltNode( Node *ctrl, Node *frameptr ) : Node(TypeFunc::Parms) { | |
64 Node* top = Compile::current()->top(); | |
65 init_req(TypeFunc::Control, ctrl ); | |
66 init_req(TypeFunc::I_O, top); | |
67 init_req(TypeFunc::Memory, top); | |
68 init_req(TypeFunc::FramePtr, frameptr ); | |
69 init_req(TypeFunc::ReturnAdr,top); | |
70 } | |
71 | |
72 const Type *HaltNode::bottom_type() const { return Type::BOTTOM; } | |
73 | |
74 //------------------------------Ideal------------------------------------------ | |
75 Node *HaltNode::Ideal(PhaseGVN *phase, bool can_reshape) { | |
76 return remove_dead_region(phase, can_reshape) ? this : NULL; | |
77 } | |
78 | |
79 //------------------------------Value------------------------------------------ | |
80 const Type *HaltNode::Value( PhaseTransform *phase ) const { | |
81 return ( phase->type(in(TypeFunc::Control)) == Type::TOP) | |
82 ? Type::TOP | |
83 : Type::BOTTOM; | |
84 } | |
85 | |
86 const RegMask &HaltNode::out_RegMask() const { | |
87 return RegMask::Empty; | |
88 } |