[vmkit-commits] [vmkit] r60185 - in /vmkit/trunk/lib/JnJVM: LLVMRuntime/Makefile LLVMRuntime/runtime-default.ll LLVMRuntime/runtime-isolate.ll LLVMRuntime/runtime-single.ll VMCore/JnjvmModule.cpp VMCore/JnjvmModule.h

Nicolas Geoffray nicolas.geoffray at lip6.fr
Thu Nov 27 14:03:00 PST 2008


Author: geoffray
Date: Thu Nov 27 16:03:00 2008
New Revision: 60185

URL: http://llvm.org/viewvc/llvm-project?rev=60185&view=rev
Log:
Make the LLVM class representation the same as the C++ representation.


Added:
    vmkit/trunk/lib/JnJVM/LLVMRuntime/runtime-single.ll
Modified:
    vmkit/trunk/lib/JnJVM/LLVMRuntime/Makefile
    vmkit/trunk/lib/JnJVM/LLVMRuntime/runtime-default.ll
    vmkit/trunk/lib/JnJVM/LLVMRuntime/runtime-isolate.ll
    vmkit/trunk/lib/JnJVM/VMCore/JnjvmModule.cpp
    vmkit/trunk/lib/JnJVM/VMCore/JnjvmModule.h

Modified: vmkit/trunk/lib/JnJVM/LLVMRuntime/Makefile
URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/JnJVM/LLVMRuntime/Makefile?rev=60185&r1=60184&r2=60185&view=diff

==============================================================================
--- vmkit/trunk/lib/JnJVM/LLVMRuntime/Makefile (original)
+++ vmkit/trunk/lib/JnJVM/LLVMRuntime/Makefile Thu Nov 27 16:03:00 2008
@@ -32,6 +32,12 @@
 endif
 endif
 
+ifndef $(ISOLATE_BUILD)
+ifndef $(SERVICE_BUILD)
+VMKIT_RUNTIME += $(PROJ_SRC_DIR)/runtime-single.ll
+endif
+endif
+
 BUILT_SOURCES = LLVMRuntime.inc
 
 include $(LEVEL)/Makefile.common

Modified: vmkit/trunk/lib/JnJVM/LLVMRuntime/runtime-default.ll
URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/JnJVM/LLVMRuntime/runtime-default.ll?rev=60185&r1=60184&r2=60185&view=diff

==============================================================================
--- vmkit/trunk/lib/JnJVM/LLVMRuntime/runtime-default.ll (original)
+++ vmkit/trunk/lib/JnJVM/LLVMRuntime/runtime-default.ll Thu Nov 27 16:03:00 2008
@@ -5,26 +5,6 @@
 ;;; A virtual table is an array of function pointers.
 %VT = type i32 (...)**
 
-%Jnjvm = type {%VT, %JavaClass*, [9 x %JavaClass*]}
-
-;;; The task class mirror in an isolate environment.
-;;; Field 1: The class state
-;;; Field 2: The class delegatee (java/lang/Class)
-;;; Field 3: The static instance
-%TaskClassMirror = type { i32, %JavaObject*, i8* }
-
-;;; The type of internal classes. This is not complete, but we only need
-;;; the first fields for now. 
-;;; Field 1 - The VT of a class C++ object.
-;;; Field 2 - The size of instances of this class.
-;;; Field 3 - The VT of instances of this class.
-;;; Field 4 - The list of super classes of this class.
-;;; Field 5 - The depth of the class in its super hierarchy.
-;;; Field 6 - The class state (resolved, initialized, ...)
-;;; field 7 - The task class mirror, for an isolate environment
-%JavaClass = type { %VT, i32, %VT ,%JavaClass**, i32, i32,
-                    [0 x %TaskClassMirror] }
-
 ;;; The root of all Java Objects: a VT, a class and a lock.
 %JavaObject = type { %VT, %JavaClass*, i8* }
 
@@ -41,10 +21,6 @@
 %ArrayUInt32 = type { %JavaObject, i8*, [0 x i32] }
 %ArrayUInt8 = type { %JavaObject, i8*, [0 x i8] }
 
-;;; The CacheNode type. The second field is the last called method. The
-;;; last field is for multi vm environment.
-%CacheNode = type { i8*, %JavaClass*, %CacheNode*, %Enveloppe*, i8** }
-
 ;;; The Enveloppe type, which contains the first cache and all the info
 ;;; to lookup in the constant pool.
 %Enveloppe = type { %CacheNode*, i8**, i8*, i32 }

Modified: vmkit/trunk/lib/JnJVM/LLVMRuntime/runtime-isolate.ll
URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/JnJVM/LLVMRuntime/runtime-isolate.ll?rev=60185&r1=60184&r2=60185&view=diff

==============================================================================
--- vmkit/trunk/lib/JnJVM/LLVMRuntime/runtime-isolate.ll (original)
+++ vmkit/trunk/lib/JnJVM/LLVMRuntime/runtime-isolate.ll Thu Nov 27 16:03:00 2008
@@ -1,4 +1,32 @@
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;;;;;;;;;;;;;;;;;;;;;;;; Isolate specific types ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+%Jnjvm = type {%VT, %JavaClass*, [9 x %JavaClass*]}
+
+;;; The task class mirror in an isolate environment.
+;;; Field 1: The class state
+;;; Field 2: The class delegatee (java/lang/Class)
+;;; Field 3: The static instance
+%TaskClassMirror = type { i32, %JavaObject*, i8* }
+
+;;; The type of internal classes. This is not complete, but we only need
+;;; the first fields for now. 
+;;; Field 1 - The VT of a class C++ object.
+;;; Field 2 - The size of instances of this class.
+;;; Field 3 - The VT of instances of this class.
+;;; Field 4 - The list of super classes of this class.
+;;; Field 5 - The depth of the class in its super hierarchy.
+;;; Field 6 - The class state (resolved, initialized, ...)
+;;; field 7 - The task class mirror, for an isolate environment
+%JavaClass = type { %VT, i32, %VT ,%JavaClass**, i32, i32,
+                    [0 x %TaskClassMirror] }
+
+;;; The CacheNode type. The second field is the last called method. The
+;;; last field is for multi vm environment.
+%CacheNode = type { i8*, %JavaClass*, %CacheNode*, %Enveloppe*, i8** }
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;;;;;;;;;;;;;;;;;;;;;;;; Isolate specific methods ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 

Added: vmkit/trunk/lib/JnJVM/LLVMRuntime/runtime-single.ll
URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/JnJVM/LLVMRuntime/runtime-single.ll?rev=60185&view=auto

==============================================================================
--- vmkit/trunk/lib/JnJVM/LLVMRuntime/runtime-single.ll (added)
+++ vmkit/trunk/lib/JnJVM/LLVMRuntime/runtime-single.ll Thu Nov 27 16:03:00 2008
@@ -0,0 +1,35 @@
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;;;;;;;;;;;;;;;;;;;;;;;; Isolate specific types ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+;;; The type of internal classes. 
+;;; Field 1 - The VT of a class C++ object.
+;;; Field 2 - The size of instances of this class.
+;;; Field 3 - The VT of instances of this class.
+;;; Field 4 - The list of super classes of this class.
+;;; Field 5 - The depth of the class in its super hierarchy.
+;;; Field 6 - The class state (resolved, initialized, ...)
+
+%JavaClass = type { %VT, i32, %VT, %JavaClass**, i32, i32, i32, i8, i8, 
+                    %Class**, i16, %UTF8*, %Class*, i8*, %JavaField*, i16, 
+                    %JavaField*, i16, %JavaMethod*, i16, %JavaMethod*, i16, 
+                    i8*, i8*, %JavaObject* }
+
+
+%Class = type { %JavaClass, %ArrayUInt8*, i8*, %Attribut*, i16, %Class**, i16,
+                %Class*, i16, i8, i32, i32, void (i8*)*, i8*, i8* }
+
+
+%Attribut = type { %UTF8*, i32, i32 }
+
+%UTF8 = type { %ArrayUInt16 }
+
+
+%JavaField = type { i8*, i16, %UTF8*, %UTF8*, %Attribut*, i16, %Class*, i64,
+                    i16, i8* }
+
+%JavaMethod = type { i8*, i16, %Attribut*, i16, %Enveloppe*, i16, %Class*,
+                     %UTF8*, %UTF8*, i8, i8*, i32, i8* }
+
+;;; The CacheNode type. The second field is the last called method.
+%CacheNode = type { i8*, %JavaClass*, %CacheNode*, %Enveloppe*}

Modified: vmkit/trunk/lib/JnJVM/VMCore/JnjvmModule.cpp
URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/JnJVM/VMCore/JnjvmModule.cpp?rev=60185&r1=60184&r2=60185&view=diff

==============================================================================
--- vmkit/trunk/lib/JnJVM/VMCore/JnjvmModule.cpp (original)
+++ vmkit/trunk/lib/JnJVM/VMCore/JnjvmModule.cpp Thu Nov 27 16:03:00 2008
@@ -44,9 +44,12 @@
 const llvm::Type* JnjvmModule::JavaArrayObjectType = 0;
 const llvm::Type* JnjvmModule::CacheNodeType = 0;
 const llvm::Type* JnjvmModule::EnveloppeType = 0;
-const llvm::Type* JnjvmModule::JnjvmType = 0;
 const llvm::Type* JnjvmModule::ConstantPoolType = 0;
 
+#ifdef ISOLATE_SHARING
+const llvm::Type* JnjvmModule::JnjvmType = 0;
+#endif
+
 llvm::Constant*     JnjvmModule::JavaObjectNullConstant;
 llvm::Constant*     JnjvmModule::UTF8NullConstant;
 llvm::Constant*     JnjvmModule::JavaClassNullConstant;
@@ -936,8 +939,10 @@
 
   VTType = module->getTypeByName("VT");
 
+#ifdef ISOLATE_SHARING
   JnjvmType = 
     PointerType::getUnqual(module->getTypeByName("Jnjvm"));
+#endif
   ConstantPoolType = ptrPtrType;
   
   JavaObjectType = 

Modified: vmkit/trunk/lib/JnJVM/VMCore/JnjvmModule.h
URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/JnJVM/VMCore/JnjvmModule.h?rev=60185&r1=60184&r2=60185&view=diff

==============================================================================
--- vmkit/trunk/lib/JnJVM/VMCore/JnjvmModule.h (original)
+++ vmkit/trunk/lib/JnJVM/VMCore/JnjvmModule.h Thu Nov 27 16:03:00 2008
@@ -251,9 +251,12 @@
   static const llvm::Type* JavaCacheType;
   static const llvm::Type* EnveloppeType;
   static const llvm::Type* CacheNodeType;
-  static const llvm::Type* JnjvmType;
   static const llvm::Type* ConstantPoolType;
   
+#ifdef ISOLATE_SHARING
+  static const llvm::Type* JnjvmType;
+#endif
+  
 #ifdef WITH_TRACER
   llvm::Function* MarkAndTraceFunction;
   static const llvm::FunctionType* MarkAndTraceType;





More information about the vmkit-commits mailing list