/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*
*/
#include "precompiled.hpp"
#include "ci/ciMethodBlocks.hpp"
#include "ci/ciStreams.hpp"
#include "interpreter/bytecode.hpp"
// ciMethodBlocks
return blk;
}
}
// ------------------------------------------------------------------
// ciMethodBlocks::split_block_at
//
// Split the block spanning bci into two separate ranges. The former
// block becomes the second half and a new range is created for the
// first half. Returns the range beginning at bci.
if (current_block == former_block) {
// Replace it.
} else if (current_block == NULL) {
// Non-bytecode start. Skip.
continue;
} else {
// We are done with our backwards walk
break;
}
}
// Move an exception handler information if needed.
if (former_block->is_handler()) {
// Clear information in former_block.
}
return former_block;
}
// This is our first time visiting this bytecode. Create
// a fresh block and assign it this starting point.
return nb;
// The block begins at bci. Simply return it.
return cb;
} else {
// We have already created a block containing bci but
// not starting at bci. This existing block needs to
// be split into two.
return split_block_at(bci);
}
}
return dum;
}
// Determine if a new block has been made at the current bci. If
// this block differs from our current range, switch to the new
// one and end the old one.
// We have not marked this bci as the start of a new block.
// Keep interpreting the current_range.
} else {
}
switch (s.cur_bc()) {
case Bytecodes::_if_icmpeq :
case Bytecodes::_if_icmpne :
case Bytecodes::_if_icmplt :
case Bytecodes::_if_icmpge :
case Bytecodes::_if_icmpgt :
case Bytecodes::_if_icmple :
case Bytecodes::_if_acmpeq :
case Bytecodes::_if_acmpne :
case Bytecodes::_ifnonnull :
{
break;
}
{
(void) make_block_at(s.next_bci());
}
break;
}
{
break;
}
case Bytecodes::_tableswitch :
{
Bytecode_tableswitch sw(&s);
int dest_bci;
for (int i = 0; i < len; i++) {
}
}
}
break;
case Bytecodes::_lookupswitch:
{
Bytecode_lookupswitch sw(&s);
int dest_bci;
for (int i = 0; i < len; i++) {
}
}
}
break;
{
(void) make_block_at(s.next_bci());
}
break;
}
{
break;
}
// fall-through
(void) make_block_at(s.next_bci());
}
break;
}
}
// End the last block
}
// create initial block covering the entire method
_bci_to_block[0] = b;
// create blocks for exception handlers
if (meth->has_exception_handlers()) {
//
// Several exception handlers can have the same handler_bci:
//
// try {
// if (a.foo(b) < 0) {
// return a.error();
// }
// return CoderResult.UNDERFLOW;
// } finally {
// a.position(b);
// }
//
// The try block above is divided into 2 exception blocks
// separated by 'areturn' bci.
//
// ensure a block at the start of exception range and start of following code
(void) make_block_at(ex_start);
if (ex_end < _code_size)
(void) make_block_at(ex_end);
if (eb->is_handler()) {
// Extend old handler exception range to cover additional range.
if (ex_start > old_ex_start)
if (ex_end < old_ex_end)
ex_end = old_ex_end;
}
}
}
// scan the bytecodes and identify blocks
do_analysis();
// mark blocks that have exception handlers
if (meth->has_exception_handlers()) {
b->set_has_handler();
}
}
}
}
}
#ifndef PRODUCT
}
}
#endif
#ifndef PRODUCT
#endif
}
set_handler();
}
#ifndef PRODUCT
static const char *flagnames[] = {
"Processed",
"Handler",
"MayThrow",
"Jsr",
"Ret",
"RetTarget",
"HasHandler",
};
for (int i = 0; i < 8; i++) {
if ((_flags & (1 << i)) != 0) {
}
}
if (is_handler())
}
// ------------------------------------------------------------------
// ciBlock::print_on
if (control_bci() == fall_through_bci) {
} else {
}
if (Verbose || WizardMode) {
}
}
#endif