summaryrefslogtreecommitdiffstats
path: root/libart
diff options
context:
space:
mode:
authorFred Shih <ffred@google.com>2014-06-25 15:58:00 -0700
committerFred Shih <ffred@google.com>2014-07-10 10:16:52 -0700
commitfb1c2c905ea38b19f43e267cd45a15e546b69288 (patch)
tree7cd27dc01021850ba30e5580dcc86fe385b5477d /libart
parentdde7a735325e7d7fe1e5c71ead206673efd18e54 (diff)
downloadlibcore-fb1c2c905ea38b19f43e267cd45a15e546b69288.zip
libcore-fb1c2c905ea38b19f43e267cd45a15e546b69288.tar.gz
libcore-fb1c2c905ea38b19f43e267cd45a15e546b69288.tar.bz2
Moved slow path flag to Reference class
Added static field in Reference class to hold slow path flag and added benchmark to test Reference.get() performance. Change-Id: I13ad65a356fe4e104d8d83980694dc2740d7d039
Diffstat (limited to 'libart')
-rw-r--r--libart/src/main/java/java/lang/ref/Reference.java16
1 files changed, 16 insertions, 0 deletions
diff --git a/libart/src/main/java/java/lang/ref/Reference.java b/libart/src/main/java/java/lang/ref/Reference.java
index 3b03ff1..31ea588 100644
--- a/libart/src/main/java/java/lang/ref/Reference.java
+++ b/libart/src/main/java/java/lang/ref/Reference.java
@@ -98,6 +98,22 @@ package java.lang.ref;
public abstract class Reference<T> {
/**
+ * Forces JNI path.
+ * If GC is not in progress (ie: not going through slow path), the referent
+ * can be quickly returned through intrinsic without passing through JNI.
+ * This flag forces the JNI path so that it can be tested and benchmarked.
+ */
+ private static boolean disableIntrinsic = false;
+
+ /**
+ * Slow path flag for the reference processor.
+ * Used by the reference processor to determine whether or not the referent
+ * can be immediately returned. Because the referent might get swept during
+ * GC, the slow path, which passes through JNI, must be taken.
+ */
+ private static boolean slowPathEnabled = false;
+
+ /**
* The object to which this reference refers.
* VM requirement: this field <em>must</em> be called "referent"
* and be an object.