ciStreams.cpp revision 0
0N/A * Copyright 1999-2005 Sun Microsystems, Inc. All Rights Reserved. 0N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 0N/A * This code is free software; you can redistribute it and/or modify it 0N/A * under the terms of the GNU General Public License version 2 only, as 0N/A * published by the Free Software Foundation. 0N/A * This code is distributed in the hope that it will be useful, but WITHOUT 0N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 0N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 0N/A * version 2 for more details (a copy is included in the LICENSE file that 0N/A * accompanied this code). 0N/A * You should have received a copy of the GNU General Public License version 0N/A * 2 along with this work; if not, write to the Free Software Foundation, 0N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 0N/A * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, 0N/A * CA 95054 USA or visit www.sun.com if you need additional information or 0N/A * have any questions. 0N/A#
include "incls/_precompiled.incl" 0N/A// ciExceptionHandlerStream 0N/A// Walk over some selected set of a methods exception handlers. 0N/A// ------------------------------------------------------------------ 0N/A// ciExceptionHandlerStream::count 0N/A// How many exception handlers are there in this stream? 0N/A// Implementation note: Compiler2 needs this functionality, so I had 0N/A// The class is used to iterate over the bytecodes of a method. 0N/A// providing accessors for constant pool items. 0N/A// ------------------------------------------------------------------ 0N/A// ciBytecodeStream::wide 0N/A// Special handling for the wide bytcode 0N/A // Get following bytecode; do not return wide 0N/A _pc +=
2;
// Skip both bytecodes 0N/A _pc +=
2;
// Skip index always 0N/A _pc +=
2;
// Skip optional constant 0N/A// ------------------------------------------------------------------ 0N/A// ciBytecodeStream::table 0N/A// Special handling for switch ops 0N/A switch(
bc ) {
// Check for special bytecode handling 0N/A // table_base[0] is default far_dest 0N/A // Table has 2 lead elements (default, length), then pairs of u4 values. 0N/A // So load table length, and compute address at end of table 0N/A // table_base[0] is default far_dest 0N/A// ------------------------------------------------------------------ 0N/A// ciBytecodeStream::reset_to_bci 0N/A// ------------------------------------------------------------------ 0N/A// ciBytecodeStream::force_bci 0N/A// ------------------------------------------------------------------ 0N/A// Constant pool access 0N/A// ------------------------------------------------------------------ 0N/A// ------------------------------------------------------------------ 0N/A// ciBytecodeStream::get_klass_index 0N/A// If this bytecodes references a klass, return the index of the 0N/A// ------------------------------------------------------------------ 0N/A// ciBytecodeStream::get_klass 0N/A// If this bytecode is a new, newarray, multianewarray, instanceof, 0N/A// or checkcast, get the referenced klass. 0N/A// ------------------------------------------------------------------ 0N/A// ciBytecodeStream::get_constant_index 0N/A// If this bytecode is one of the ldc variants, get the index of the 0N/A// referenced constant. 0N/A// ------------------------------------------------------------------ 0N/A// ciBytecodeStream::get_constant 0N/A// If this bytecode is one of the ldc variants, get the referenced 0N/A// ------------------------------------------------------------------ 0N/A// ------------------------------------------------------------------ 0N/A// ------------------------------------------------------------------ 0N/A// ciBytecodeStream::get_field_index 0N/A// If this is a field access bytecode, get the constant pool 0N/A// index of the referenced field. 0N/A// ------------------------------------------------------------------ 0N/A// ciBytecodeStream::get_field 0N/A// If this bytecode is one of get_field, get_static, put_field, 0N/A// or put_static, get the referenced field. 0N/A// ------------------------------------------------------------------ 0N/A// ciBytecodeStream::get_declared_field_holder 0N/A// Get the declared holder of the currently referenced field. 0N/A// Usage note: the holder() of a ciField class returns the canonical 0N/A// holder of the field, rather than the holder declared in the 0N/A// There is no "will_link" result passed back. The user is responsible 0N/A// for checking linkability when retrieving the associated field. 0N/A// ------------------------------------------------------------------ 0N/A// ciBytecodeStream::get_field_holder_index 0N/A// Get the constant pool index of the declared holder of the field 0N/A// referenced by the current bytecode. Used for generating 0N/A// deoptimization information. 0N/A// ------------------------------------------------------------------ 0N/A// ciBytecodeStream::get_field_signature_index 0N/A// Get the constant pool index of the signature of the field 0N/A// referenced by the current bytecode. Used for generating 0N/A// deoptimization information. 0N/A// ------------------------------------------------------------------ 0N/A// ciBytecodeStream::get_method_index 0N/A// If this is a method invocation bytecode, get the constant pool 0N/A// index of the invoked method. 0N/A// ------------------------------------------------------------------ 0N/A// ciBytecodeStream::get_method 0N/A// If this is a method invocation bytecode, get the invoked method. 0N/A// ------------------------------------------------------------------ 0N/A// ciBytecodeStream::get_declared_method_holder 0N/A// Get the declared holder of the currently referenced method. 0N/A// Usage note: the holder() of a ciMethod class returns the canonical 0N/A// holder of the method, rather than the holder declared in the 0N/A// There is no "will_link" result passed back. The user is responsible 0N/A// for checking linkability when retrieving the associated method. 0N/A// ------------------------------------------------------------------ 0N/A// ciBytecodeStream::get_method_holder_index 0N/A// Get the constant pool index of the declared holder of the method 0N/A// referenced by the current bytecode. Used for generating 0N/A// deoptimization information. 0N/A// ------------------------------------------------------------------ 0N/A// ciBytecodeStream::get_method_signature_index 0N/A// Get the constant pool index of the signature of the method 0N/A// referenced by the current bytecode. Used for generating 0N/A// deoptimization information.