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 * 19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 20 * or visit www.oracle.com if you need additional information or have any 21 * questions. 22 * 23 */ 24 25 class FastLockNode; 26 class FastUnlockNode; 27 class IdealKit; 28 class Parse; 29 class RootNode; 30 31 //----------------------------------------------------------------------------- 32 //----------------------------GraphKit----------------------------------------- 33 // Toolkit for building the common sorts of subgraphs. 34 // Does not know about bytecode parsing or type-flow results. 35 // It is able to create graphs implementing the semantics of most 36 // or all bytecodes, so that it can expand intrinsics and calls. 37 // It may depend on JVMState structure, but it must not depend 38 // on specific bytecode streams. 39 class GraphKit : public Phase { 40 friend class PreserveJVMState; 41 42 protected: 43 ciEnv* _env; // Compilation environment 44 PhaseGVN &_gvn; // Some optimizations while parsing 807 // The code {x...} must not fall through. 808 // The kit's main flow of control is set to the "then" continuation of if(p). 809 class BuildCutout: public PreserveJVMState { 810 public: 811 BuildCutout(GraphKit* kit, Node* p, float prob, float cnt = COUNT_UNKNOWN); 812 ~BuildCutout(); 813 }; 814 815 // Helper class to preserve the original _reexecute bit and _sp and restore 816 // them back 817 class PreserveReexecuteState: public StackObj { 818 protected: 819 GraphKit* _kit; 820 uint _sp; 821 JVMState::ReexecuteState _reexecute; 822 823 public: 824 PreserveReexecuteState(GraphKit* kit); 825 ~PreserveReexecuteState(); 826 }; | 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 * 19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 20 * or visit www.oracle.com if you need additional information or have any 21 * questions. 22 * 23 */ 24 25 #ifndef SHARE_VM_OPTO_GRAPHKIT_HPP 26 #define SHARE_VM_OPTO_GRAPHKIT_HPP 27 28 #include "ci/ciEnv.hpp" 29 #include "ci/ciMethodData.hpp" 30 #include "opto/addnode.hpp" 31 #include "opto/callnode.hpp" 32 #include "opto/cfgnode.hpp" 33 #include "opto/compile.hpp" 34 #include "opto/divnode.hpp" 35 #include "opto/mulnode.hpp" 36 #include "opto/phaseX.hpp" 37 #include "opto/subnode.hpp" 38 #include "opto/type.hpp" 39 #include "runtime/deoptimization.hpp" 40 41 class FastLockNode; 42 class FastUnlockNode; 43 class IdealKit; 44 class Parse; 45 class RootNode; 46 47 //----------------------------------------------------------------------------- 48 //----------------------------GraphKit----------------------------------------- 49 // Toolkit for building the common sorts of subgraphs. 50 // Does not know about bytecode parsing or type-flow results. 51 // It is able to create graphs implementing the semantics of most 52 // or all bytecodes, so that it can expand intrinsics and calls. 53 // It may depend on JVMState structure, but it must not depend 54 // on specific bytecode streams. 55 class GraphKit : public Phase { 56 friend class PreserveJVMState; 57 58 protected: 59 ciEnv* _env; // Compilation environment 60 PhaseGVN &_gvn; // Some optimizations while parsing 823 // The code {x...} must not fall through. 824 // The kit's main flow of control is set to the "then" continuation of if(p). 825 class BuildCutout: public PreserveJVMState { 826 public: 827 BuildCutout(GraphKit* kit, Node* p, float prob, float cnt = COUNT_UNKNOWN); 828 ~BuildCutout(); 829 }; 830 831 // Helper class to preserve the original _reexecute bit and _sp and restore 832 // them back 833 class PreserveReexecuteState: public StackObj { 834 protected: 835 GraphKit* _kit; 836 uint _sp; 837 JVMState::ReexecuteState _reexecute; 838 839 public: 840 PreserveReexecuteState(GraphKit* kit); 841 ~PreserveReexecuteState(); 842 }; 843 844 #endif // SHARE_VM_OPTO_GRAPHKIT_HPP |