/*
* Copyright 2008, 2009, 2010 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.
*
*/
#include "ci/ciStreams.hpp"
#include "ci/ciType.hpp"
#include "ci/ciTypeFlow.hpp"
#include "interpreter/bytecodes.hpp"
#include "memory/allocation.hpp"
#include "shark/llvmHeaders.hpp"
#include "shark/sharkBlock.hpp"
#include "shark/sharkBuilder.hpp"
#include "shark/sharkFunction.hpp"
#include "shark/sharkState.hpp"
#include "shark/sharkValue.hpp"
public:
: SharkBlock(function),
_entered(false),
_has_trap(false),
_needs_phis(false),
_entry_block(NULL) {}
private:
public:
return _function;
}
return _ciblock;
}
// Function properties
public:
}
// Typeflow properties
public:
int index() const {
}
bool is_backedge_copy() const {
return ciblock()->is_backedge_copy();
}
int stack_depth_at_entry() const {
return ciblock()->stack_size();
}
}
}
int start() const {
}
int limit() const {
}
bool falls_through() const {
}
int num_successors() const {
}
}
// Exceptions
private:
private:
void compute_exceptions();
private:
int num_exceptions() const {
return _exc_handlers->length();
}
}
}
// Traps
private:
bool _has_trap;
int _trap_request;
int _trap_bci;
_has_trap = true;
}
private:
bool has_trap() {
return _has_trap;
}
int trap_request() {
return _trap_request;
}
int trap_bci() {
return _trap_bci;
}
private:
void scan_for_traps();
private:
// Entry state
private:
bool _entered;
bool _needs_phis;
public:
bool entered() const {
return _entered;
}
bool needs_phis() const {
return _needs_phis;
}
private:
public:
void enter() {
}
private:
private:
private:
public:
return _entry_block;
}
public:
void initialize();
public:
// Method
public:
return current_state()->method();
}
// Temporary oop storage
public:
}
return value;
}
// Cache and decache
private:
void decache_for_VM_call();
void cache_after_VM_call();
void decache_for_trap();
// Monitors
private:
int num_monitors() {
return current_state()->num_monitors();
}
}
// Code generation
public:
void emit_IR();
// Branch helpers
private:
void do_branch(int successor_index);
// Zero checks
private:
public:
int bci,
// Exceptions
private:
return builder()->CreateAddressOfStructEntry(
"pending_exception_addr");
}
return builder()->CreateLoad(
pending_exception_address(), "pending_exception");
}
void clear_pending_exception() const {
}
public:
enum ExceptionActionMask {
// The actual bitmasks that things test against
// More convenient values for passing
EX_CHECK_NONE = 0,
};
void check_pending_exception(int action);
void marshal_exception_fast(int num_options);
void marshal_exception_slow(int num_options);
// VM calls
private:
int exception_action) {
stack()->CreateSetLastJavaFrame();
if (exception_action & EAM_CHECK) {
current_state()->set_has_safepointed(true);
}
return res;
}
public:
int exception_action) {
}
int exception_action) {
}
int exception_action) {
}
int exception_action) {
}
// VM call oop return handling
private:
"vm_result_addr");
return result;
}
// Synchronization
private:
void release_lock(int exception_action);
public:
void acquire_method_lock();
// Bounds checks
private:
// Safepoints
private:
void maybe_add_safepoint();
void maybe_add_backedge_safepoint();
// Loop safepoint removal
private:
bool _can_reach_visited;
// Traps
private:
void do_trap(int trap_request);
// Returns
private:
// arraylength
private:
void do_arraylength();
// *aload and *astore
private:
// *return and athrow
private:
void do_athrow();
// goto*
private:
void do_goto();
// jsr* and ret
private:
void do_jsr();
void do_ret();
// if*
private:
// tableswitch and lookupswitch
private:
void do_switch();
// invoke*
private:
void do_call();
// checkcast and instanceof
private:
void do_instance_check();
bool maybe_do_instanceof_if();
// new and *newarray
private:
void do_new();
void do_newarray();
void do_anewarray();
void do_multianewarray();
// monitorenter and monitorexit
private:
void do_monitorenter();
void do_monitorexit();
};
#endif // SHARE_VM_SHARK_SHARKTOPLEVELBLOCK_HPP