SF.net SVN: jikesrvm:[14789] rvmroot/trunk

View: New views
1 Messages — Rating Filter:   Alert me  

SF.net SVN: jikesrvm:[14789] rvmroot/trunk

by captain5050 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Revision: 14789
          http://jikesrvm.svn.sourceforge.net/jikesrvm/?rev=14789&view=rev
Author:   captain5050
Date:     2008-07-24 20:18:43 +0000 (Thu, 24 Jul 2008)

Log Message:
-----------
RVM-598 wip, add UnpreemptibleNoWarn annotation for unpreemptible code that calls interruptible code.

Modified Paths:
--------------
    rvmroot/trunk/rvm/src/org/jikesrvm/classloader/AnnotatedElement.java
    rvmroot/trunk/rvm/src/org/jikesrvm/classloader/RVMMethod.java
    rvmroot/trunk/rvm/src/org/jikesrvm/classloader/TypeReference.java

Added Paths:
-----------
    rvmroot/trunk/common/vmmagic/src/org/vmmagic/pragma/UnpreemptibleNoWarn.java

Added: rvmroot/trunk/common/vmmagic/src/org/vmmagic/pragma/UnpreemptibleNoWarn.java
===================================================================
--- rvmroot/trunk/common/vmmagic/src/org/vmmagic/pragma/UnpreemptibleNoWarn.java                        (rev 0)
+++ rvmroot/trunk/common/vmmagic/src/org/vmmagic/pragma/UnpreemptibleNoWarn.java 2008-07-24 20:18:43 UTC (rev 14789)
@@ -0,0 +1,33 @@
+/*
+ *  This file is part of the Jikes RVM project (http://jikesrvm.org).
+ *
+ *  This file is licensed to You under the Common Public License (CPL);
+ *  You may not use this file except in compliance with the License. You
+ *  may obtain a copy of the License at
+ *
+ *      http://www.opensource.org/licenses/cpl1.0.php
+ *
+ *  See the COPYRIGHT.txt file distributed with this work for information
+ *  regarding copyright ownership.
+ */
+package org.vmmagic.pragma;
+
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.ElementType;
+import org.vmmagic.Pragma;
+
+/**
+ * A special case of {@link Unpreemptible} where the code may call out to other
+ * interruptible routines.
+ */
+@Retention(RetentionPolicy.RUNTIME)
+@Target({ElementType.TYPE, ElementType.METHOD})
+@Pragma
+public @interface UnpreemptibleNoWarn {
+  /**
+   * @return Explanation of why code needs to be unpreemptible
+   */
+  String value() default "";
+}

Modified: rvmroot/trunk/rvm/src/org/jikesrvm/classloader/AnnotatedElement.java
===================================================================
--- rvmroot/trunk/rvm/src/org/jikesrvm/classloader/AnnotatedElement.java 2008-07-24 17:35:29 UTC (rev 14788)
+++ rvmroot/trunk/rvm/src/org/jikesrvm/classloader/AnnotatedElement.java 2008-07-24 20:18:43 UTC (rev 14789)
@@ -233,6 +233,14 @@
   }
 
   /**
+   * Return true if this element has a UninterruptibleNoWarn annotation.
+   * @see org.vmmagic.pragma.UninterruptibleNoWarn
+   */
+  public final boolean hasUnpreemptibleNoWarnAnnotation() {
+    return isAnnotationDeclared(TypeReference.UnpreemptibleNoWarn);
+  }
+
+  /**
    * Return true if this element has a Uninterruptible annotation.
    * @see org.vmmagic.pragma.Uninterruptible
    */

Modified: rvmroot/trunk/rvm/src/org/jikesrvm/classloader/RVMMethod.java
===================================================================
--- rvmroot/trunk/rvm/src/org/jikesrvm/classloader/RVMMethod.java 2008-07-24 17:35:29 UTC (rev 14788)
+++ rvmroot/trunk/rvm/src/org/jikesrvm/classloader/RVMMethod.java 2008-07-24 20:18:43 UTC (rev 14789)
@@ -573,6 +573,7 @@
     if (hasUninterruptibleNoWarnAnnotation()) return false;
     if (hasUninterruptibleAnnotation()) return false;
     if (hasUnpreemptibleAnnotation()) return false;
+    if (hasUnpreemptibleNoWarnAnnotation()) return false;
     if (getDeclaringClass().hasUnpreemptibleAnnotation()) return false;
     return !getDeclaringClass().hasUninterruptibleAnnotation();
   }
@@ -588,6 +589,7 @@
     if (hasUninterruptibleAnnotation()) return false;
     if (hasUninterruptibleNoWarnAnnotation()) return false;
     if (hasUnpreemptibleAnnotation()) return true;
+    if (hasUnpreemptibleNoWarnAnnotation()) return true;
     return getDeclaringClass().hasUnpreemptibleAnnotation();
   }
 

Modified: rvmroot/trunk/rvm/src/org/jikesrvm/classloader/TypeReference.java
===================================================================
--- rvmroot/trunk/rvm/src/org/jikesrvm/classloader/TypeReference.java 2008-07-24 17:35:29 UTC (rev 14788)
+++ rvmroot/trunk/rvm/src/org/jikesrvm/classloader/TypeReference.java 2008-07-24 20:18:43 UTC (rev 14789)
@@ -160,7 +160,9 @@
       findOrCreate(org.vmmagic.pragma.LogicallyUninterruptible.class);
   public static final TypeReference Preemptible = findOrCreate(org.vmmagic.pragma.Preemptible.class);
   public static final TypeReference UninterruptibleNoWarn =
-      findOrCreate(org.vmmagic.pragma.UninterruptibleNoWarn.class);
+    findOrCreate(org.vmmagic.pragma.UninterruptibleNoWarn.class);
+  public static final TypeReference UnpreemptibleNoWarn =
+    findOrCreate(org.vmmagic.pragma.UnpreemptibleNoWarn.class);
   public static final TypeReference Uninterruptible = findOrCreate(org.vmmagic.pragma.Uninterruptible.class);
   public static final TypeReference Unpreemptible = findOrCreate(org.vmmagic.pragma.Unpreemptible.class);
   public static final TypeReference SpecializedMethodInvoke = findOrCreate(org.vmmagic.pragma.SpecializedMethodInvoke.class);


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Jikesrvm-commits mailing list
Jikesrvm-commits@...
https://lists.sourceforge.net/lists/listinfo/jikesrvm-commits
LightInTheBox - Buy quality products at wholesale price