/*
* 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 "classfile/verificationType.hpp"
#include "classfile/verifier.hpp"
#include "oops/methodOop.hpp"
#include "runtime/handles.hpp"
#include "runtime/signature.hpp"
#include "utilities/exceptions.hpp"
// A StackMapFrame represents one frame in the stack map attribute.
class TypeContext;
enum {
};
private:
// See comment in StackMapTable about _frame_count about why these
// fields are int32_t instead of u2.
// instruction modification, to allow rewinding
for (int i = 0; i < _max_locals; ++i) {
if (i < _locals_size) {
} else {
}
}
for (int i = 0; i < _max_stack; ++i) {
if (i < ss) {
} else {
}
}
}
public:
// constructors
// This constructor is used by the type checker to allocate frames
// in type state, which have _max_locals and _max_stack array elements
// in _locals and _stack.
// This constructor is used to initialize stackmap frames in stackmap table,
// which have _locals_size and _stack_size array elements in _locals and _stack.
_stack_mark(-1),
_verifier(v) { }
return new StackMapFrame(*smf);
}
// Set locals and stack types to bogus
inline void reset() {
int32_t i;
for (i = 0; i < _max_locals; i++) {
}
for (i = 0; i < _max_stack; i++) {
}
}
// Return a StackMapFrame with the same local variable array and empty stack.
// Stack array is allocate with unused one element.
// Set local variable type array based on m's signature.
// Search local variable type array and stack type array.
// Return true if an uninitialized object is found.
bool has_new_object() const;
// Search local variable type array and stack type array.
// Set every element with type of old_object to new_object.
void initialize_object(
// Copy local variable type array in src into this local variable type array.
// Copy stack type array in src into this stack type array.
// Return true if this stack map frame is assignable to target.
bool is_assignable_to(
inline void set_mark() {
#ifdef DEBUG
// Put bogus type to indicate it's no longer valid.
if (_stack_mark != -1) {
for (int i = _stack_mark; i >= _stack_size; --i) {
}
}
#endif // def DEBUG
}
// Used when an error occurs and we want to reset the stack to the state
// it was before operands were popped off.
void restore() {
if (_stack_mark != -1) {
}
}
// Push type into stack type array.
if (_stack_size >= _max_stack) {
verifier()->verify_error(
"Operand stack overflow");
return;
}
}
inline void push_stack_2(
verifier()->verify_error(
"Operand stack overflow");
return;
}
}
// Pop and return the top type on stack without verifying.
if (_stack_size <= 0) {
verifier()->verify_error(
"Operand stack underflow");
return VerificationType::bogus_type();
}
return top;
}
// Pop and return the top type on stack type array after verifying it
// is assignable to type.
if (_stack_size != 0) {
if (subtype) {
--_stack_size;
return top;
}
}
}
inline void pop_stack_2(
if (_stack_size >= 2) {
_stack_size -= 2;
return;
}
}
}
}
}
// Uncommon case that throws exceptions.
// Return the type at index in local variable array after verifying
// it is assignable to type.
void get_local_2(
// Set element at index in local variable array to type.
void set_local_2(
// Private auxiliary method used only in is_assignable_to(StackMapFrame).
// Returns true if src is assignable to target.
int is_assignable_to(
};
#endif // SHARE_VM_CLASSFILE_STACKMAPFRAME_HPP