harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dlyd...@apache.org
Subject svn commit: r418265 - /incubator/harmony/enhanced/trunk/sandbox/contribs/bootjvm/bootJVM/jvm/src/attribute.h
Date Fri, 30 Jun 2006 13:31:07 GMT
Author: dlydick
Date: Fri Jun 30 06:31:06 2006
New Revision: 418265

URL: http://svn.apache.org/viewvc?rev=418265&view=rev
Log:
Moved PTR_DST_XXX_AI() and PTR_XXX_AI() macros out
from 'cfattrib.c' for sharing with other areas of the
code.  Renamed to ATR_XXX_AI() and PTR_DST_XX_AI()
in support of easier identification of purpose.

Modified:
    incubator/harmony/enhanced/trunk/sandbox/contribs/bootjvm/bootJVM/jvm/src/attribute.h

Modified: incubator/harmony/enhanced/trunk/sandbox/contribs/bootjvm/bootJVM/jvm/src/attribute.h
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/trunk/sandbox/contribs/bootjvm/bootJVM/jvm/src/attribute.h?rev=418265&r1=418264&r2=418265&view=diff
==============================================================================
--- incubator/harmony/enhanced/trunk/sandbox/contribs/bootjvm/bootJVM/jvm/src/attribute.h
(original)
+++ incubator/harmony/enhanced/trunk/sandbox/contribs/bootjvm/bootJVM/jvm/src/attribute.h
Fri Jun 30 06:31:06 2006
@@ -46,6 +46,113 @@
 "$URL$",
 "$Id$");
 
+#include "classfile.h"
+
+/*!
+ * @name Attribute single deferencing support.
+ *
+ * @brief Conveniently reference an
+ * @link Code_attribute Xxx_attribute@endlink contained in
+ * a <b><code>attribute_info_mem_align *paima</code></b>, namely,
with
+ * single pointer indirection.
+ *
+ * This is a counterpart for cfattrib_unload_attribute() where
+ * no indirection is needed.  Notice that
+ * @link #PTR_ATR_CODE_AI() PTR_ATR_XXX_AI()@endlink references
+ * a <b><code>attribute_info_mem_align **ppaima</code></b>, while
this
+ * macro references a
+ * <b><code>attribute_info_mem_align *paima</code></b>.
+ *
+ */
+/*@{ */ /* Begin grouped definitions */
+
+#define ATR_CONSTANTVALUE_AI(paima) \
+                                ((ConstantValue_attribute *) &paima->ai)
+#define ATR_CODE_AI(paima)               ((Code_attribute *) &paima->ai)
+#define ATR_EXCEPTIONS_AI(paima)   ((Exceptions_attribute *) &paima->ai)
+#define ATR_INNERCLASSES_AI(paima) \
+                                 ((InnerClasses_attribute *) &paima->ai)
+#define ATR_ENCLOSINGMETHOD_AI(paima) \
+                              ((EnclosingMethod_attribute *) &paima->ai)
+#define ATR_SIGNATURE_AI(paima)     ((Signature_attribute *) &paima->ai)
+#define ATR_SOURCEFILE_AI(paima)   ((SourceFile_attribute *) &paima->ai)
+#define ATR_LINENUMBERTABLE_AI(ppaima) \
+                              ((LineNumberTable_attribute *) &paima->ai)
+#define ATR_LOCALVARIABLETABLE_AI(paima) \
+                           ((LocalVariableTable_attribute *) &paima->ai)
+#define ATR_LOCALVARIABLETYPETABLE_AI(paima) \
+                       ((LocalVariableTypeTable_attribute *) &paima->ai)
+#define ATR_RUNTIMEVISIBLEANNOTATIONS_AI(paima) \
+                    ((RuntimeVisibleAnnotations_attribute *) &paima->ai)
+#define ATR_RUNTIMEINVISIBLEANNOTATIONS_AI(paima) \
+                  ((RuntimeInvisibleAnnotations_attribute *) &paima->ai)
+#define ATR_RUNTIMEVISIBLEPARAMETERANNOTATIONS_AI(paima) \
+           ((RuntimeVisibleParameterAnnotations_attribute *) &paima->ai)
+#define ATR_RUNTIMEINVISIBLEPARAMETERANNOTATIONS_AI(paima) \
+         ((RuntimeInvisibleParameterAnnotations_attribute *) &paima->ai)
+#define ATR_ANNOTATIONDEFAULT_AI(paima) \
+                            ((AnnotationDefault_attribute *) &paima->ai)
+#define ATR_ANNOTATIONDEFAULTMEMALIGN_AI(paima) \
+                  ((AnnotationDefault_attribute_mem_align *) &paima->ai)
+/*@} */ /* End of grouped definitions */
+
+/*!
+ * @name Attribute double deferencing support.
+ *
+ * @brief Conveniently reference the XXX_attribute contained in
+ * an indirect <b><code>attribute_info_mem_align **ppaima</code></b>,
+ * namely, with double pointer indirection.
+ *
+ * After putting in the 4-byte access alignment changes,
+ * it became obvious that what was once (*atrptr)->member
+ * had become quite cumbersome.  Therefore, in order to
+ * simplify access through (attribute_info_mem_align *)->ai.member
+ * constructions, including appropriate casting, the following
+ * macros were added to take care of the most common usage.
+ * The few other references are unchanged, and the code is
+ * easier to understand.
+ *
+ * Notice that @link #ATR_CODE_AI() ATR_XXX_AI()@endlink
+ * references a <b><code>attribute_info_mem_align *paima</code></b>,
+ * while  @link #PTR_ATR_CODE_AI() PTR_ATR_XXX_AI()@endlink
+ * references a <b><code>attribute_info_mem_align **ppaima</code></b>.
+ */
+
+/*@{ */ /* Begin grouped definitions */
+#define PTR_ATR_CONSTANTVALUE_AI(ppaima) \
+                            ((ConstantValue_attribute *) &(*ppaima)->ai)
+#define PTR_ATR_CODE_AI(ppaima)      ((Code_attribute *) &(*ppaima)->ai)
+#define PTR_ATR_EXCEPTIONS_AI(ppaima) \
+                                ((Exceptions_attribute *)&(*ppaima)->ai)
+#define PTR_ATR_INNERCLASSES_AI(ppaima) \
+                              ((InnerClasses_attribute *)&(*ppaima)->ai)
+#define PTR_ATR_ENCLOSINGMETHOD_AI(ppaima) \
+                           ((EnclosingMethod_attribute *)&(*ppaima)->ai)
+#define PTR_ATR_SIGNATURE_AI(ppaima) \
+                                 ((Signature_attribute *)&(*ppaima)->ai)
+#define PTR_ATR_SOURCEFILE_AI(ppaima) \
+                                ((SourceFile_attribute *)&(*ppaima)->ai)
+#define PTR_ATR_LINENUMBERTABLE_AI(ppaima) \
+                           ((LineNumberTable_attribute *)&(*ppaima)->ai)
+#define PTR_ATR_LOCALVARIABLETABLE_AI(ppaima) \
+                        ((LocalVariableTable_attribute *)&(*ppaima)->ai)
+#define PTR_ATR_LOCALVARIABLETYPETABLE_AI(ppaima) \
+                    ((LocalVariableTypeTable_attribute *)&(*ppaima)->ai)
+#define PTR_ATR_RUNTIMEVISIBLEANNOTATIONS_AI(ppaima) \
+                 ((RuntimeVisibleAnnotations_attribute *)&(*ppaima)->ai)
+#define PTR_ATR_RUNTIMEINVISIBLEANNOTATIONS_AI(ppaima) \
+               ((RuntimeInvisibleAnnotations_attribute *)&(*ppaima)->ai)
+#define PTR_ATR_RUNTIMEVISIBLEPARAMETERANNOTATIONS_AI(ppaima) \
+        ((RuntimeVisibleParameterAnnotations_attribute *)&(*ppaima)->ai)
+#define PTR_ATR_RUNTIMEINVISIBLEPARAMETERANNOTATIONS_AI(ppaima) \
+      ((RuntimeInvisibleParameterAnnotations_attribute *)&(*ppaima)->ai)
+#define PTR_ATR_ANNOTATIONDEFAULT_AI(ppaima) \
+                         ((AnnotationDefault_attribute *)&(*ppaima)->ai)
+#define PTR_ATR_ANNOTATIONDEFAULTMEMALIGN_AI(ppaima) \
+               ((AnnotationDefault_attribute_mem_align *)&(*ppaima)->ai)
+
+/*@} */ /* End of grouped definitions */
+
 
 extern jvm_attribute_index attribute_find_in_field_by_cp_entry(
                                    jvm_class_index    clsidx,



Mime
View raw message