Path: blob/master/src/hotspot/share/ci/ciExceptionHandler.hpp
40930 views
/*1* Copyright (c) 1999, 2019, Oracle and/or its affiliates. All rights reserved.2* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.3*4* This code is free software; you can redistribute it and/or modify it5* under the terms of the GNU General Public License version 2 only, as6* published by the Free Software Foundation.7*8* This code is distributed in the hope that it will be useful, but WITHOUT9* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or10* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License11* version 2 for more details (a copy is included in the LICENSE file that12* accompanied this code).13*14* You should have received a copy of the GNU General Public License version15* 2 along with this work; if not, write to the Free Software Foundation,16* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.17*18* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA19* or visit www.oracle.com if you need additional information or have any20* questions.21*22*/2324#ifndef SHARE_CI_CIEXCEPTIONHANDLER_HPP25#define SHARE_CI_CIEXCEPTIONHANDLER_HPP2627#include "ci/ciClassList.hpp"28#include "ci/ciInstanceKlass.hpp"2930// ciExceptionHandler31//32// This class represents an exception handler for a method.33class ciExceptionHandler : public ResourceObj {34private:35friend class ciMethod;3637// The loader to be used for resolving the exception38// klass.39ciInstanceKlass* _loading_klass;4041// Handler data.42int _start;43int _limit;44int _handler_bci;45int _catch_klass_index;4647// The exception klass that this handler catches.48ciInstanceKlass* _catch_klass;4950public:51ciExceptionHandler(ciInstanceKlass* loading_klass,52int start, int limit,53int handler_bci, int klass_index) {54_loading_klass = loading_klass;55_start = start;56_limit = limit;57_handler_bci = handler_bci;58_catch_klass_index = klass_index;59_catch_klass = NULL;60}6162int start() { return _start; }63int limit() { return _limit; }64int handler_bci() { return _handler_bci; }65int catch_klass_index() { return _catch_klass_index; }6667// Get the exception klass that this handler catches.68ciInstanceKlass* catch_klass();6970bool is_catch_all() { return catch_klass_index() == 0; }71bool is_in_range(int bci) {72return start() <= bci && bci < limit();73}74bool is_rethrow() { return handler_bci() == -1; }7576void print();77};7879#endif // SHARE_CI_CIEXCEPTIONHANDLER_HPP808182