/*
* 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 "assembler_sparc.inline.hpp"
#include "interpreter/invocationCounter.hpp"
// This file specializes the assember with interpreter-specific macros
#ifndef DONT_USE_REGISTER_DEFINES
#endif // DONT_USE_REGISTER_DEFINES
protected:
#ifndef CC_INTERP
// Interpreter specific version of call_VM_base
virtual void call_VM_leaf_base(
);
virtual void call_VM_base(
int number_of_arguments,
bool check_exception=true
);
// base routine for all dispatches
#endif /* CC_INTERP */
public:
: MacroAssembler(c) {}
#ifndef CC_INTERP
#endif /* CC_INTERP */
// helper routine for frame allocation/deallocation
// compute the delta by which the caller's SP has to
// be adjusted to accomodate for the non-argument
// locals
#ifndef CC_INTERP
// dispatch routines
// Removes the current activation (incl. unlocking of monitors).
// Additionally this code is used for earlyReturn in which case we
// want to skip throwing an exception and installing an exception.
bool throw_monitor_exception = true,
bool install_monitor_exception = true);
protected:
#endif /* CC_INTERP */
public:
// Super call_VM calls - correspond to MacroAssembler::call_VM(_leaf) calls
bool check_exception = true);
#ifndef CC_INTERP
void super_call_VM_leaf(Register thread_cache, address entry_point, Register arg_1, Register arg_2);
// Generate a subtype check: branch to ok_is_subtype if sub_klass is
// a subtype of super_klass. Blows registers tmp1, tmp2 and tmp3.
void gen_subtype_check( Register sub_klass, Register super_klass, Register tmp1, Register tmp2, Register tmp3, Label &ok_is_subtype );
// helpers for tossing exceptions
// helpers for expression stack
// G4_scratch and Lscratch are used at call sites!!
void empty_expression_stack(); // resets both Lesp and SP
#ifdef ASSERT
#endif // ASSERT
public:
// Load values from bytecode stream:
void get_2_byte_integer_at_bcp( int bcp_offset,
void get_4_byte_integer_at_bcp( int bcp_offset,
void get_cache_and_index_at_bcp(Register cache, Register tmp, int bcp_offset, size_t index_size = sizeof(u2));
void get_cache_and_index_and_bytecode_at_bcp(Register cache, Register temp, Register bytecode, int byte_no, int bcp_offset, size_t index_size = sizeof(u2));
void get_cache_entry_pointer_at_bcp(Register cache, Register tmp, int bcp_offset, size_t index_size = sizeof(u2));
void get_cache_index_at_bcp(Register cache, Register tmp, int bcp_offset, size_t index_size = sizeof(u2));
// common code
void index_check_without_pop(Register array, Register index, int index_shift, Register tmp, Register res);
// Load compiled (i2c) or interpreter entry and call from interpreted
// --------------------------------------------------
void unlock_if_synchronized_method(TosState state, bool throw_monitor_exception = true, bool install_monitor_exception = true);
void add_monitor_to_stack( bool stack_is_empty,
// These only apply to the Interpreter expression stack and locals!
#ifdef ASSERT
void check_for_regarea_stomp( Register Rindex, int offset, Register Rlimit, Register Rscratch, Register Rscratch1);
#endif // ASSERT
// Helpers for swap and dup
// Helper for getting receiver in register.
static int top_most_monitor_byte_offset(); // offset in bytes to top of monitor block
#endif /* CC_INTERP */
#ifndef CC_INTERP
#endif /* CC_INTERP */
// Object locking
#ifndef CC_INTERP
// Interpreter profiling operations
void set_method_data_pointer();
void set_method_data_pointer_for_bcp();
void verify_method_data_pointer();
void test_invocation_counter_for_mdp(Register invocation_count, Register Rtmp, Label &profile_continue);
bool decrement = false);
bool decrement = false);
bool decrement = false);
void update_mdp_by_constant(int constant);
// Debugging
void interp_verify_oop(Register reg, TosState state, const char * file, int line); // only if +VerifyOops && state == atos
void verify_FPU(int stack_depth, TosState state = ftos); // only if +VerifyFPU && (state == ftos || state == dtos)
#endif /* CC_INTERP */
void notify_method_entry();
void notify_method_exit(
};
#endif // CPU_SPARC_VM_INTERP_MASM_SPARC_HPP