harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dlyd...@apache.org
Subject svn commit: r565147 - /harmony/enhanced/sandbox/bootjvm/bootJVM/jvm/src/cfmacros.h
Date Sun, 12 Aug 2007 20:52:10 GMT
Author: dlydick
Date: Sun Aug 12 13:52:09 2007
New Revision: 565147

URL: http://svn.apache.org/viewvc?view=rev&rev=565147
Log:
Defined PTR_CP1_MEMALIGN() and PTR_CP1_CLASS_NAME_MEMALIGN()
macros.

Defined GENERIC_FAILURECP1_THROWERROR() macro.

Modified:
    harmony/enhanced/sandbox/bootjvm/bootJVM/jvm/src/cfmacros.h

Modified: harmony/enhanced/sandbox/bootjvm/bootJVM/jvm/src/cfmacros.h
URL: http://svn.apache.org/viewvc/harmony/enhanced/sandbox/bootjvm/bootJVM/jvm/src/cfmacros.h?view=diff&rev=565147&r1=565146&r2=565147
==============================================================================
--- harmony/enhanced/sandbox/bootjvm/bootJVM/jvm/src/cfmacros.h (original)
+++ harmony/enhanced/sandbox/bootjvm/bootJVM/jvm/src/cfmacros.h Sun Aug 12 13:52:09 2007
@@ -312,7 +312,14 @@
  * <ul>
  *
  * <li>
- *     PTR_CP1_NAME()          Pointer to whole (CONSTANT_Utf8_info)
+ *     PTR_CP1_MEMALIGN()      Pointer to enclosing (cp_info_mem_align)
+ *                             CP entry referenced by index in
+ *                             @p @b strname_idx field, not yet cast as
+ *                             (CONSTANT_Utf8_info *).
+ * </li>
+ *
+ * <li>
+ *     PTR_CP1_NAME()          Pointer to enclosed (CONSTANT_Utf8_info)
  *                             CP entry referenced by index in
  *                             @p @b strname_idx field, cast as
  *                             (CONSTANT_Utf8_info *) and pointing
@@ -341,7 +348,16 @@
  * <ul>
  *
  * <li>
- *     PTR_CP1_CLASS_NAME()    Pointer to whole (CONSTANT_Utf8_info)
+ * PTR_CP1_CLASS_NAME_MEMALIGN() Pointer to enclosing
+ *                               (cp_info_mem_align) CP entry
+ *                               referenced by index in a
+ *                               (CONSTANT_Class_info) slot entry,
+ *                               not yet cast as
+ *                               (CONSTANT_Utf8_info *).
+ * </li>
+ *
+ * <li>
+ *     PTR_CP1_CLASS_NAME()      Pointer to whole (CONSTANT_Utf8_info)
  *                               CP entry referenced by index that
  *                               represents a (CONSTANT_Class_info)
  *                               slot entry.  Cast as type
@@ -381,11 +397,11 @@
                                      @link #CONSTANT_Class_info
                                      CONSTANT_xxxxx_info@endlink),
  *                                   which references the class name
- *                                   of that CP entry, as referenced by
+ *                                   of that CP entry, as a
+ *                                   (CONSTANT_Utf8_info *) by
  *                                   the @p @b strname_idx CP entry of
  *                                   @p @b cpidx case as
- *                                   (CONSTANT_Utf8_info *) and
- *                                   pointing to the beginning of
+ *                                   and pointing to the beginning of
  *                                   that structure.
  * </li>
  *
@@ -450,8 +466,11 @@
  *               AT THE ENTRY POINTED TO by this @p @b pcfs and
  *               @p @b cpidx AS FOUND IN FIELD @p @b strname_idx:
  */
+#define PTR_CP1_MEMALIGN(type, pcfs, cpidx, strname_idx) \
+   PTR_CP_SLOT(pcfs, PTR_CP_ENTRY_TYPE(type, pcfs, cpidx)->strname_idx)
+
 #define PTR_CP1_NAME(type, pcfs, cpidx, strname_idx) \
-   PTR_CP_THIS(pcfs, (PTR_CP_ENTRY_TYPE(type, pcfs,cpidx)->strname_idx))
+   PTR_CP_THIS(pcfs, (PTR_CP_ENTRY_TYPE(type,pcfs,cpidx)->strname_idx))
 
 #define CP1_NAME_STRLEN(type, pcfs, cpidx, strname_idx) \
  CP_THIS_STRLEN(pcfs, (PTR_CP_ENTRY_TYPE(type,pcfs,cpidx)->strname_idx))
@@ -467,6 +486,9 @@
  *               @p @b pcfs and @c @b cpidx refer to such a class info
  *               slot.
  */
+#define PTR_CP1_CLASS_NAME_MEMALIGN(pcfs, cpidx) \
+    PTR_CP1_MEMALIGN(CONSTANT_Class_info, pcfs, cpidx, name_index)
+
 #define PTR_CP1_CLASS_NAME(pcfs, cpidx) \
     PTR_CP1_NAME(CONSTANT_Class_info, pcfs, cpidx, name_index)
 
@@ -546,7 +568,8 @@
  * value of a typed @link #rnull rnull@endlink pointer
  * (@b GENERIC_FAILUREx_PTR() only), a generic value
  * (@b GENERIC_FAILUREx_VALUE() only), or throw an error
- * (@b GENERIC_FAILUREx_THROWERROR() only), plus a error message.
+ * (@b GENERIC_FAILUREx_THROWERROR() and
+   @b GENERIC_FAILURECPx_THROWERROR() macros), plus a error message.
  * If @p @b expr is @link #rtrue rtrue@endlink, return the return value
  * or throw the error (depending on the specific macro), else
  * continue with inline code.
@@ -694,6 +717,33 @@
         HEAP_FREE_DATA((rvoid *) heap1ptr); /* Ignored if rnull */     \
         HEAP_FREE_DATA((rvoid *) heap2ptr); /* Ignored if rnull */     \
         sysDbgMsg(dml, fn, msg, parm1, parm2);                         \
+        exit_throw_exception(retval, retclass);                        \
+/*NOTREACHED*/                                                         \
+    }
+
+#define GENERIC_FAILURECP1_THROWERROR(expr, dml, fn, msg, parm1,       \
+                                 retval, retclass, heap1ptr, heap2ptr) \
+    if (expr)                                                          \
+    {                                                                  \
+        sysDbgMsg(dml, fn, msg,                                        \
+                  PTR_THIS_CP_Utf8(parm1)->length,                     \
+                  PTR_THIS_CP_Utf8(parm1)->length,                     \
+                  PTR_THIS_CP_Utf8(parm1)->bytes);                     \
+        if (heap1ptr && (rnull != ((classpath_search *) heap1ptr)      \
+                                    ->jarfile_member_state))           \
+        {                                                              \
+            if (JAR_MEMBER_IMPOSSIBLE_OPEN_FD !=                       \
+                (((classpath_search *) heap1ptr)                       \
+                                          ->jarfile_member_state->fd)) \
+            {                                                          \
+                portable_close(((classpath_search *) heap1ptr)         \
+                                          ->jarfile_member_state->fd); \
+            }                                                          \
+        }                                                              \
+        /* Ignored if rnull */                                         \
+        classpath_free_search_result((classpath_search *) heap1ptr);   \
+                                                                       \
+        HEAP_FREE_DATA((rvoid *) heap2ptr); /* Ignored if rnull */     \
         exit_throw_exception(retval, retclass);                        \
 /*NOTREACHED*/                                                         \
     }



Mime
View raw message