android/runtime/v8/src/native/JavaObject.cpp
void JavaObject::weakGlobalRef()
{
	JNIEnv *env = JNIUtil::getJNIEnv();
	ASSERT(env != NULL);

	if (useGlobalRefs) {
		ASSERT(javaObject_ != NULL);
		jweak weakRef = env->NewWeakGlobalRef(javaObject_);
		env->DeleteGlobalRef(javaObject_);
		javaObject_ = weakRef;
	} else {
		ReferenceTable::makeWeakReference(refTableKey_);
	}

	isWeakRef_ = true;
}
// Convert our strong reference to the Java object into a weak
// reference to allow it to become eligible for collection by Dalvik.
// This typically happens once V8 has detected the JavaScript object
// that wraps the Java object is no longer reachable.
Convert our strong reference to the Java object into a weak
reference to allow it to become eligible for collection by Dalvik.
This typically happens once V8 has detected the JavaScript object
that wraps the Java object is no longer reachable.
Convert our strong reference to the Java object into a weak reference to allow it to become eligible for collection by Dalvik . This typically happens once V8 has detected the JavaScript object that wraps the Java object is no longer reachable .
void JavaObject::weakGlobalRef()
{
	JNIEnv *env = JNIUtil::getJNIEnv();
	ASSERT(env != NULL);
	if (useGlobalRefs) {
		ASSERT(javaObject_ != NULL);
		jweak weakRef = env->NewWeakGlobalRef(javaObject_);
		env->DeleteGlobalRef(javaObject_);
		javaObject_ = weakRef;
	} else {
		ReferenceTable::makeWeakReference(refTableKey_);
	}
	isWeakRef_ = true;
}
void JavaObject :: weakGlobalRef ( ) { JNIEnv * env = JNIUtil :: getJNIEnv ( ) ; ASSERT ( env != NULL ) ; if ( useGlobalRefs ) { ASSERT ( javaObject_ != NULL ) ; jweak weakRef = env -> NewWeakGlobalRef ( javaObject_ ) ; env -> DeleteGlobalRef ( javaObject_ ) ; javaObject_ = weakRef ; } else { ReferenceTable :: makeWeakReference ( refTableKey_ ) ; } isWeakRef_ = true ; }
Convert our strong reference to the Java object into a weak
reference to allow it to become eligible for collection by Dalvik.
Convert our strong reference to the Java object into a weak reference to allow it to become eligible for collection by Dalvik .