/*
* Copyright 2008, 2009 Red Hat, Inc.
* 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.
*
*/
#ifndef SHARE_VM_SHARK_SHARKBLOCK_HPP
#define SHARE_VM_SHARK_SHARKBLOCK_HPP
#include "ci/ciMethod.hpp"
#include "ci/ciStreams.hpp"
#include "memory/allocation.hpp"
#include "shark/llvmHeaders.hpp"
#include "shark/sharkBuilder.hpp"
#include "shark/sharkConstant.hpp"
#include "shark/sharkInvariants.hpp"
#include "shark/sharkState.hpp"
#include "shark/sharkValue.hpp"
class SharkState;
protected:
_current_state(NULL) {}
_current_state(NULL) {}
private:
public:
return &_iter;
}
}
int bci() {
}
// Entry state
protected:
virtual SharkState* entry_state();
// Current state
private:
public:
if (_current_state == NULL)
return _current_state;
}
protected:
}
// Local variables
protected:
return value;
}
if (value->is_two_word())
}
// Expression stack (raw)
protected:
}
return current_state()->pop();
}
(slot > 0 &&
return value;
}
int xstack_depth() {
return current_state()->stack_depth();
}
// Expression stack (cooked)
protected:
if (value->is_two_word())
}
if (size == 2)
xpop();
return value;
}
#ifdef ASSERT
switch (result->basic_type()) {
case T_BOOLEAN:
case T_BYTE:
case T_CHAR:
case T_SHORT:
break;
case T_ARRAY:
break;
default:
}
#endif // ASSERT
return result;
}
// Code generation
public:
virtual void emit_IR();
protected:
// Helpers
protected:
// Zero checking
protected:
}
}
private:
if (!value->zero_checked())
}
// Safepoints
protected:
virtual void maybe_add_backedge_safepoint();
// Traps
protected:
virtual bool has_trap();
virtual int trap_request();
virtual int trap_bci();
virtual void do_trap(int trap_request);
// arraylength
protected:
virtual void do_arraylength();
// *aload and *astore
protected:
// *div and *rem
private:
void do_idiv() {
do_div_or_rem(false, false);
}
void do_irem() {
do_div_or_rem(false, true);
}
void do_ldiv() {
do_div_or_rem(true, false);
}
void do_lrem() {
do_div_or_rem(true, true);
}
// get* and put*
private:
void do_getstatic() {
do_field_access(true, false);
}
void do_getfield() {
do_field_access(true, true);
}
void do_putstatic() {
do_field_access(false, false);
}
void do_putfield() {
do_field_access(false, true);
}
// lcmp and [fd]cmp[lg]
private:
void do_lcmp();
// *return and athrow
protected:
virtual void do_athrow();
// goto*
protected:
virtual void do_goto();
// jsr* and ret
protected:
virtual void do_jsr();
virtual void do_ret();
// if*
protected:
// *switch
protected:
int switch_default_dest();
int switch_table_length();
int switch_key(int i);
int switch_dest(int i);
virtual void do_switch();
// invoke*
protected:
virtual void do_call();
// checkcast and instanceof
protected:
virtual void do_instance_check();
virtual bool maybe_do_instanceof_if();
// new and *newarray
protected:
virtual void do_new();
virtual void do_newarray();
virtual void do_anewarray();
virtual void do_multianewarray();
// monitorenter and monitorexit
protected:
virtual void do_monitorenter();
virtual void do_monitorexit();
};
#endif // SHARE_VM_SHARK_SHARKBLOCK_HPP