예제 #1
0
void JNICALL native_method_bind_hook(
            jvmtiEnv *jvmti_env,
            JNIEnv* env,
            jthread thread,
            jmethodID method,
            void* address,
            void** new_address_ptr) {

    if (env == NULL) {
        return; // primordial phase
    }
  
    if (!trackingMethodsInitialized && !waitInitError) {
        initializeMethods (env);
    }
  
    if (!waitInitError) {
        if (method == waitID) {
            waitAddress = (waitCall)address;
            *new_address_ptr = (void*) &waitInterceptor;
            // fprintf(stderr, "Profiler Agent: Object.wait intercepted.\n");
        } else if (method == sleepID) {
            sleepAddress = (sleepCall)address;
            *new_address_ptr = (void*) &sleepInterceptor;
            // fprintf(stderr, "Profiler Agent: Thread.sleep intercepted.\n");
        }
    }
}
예제 #2
0
KeyRange::KeyRange(FB::variant left, FB::variant right, int flags)
	: flags(flags), left(left), right(right)
	{
	if(left.get_type() != right.get_type() && !left.empty() && !right.empty())
		throw new DatabaseException("NOT_ALLOWED_ERR", DatabaseException::NOT_ALLOWED_ERR);

	initializeMethods();
	}
예제 #3
0
void JNICALL monitor_contended_entered_hook(
            jvmtiEnv *jvmti_env,
            JNIEnv* jni_env,
            jthread thread,
            jobject object) {

    if (!trackingMethodsInitialized && !waitInitError) {
        initializeMethods (jni_env);
    }
    
    if (waitTrackingEnabled) {
        (*jni_env)->CallStaticVoidMethod (jni_env, profilerRuntimeID, monitorExitID, thread, object);
        (*jni_env)->ExceptionDescribe (jni_env);
    }
}
예제 #4
0
void JNICALL vm_object_alloc(jvmtiEnv *jvmti_env,
            JNIEnv* jni_env,
            jthread thread,
            jobject object,
            jclass object_klass,
            jlong size) {
    if (jni_env == NULL) {
        return; // primordial phase
    }

    if (!trackingMethodsInitialized) {
        initializeMethods (jni_env);
    }
    (*jni_env)->CallStaticVoidMethod (jni_env, profilerRuntimeID, traceVMObjectAllocID, object, object_klass);
    (*jni_env)->ExceptionDescribe (jni_env);
}
예제 #5
0
IndexSync::IndexSync(FB::BrowserHost host, ObjectStoreSync& objectStore, TransactionFactory& transactionFactory, Metadata& metadata, const string& name, const optional<string>& keyPath, const bool unique)
	: Index(name, objectStore.getName(), keyPath, unique), 
	  transactionFactory(transactionFactory),
	  host(host),
	  metadata(metadata, Metadata::Index, name),
	  keyGenerator(keyPath.is_initialized()
		? new Support::KeyPathKeyGenerator(host, keyPath.get())
		: NULL),
	  implementation(keyPath.is_initialized()
		? Implementation::AbstractDatabaseFactory::getInstance().createIndex(
			objectStore.getImplementation(), name, keyGenerator, unique, transactionFactory.getTransactionContext())
		: Implementation::AbstractDatabaseFactory::getInstance().createIndex(
			objectStore.getImplementation(), name, unique, transactionFactory.getTransactionContext()))
	{ 
	createMetadata(keyPath, unique);
	initializeMethods(); 
	}
예제 #6
0
IndexSync::IndexSync(FB::BrowserHost host, ObjectStoreSync& objectStore, TransactionFactory& transactionFactory, Metadata& metadata, const string& name)
	: Index(name, objectStore.getName()), 
	  transactionFactory(transactionFactory),
	  metadata(metadata, Metadata::Index, name),
	  host(host)
	{ 
	loadMetadata();

	keyGenerator = auto_ptr<KeyGenerator>(keyPath.is_initialized()
		? new Support::KeyPathKeyGenerator(host, keyPath.get())
		: NULL);
	implementation = keyPath.is_initialized()
		? Implementation::AbstractDatabaseFactory::getInstance().openIndex(
			objectStore.getImplementation(), name, keyGenerator, unique, transactionFactory.getTransactionContext())
		: Implementation::AbstractDatabaseFactory::getInstance().openIndex(
			objectStore.getImplementation(), name, unique, transactionFactory.getTransactionContext());
	initializeMethods();
	}
예제 #7
0
KeyRange::KeyRange(void)
	: flags(-1)
	{ initializeMethods(); }
예제 #8
0
Cursor::Cursor(const Cursor::Direction direction)
	: direction(direction)
	{ initializeMethods(); }
예제 #9
0
Cursor::Cursor(void)
	: direction(NEXT)
	{ initializeMethods(); }