[vmkit-commits] [vmkit] r120568 - in /vmkit/branches/multi-vm: include/mvm/Threads/Thread.h lib/J3/VMCore/JavaThread.cpp lib/J3/VMCore/JavaThread.h lib/Mvm/Compiler/mvm-runtime.ll

Gael Thomas gael.thomas at lip6.fr
Wed Dec 1 02:31:04 PST 2010


Author: gthomas
Date: Wed Dec  1 04:31:04 2010
New Revision: 120568

URL: http://llvm.org/viewvc/llvm-project?rev=120568&view=rev
Log:
add a field to hold the vm in the vm specific data

Modified:
    vmkit/branches/multi-vm/include/mvm/Threads/Thread.h
    vmkit/branches/multi-vm/lib/J3/VMCore/JavaThread.cpp
    vmkit/branches/multi-vm/lib/J3/VMCore/JavaThread.h
    vmkit/branches/multi-vm/lib/Mvm/Compiler/mvm-runtime.ll

Modified: vmkit/branches/multi-vm/include/mvm/Threads/Thread.h
URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/multi-vm/include/mvm/Threads/Thread.h?rev=120568&r1=120567&r2=120568&view=diff
==============================================================================
--- vmkit/branches/multi-vm/include/mvm/Threads/Thread.h (original)
+++ vmkit/branches/multi-vm/include/mvm/Threads/Thread.h Wed Dec  1 04:31:04 2010
@@ -146,14 +146,18 @@
 class VMThreadData {
 public:
   /// mut - The associated thread mutator
-	MutatorThread* mut;
+	MutatorThread*  mut;
+	VirtualMachine* vm;
 
-	VMThreadData(MutatorThread* m) {
+	VMThreadData(MutatorThread* m, VirtualMachine *v) {
 		this->mut = m;
+		this->vm = v;
 	}
 
   virtual void tracer(uintptr_t closure) = 0;
 
+	void attach();
+
 	virtual ~VMThreadData() {} // force the construction of a VT
 };
 

Modified: vmkit/branches/multi-vm/lib/J3/VMCore/JavaThread.cpp
URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/multi-vm/lib/J3/VMCore/JavaThread.cpp?rev=120568&r1=120567&r2=120568&view=diff
==============================================================================
--- vmkit/branches/multi-vm/lib/J3/VMCore/JavaThread.cpp (original)
+++ vmkit/branches/multi-vm/lib/J3/VMCore/JavaThread.cpp Wed Dec  1 04:31:04 2010
@@ -20,7 +20,7 @@
 using namespace j3;
 
 JavaThread::JavaThread(mvm::MutatorThread* mut, Jnjvm* isolate)
-	: mvm::VMThreadData(mut) {
+	: mvm::VMThreadData(mut, isolate) {
   jniEnv = isolate->jniEnv;
   localJNIRefs = new JNILocalReferences();
   currentAddedReferences = NULL;

Modified: vmkit/branches/multi-vm/lib/J3/VMCore/JavaThread.h
URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/multi-vm/lib/J3/VMCore/JavaThread.h?rev=120568&r1=120567&r2=120568&view=diff
==============================================================================
--- vmkit/branches/multi-vm/lib/J3/VMCore/JavaThread.h (original)
+++ vmkit/branches/multi-vm/lib/J3/VMCore/JavaThread.h Wed Dec  1 04:31:04 2010
@@ -89,10 +89,6 @@
   ///
   JNILocalReferences* localJNIRefs;
 
-  /// jnjvm - my vm
-  ///
-	Jnjvm *jnjvm;
-
   gc** pushJNIRef(gc* obj) {
     llvm_gcroot(obj, 0);
     if (!obj) return 0;
@@ -108,7 +104,7 @@
 
   /// JavaThread - Empty constructor, used to get the VT.
   ///
-  JavaThread() : mvm::VMThreadData(0) {
+  JavaThread() : mvm::VMThreadData(0, 0) {
 #ifdef SERVICE
     replacedEIPs = 0;
 #endif
@@ -143,7 +139,7 @@
   /// getJVM - Get the Java VM in which this thread executes.
   ///
   Jnjvm* getJVM() {
-    return jnjvm;
+    return (Jnjvm*)vm;
   }
 
   /// currentThread - Return the current thread as a Java object.

Modified: vmkit/branches/multi-vm/lib/Mvm/Compiler/mvm-runtime.ll
URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/multi-vm/lib/Mvm/Compiler/mvm-runtime.ll?rev=120568&r1=120567&r2=120568&view=diff
==============================================================================
--- vmkit/branches/multi-vm/lib/Mvm/Compiler/mvm-runtime.ll (original)
+++ vmkit/branches/multi-vm/lib/Mvm/Compiler/mvm-runtime.ll Wed Dec  1 04:31:04 2010
@@ -22,7 +22,11 @@
 ;;; field 12: void*  vmData
 ;;; field 13: gc*    pendingException
 %Thread       = type { %CircularBase, i32, i8*, i8*, i1, i1, i1, i8*, i8*, i8*, i8*, i8*, i8*, i8* }
-%VMThreadData = type { %VT*, %Thread* }
+
+;;; field 0: VT
+;;; field 1: mvm::MutatorThread*  mut
+;;; field 2: mvm::VirtualMachine* vm
+%VMThreadData = type { %VT*, %MutatorThread*, i8* }
 
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Printing functions ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;





More information about the vmkit-commits mailing list