You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by mc...@apache.org on 2008/03/28 16:11:17 UTC
svn commit: r642252 [1/2] - in /harmony/enhanced/drlvm/trunk/vm: em/src/
include/ include/open/ interpreter/src/ jitrino/src/jet/
jitrino/src/optimizer/ jitrino/src/translator/java/ jitrino/src/vm/
thread/src/ vmcore/build/ vmcore/include/ vmcore/src/c...
Author: mcfirst
Date: Fri Mar 28 08:11:03 2008
New Revision: 642252
URL: http://svn.apache.org/viewvc?rev=642252&view=rev
Log:
Applying patch associated with HARMONY-5649 [drlvm] Cleaning external VM interfaces and make them run-time linkable. Method access interfaces addressed.
Modified:
harmony/enhanced/drlvm/trunk/vm/em/src/DrlEMImpl.cpp
harmony/enhanced/drlvm/trunk/vm/em/src/EBProfileCollector.cpp
harmony/enhanced/drlvm/trunk/vm/em/src/EdgeProfileCollector.cpp
harmony/enhanced/drlvm/trunk/vm/em/src/MTable.cpp
harmony/enhanced/drlvm/trunk/vm/include/jit_import.h
harmony/enhanced/drlvm/trunk/vm/include/jit_intf.h
harmony/enhanced/drlvm/trunk/vm/include/open/em.h
harmony/enhanced/drlvm/trunk/vm/include/open/rt_types.h
harmony/enhanced/drlvm/trunk/vm/include/open/vm.h
harmony/enhanced/drlvm/trunk/vm/include/open/vm_class_support.h
harmony/enhanced/drlvm/trunk/vm/include/open/vm_interface.h
harmony/enhanced/drlvm/trunk/vm/include/open/vm_method_access.h
harmony/enhanced/drlvm/trunk/vm/include/vm_java_support.h
harmony/enhanced/drlvm/trunk/vm/interpreter/src/interp_native_em64t.cpp
harmony/enhanced/drlvm/trunk/vm/interpreter/src/interp_native_ia32.cpp
harmony/enhanced/drlvm/trunk/vm/interpreter/src/interp_native_ipf.cpp
harmony/enhanced/drlvm/trunk/vm/interpreter/src/interp_stack_trace.cpp
harmony/enhanced/drlvm/trunk/vm/interpreter/src/interpreter.cpp
harmony/enhanced/drlvm/trunk/vm/interpreter/src/interpreter_ti.cpp
harmony/enhanced/drlvm/trunk/vm/jitrino/src/jet/cg.h
harmony/enhanced/drlvm/trunk/vm/jitrino/src/jet/cg_ia32.cpp
harmony/enhanced/drlvm/trunk/vm/jitrino/src/jet/cg_regs.cpp
harmony/enhanced/drlvm/trunk/vm/jitrino/src/jet/compiler.cpp
harmony/enhanced/drlvm/trunk/vm/jitrino/src/jet/compiler.h
harmony/enhanced/drlvm/trunk/vm/jitrino/src/jet/jet.cpp
harmony/enhanced/drlvm/trunk/vm/jitrino/src/jet/rt.cpp
harmony/enhanced/drlvm/trunk/vm/jitrino/src/jet/structs.h
harmony/enhanced/drlvm/trunk/vm/jitrino/src/jet/trace.cpp
harmony/enhanced/drlvm/trunk/vm/jitrino/src/optimizer/devirtualizer.cpp
harmony/enhanced/drlvm/trunk/vm/jitrino/src/optimizer/simplifier.cpp
harmony/enhanced/drlvm/trunk/vm/jitrino/src/translator/java/JavaByteCodeTranslator.cpp
harmony/enhanced/drlvm/trunk/vm/jitrino/src/vm/VMInterface.cpp
harmony/enhanced/drlvm/trunk/vm/jitrino/src/vm/VMInterface.h
harmony/enhanced/drlvm/trunk/vm/thread/src/thread_native_basic.c
harmony/enhanced/drlvm/trunk/vm/vmcore/build/vmcore.exp
harmony/enhanced/drlvm/trunk/vm/vmcore/include/class_interface.h
harmony/enhanced/drlvm/trunk/vm/vmcore/include/class_member.h
harmony/enhanced/drlvm/trunk/vm/vmcore/src/class_support/C_Interface.cpp
harmony/enhanced/drlvm/trunk/vm/vmcore/src/class_support/class_impl.cpp
harmony/enhanced/drlvm/trunk/vm/vmcore/src/class_support/classloader.cpp
harmony/enhanced/drlvm/trunk/vm/vmcore/src/class_support/method.cpp
harmony/enhanced/drlvm/trunk/vm/vmcore/src/gc/root_set_enum_common.cpp
harmony/enhanced/drlvm/trunk/vm/vmcore/src/init/vm_init.cpp
harmony/enhanced/drlvm/trunk/vm/vmcore/src/jit/compile.cpp
harmony/enhanced/drlvm/trunk/vm/vmcore/src/jni/jni_method.cpp
harmony/enhanced/drlvm/trunk/vm/vmcore/src/jni/jni_utils.cpp
harmony/enhanced/drlvm/trunk/vm/vmcore/src/jvmti/jvmti_break.cpp
harmony/enhanced/drlvm/trunk/vm/vmcore/src/jvmti/jvmti_break_intf.cpp
harmony/enhanced/drlvm/trunk/vm/vmcore/src/jvmti/jvmti_event.cpp
harmony/enhanced/drlvm/trunk/vm/vmcore/src/jvmti/jvmti_method.cpp
harmony/enhanced/drlvm/trunk/vm/vmcore/src/jvmti/jvmti_pop_frame.cpp
harmony/enhanced/drlvm/trunk/vm/vmcore/src/jvmti/jvmti_stack.cpp
harmony/enhanced/drlvm/trunk/vm/vmcore/src/jvmti/jvmti_step.cpp
harmony/enhanced/drlvm/trunk/vm/vmcore/src/kernel_classes/native/java_lang_reflect_VMReflection.cpp
harmony/enhanced/drlvm/trunk/vm/vmcore/src/kernel_classes/native/org_apache_harmony_vm_VMStack.cpp
harmony/enhanced/drlvm/trunk/vm/vmcore/src/lil/em64t/stack_iterator_em64t.cpp
harmony/enhanced/drlvm/trunk/vm/vmcore/src/lil/ia32/stack_iterator_ia32.cpp
harmony/enhanced/drlvm/trunk/vm/vmcore/src/lil/lil.cpp
harmony/enhanced/drlvm/trunk/vm/vmcore/src/ncai/ncai_step.cpp
harmony/enhanced/drlvm/trunk/vm/vmcore/src/reflection/annotations.cpp
harmony/enhanced/drlvm/trunk/vm/vmcore/src/reflection/reflection.cpp
harmony/enhanced/drlvm/trunk/vm/vmcore/src/stack/stack_trace.cpp
harmony/enhanced/drlvm/trunk/vm/vmcore/src/util/em64t/base/compile_em64t.cpp
harmony/enhanced/drlvm/trunk/vm/vmcore/src/util/ia32/base/compile_IA32.cpp
harmony/enhanced/drlvm/trunk/vm/vmcore/src/verifier-3363/base/context_base.h
harmony/enhanced/drlvm/trunk/vm/vmcore/src/verifier-3363/java5/context_5.cpp
harmony/enhanced/drlvm/trunk/vm/vmcore/src/verifier-3363/java6/context_6.cpp
harmony/enhanced/drlvm/trunk/vm/vmcore/src/verifier-3363/x_verifier/recompute.cpp
Modified: harmony/enhanced/drlvm/trunk/vm/em/src/DrlEMImpl.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/em/src/DrlEMImpl.cpp?rev=642252&r1=642251&r2=642252&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/em/src/DrlEMImpl.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/em/src/DrlEMImpl.cpp Fri Mar 28 08:11:03 2008
@@ -27,6 +27,7 @@
#include "jit_import.h"
#include "em_intf.h"
#include "open/vm.h"
+#include "open/vm_method_access.h"
#include "ini.h"
#include "cxxlog.h"
Modified: harmony/enhanced/drlvm/trunk/vm/em/src/EBProfileCollector.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/em/src/EBProfileCollector.cpp?rev=642252&r1=642251&r2=642252&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/em/src/EBProfileCollector.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/em/src/EBProfileCollector.cpp Fri Mar 28 08:11:03 2008
@@ -24,11 +24,12 @@
#include <algorithm>
#include <assert.h>
+#define LOG_DOMAIN "em"
#include "cxxlog.h"
+
#include <sstream>
+#include "open/vm_method_access.h"
#include "port_mutex.h"
-
-#define LOG_DOMAIN "em"
EBProfileCollector::EBProfileCollector(EM_PC_Interface* em, const std::string& name, JIT_Handle genJit,
Modified: harmony/enhanced/drlvm/trunk/vm/em/src/EdgeProfileCollector.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/em/src/EdgeProfileCollector.cpp?rev=642252&r1=642251&r2=642252&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/em/src/EdgeProfileCollector.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/em/src/EdgeProfileCollector.cpp Fri Mar 28 08:11:03 2008
@@ -21,13 +21,15 @@
#include "EdgeProfileCollector.h"
+#define LOG_DOMAIN "em"
+#include "cxxlog.h"
+
#include <algorithm>
#include <assert.h>
-#include "cxxlog.h"
#include <sstream>
+#include "open/vm_method_access.h"
#include "port_mutex.h"
-#define LOG_DOMAIN "em"
Method_Profile_Handle edge_profiler_create_profile( PC_Handle ph,
Method_Handle mh,
Modified: harmony/enhanced/drlvm/trunk/vm/em/src/MTable.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/em/src/MTable.cpp?rev=642252&r1=642251&r2=642252&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/em/src/MTable.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/em/src/MTable.cpp Fri Mar 28 08:11:03 2008
@@ -22,6 +22,7 @@
#include "MTable.h"
#include <assert.h>
#include <algorithm>
+#include "open/vm_method_access.h"
#include "jit_import.h"
MTable::~MTable() {
@@ -156,7 +157,7 @@
bool MTable::BCSizeMethodFilter::matchMethod(const MTable::MethodInfo& mInfo) const {
- size_t size = method_get_byte_code_size(mInfo.mh);
+ size_t size = method_get_bytecode_length(mInfo.mh);
bool matched = size >=start && size<=end;
return matched;
}
Modified: harmony/enhanced/drlvm/trunk/vm/include/jit_import.h
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/include/jit_import.h?rev=642252&r1=642251&r2=642252&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/include/jit_import.h (original)
+++ harmony/enhanced/drlvm/trunk/vm/include/jit_import.h Fri Mar 28 08:11:03 2008
@@ -100,252 +100,12 @@
VMEXPORT JIT_Result vm_compile_method(JIT_Handle jit, Method_Handle method);
//@}
-/** @name Exception-related compile-time functions
- */
-//@{
-
-/**
- * @return The number of exception handlers defined for this method in the
- * bytecodes.
- */
-
-VMEXPORT unsigned method_get_num_handlers(Method_Handle method);
-
-/**
- * Deprecated.
- *
- * @sa method_get_handler_info
- */
-VMEXPORT void method_get_handler_info_full(Method_Handle method,
- unsigned handler_id,
- unsigned *begin_offset,
- unsigned *end_offset,
- unsigned *handler_offset,
- unsigned *handler_len,
- unsigned *filter_offset,
- unsigned *handler_class_index);
-
-/**
- * This is a simpler version of method_get_handler_info_full() that works
- * only for JVM.
- */
-VMEXPORT void method_get_handler_info(Method_Handle method,
- unsigned handler_id,
- unsigned *begin_offset,
- unsigned *end_offset,
- unsigned *handler_offset,
- unsigned *handler_class_index);
-
-/**
- * Deprecated.
- *
- * @return For Java methods, it always returns <code>FALSE</code> since JVM
- * handlers do not have a finally clause.
- */
-VMEXPORT Boolean method_handler_has_finally(Method_Handle method,
- unsigned handler_id);
-
-/**
- * Deprecated.
- *
- * @return For Java methods, it always returns <code>FALSE</code> since JVM
- * handlers do not have a filters.
- */
-
-VMEXPORT Boolean method_handler_has_filter(Method_Handle method,
- unsigned handler_id);
-
-/**
- * Deprecated.
- *
- * @return For Java methods, it always returns <code>FALSE</code> since JVM
- * handlers do not have a fault clause.
- */
-
-VMEXPORT Boolean method_handler_has_fault(Method_Handle method,
- unsigned handler_id);
-
-/**
- * Set the number of exception handlers in the code generated by the JIT
- * <code>j</code> for a given method. The JIT must then
- * call method_set_target_handler_info()
- * for each of the num_handlers exception handlers.
- */
-
-VMEXPORT void method_set_num_target_handlers(Method_Handle method,
- JIT_Handle j,
- unsigned num_handlers);
-
-/**
- * Set the information about an exception handler in the code generated by
- * the JIT.
- */
-VMEXPORT void method_set_target_handler_info(Method_Handle method,
- JIT_Handle j,
- unsigned eh_number,
- void *start_ip,
- void *end_ip,
- void *handler_ip,
- Class_Handle catch_cl,
- Boolean exc_obj_is_dead);
-
-
-//@}
-/** @name Method-related functions
- */
-//@{
-
-/**
- * @ingroup bytecodes
- */
-///////////////////////////////////////////////////////
-// begin method-related functions: bytecodes
-///////////////////////////////////
-
-/**
- * Get a pointer to the buffer containing the bytecodes for this method.
- * Bytecodes are either JVML instructions or CIL instructions.
- */
- VMEXPORT const Byte *method_get_byte_code_addr(Method_Handle method);
-
-/**
- * Size if the buffer returned by method_get_byte_code_addr().
- */
-
-VMEXPORT size_t method_get_byte_code_size(Method_Handle method);
-
-/**
- * Maximum depth of the evaluation stack in this method.
- */
-
-VMEXPORT unsigned method_get_max_stack(Method_Handle method);
-//////////////////////////
-// end method-related functions: bytecodes
-///////////////////////////////////////////////////////
-
-
-///////////////////////////////////////////////////////
-// begin method-related functions: compiled code
-////////////////////////////
-/**
- * @return The address where the code pointer for a given method is.
- *
- * A simple JIT that doesn't support recompilation (see e.g.
- * <code>vm_register_jit_recompiled_method_callback</code>) can only
- * generate code with indirect branches through the address provided
- * by method_get_indirect_address().
- */
-
-VMEXPORT void *method_get_indirect_address(Method_Handle method);
-
-/**
- * @return The offset in bytes from the start of the vtable to the entry for
- * a given method.
- */
-VMEXPORT unsigned method_get_offset(Method_Handle method);
-///////////////////////////
-// end method-related functions: compiled code
-///////////////////////////////////////////////////////
-
///////////////////////////////////////////////////////
// begin method memory allocation-related functions.
/////////////////////////////////
/**
- * Allocate the "read-write" data block for this method. This memory block
- * cannot be retrieved later. The intention is to use the data block for data
- * that may be needed during the program execution (e.g. tables for
- * switch statements).
- *
- * Separation of data allocated by method_allocate_data_block() and
- * method_allocate_info_block() may help improve locality of
- * references to data accessed during execution of compiled code and data
- * accessed during stack uwinding.
- *
- * @sa method_allocate_info_block
- */
-
-VMEXPORT Byte *method_allocate_data_block(Method_Handle method,
- JIT_Handle j,
- size_t size,
- size_t alignment);
-
-/**
- * Allocated a "read-only" data block.
- *
- * (? 20030314) This function is deprecated. In all new code, use
- * method_allocate_data_block() only. At some point, we
- * will revisit this interface to have more control over the layout
- * of various memory blocks allocated by the VM.
- */
-
-VMEXPORT Byte *method_allocate_jit_data_block(Method_Handle method,
- JIT_Handle j,
- size_t size,
- size_t alignment);
-
-
-/**
- * This function allows allocation of multiple chunks of code with different
- * heat values. The JIT is responsible for specifying ids that are unique
- * within the same method.
- * The first instruction of the chunk with <code>id=0</code> is the entry point
- * of the method.
- *
- * Deprecated.
- *
- * @return If the <code>CAA_Allocate</code> argument is specified, memory is
- * allocated and a pointer to it is returned. If the
- * <code>CAA_Simulate</code> argument is specified, no memory is
- * allocated - the same as pass parameter size = 0 - function returns
- * only current address for allocation in pool but no memory is allocated.
- */
-
-VMEXPORT Byte *
-method_allocate_code_block(Method_Handle m,
- JIT_Handle j,
- size_t size,
- size_t alignment,
- CodeBlockHeat heat,
- int id,
- Code_Allocation_Action action);
-
-
-VMEXPORT void
-method_set_relocatable(Method_Handle m, JIT_Handle j, NativeCodePtr code_address, Boolean is_relocatable);
-
-
-/**
- * Allocate an info block for this method. An info block can be later
- * retrieved by the JIT. The JIT may for instance store GC maps for
- * root set enumeration and stack unwinding in the onfo block.
- *
- * @sa method_allocate_data_block
- */
-VMEXPORT Byte *method_allocate_info_block(Method_Handle method,
- JIT_Handle j,
- size_t size);
-
-
-/**
- * Retrieve the memory block allocated earlier by
- * method_allocate_code_block().
- * A pair <code><method, jit></code> uniquely identifies a code block.
- */
-
-VMEXPORT Byte *method_get_code_block_addr_jit(Method_Handle method,
- JIT_Handle j);
-
-/**
- * Get the size of the memory block allocated earlier by
- * method_allocate_code_block().
- */
-
-VMEXPORT unsigned method_get_code_block_size_jit(Method_Handle method,
- JIT_Handle j);
-
-/**
* Retrieve the memory block allocated earlier by
* method_allocate_code_block().
* A triple <code><method, jit, id></code> uniquely identifies a
@@ -367,41 +127,6 @@
JIT_Handle j,
int id);
-/**
- * Retrieve the memory block allocated earlier by
- * method_allocate_info_block().
- * A pair <code><method, jit></code> uniquely identifies a JIT info block.
- */
-
-VMEXPORT Byte *method_get_info_block_jit(Method_Handle method,
- JIT_Handle j);
-
-/**
- * Get the size of the memory block allocated earlier by
- * method_allocate_info_block().
- */
-
-VMEXPORT unsigned method_get_info_block_size_jit(Method_Handle method,
- JIT_Handle j);
-
-///////////////////////////////////////////////////////
-// begin functions for iterating over methods compiled by a given JIT.
-/////////////////////////////////////
-
-#define METHOD_JIT_ITER_END 0
-
-/**
- * Here are the obvious three functions to iterate over all methods
- * compiled by a given JIT.
- */
-
-VMEXPORT Method_Iterator method_get_first_method_jit(JIT_Handle j);
-VMEXPORT Method_Iterator method_get_next_method_jit(Method_Iterator mi);
-VMEXPORT Method_Handle method_get_method_jit(Method_Iterator mi);
-
-/////////////////////////////////////////
-// end functions for iterating over methods compiled by a given JIT.
-///////////////////////////////////////////////////////
//////////////////////////////
// end method-related functions.
///////////////////////////////////////////////////////
@@ -487,15 +212,6 @@
/** @name Miscellaneous functions
*/
//@{
-
-/**
-* Looks for a method in native libraries of a class loader.
-*
-* @param[in] method - a searching native-method structure
-* @return The pointer to found a native function.
-* @note The function raises <code>UnsatisfiedLinkError</code> with a method name
-* in an exception message, if the specified method is not found.*/
-VMEXPORT void* method_get_native_func_addr(Method_Handle method);
/**
* @return The JIT handle for a the current compilation.
Modified: harmony/enhanced/drlvm/trunk/vm/include/jit_intf.h
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/include/jit_intf.h?rev=642252&r1=642251&r2=642252&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/include/jit_intf.h (original)
+++ harmony/enhanced/drlvm/trunk/vm/include/jit_intf.h Fri Mar 28 08:11:03 2008
@@ -112,21 +112,6 @@
VMEXPORT Class_Handle
resolve_class(Compile_Handle h, Class_Handle c, unsigned index);
-VMEXPORT Boolean method_is_public(Method_Handle m);
-VMEXPORT unsigned method_get_max_locals(Method_Handle m);
-VMEXPORT Boolean method_is_fake(Method_Handle m);
-
-
-VMEXPORT Method_Side_Effects method_get_side_effects(Method_Handle m);
-VMEXPORT void method_set_side_effects(Method_Handle m, Method_Side_Effects mse);
-
-
-VMEXPORT Class_Handle method_get_return_type_class(Method_Handle m);
-
-
-VMEXPORT Boolean method_has_annotation(Method_Handle target, Class_Handle antn_type);
-
-
VMEXPORT unsigned class_number_fields(Class_Handle ch);
VMEXPORT Field_Handle class_get_field(Class_Handle ch, unsigned idx);
VMEXPORT int class_get_super_offset();
Modified: harmony/enhanced/drlvm/trunk/vm/include/open/em.h
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/include/open/em.h?rev=642252&r1=642251&r2=642252&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/include/open/em.h (original)
+++ harmony/enhanced/drlvm/trunk/vm/include/open/em.h Fri Mar 28 08:11:03 2008
@@ -34,14 +34,12 @@
#define OPEN_EM "em"
#define OPEN_EM_VERSION "1.0"
+#include "rt_types.h"
+
/**
* The handle to the EM instance.
*/
typedef void *EM_Handle;
- /**
- * The handle to the JIT instance.
- */
-typedef void *JIT_Handle;
/**
* The handle to the profile collector instance.
*/
Modified: harmony/enhanced/drlvm/trunk/vm/include/open/rt_types.h
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/include/open/rt_types.h?rev=642252&r1=642251&r2=642252&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/include/open/rt_types.h (original)
+++ harmony/enhanced/drlvm/trunk/vm/include/open/rt_types.h Fri Mar 28 08:11:03 2008
@@ -235,6 +235,11 @@
typedef void * InlineInfoPtr;
typedef void * Compile_Handle; //deprecated??
+ /**
+ * The handle to the JIT instance.
+ */
+typedef void *JIT_Handle;
+
typedef
enum Method_Side_Effects {
Modified: harmony/enhanced/drlvm/trunk/vm/include/open/vm.h
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/include/open/vm.h?rev=642252&r1=642251&r2=642252&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/include/open/vm.h (original)
+++ harmony/enhanced/drlvm/trunk/vm/include/open/vm.h Fri Mar 28 08:11:03 2008
@@ -429,6 +429,8 @@
* @return <code>TRUE</code> if the field must be enumerated by GC
*
* This function doesn't cause resolution of the class of the field.
+ *
+ * FIXME: move to internal headers
*/
VMEXPORT Boolean field_is_enumerable_reference(Field_Handle fh);
@@ -437,238 +439,6 @@
////
////
-// begin method-related functions.
-////
-
-/**
- * @return The method name.
- */
-VMEXPORT const char *method_get_name(Method_Handle mh);
-
-/**
- * @return The method descriptor. The descriptor is a string representation
- * of the parameter and return value types as defined by the JVM spec.
- */
-VMEXPORT const char *method_get_descriptor(Method_Handle mh);
-
-/**
- * @return A class in which the method is declared.
- */
-VMEXPORT Class_Handle method_get_class(Method_Handle mh);
-
-/*
-* Acquires lock associated with method
-*/
-VMEXPORT void method_lock(Method_Handle mh);
-
-/*
-* Releases lock associated with method
-*/
-VMEXPORT void method_unlock(Method_Handle mh);
-
-/**
- * @return <code>TRUE</code> if the method is private.
- */
-VMEXPORT Boolean method_is_private(Method_Handle mh);
-
-/**
- * @return <code>TRUE</code> if the method is static.
- */
-VMEXPORT Boolean method_is_static(Method_Handle mh);
-
-/**
- * @return <code>TRUE</code> if the method is final.
- */
-VMEXPORT Boolean method_is_final(Method_Handle mh);
-
-/**
- * @return <code>TRUE</code> if the method is native.
- */
-VMEXPORT Boolean method_is_native(Method_Handle mh);
-
-/**
- * @return <code>TRUE</code> if the method is synchronized.
- */
-VMEXPORT Boolean method_is_synchronized(Method_Handle mh);
-
-/**
- * @return <code>TRUE</code> if the method is abstract.
- */
-VMEXPORT Boolean method_is_abstract(Method_Handle mh);
-
-/**
- * Java methods may have a flag set to indicate that floating point operations
- * must be performed in the strict mode.
- *
- * @return <code>method_is_strict()</code> returns <code>TRUE</code> if
- * the ACC_STRICT flag is set for a Java method and <code>FALSE</code> otherwise.
- */
-VMEXPORT Boolean method_is_strict(Method_Handle m);
-
-/**
- * @return <code>TRUE</code> if the method has been overriden in a subclass
- * and <code>FALSE</code> otherwise.
- *
- * @note If <code>method_is_overridden</code> returns <code>FALSE</code>, loading
- * of a subclass later in the execution of the program may change
- * invalidate this condition. If a JIT uses <code>method_is_overridden</code>
- * to implement unconditional inlining, it must be prepared to patch the code later
- * (see <code>vm_register_jit_overridden_method_callback</code>).
- */
-VMEXPORT Boolean method_is_overridden(Method_Handle m);
-
-/**
- * @return <code>TRUE</code> if the method should not be inlined. There may also
- * be other reasons why a method shouldn't be inlined, e.g., native methods
- * can't be inlined and in Java you can't inlined methods that are
- * loaded by a different class loader than the caller.
- * Always <code>FALSE</code> for Java.
- */
-VMEXPORT Boolean method_is_no_inlining(Method_Handle mh);
-
-/**
- * Always <code>FALSE</code> for Java.
- */
-VMEXPORT Boolean method_is_require_security_object(Method_Handle mh);
-
-/**
- * @return A signature that can be used to iterate over method's arguments
- * and query the type of the method result.
- */
-VMEXPORT Method_Signature_Handle method_get_signature(Method_Handle mh);
-
-/**
- * Class <code>ch</code> is a subclass of <code>method_get_class(mh)</code>.
- * The function returns a method handle for an accessible method overriding
- * <code>mh</code> in <code>ch</code> or in its closest superclass that overrides
- * <code>mh</code>.
- * Class <code>ch</code> must be a class not an interface.
- */
-VMEXPORT Method_Handle method_find_overridden_method(Class_Handle ch, Method_Handle mh);
-
-////
-// begin method iterator related functions.
-///
-
-/**
- * Initializes the <code>CHA_Method_Iterator</code>, to iterate over all methods that
- * match the method signature and descend from <code>root_class</code>
- * (including <code>root_class</code> itself).
- *
- * @return <code>TRUE</code> if iteration is supported over <code>root_class</code>,
- * <code>FALSE</code> if not.
- */
-VMEXPORT Boolean method_iterator_initialize(ChaMethodIterator*, Method_Handle method, Class_Handle root_class);
-
-/**
- * @return The current method of the iterator. <code>NULL</code> is returned if
- * therea are no more methods.
- */
-VMEXPORT Method_Handle method_iterator_get_current(const ChaMethodIterator*);
-
-/**
- * Advances the iterator.
- */
-VMEXPORT void method_iterator_advance(ChaMethodIterator*);
-
-////
-// begin method signature-related functions.
-////
-
-/**
- * @return The method descriptor for a given method signature.
- * See <code>method_get_descriptor()</code>.
- */
-VMEXPORT const char *method_sig_get_descriptor(Method_Signature_Handle s);
-
-/**
- * Return a signature that can be used to iterate over method's arguments
- * and query the type of the method result.
- * Java doesn't have standalone signatures, so for Java, always return <code>NULL</code>.
- */
-VMEXPORT Method_Signature_Handle method_standalone_signature(Class_Handle ch,
- unsigned idx);
-
-////
-// end method signature-related functions.
-////
-
-////
-// begin local variables-related functions.
-///
-
-/**
- * @return the number of local variables defined for the method.
- */
-VMEXPORT unsigned method_vars_get_number(Method_Handle mh);
-
-/**
- * Return the type info of the local variable number idx.
- * Since local variables are not typed in Java. this function
- * always returns <code>NULL</code> for Java methods.
- */
-VMEXPORT Type_Info_Handle method_vars_get_type_info(Method_Handle mh,
- unsigned idx);
-/**
- * @return <code>TRUE</code> if the local variable is a managed pointer.
- */
-VMEXPORT Boolean method_vars_is_managed_pointer(Method_Handle mh, unsigned idx);
-
-/**
- * @return <code>TRUE</code> if the local variable is pinned.
- */
-VMEXPORT Boolean method_vars_is_pinned(Method_Handle mh, unsigned idx);
-
-/**
- * end local variables-related functions.
- */
-
-/**
- * begin argument-related functions.
- */
-
-/**
- * @return the number of arguments defined for the method.
- * This number automatically includes the this pointer (if present).
- */
-VMEXPORT unsigned method_args_get_number(Method_Signature_Handle msh);
-
-VMEXPORT Boolean method_args_has_this(Method_Signature_Handle msh);
-
-/**
- * Return the class handle of the argument number idx.
- * That's <code>TRUE</code> even for primitive types like int or float.
- */
-VMEXPORT Type_Info_Handle method_args_get_type_info(Method_Signature_Handle msh,
- unsigned idx);
-/**
- * @return <code>TRUE</code> if the argument is a managed pointer.
- */
-VMEXPORT Boolean method_args_is_managed_pointer(Method_Signature_Handle msh, unsigned idx);
-
-////
-// end argument-related functions.
-////
-
-////
-// begin return value-related functions.
-////
-VMEXPORT Type_Info_Handle method_ret_type_get_type_info(Method_Signature_Handle msh);
-
-/**
- * @return <code>TRUE</code> if the return value is a managed pointer.
- */
-VMEXPORT Boolean method_ret_type_is_managed_pointer(Method_Signature_Handle msh);
-
-////
-// end return value-related functions.
-////
-
-////
-// end method-related functions.
-////
-
-////
// begin vector layout functions.
////
@@ -795,17 +565,6 @@
* type checks or for inlining of virtual methods.
*/
VMEXPORT unsigned vm_get_vtable_ptr_size();
-
-/**
- * @return A printable signature. The character buffer is owned by the
- * caller. Call <code>free_string_buffer</code> to reclaim the memory.
- */
-VMEXPORT char *method_sig_get_string(Method_Signature_Handle msh);
-
-/**
- * Free a string buffer returned by <code>method_sig_get_string</code>.
- */
-VMEXPORT void free_string_buffer(char *buffer);
/**
* Sets the property for <code>table_number</code> property table. <code>NULL</code> value is supported.
Modified: harmony/enhanced/drlvm/trunk/vm/include/open/vm_class_support.h
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/include/open/vm_class_support.h?rev=642252&r1=642251&r2=642252&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/include/open/vm_class_support.h (original)
+++ harmony/enhanced/drlvm/trunk/vm/include/open/vm_class_support.h Fri Mar 28 08:11:03 2008
@@ -73,42 +73,6 @@
void vm_register_jit_extended_class_callback(JIT_Handle jit, Class_Handle clss, void* callback_data);
/**
- * Set the information about an exception handler in the code generated by
- * the JIT.
- */
-void method_set_target_handler_info(Method_Handle method, JIT_Handle j, unsigned eh_number, void* start_ip, void* end_ip, void* handler_ip, Class_Handle catch_cl, Boolean exc_obj_is_dead);
-
-/**
- * Get the size of the memory block allocated earlier by
- * method_allocate_info_block().
- */
-unsigned method_get_info_block_size_jit(Method_Handle method, JIT_Handle j);
-
-/**
- * Get the size of the memory block allocated earlier by
- * method_allocate_code_block().
- * A triple <method, jit, id> uniquely identifies a code block.
- */
-VMEXPORT unsigned method_get_code_block_size_jit(Method_Handle method, JIT_Handle j, int id);
-
-/**
- * Retrieve the memory block allocated earlier by
- * method_allocate_code_block().
- * A triple <method, jit, id> uniquely identifies a code block.
- */
-Byte* method_get_code_block_addr_jit(Method_Handle method, JIT_Handle j, int id);
-
-/**
- * Allocated a "read-only" data block.
- *
- * This function is deprecated. In all new code, use
- * method_allocate_data_block() only. At some point, we will revisit
- * this interface to have more control over the layout of various
- * memory blocks allocated by the VM.
- */
-Byte* method_allocate_jit_data_block(Method_Handle method, JIT_Handle j, size_t size, size_t alignment);
-
-/**
* Called by a JIT to have the VM recompile a method using the specified JIT. After
* recompilation, the corresponding vtable entries will be updated, and the necessary
* callbacks to JIT_recompiled_method_callback will be made. It is a requirement that
@@ -121,70 +85,6 @@
// Replaces method_get_JIT_id
JIT_Handle
compilation_get_JIT_id(Compile_Handle compile_handle);
-
-/**
- * Enables allocation of multiple chunks of code with different heat values.
- *
- * The JIT compiler is responsible for specifying unique IDs of code chunks within one method.
- * The first instruction of the chunk with id=0 is the entry point of the method.
- *
- * @param method - the method handle
- * @param jit - the JIT handle
- * @param size - the size of the allocated code block
- * @param alignment - the memory block aligment
- * @param heat - ?
- * @param id - code chunk id
- * @param action - the resulting return action
- *
- * @return The pointer to the allocated code block with the following specifics:
- * <ul>
- * <li>If the CAA_Allocate argument is specified, memory is allocated and the function returns the pointer
- * to this memory.
- * <li>If the CAA_Simulate argument is specified, no memory is allocated and the function returns the address
- * that would have been allocated if CAA_Allocate was specified and all the other arguments were the same.
- * </ul>
- * The function may also return <code>NULL</code> when CAA_Simulate is specified. For example, this may happen
- * when multiple heat values are mapped to the same code pool or when the specified size require a new code pool.
- *
- * @note FIXME This has to go to the compilation infrastructure interface.
- */
-Open_Native_Code_Ptr
-method_allocate_code_block(Open_Method_Handle method,
- JIT_Handle jit,
- size_t size,
- size_t alignment,
- unsigned heat,
- int id,
- Code_Allocation_Action action);
-
-/**
- * Allocates the "read-write" data block for the given method.
- *
- * This block is intended for data that may be required during program execution,
- * for example, tables for switch statements. This block cannot be retrieved later.
- *
- * Separation of data allocated by <i>method_allocate_data_block</i> and
- * <i>method_allocate_info_block</i> may help improve locality of references
- * to data accessed during execution of compiled code and data accessed during
- * stack unwinding.
- *
- * @param method - the method handle
- * @param jit - the JIT handle
- * @param size - the size of the allocated code block
- * @param alignment - the memory block aligment
- *
- * @return The pointer to the allocated data block.
- *
- * @note Reference to type <i>Byte</i>.
- * @note FIXME This has to go to the compilation infrastructure interface.
- *
- * @see method_allocate_info_block
- */
-Byte*
-method_allocate_data_block(Open_Method_Handle method,
- JIT_Handle jit,
- size_t size,
- size_t alignment);
/**
* Returns the class handle corresponding to a given allocation handle.
Modified: harmony/enhanced/drlvm/trunk/vm/include/open/vm_interface.h
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/include/open/vm_interface.h?rev=642252&r1=642251&r2=642252&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/include/open/vm_interface.h (original)
+++ harmony/enhanced/drlvm/trunk/vm/include/open/vm_interface.h Fri Mar 28 08:11:03 2008
@@ -74,29 +74,6 @@
//Method
-PROTOTYPE_WITH_NAME(Method_Handle, method_get_overridden_method, (Class_Handle ch, Method_Handle mh));//method_find_overridden_method
-PROTOTYPE_WITH_NAME(Byte* , method_get_info_block_jit, (Method_Handle m, JIT_Handle j));
-PROTOTYPE_WITH_NAME(unsigned , method_get_info_block_size_jit, (Method_Handle m, JIT_Handle j));
-PROTOTYPE_WITH_NAME(const char* , method_get_name, (Method_Handle mh));
-PROTOTYPE_WITH_NAME(const char* , method_get_descriptor, (Method_Handle mh));
-PROTOTYPE_WITH_NAME(const Byte* , method_get_byte_code_addr, (Method_Handle mh));
-PROTOTYPE_WITH_NAME(uint32 , method_get_byte_code_size, (Method_Handle mh));
-PROTOTYPE_WITH_NAME(uint16 , method_get_max_stack, (Method_Handle mh));
-PROTOTYPE_WITH_NAME(uint32 , method_get_num_handlers, (Method_Handle mh));
-PROTOTYPE_WITH_NAME(uint32 , method_get_offset, (Method_Handle mh));
-PROTOTYPE_WITH_NAME(void* , method_get_indirect_address, (Method_Handle mh));
-PROTOTYPE_WITH_NAME(void* , method_get_native_func_addr, (Method_Handle mh));
-PROTOTYPE_WITH_NAME(uint32 , method_vars_get_number, (Method_Handle mh));
-PROTOTYPE_WITH_NAME(unsigned , method_args_get_number, (Method_Signature_Handle mh));
-PROTOTYPE_WITH_NAME(Type_Info_Handle, method_args_get_type_info, (Method_Signature_Handle msh, unsigned idx));
-PROTOTYPE_WITH_NAME(Type_Info_Handle, method_ret_type_get_type_info, (Method_Signature_Handle msh));
-PROTOTYPE_WITH_NAME(Method_Signature_Handle, method_get_signature, (Method_Handle mh));
-PROTOTYPE_WITH_NAME(Class_Handle, method_get_class, (Method_Handle mh));
-PROTOTYPE_WITH_NAME(void , method_get_handler_info,
- (Method_Handle mh,
- unsigned handler_id, unsigned *begin_offset,
- unsigned *end_offset, unsigned *handler_offset,
- unsigned *handler_cpindex));
PROTOTYPE_WITH_NAME(Byte* , method_get_code_block_addr_jit_new,
(Method_Handle mh,
JIT_Handle j,
@@ -105,55 +82,9 @@
(Method_Handle nh,
JIT_Handle j,
int id));
-PROTOTYPE_WITH_NAME(Method_Side_Effects, method_get_side_effects, (Method_Handle mh));
-
-PROTOTYPE_WITH_NAME(Boolean , method_has_annotation, (Method_Handle mh, Class_Handle antn_type));
-PROTOTYPE_WITH_NAME(Boolean , method_is_private, (Method_Handle mh));
-PROTOTYPE_WITH_NAME(Boolean , method_is_static, (Method_Handle mh));
-PROTOTYPE_WITH_NAME(Boolean , method_is_native, (Method_Handle mh));
-PROTOTYPE_WITH_NAME(Boolean , method_is_synchronized, (Method_Handle mh));
-PROTOTYPE_WITH_NAME(Boolean , method_is_final, (Method_Handle mh));
-PROTOTYPE_WITH_NAME(Boolean , method_is_abstract, (Method_Handle mh));
-PROTOTYPE_WITH_NAME(Boolean , method_is_strict, (Method_Handle mh));
-PROTOTYPE_WITH_NAME(Boolean , method_is_overridden, (Method_Handle mh));
-PROTOTYPE_WITH_NAME(Boolean , method_is_no_inlining, (Method_Handle mh));
-
-
-PROTOTYPE_WITH_NAME(void , method_set_side_effects, (Method_Handle mh, Method_Side_Effects mse));
-PROTOTYPE_WITH_NAME(void , method_set_num_target_handlers,
- (Method_Handle mh,
- JIT_Handle j,
- unsigned num_handlers));
-PROTOTYPE_WITH_NAME(void , method_set_target_handler_info,
- (Method_Handle mh,
- JIT_Handle j,
- unsigned eh_number,
- void *start_ip,
- void *end_ip,
- void *handler_ip,
- Class_Handle catch_cl,
- Boolean exc_obj_is_dead));
-
-
-PROTOTYPE_WITH_NAME(void , method_lock, (Method_Handle m));
-PROTOTYPE_WITH_NAME(void , method_unlock, (Method_Handle m));
-
-PROTOTYPE_WITH_NAME(Byte* , method_allocate_code_block,
- (Method_Handle m,
- JIT_Handle j,
- size_t size,
- size_t alignment,
- CodeBlockHeat heat,
- int id,
- Code_Allocation_Action action));
-PROTOTYPE_WITH_NAME(Byte* , method_allocate_data_block, (Method_Handle m, JIT_Handle j, size_t size, size_t alignment));
-PROTOTYPE_WITH_NAME(Byte* , method_allocate_info_block, (Method_Handle m, JIT_Handle j, size_t size));
-PROTOTYPE_WITH_NAME(Byte* , method_allocate_jit_data_block, (Method_Handle m, JIT_Handle j, size_t size, size_t alignment));
-
//Object
PROTOTYPE_WITH_NAME(int , object_get_vtable_offset, ());
-
//Resolve
PROTOTYPE_WITH_NAME(Class_Handle, resolve_class, (Compile_Handle h, Class_Handle c, unsigned index));
Modified: harmony/enhanced/drlvm/trunk/vm/include/open/vm_method_access.h
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/include/open/vm_method_access.h?rev=642252&r1=642251&r2=642252&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/include/open/vm_method_access.h (original)
+++ harmony/enhanced/drlvm/trunk/vm/include/open/vm_method_access.h Fri Mar 28 08:11:03 2008
@@ -21,6 +21,15 @@
#ifndef _VM_METHOD_ACCESS_H
#define _VM_METHOD_ACCESS_H
+#include "common.h"
+#include "platform_types.h"
+#include "types.h"
+#include "rt_types.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/**
* @file
* Part of Class Support interface related to retrieving different
@@ -34,10 +43,9 @@
*
* @return Method name bytes.
*
- * @note An assertion is raised if <i>method</i> equals to <code>NULL</code>.
+ * @note An assertion is raised if <i>method</i> equals to <code>NULL</code>.
*/
-const char*
-method_get_name(Open_Method_Handle method);
+DECLARE_OPEN(const char*, method_get_name, (Method_Handle method));
/**
* Returns the method descriptor.
@@ -46,10 +54,9 @@
*
* @return Method descriptor bytes.
*
- * @note An assertion is raised if <i>method</i> equals to <code>NULL</code>.
+ * @note An assertion is raised if <i>method</i> equals to <code>NULL</code>.
*/
-const char*
-method_get_descriptor(Open_Method_Handle method);
+DECLARE_OPEN(const char*, method_get_descriptor, (Method_Handle method));
/**
* Returns the signature that can be used to iterate over the agruments of the given method
@@ -61,8 +68,7 @@
*
* @note An assertion is raised if <i>method</i> equals to <code>NULL</code>.
*/
-Method_Signature_Handle
-method_get_signature(Method_Handle method);
+DECLARE_OPEN(Method_Signature_Handle, method_get_signature, (Method_Handle method));
/**
* Returns the class where the given method is declared.
@@ -73,32 +79,21 @@
*
* @note An assertion is raised if <i>method</i> equals to <code>NULL</code>.
*/
-Open_Class_Handle
-method_get_class(Open_Method_Handle method);
+DECLARE_OPEN(Class_Handle, method_get_class, (Method_Handle method));
/**
- * Returns access flags for the given method.
+ * Acquires lock associated with a method
*
* @param method - the method handle
- *
- * @return Access flags.
- *
- * @note An assertion is raised if <i>method</i> equals to <code>NULL</code>.
- */
-unsigned short
-method_get_flags(Open_Method_Handle method);
+*/
+DECLARE_OPEN(void, method_lock, (Method_Handle method));
/**
- * Checks whether the given method is protected.
+ * Releases lock associated with a method
*
* @param method - the method handle
- *
- * @return <code>TRUE</code> if the given method is protected; otherwise, <code>FALSE</code>.
- *
- * @note An assertion is raised if <i>method</i> equals to <code>NULL</code>.
- **/
-unsigned
-method_is_protected(Open_Method_Handle method);
+*/
+DECLARE_OPEN(void, method_unlock, (Method_Handle method));
/**
* Checks whether the given method is private.
@@ -110,21 +105,7 @@
* @note An assertion is raised if <i>method</i> equals to <code>NULL</code>.
* @ingroup Extended
*/
-Boolean
-method_is_private(Open_Method_Handle method);
-
-/**
- * Checks whether the given method is public.
- *
- * @param method - the method handle
- *
- * @return <code>TRUE</code> if the given method is public; otherwise, <code>FALSE</code>.
- *
- * @note An assertion is raised if <i>method</i> equals to <code>NULL</code>.
- * @ingroup Extended
- */
-Boolean
-method_is_public(Open_Method_Handle method);
+DECLARE_OPEN(BOOLEAN, method_is_private, (Method_Handle method));
/**
* Checks whether the given method is static.
@@ -133,11 +114,10 @@
*
* @return <code>TRUE</code> if the given method is static; otherwise, <code>FALSE</code>.
*
- * @note An assertion is raised if <i>method</i> equals to <code>NULL</code>.
- * @ingroup Extended
+ * @note An assertion is raised if <i>method</i> equals to <code>NULL</code>.
+ * @ingroup Extended
*/
-Boolean
-method_is_static(Open_Method_Handle method);
+DECLARE_OPEN(BOOLEAN, method_is_static, (Method_Handle method));
/**
* Checks whether the given method is native.
@@ -149,8 +129,7 @@
* @note An assertion is raised if <i>method</i> equals to <code>NULL</code>.
* @ingroup Extended
*/
-Boolean
-method_is_native(Open_Method_Handle method);
+DECLARE_OPEN(BOOLEAN, method_is_native, (Method_Handle method));
/**
* Checks whether the given method is synchronized.
@@ -162,8 +141,7 @@
* @note An assertion is raised if <i>method</i> equals to <code>NULL</code>.
* @ingroup Extended
*/
-Boolean
-method_is_synchronized(Open_Method_Handle method);
+DECLARE_OPEN(BOOLEAN, method_is_synchronized, (Method_Handle method));
/**
* Checks whether the given method is final.
@@ -175,8 +153,7 @@
* @note An assertion is raised if <i>method</i> equals to <code>NULL</code>.
* @ingroup Extended
*/
-Boolean
-method_is_final(Open_Method_Handle method);
+DECLARE_OPEN(BOOLEAN, method_is_final, (Method_Handle method));
/**
* Checks whether the given method is abstract.
@@ -188,8 +165,7 @@
* @note An assertion is raised if <i>method</i> equals to <code>NULL</code>.
* @ingroup Extended
*/
-Boolean
-method_is_abstract(Open_Method_Handle method);
+DECLARE_OPEN(BOOLEAN, method_is_abstract, (Method_Handle method));
/**
* Checks whether the given method is strict.
@@ -203,10 +179,9 @@
* the Java* method and <code>FALSE</code> if otherwise.
*
* @note An assertion is raised if <i>method</i> equals to <code>NULL</code>.
-* @ingroup Extended
+ * @ingroup Extended
*/
-Boolean
-method_is_strict(Open_Method_Handle method);
+DECLARE_OPEN(BOOLEAN, method_is_strict, (Method_Handle method));
/**
* Checks whether the given method has been overridden in a subclass.
@@ -219,33 +194,12 @@
*
* @note If this function returns <code>FALSE</code>, loading the subclass later
* in the execution of the program may invalidate this condition.
-* If a JIT compiler uses this function to perform unconditional inlining,
- the compiler must be prepared to patch the code later.
-*
- * @see vm_register_jit_overridden_method_callback
- */
-Boolean
-method_is_overridden(Open_Method_Handle method);
-
-/**
- * Checks whether the method is the <init> method for the class.
- *
- * @param method - the method handle
- *
- * @return <code>TRUE</code> if the method is the <init> method; otherwise, <code>FALSE</code>.
- */
-Boolean
-method_is_init(Open_Method_Handle method);
-
-/**
- * Checks whether the method is the <clinit> method for the class.
+ * If a JIT compiler uses this function to perform unconditional inlining,
+ * the compiler must be prepared to patch the code later.
*
- * @param method - the method handle
- *
- * @return <code>TRUE</code> if the method is the <clinit> method for the class; otherwise, <code>FALSE</code>.
+ * @see vm_register_jit_overridden_method_callback
*/
-Boolean
-method_is_clinit(Open_Method_Handle method);
+DECLARE_OPEN(BOOLEAN, method_is_overridden, (Method_Handle method));
/**
* Checks whether the JIT compiler is allowed to in-line the method.
@@ -261,13 +215,17 @@
* @note An assertion is raised if <i>method</i> equals to <code>NULL</code>.
* @note Always <code>FALSE</code> for Java*.
*/
-Boolean
-method_is_no_inlining(Open_Method_Handle method);
+DECLARE_OPEN(BOOLEAN, method_is_no_inlining, (Method_Handle method));
+
+/**
+ * FIXME: NOCOMMENT
+ */
+DECLARE_OPEN(BOOLEAN, method_has_annotation, (Method_Handle mh, Class_Handle antn_type));
/**
* Retrieves potential side effects of the given method.
*
- * @param m - handle for the method, for which side effects are retrieved
+ * @param method - handle for the method, for which side effects are retrieved
*
* @return Enumeration value which corresponds to side effects method may have.
* One of:
@@ -276,7 +234,7 @@
* MSE_False - method does not have side effects
* MSE_True_Null_Param -
*/
-VMEXPORT Method_Side_Effects method_get_side_effects(Open_Method_Handle m);
+DECLARE_OPEN(Method_Side_Effects, method_get_side_effects, (Method_Handle method));
/**
* Sets potential side effects of the given method.
@@ -284,7 +242,7 @@
* @param m - method handle for which side effects are set
* @param mse - side effect of this method (see method_get_side_effects for details)
*/
-VMEXPORT void method_set_side_effects(Open_Method_Handle m, Method_Side_Effects mse);
+DECLARE_OPEN(void, method_set_side_effects, (Method_Handle m, Method_Side_Effects mse));
/**
* Sets the number of exception handlers in the code generated by the JIT compiler
@@ -297,25 +255,17 @@
* @note The JIT compiler must then call the <i>method_set_target_handler_info</i> function
* for each of the <i>num_handlers</i> exception handlers.
*/
-void
-method_set_num_target_handlers(Open_Method_Handle method,
- Open_JIT_Handle jit,
- unsigned short num_handlers);
+DECLARE_OPEN(void, method_set_num_target_handlers,
+ (Method_Handle method, JIT_Handle jit, unsigned num_handlers));
/**
- * Checks whether the local variable is pinned.
- *
- * @param method - method handle
- * @param index - the local variable index
- *
- * @return <i>TRUE</i> if the local variable is pinned; otherwise, <code>FALSE</code>.
- *
- * @note Replaces the method_vars_is_pinned function.
-* @ingroup Extended
-* @note Not used.
+ * Set the information about an exception handler in the code generated by
+ * the JIT.
*/
-Boolean
-method_local_is_pinned(Open_Method_Handle method, unsigned short index);
+DECLARE_OPEN(void, method_set_target_handler_info,
+ (Method_Handle method, JIT_Handle j, unsigned eh_number,
+ void* start_ip, void* end_ip, void* handler_ip,
+ Class_Handle catch_cl, Boolean exc_obj_is_dead));
/**
* Returns the handle for an accessible method overriding <i>method</i> in <i>klass</i>
@@ -326,24 +276,8 @@
*
* @return The method handle for an accessible method overriding <i>method</i>; otherwise, <code>FALSE</code>.
*/
-Open_Method_Handle
-method_find_overridden_method(Open_Class_Handle klass,
- Open_Method_Handle method);
-
-/**
- * Returns type information of the local variable.
- *
- * @param method - the method handle
- * @param index - the local variable number
- *
- * @return The type information of the local variable.
- *
- * @note Because local variables are not typed in Java*, this function
- * always returns <code>NULL</code> for Java* methods.
- * @note Replaces the method_vars_get_type_info function.
- */
-Open_Type_Info_Handle
-method_local_get_type_info(Open_Method_Handle method, unsigned short index);
+DECLARE_OPEN(Method_Handle, method_get_overriding_method,
+ (Class_Handle klass, Method_Handle method));
/**
* Returns the number of arguments defined for the method.
@@ -353,72 +287,7 @@
*
* @return The number of arguments defined for the method.
*/
-unsigned char
-method_args_get_number(Method_Signature_Handle method_signature);
-
-/**
- * Initializes the ChaMethodIterator <i>iterator</i> to iterate over all
- * methods that match the method signature and descend from <i>klass</i>
- * (including <i>klass</i> itself).
- *
- * @param iterator - the class iterator
- * @param method - the method handle
- * @param klass - the class handle
- *
- * @return <code>TRUE</code> if iteration is supported over <i>klass</i>,
- * <code>FALSE</code> if it is not.
- *
- * @note Reference to internal type ChaMethodIterator.
- */
-Boolean
-method_iterator_initialize(ChaMethodIterator* iterator,
- Open_Method_Handle method,
- Open_Class_Handle klass);
-
-/**
- * Advances the iterator.
- *
- * @param iterator - class iterator
- *
- * @note Reference to internal type ChaMethodIterator.
- */
-void
-method_iterator_advance(ChaMethodIterator* iterator);
-
-/**
- * Returns the current method of the iterator.
- *
- * @param iterator - the class iterator
- *
- * @return The current method of the iterator or <code>NULL</code> if no more methods are left.
- *
- * @note Reference to the internal type <i>ChaMethodIterator</i>.
- */
-Method_Handle
-method_iterator_get_current(ChaMethodIterator* iterator);
-
-/**
- * Returns the number of exceptions that the given method can throw.
- *
- * @param method - the method handle
- *
- * @return The number of exceptions.
- *
- * @note Replaces method_number_throws function.
- */
-unsigned short
-method_get_num_throws(Open_Method_Handle method);
-
-/**
- * Returns the exception class a given method can throw.
- *
- * @param method - the method handle
- * @param index - the exception number
- *
- * @return the exception class a given method can throw.
- */
-Open_Class_Handle
-method_get_throws(Open_Method_Handle method, unsigned short index);
+DECLARE_OPEN(unsigned char, method_args_get_number, (Method_Signature_Handle method_signature));
/**
* Returns the number of method exception handlers.
@@ -430,30 +299,25 @@
* @note An assertion is raised if method equals to <code>NULL</code>.
* @note Replaces method_get_num_handlers function.
*/
-unsigned short
-method_get_exc_handler_number(Open_Method_Handle method);
+DECLARE_OPEN(uint16, method_get_exc_handler_number, (Method_Handle method));
/**
* Obtains the method exception handle information.
*
- * @param method - the method handle
- * @param index - the exception handle index number
- * @param start_pc - the resulting pointer to the exception handle start program count
- * @param end_pc - the resulting pointer to the exception handle end program count
- * @param handler_pc - the resulting pointer to the exception handle program count
- * @param catch_type - the resulting pointer to the constant pool entry index
+ * @param method - the method handle
+ * @param index - the exception handle index number
+ * @param start_pc - the resulting pointer to the exception handle start program count
+ * @param end_pc - the resulting pointer to the exception handle end program count
+ * @param handler_pc - the resulting pointer to the exception handle program count
+ * @param catch_type - the resulting pointer to the constant pool entry index
*
* @note An assertion is raised if <i>method</i> equals to <code>NULL</code> or
* if the exception handle index is out of range or if any pointer equals to <code>NULL</code>.
* @note Replaces the method_get_handler_info function.
*/
-void
-method_get_exc_handler_info(Open_Method_Handle method,
- unsigned short index,
- unsigned short* start_pc,
- unsigned short* end_pc,
- unsigned short* handler_pc,
- unsigned short* catch_type);
+DECLARE_OPEN(void, method_get_exc_handler_info,
+ (Method_Handle method, uint32 index,
+ uint32* start_pc, uint32* end_pc, uint32* handler_pc, uint32* catch_type));
/**
* Returns type information for the return value.
@@ -462,19 +326,8 @@
*
* @return The type information for the return value.
*/
-Type_Info_Handle
-method_ret_type_get_type_info(Method_Signature_Handle method_signature);
-
-/**
- * Checks whether the given argument is a managed pointer.
- *
- * @param method_signature - the method signature handle
- * @param index - the argument index
- *
- * @return <code>TRUE</code> if the argument is a managed pointer; otherwise, <code>FALSE</code>.
- */
-Boolean
-method_args_is_managed_pointer(Method_Signature_Handle method_signature, unsigned index);
+DECLARE_OPEN(Type_Info_Handle, method_ret_type_get_type_info,
+ (Method_Signature_Handle method_signature));
/**
* Returns type information for the given argument.
@@ -484,8 +337,8 @@
*
* @return Type information for the argument.
*/
-Type_Info_Handle
-method_args_get_type_info(Method_Signature_Handle method_signature, unsigned index);
+DECLARE_OPEN(Type_Info_Handle, method_args_get_type_info,
+ (Method_Signature_Handle method_signature, unsigned index));
/**
* Returns the method bytecode size.
@@ -493,11 +346,8 @@
* @param method - the method handle
*
* @return The method bytecode size.
- *
- * @note Replaces the method_get_code_length function.
*/
-jint
-method_get_bytecode_size(Open_Method_Handle method);
+DECLARE_OPEN(uint32, method_get_bytecode_length, (Method_Handle method));
/**
* Returns the method bytecode array.
@@ -508,10 +358,8 @@
*
* @note An assertion is raised if the method equals to <code>NULL</code>.
* @note Reference to type <i>Byte</i>.
- * @note Replaces the method_get_bytecode function.
*/
-const char*
-method_get_bytecode_addr(Open_Method_Handle method);
+DECLARE_OPEN(const Byte*, method_get_bytecode, (Method_Handle method));
/**
* Returns the maximum number of local variables for the given method.
@@ -523,8 +371,7 @@
* @note An assertion is raised if the method equals to <code>NULL</code>.
* @note Replaces functions method_get_max_local and method_vars_get_number.
*/
-jint
-method_get_max_locals(Open_Method_Handle method);
+DECLARE_OPEN(uint32, method_get_max_locals, (Method_Handle method));
/**
* Returns the maximum stack depth for the given method.
@@ -535,8 +382,7 @@
*
* @note An assertion is raised if <i>method</i> equals to <code>NULL</code>.
*/
-jint
-method_get_max_stack(Open_Method_Handle method);
+DECLARE_OPEN(uint16, method_get_max_stack, (Method_Handle method));
/**
* Returns the offset from the start of the vtable to the entry for the given method
@@ -545,8 +391,7 @@
*
* @return The offset from the start of the vtable to the entry for the method, in bytes.
*/
-unsigned
-method_get_offset(Open_Method_Handle method);
+DECLARE_OPEN(unsigned, method_get_offset, (Method_Handle method));
/**
* Gets the address of the code pointer for the given method.
@@ -560,8 +405,16 @@
*
* @see vm_register_jit_recompiled_method_callback
*/
-Open_Native_Code_Ptr
-method_get_indirect_address(Open_Method_Handle method);
+DECLARE_OPEN(void*, method_get_indirect_address, (Method_Handle method));
+
+/**
+* Looks for a method in native libraries of a class loader.
+*
+* @param[in] method - a searching native-method structure
+* @return The pointer to found a native function.
+* @note The function raises <code>UnsatisfiedLinkError</code> with a method name
+* in an exception message, if the specified method is not found.*/
+DECLARE_OPEN(void*, method_get_native_func_addr, (Method_Handle method));
/**
* Allocates an information block for the given method.
@@ -580,25 +433,104 @@
*
* @see method_allocate_data_block
*/
-Byte*
-method_allocate_info_block(Open_Method_Handle method,
- JIT_Handle jit,
- size_t size);
+DECLARE_OPEN(Byte*, method_allocate_info_block,
+ (Method_Handle method, JIT_Handle jit, size_t size));
/**
- * Retrieves the memory block allocated earlier by the
- * <i>method_allocate_data_block</i> function.
-* The pair of parameters <method, jit> uniquely identifies the JIT compiler information block.
+ * Allocates the "read-write" data block for the given method.
+ *
+ * This block is intended for data that may be required during program execution,
+ * for example, tables for switch statements. This block cannot be retrieved later.
+ *
+ * Separation of data allocated by <i>method_allocate_data_block</i> and
+ * <i>method_allocate_info_block</i> may help improve locality of references
+ * to data accessed during execution of compiled code and data accessed during
+ * stack unwinding.
*
* @param method - the method handle
* @param jit - the JIT handle
+ * @param size - the size of the allocated code block
+ * @param alignment - the memory block aligment
*
* @return The pointer to the allocated data block.
*
* @note Reference to type <i>Byte</i>.
+ * @note FIXME This has to go to the compilation infrastructure interface.
+ *
+ * @see method_allocate_info_block
+ */
+DECLARE_OPEN(Byte*, method_allocate_data_block,
+ (Method_Handle method, JIT_Handle jit, size_t size, size_t alignment));
+
+/**
+ * Allocated a "read-only" data block.
+ *
+ * This function is deprecated. In all new code, use
+ * method_allocate_data_block() only. At some point, we will revisit
+ * this interface to have more control over the layout of various
+ * memory blocks allocated by the VM.
*/
-Byte*
-method_get_data_block_jit(Method_Handle method, JIT_Handle jit);
+DECLARE_OPEN(Byte*, method_allocate_jit_data_block,
+ (Method_Handle method, JIT_Handle jit, size_t size, size_t alignment));
+
+/**
+ * Enables allocation of multiple chunks of code with different heat values.
+ *
+ * The JIT compiler is responsible for specifying unique IDs of code chunks within one method.
+ * The first instruction of the chunk with id=0 is the entry point of the method.
+ *
+ * @param method - the method handle
+ * @param jit - the JIT handle
+ * @param size - the size of the allocated code block
+ * @param alignment - the memory block aligment
+ * @param heat - ?
+ * @param id - code chunk id
+ * @param action - the resulting return action
+ *
+ * @return The pointer to the allocated code block with the following specifics:
+ * <ul>
+ * <li>If the CAA_Allocate argument is specified, memory is allocated and the function returns the pointer
+ * to this memory.
+ * <li>If the CAA_Simulate argument is specified, no memory is allocated and the function returns the address
+ * that would have been allocated if CAA_Allocate was specified and all the other arguments were the same.
+ * </ul>
+ * The function may also return <code>NULL</code> when CAA_Simulate is specified. For example, this may happen
+ * when multiple heat values are mapped to the same code pool or when the specified size require a new code pool.
+ *
+ * @note FIXME This has to go to the compilation infrastructure interface.
+ */
+DECLARE_OPEN(Byte*, method_allocate_code_block,
+ (Method_Handle method, JIT_Handle jit, size_t size, size_t alignment,
+ CodeBlockHeat heat, int id, Code_Allocation_Action action));
+
+/**
+ * Retrieve the memory block allocated earlier by
+ * method_allocate_code_block().
+ * A triple <method, jit, id> uniquely identifies a code block.
+ *
+ * @param method - the method handle
+ * @param j - the JIT handle
+ * @param id - code block ID
+ *
+ * @return address of the requested code block
+ */
+DECLARE_OPEN(Byte*, method_get_code_block_jit,
+ (Method_Handle method, JIT_Handle j));/*, int id));*/
+
+/**
+ * Get the size of the memory block allocated earlier by
+ * method_allocate_code_block().
+ * A triple <method, jit, id> uniquely identifies a code block.
+ *
+ * @param method - the method handle
+ * @param j - the JIT handle
+ * @param id - code block ID
+ *
+ * @return size of the requested code block
+ */
+DECLARE_OPEN(unsigned, method_get_code_block_size_jit,
+ (Method_Handle method, JIT_Handle j));/*, int id));*/
+
/**
* Retrieves the memory block allocated earlier by the
@@ -612,7 +544,16 @@
*
* @note Reference to type <i>Byte</i>.
*/
-Byte*
-method_get_info_block_jit(Method_Handle method, JIT_Handle jit);
+DECLARE_OPEN(Byte*, method_get_info_block_jit, (Method_Handle method, JIT_Handle jit));
+
+/**
+ * Get the size of the memory block allocated earlier by
+ * method_allocate_info_block().
+ *
+ * FIXME: NOCOMMENT
+ */
+DECLARE_OPEN(unsigned, method_get_info_block_size_jit, (Method_Handle method, JIT_Handle jit));
+
+}
#endif // _VM_METHOD_ACCESS_H
Modified: harmony/enhanced/drlvm/trunk/vm/include/vm_java_support.h
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/include/vm_java_support.h?rev=642252&r1=642251&r2=642252&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/include/vm_java_support.h (original)
+++ harmony/enhanced/drlvm/trunk/vm/include/vm_java_support.h Fri Mar 28 08:11:03 2008
@@ -59,8 +59,6 @@
VMEXPORT unsigned class_number_implements(Class_Handle ch);
VMEXPORT Class_Handle class_get_implements(Class_Handle ch, unsigned idx);
-VMEXPORT unsigned method_number_throws(Method_Handle m);
-VMEXPORT Class_Handle method_get_throws(Method_Handle m, unsigned idx);
/**
* @return <code>TRUE</code> if this a Java method. Every Java JIT must call this
@@ -69,7 +67,6 @@
*/
VMEXPORT Boolean method_is_java(Method_Handle mh);
VMEXPORT unsigned field_get_flags(Field_Handle f);
-VMEXPORT unsigned method_get_flags(Method_Handle m);
VMEXPORT unsigned class_get_flags(Class_Handle cl);
void
Modified: harmony/enhanced/drlvm/trunk/vm/interpreter/src/interp_native_em64t.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/interpreter/src/interp_native_em64t.cpp?rev=642252&r1=642251&r2=642252&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/interpreter/src/interp_native_em64t.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/interpreter/src/interp_native_em64t.cpp Fri Mar 28 08:11:03 2008
@@ -27,6 +27,7 @@
#include "exceptions.h"
#include "mon_enter_exit.h"
#include "open/jthread.h"
+#include "open/vm_method_access.h"
#include "interp_native.h"
#include "interp_defs.h"
#include "ini.h"
Modified: harmony/enhanced/drlvm/trunk/vm/interpreter/src/interp_native_ia32.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/interpreter/src/interp_native_ia32.cpp?rev=642252&r1=642251&r2=642252&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/interpreter/src/interp_native_ia32.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/interpreter/src/interp_native_ia32.cpp Fri Mar 28 08:11:03 2008
@@ -28,6 +28,7 @@
#include "interp_defs.h"
#include "ini.h"
//#include "open/jthread.h"
+#include "open/vm_method_access.h"
using namespace std;
Modified: harmony/enhanced/drlvm/trunk/vm/interpreter/src/interp_native_ipf.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/interpreter/src/interp_native_ipf.cpp?rev=642252&r1=642251&r2=642252&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/interpreter/src/interp_native_ipf.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/interpreter/src/interp_native_ipf.cpp Fri Mar 28 08:11:03 2008
@@ -28,6 +28,7 @@
#include "interp_defs.h"
#include "ini.h"
#include "open/jthread.h"
+#include "open/vm_method_access.h"
Modified: harmony/enhanced/drlvm/trunk/vm/interpreter/src/interp_stack_trace.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/interpreter/src/interp_stack_trace.cpp?rev=642252&r1=642251&r2=642252&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/interpreter/src/interp_stack_trace.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/interpreter/src/interp_stack_trace.cpp Fri Mar 28 08:11:03 2008
@@ -20,6 +20,7 @@
*/
#include "interpreter.h"
+#include "open/vm_method_access.h"
#include "interp_native.h"
#include "interp_defs.h"
#include "stack_trace.h"
Modified: harmony/enhanced/drlvm/trunk/vm/interpreter/src/interpreter.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/interpreter/src/interpreter.cpp?rev=642252&r1=642251&r2=642252&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/interpreter/src/interpreter.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/interpreter/src/interpreter.cpp Fri Mar 28 08:11:03 2008
@@ -19,6 +19,7 @@
#include "interpreter_imports.h"
#include "open/vm_class_info.h"
#include "open/vm_field_access.h"
+#include "open/vm_method_access.h"
#include <math.h>
#include "exceptions.h"
Modified: harmony/enhanced/drlvm/trunk/vm/interpreter/src/interpreter_ti.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/interpreter/src/interpreter_ti.cpp?rev=642252&r1=642251&r2=642252&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/interpreter/src/interpreter_ti.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/interpreter/src/interpreter_ti.cpp Fri Mar 28 08:11:03 2008
@@ -24,6 +24,7 @@
#include "interp_defs.h"
#include "interp_native.h"
#include "open/vm_field_access.h"
+#include "open/vm_method_access.h"
#include "port_malloc.h"
#include "thread_generic.h"
Modified: harmony/enhanced/drlvm/trunk/vm/jitrino/src/jet/cg.h
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/jitrino/src/jet/cg.h?rev=642252&r1=642251&r2=642252&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/jitrino/src/jet/cg.h (original)
+++ harmony/enhanced/drlvm/trunk/vm/jitrino/src/jet/cg.h Fri Mar 28 08:11:03 2008
@@ -1189,7 +1189,7 @@
/**
* @brief The byte code of the method being compiled.
*/
- unsigned char * m_bc;
+ const unsigned char* m_bc;
JFrame * m_jframe;
/**
Modified: harmony/enhanced/drlvm/trunk/vm/jitrino/src/jet/cg_ia32.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/jitrino/src/jet/cg_ia32.cpp?rev=642252&r1=642251&r2=642252&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/jitrino/src/jet/cg_ia32.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/jitrino/src/jet/cg_ia32.cpp Fri Mar 28 08:11:03 2008
@@ -18,6 +18,7 @@
* @author Alexander Astapchuk
* @version $Revision$
*/
+#include "open/vm_method_access.h"
#include "compiler.h"
#include "trace.h"
Modified: harmony/enhanced/drlvm/trunk/vm/jitrino/src/jet/cg_regs.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/jitrino/src/jet/cg_regs.cpp?rev=642252&r1=642251&r2=642252&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/jitrino/src/jet/cg_regs.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/jitrino/src/jet/cg_regs.cpp Fri Mar 28 08:11:03 2008
@@ -18,8 +18,8 @@
* @author Alexander Astapchuk
* @version $Revision$
*/
+#include "open/vm_method_access.h"
#include "compiler.h"
-//#include <open/vm.h>
#include "trace.h"
/**
Modified: harmony/enhanced/drlvm/trunk/vm/jitrino/src/jet/compiler.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/jitrino/src/jet/compiler.cpp?rev=642252&r1=642251&r2=642252&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/jitrino/src/jet/compiler.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/jitrino/src/jet/compiler.cpp Fri Mar 28 08:11:03 2008
@@ -29,10 +29,11 @@
#include <stdlib.h>
#endif
-#include "open/vm_class_info.h"
#include "open/vm.h"
#include "open/hythread_ext.h"
+#include "open/vm_class_info.h"
#include "open/vm_type_access.h"
+#include "open/vm_method_access.h"
#include "jit_import.h"
#include "jit_runtime_support.h"
#include "jit_intf.h"
@@ -335,9 +336,9 @@
}
m_max_native_stack_depth = 0;
- m_bc = (unsigned char*)method_get_byte_code_addr(m_method);
- unsigned bc_size = (unsigned)method_get_byte_code_size(m_method);
- unsigned num_locals = method_vars_get_number(m_method);
+ m_bc = method_get_bytecode(m_method);
+ unsigned bc_size = (unsigned)method_get_bytecode_length(m_method);
+ unsigned num_locals = method_get_max_locals(m_method);
unsigned max_stack = method_get_max_stack(m_method);
// Input arguments
@@ -1201,13 +1202,13 @@
bool Compiler::comp_resolve_ehandlers(void)
{
- unsigned num_handlers = method_get_num_handlers(m_method);
+ unsigned num_handlers = method_get_exc_handler_number(m_method);
m_handlers.resize(num_handlers);
bool eh_ok = true;
for (unsigned i=0; i<num_handlers; i++) {
unsigned regStart, regEnd, handlerStart, klassType;
- method_get_handler_info(m_method, i,
+ method_get_exc_handler_info(m_method, i,
®Start, ®End, &handlerStart,
&klassType);
HandlerInfo& hi = m_handlers[i];
Modified: harmony/enhanced/drlvm/trunk/vm/jitrino/src/jet/compiler.h
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/jitrino/src/jet/compiler.h?rev=642252&r1=642251&r2=642252&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/jitrino/src/jet/compiler.h (original)
+++ harmony/enhanced/drlvm/trunk/vm/jitrino/src/jet/compiler.h Fri Mar 28 08:11:03 2008
@@ -125,7 +125,7 @@
* For debugging only.
*
* The code must be already generated and available for VM -
- * \b method_get_code_block_addr_jit is used to obtain the code.
+ * \b method_get_code_block_jit is used to obtain the code.
*/
void dbg_dump_code_bc(const char * code, unsigned codeLen);
/**
Modified: harmony/enhanced/drlvm/trunk/vm/jitrino/src/jet/jet.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/jitrino/src/jet/jet.cpp?rev=642252&r1=642251&r2=642252&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/jitrino/src/jet/jet.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/jitrino/src/jet/jet.cpp Fri Mar 28 08:11:03 2008
@@ -131,6 +131,7 @@
*
*/
+#include "open/vm_method_access.h"
#include "jet.h"
#include "compiler.h"
#include "stats.h"
Modified: harmony/enhanced/drlvm/trunk/vm/jitrino/src/jet/rt.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/jitrino/src/jet/rt.cpp?rev=642252&r1=642251&r2=642252&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/jitrino/src/jet/rt.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/jitrino/src/jet/rt.cpp Fri Mar 28 08:11:03 2008
@@ -23,6 +23,7 @@
* @file
* @brief Contains platform-independent routines for runtime support.
*/
+#include "open/vm_method_access.h"
#include "compiler.h"
#include "trace.h"
@@ -272,7 +273,7 @@
// hardware NPE happened.
// A special case is SOE, which is allowed to happen only at the method start.
// Check the presumptions:
- assert(method_get_num_handlers(method) == 0 || rt_is_soe_area(jit, method, context));
+ assert(method_get_exc_handler_number(method) == 0 || rt_is_soe_area(jit, method, context));
#ifdef _DEBUG
bool sync = method_is_synchronized(method);
bool inst = !method_is_static(method);
@@ -639,7 +640,7 @@
//next instruction
//2. Replace all the remaining bytes of counter instruction with nops
//3. Atomically replace jump with 2 nops
- Byte* methodAddr = method_get_code_block_addr_jit(mh, jit);
+ Byte* methodAddr = method_get_code_block_jit(mh, jit);
for (uint32 i = 0 ; i<infoBlock.num_profiler_counters; i++) {
uint32 offsetInfo = infoBlock.profiler_counters_map[i];
uint32 codeOffset = ProfileCounterInfo::getInstOffset(offsetInfo);
Modified: harmony/enhanced/drlvm/trunk/vm/jitrino/src/jet/structs.h
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/jitrino/src/jet/structs.h?rev=642252&r1=642251&r2=642252&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/jitrino/src/jet/structs.h (original)
+++ harmony/enhanced/drlvm/trunk/vm/jitrino/src/jet/structs.h Fri Mar 28 08:11:03 2008
@@ -34,6 +34,7 @@
#include "jframe.h"
#include "open/vm.h"
#include "jit_import.h"
+#include "open/vm_method_access.h"
namespace Jitrino {
namespace Jet {
@@ -544,7 +545,7 @@
/** Returns number of exception handlers in the method. */
unsigned meth_num_handlers(void) const
{
- return method_get_num_handlers(m_method);
+ return method_get_exc_handler_number(m_method);
}
/** Tests whether the method is synchronized. */
Modified: harmony/enhanced/drlvm/trunk/vm/jitrino/src/jet/trace.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/jitrino/src/jet/trace.cpp?rev=642252&r1=642251&r2=642252&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/jitrino/src/jet/trace.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/jitrino/src/jet/trace.cpp Fri Mar 28 08:11:03 2008
@@ -471,7 +471,7 @@
dbg("start |%5d| %s::%s | bc.size=%d | %s\n",
m_methID,
class_get_name(m_klass), method_get_name(m_method),
- method_get_byte_code_size(m_method),
+ method_get_bytecode_length(m_method),
method_get_descriptor(m_method));
}
@@ -485,7 +485,7 @@
if (success) {
unsigned size = method_get_code_block_size_jit(m_method, m_hjit);
- void * start = size ? method_get_code_block_addr_jit(m_method, m_hjit) : NULL;
+ void * start = size ? method_get_code_block_jit(m_method, m_hjit) : NULL;
dbg("code.begin=%p | code.end=%p | code.size=%d",
start, (char*)start + size, size);
Modified: harmony/enhanced/drlvm/trunk/vm/jitrino/src/optimizer/devirtualizer.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/jitrino/src/optimizer/devirtualizer.cpp?rev=642252&r1=642251&r2=642252&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/jitrino/src/optimizer/devirtualizer.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/jitrino/src/optimizer/devirtualizer.cpp Fri Mar 28 08:11:03 2008
@@ -497,7 +497,7 @@
} else {
NamedType* methodType = origMethodDesc->getParentType();
if (_typeManager.isSubClassOf(baseType, methodType)) {
- candidateMeth = regionIRM.getCompilationInterface().getOverriddenMethod(baseType, origMethodDesc);
+ candidateMeth = regionIRM.getCompilationInterface().getOverridingMethod(baseType, origMethodDesc);
if (candidateMeth) {
jitrino_assert(origMethodDesc->getParentType()->isClass());
methodInst->setMethodDesc(candidateMeth);
Modified: harmony/enhanced/drlvm/trunk/vm/jitrino/src/optimizer/simplifier.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/jitrino/src/optimizer/simplifier.cpp?rev=642252&r1=642251&r2=642252&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/jitrino/src/optimizer/simplifier.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/jitrino/src/optimizer/simplifier.cpp Fri Mar 28 08:11:03 2008
@@ -3536,7 +3536,7 @@
}
if (baseType != NULL) {
MethodDesc* newMethodDesc =
- irManager.getCompilationInterface().getOverriddenMethod((NamedType*)baseType, methodDesc);
+ irManager.getCompilationInterface().getOverridingMethod((NamedType*)baseType, methodDesc);
if (newMethodDesc) {
// change to ldvirtfunaddrslot of newMethodDesc
return genLdFunAddrSlot(newMethodDesc)->getDst();
@@ -3576,7 +3576,7 @@
//
if (isExactType(args[0]) || methodDesc->isFinal() || methodDesc->isPrivate()) {
if(isExactType(args[0]) && !args[0]->getType()->isInterface()) {
- methodDesc = irManager.getCompilationInterface().getOverriddenMethod(
+ methodDesc = irManager.getCompilationInterface().getOverridingMethod(
(NamedType*) args[0]->getType(), methodDesc);
}
if (methodDesc == NULL || methodDesc->getParentType()->isValue()) {
Modified: harmony/enhanced/drlvm/trunk/vm/jitrino/src/translator/java/JavaByteCodeTranslator.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/jitrino/src/translator/java/JavaByteCodeTranslator.cpp?rev=642252&r1=642251&r2=642252&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/jitrino/src/translator/java/JavaByteCodeTranslator.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/jitrino/src/translator/java/JavaByteCodeTranslator.cpp Fri Mar 28 08:11:03 2008
@@ -1556,10 +1556,10 @@
Type* type = thisOpnd->getType();
if (!type->isNullObject() && !type->isUnresolvedType() && !type->isInterface()) {
// needs to refine the method descriptor before doing any optimization
- MethodDesc *overridden = compilationInterface.getOverriddenMethod(
+ MethodDesc *overriding = compilationInterface.getOverridingMethod(
(NamedType*)type,methodDesc);
- if (overridden && overridden != methodDesc) {
- methodDesc = overridden;
+ if (overriding && overriding != methodDesc) {
+ methodDesc = overriding;
}
}
}
@@ -1687,10 +1687,10 @@
Type * type = thisOpnd->getType();
if (!type->isNullObject() && !type->isUnresolvedObject() && !type->isInterface()) {
// need to refine the method descriptor before doing any optimization
- MethodDesc *overridden = compilationInterface.getOverriddenMethod(
+ MethodDesc *overriding = compilationInterface.getOverridingMethod(
(NamedType*)type,methodDesc);
- if (overridden && overridden != methodDesc && !overridden->getParentType()->isInterface()) {
- methodDesc = overridden;
+ if (overriding && overriding != methodDesc && !overriding->getParentType()->isInterface()) {
+ methodDesc = overriding;
}
}
}