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 // An XHandler is a C1 internal description for an exception handler 26 27 class XHandler: public CompilationResourceObj { 28 private: 29 ciExceptionHandler* _desc; 30 31 BlockBegin* _entry_block; // Entry block of xhandler 32 LIR_List* _entry_code; // LIR-operations that must be executed before jumping to entry_block 33 int _entry_pco; // pco where entry_code (or entry_block if no entry_code) starts 34 int _phi_operand; // For resolving of phi functions at begin of entry_block 35 int _scope_count; // for filling ExceptionRangeEntry::scope_count 36 37 #ifdef ASSERT 38 int _lir_op_id; // op_id of the LIR-operation throwing to this handler 39 #endif 40 41 public: 42 // creation 43 XHandler(ciExceptionHandler* desc) 44 : _desc(desc) 368 369 370 // Globally do instruction substitution and remove substituted 371 // instructions from the instruction list. 372 // 373 374 class SubstitutionResolver: public BlockClosure, ValueVisitor { 375 virtual void visit(Value* v); 376 377 public: 378 SubstitutionResolver(IR* hir) { 379 hir->iterate_preorder(this); 380 } 381 382 SubstitutionResolver(BlockBegin* block) { 383 block->iterate_preorder(this); 384 } 385 386 virtual void block_do(BlockBegin* block); 387 }; | 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_C1_C1_IR_HPP 26 #define SHARE_VM_C1_C1_IR_HPP 27 28 #include "c1/c1_Instruction.hpp" 29 #include "ci/ciExceptionHandler.hpp" 30 #include "ci/ciMethod.hpp" 31 #include "ci/ciStreams.hpp" 32 #include "memory/allocation.hpp" 33 34 // An XHandler is a C1 internal description for an exception handler 35 36 class XHandler: public CompilationResourceObj { 37 private: 38 ciExceptionHandler* _desc; 39 40 BlockBegin* _entry_block; // Entry block of xhandler 41 LIR_List* _entry_code; // LIR-operations that must be executed before jumping to entry_block 42 int _entry_pco; // pco where entry_code (or entry_block if no entry_code) starts 43 int _phi_operand; // For resolving of phi functions at begin of entry_block 44 int _scope_count; // for filling ExceptionRangeEntry::scope_count 45 46 #ifdef ASSERT 47 int _lir_op_id; // op_id of the LIR-operation throwing to this handler 48 #endif 49 50 public: 51 // creation 52 XHandler(ciExceptionHandler* desc) 53 : _desc(desc) 377 378 379 // Globally do instruction substitution and remove substituted 380 // instructions from the instruction list. 381 // 382 383 class SubstitutionResolver: public BlockClosure, ValueVisitor { 384 virtual void visit(Value* v); 385 386 public: 387 SubstitutionResolver(IR* hir) { 388 hir->iterate_preorder(this); 389 } 390 391 SubstitutionResolver(BlockBegin* block) { 392 block->iterate_preorder(this); 393 } 394 395 virtual void block_do(BlockBegin* block); 396 }; 397 398 #endif // SHARE_VM_C1_C1_IR_HPP |