harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mcfi...@apache.org
Subject svn commit: r648211 [4/4] - in /harmony/enhanced/drlvm/trunk: make/vm/ vm/em/src/ vm/gc_gen/src/common/ vm/include/ vm/include/open/ vm/interpreter/src/ vm/jitrino/src/jet/ vm/jitrino/src/translator/java/ vm/jitrino/src/vm/ vm/vmcore/build/ vm/vmcore/i...
Date Tue, 15 Apr 2008 11:29:54 GMT
Modified: harmony/enhanced/drlvm/trunk/vm/vmcore/src/verifier-3363/x_verifier/recompute.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/vmcore/src/verifier-3363/x_verifier/recompute.cpp?rev=648211&r1=648210&r2=648211&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/vmcore/src/verifier-3363/x_verifier/recompute.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/vmcore/src/verifier-3363/x_verifier/recompute.cpp Tue
Apr 15 04:29:41 2008
@@ -39,9 +39,10 @@
 *
 */
 vf_Result
-vf_recompute_stackmaptable( method_handler method, uint8 **attrBytes, char **error, void
*trustedPairs )
+vf_recompute_stackmaptable(Method_Handle method, uint8** attrBytes, char** error,
+                           void* trustedPairs )
 {
-    class_handler klass = method_get_class(method);
+    Class_Handle klass = method_get_class(method);
     vf_Result result = VF_OK;
 
     // Create context
@@ -61,7 +62,7 @@
     return result;
 } // vf_recompute_stackmaptable
 
-vf_Result vf_Context_5e::recompute_stackmaptable( method_handler method ) {
+vf_Result vf_Context_5e::recompute_stackmaptable(Method_Handle method ) {
     written_stackmap = 0;
 
     //nothing to verify
@@ -562,11 +563,11 @@
     }
 
     if( t->cls != CLASS_NOT_LOADED ) {
-        if( class_is_interface_(t->cls) ) {
+        if(class_is_interface(t->cls)) {
             parsedTrustedData[idx].set_interface();
             return;
         }
-        class_handler h_sup = class_get_super_class(t->cls);
+        Class_Handle h_sup = class_get_super_class(t->cls);
         if( h_sup ) {
             sup = tpool.get_ref_type( class_get_name(h_sup));
             int sup_idx = sup.getReferenceIdx();

Modified: harmony/enhanced/drlvm/trunk/vm/vmcore/src/verifier-3363/x_verifier/recompute.h
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/vmcore/src/verifier-3363/x_verifier/recompute.h?rev=648211&r1=648210&r2=648211&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/vmcore/src/verifier-3363/x_verifier/recompute.h (original)
+++ harmony/enhanced/drlvm/trunk/vm/vmcore/src/verifier-3363/x_verifier/recompute.h Tue Apr
15 04:29:41 2008
@@ -27,7 +27,7 @@
 #include "x_class_interface.h"
 
 
-vf_Result vf_recompute_stackmaptable( method_handler method, uint8 **attrBytes, char **error,
void *trustedPairs );
+vf_Result vf_recompute_stackmaptable(Method_Handle method, uint8** attrBytes, char** error,
void* trustedPairs);
 
 namespace CPVerifier_5 {
 
@@ -195,7 +195,7 @@
               stackmapattr_calculation = true;
           }
 
-        vf_Result recompute_stackmaptable( method_handler method );
+        vf_Result recompute_stackmaptable(Method_Handle method);
 
         ~vf_Context_5e() {
             tc_free(parsedTrustedData);
@@ -335,8 +335,8 @@
         int isObjectOrInterface(SmConstant ref) {
             if( ref == tpool.sm_get_const_object() ) return true;
 
-            class_handler h = tpool.sm_get_handler(ref);
-            if( h && h != CLASS_NOT_LOADED ) return class_is_interface_(h);
+            Class_Handle h = tpool.sm_get_handler(ref);
+            if( h && h != CLASS_NOT_LOADED ) return class_is_interface(h);
 
             parseTrustedData(ref);
             return parsedTrustedData[ref.getReferenceIdx()].is_interface();
@@ -358,7 +358,7 @@
 
             parseTrustedData(from); // it may change class_handler for 'to'
 
-            class_handler t = tpool.sm_get_handler(to);
+            Class_Handle t = tpool.sm_get_handler(to);
             assert(t);
 
             for( SmConstant *sm = parsedTrustedData[from.getReferenceIdx()].superclasses();
*sm != SM_NONE; sm++ ) {
@@ -367,9 +367,9 @@
                 }
 
                 if( t != CLASS_NOT_LOADED ) {
-                    class_handler f = tpool.sm_get_handler(*sm);
+                    Class_Handle f = tpool.sm_get_handler(*sm);
                     if( f != CLASS_NOT_LOADED && vf_is_extending(f, t) ) return true;
-                }                
+                }
             }
             return false;
         }

Modified: harmony/enhanced/drlvm/trunk/vm/vmcore/src/verifier-3363/x_verifier/write_attr.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/vmcore/src/verifier-3363/x_verifier/write_attr.cpp?rev=648211&r1=648210&r2=648211&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/vmcore/src/verifier-3363/x_verifier/write_attr.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/vmcore/src/verifier-3363/x_verifier/write_attr.cpp Tue
Apr 15 04:29:41 2008
@@ -211,7 +211,7 @@
         if( el.isReference() ) {
             writeByte(ITEM_OBJECT);
 
-            uint16 cp_idx = class_get_cp_class_entry( k_class, tpool.sm_get_refname(el));
+            uint16 cp_idx = class_cp_get_class_entry( k_class, tpool.sm_get_refname(el));
             writeByte(cp_idx >> 8);
             writeByte(cp_idx & 0xFF);
         } else if( el.isNewObject() ) {

Modified: harmony/enhanced/drlvm/trunk/vm/vmcore/src/verifier-3363/x_verifier/x_class_interface.h
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/vmcore/src/verifier-3363/x_verifier/x_class_interface.h?rev=648211&r1=648210&r2=648211&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/vmcore/src/verifier-3363/x_verifier/x_class_interface.h
(original)
+++ harmony/enhanced/drlvm/trunk/vm/vmcore/src/verifier-3363/x_verifier/x_class_interface.h
Tue Apr 15 04:29:41 2008
@@ -21,21 +21,53 @@
 #ifndef __X_CLASS_INTERFACE_H__
 #define __X_CLASS_INTERFACE_H__
 
+#include "open/types.h"
+#include "open/common.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
 
 /**
- * returns constantpool index for the given class
+ * Returns constant pool index of CONSTANT_Class for the given class name
+ * If such entry is not present in the constant pool, the function adds this entry
+ *
+ * @param k_class   - the class handle
+ * @param name      - name of the class to return constant pool index for
+ *
+ * @return constant pool index of the CONSTANT_Class entry with a given
+ * <code>name</code>
  */
-unsigned short class_get_cp_class_entry(class_handler k_class, const char* name);
+DECLARE_OPEN(unsigned short, class_cp_get_class_entry, (Class_Handle k_class, const char*
name));
 
 /**
- * removes given exception handler (handlers with greater indexes shift)
+ * Removes given exception handler (handlers with greater indexes shift)
+ *
+ * @param method    - method to remove exception handler from
+ * @param idx       - index of exception handler in exception handlers array
  */
-void method_remove_exc_handler( method_handler method, unsigned short idx );
+DECLARE_OPEN(void, method_remove_exc_handler, (Method_Handle method, unsigned short idx));
 
 /**
- * modifies start_pc, end_pc 
+ * Modifies particular exception handler information.
+ *
+ * @param method    - method in which exception handler must be updated
+ * @param idx       - index of exception handler to update
+ * @param start_pc  - new start pc
+ * @param end_pc    - new end pc
+ * @param handler_pc - pc of the beginning of the exception handler
+ * @param handler_cp_index - index in the constant pool of the class
+ *                           of the handled exception
+ *
+ * @note Usually it is only needed to modify start_pc and end_pc
  */
-void method_modify_exc_handler_info( method_handler method, unsigned short idx, unsigned
short start_pc, 
-                                    unsigned short end_pc, unsigned short handler_pc, unsigned
short handler_cp_index );
+DECLARE_OPEN(void, method_modify_exc_handler_info,
+    (Method_Handle method, unsigned short idx,
+     unsigned short start_pc, unsigned short end_pc,
+     unsigned short handler_pc, unsigned short handler_cp_index));
+
+#ifdef __cplusplus
+}
+#endif
 
 #endif

Modified: harmony/enhanced/drlvm/trunk/vm/vmcore/src/verifier-3363/x_verifier/x_verifier.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/vmcore/src/verifier-3363/x_verifier/x_verifier.cpp?rev=648211&r1=648210&r2=648211&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/vmcore/src/verifier-3363/x_verifier/x_verifier.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/vmcore/src/verifier-3363/x_verifier/x_verifier.cpp Tue
Apr 15 04:29:41 2008
@@ -42,7 +42,7 @@
  * @return a verification context for the class
  */
 verification_context
-allocate_verification_context(class_handler klass) {
+allocate_verification_context(Class_Handle klass) {
     return (verification_context) (new SharedClasswideData(klass));
 }
 
@@ -57,8 +57,8 @@
  * method's defining class
  * @return error code 
  */
-vf_Result 
-init_verification_context_for_method(method_handler method, verification_context context)
{
+vf_Result
+init_verification_context_for_method(Method_Handle method, verification_context context)
{
     vf_Context_6 context6( *((SharedClasswideData*)context) );
     return context6.verify_method(method);
 }
@@ -75,8 +75,10 @@
  * @param context - class and method verification context
  * @return error code
  */
-vf_Result recompute_stackmaptable(uint8 **attrBytes, method_handler method, verification_context
context) {
-    char *error_message;
+vf_Result recompute_stackmaptable(uint8** attrBytes, Method_Handle method,
+                                  verification_context context)
+{
+    char* error_message;
     return vf_recompute_stackmaptable(method, attrBytes, &error_message, ((SharedClasswideData*)context)->class_constraints);
 }
 

Modified: harmony/enhanced/drlvm/trunk/vm/vmcore/src/verifier-3363/x_verifier/x_verifier.h
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/vmcore/src/verifier-3363/x_verifier/x_verifier.h?rev=648211&r1=648210&r2=648211&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/vmcore/src/verifier-3363/x_verifier/x_verifier.h (original)
+++ harmony/enhanced/drlvm/trunk/vm/vmcore/src/verifier-3363/x_verifier/x_verifier.h Tue Apr
15 04:29:41 2008
@@ -23,10 +23,14 @@
 #ifndef __X_VERIFIER_H__
 #define __X_VERIFIER_H__
 
+#include "open/types.h"
 #include "verifier.h"
 
-typedef struct Context_* verification_context;
+#ifdef __cplusplus
+extern "C" {
+#endif
 
+typedef struct Context_* verification_context;
 
 /**
  * Allocates an empty verification context for a class, 
@@ -36,7 +40,7 @@
  * @param klass - class handler
  * @return a verification context for the class
  */
-verification_context allocate_verification_context(class_handler klass);
+verification_context allocate_verification_context(Class_Handle klass);
 
 /**
  * Initializes the verification context with method's information. 
@@ -48,8 +52,8 @@
  * method's defining class
  * @return error code 
  */
-vf_Result 
-init_verification_context_for_method(method_handler method, verification_context context);
+vf_Result
+init_verification_context_for_method(Method_Handle method, verification_context context);
 
 /**
  * Recomputes the StackMapTable of a method using the verification 
@@ -62,18 +66,24 @@
  * @param context - class and method verification context
  * @return error code
  */
-vf_Result recompute_stackmaptable(uint8 **attrBytes, 
-  method_handler method, verification_context context);
+vf_Result
+recompute_stackmaptable(uint8 **attrBytes,
+                        Method_Handle method,
+                        verification_context context);
 
 
 /**
  * Frees memory allocated for a StackMapTable attribute
  */
-void free_stackmaptable(uint8 *attrBytes);
+void free_stackmaptable(uint8* attrBytes);
 
 /**
  * Frees memory allocated for a verification context
  */
-void free_verification_context (verification_context context);
+void free_verification_context(verification_context context);
+
+#ifdef __cplusplus
+}
+#endif
 
 #endif



Mime
View raw message