[vmkit-commits] [vmkit] r195633 - add a j3symbol class, will be used to resolve symbol in mcjit
Gael Thomas
gael.thomas at lip6.fr
Mon Nov 25 02:31:31 PST 2013
Author: gthomas
Date: Mon Nov 25 04:31:31 2013
New Revision: 195633
URL: http://llvm.org/viewvc/llvm-project?rev=195633&view=rev
Log:
add a j3symbol class, will be used to resolve symbol in mcjit
Added:
vmkit/branches/mcjit/include/j3/j3symbol.h
Modified:
vmkit/branches/mcjit/ (props changed)
vmkit/branches/mcjit/include/j3/ (props changed)
vmkit/branches/mcjit/include/j3/j3class.h
vmkit/branches/mcjit/include/j3/j3method.h
vmkit/branches/mcjit/lib/j3/vm/j3method.cc
Propchange: vmkit/branches/mcjit/
------------------------------------------------------------------------------
--- svn:ignore (original)
+++ svn:ignore Mon Nov 25 04:31:31 2013
@@ -1,3 +1,4 @@
+Makefile.config
Debug+Asserts
config.log
config.status
Propchange: vmkit/branches/mcjit/include/j3/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Mon Nov 25 04:31:31 2013
@@ -0,0 +1 @@
+j3config.h
Modified: vmkit/branches/mcjit/include/j3/j3class.h
URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/mcjit/include/j3/j3class.h?rev=195633&r1=195632&r2=195633&view=diff
==============================================================================
--- vmkit/branches/mcjit/include/j3/j3class.h (original)
+++ vmkit/branches/mcjit/include/j3/j3class.h Mon Nov 25 04:31:31 2013
@@ -5,7 +5,7 @@
#include <stdint.h>
#include <vector>
-#include "vmkit/allocator.h"
+#include "j3/j3symbol.h"
namespace llvm {
class StructType;
@@ -32,7 +32,7 @@ namespace j3 {
class J3ObjectHandle;
class J3Field;
- class J3Type : public vmkit::PermanentObject {
+ class J3Type : public J3Symbol {
pthread_mutex_t _mutex;
J3ClassLoader* _loader;
J3ArrayClass* volatile _array;
@@ -55,6 +55,8 @@ namespace j3 {
virtual llvm::GlobalValue* llvmDescriptor(llvm::Module* module) { return 0; }
+ int isTypeDescriptor() { return 1; }
+
bool isResolved() { return status >= RESOLVED; }
bool isInitialised() { return status == INITED; }
J3Type* resolve(J3Field* hiddenFields, uint32_t nbHiddenFields);
Modified: vmkit/branches/mcjit/include/j3/j3method.h
URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/mcjit/include/j3/j3method.h?rev=195633&r1=195632&r2=195633&view=diff
==============================================================================
--- vmkit/branches/mcjit/include/j3/j3method.h (original)
+++ vmkit/branches/mcjit/include/j3/j3method.h Mon Nov 25 04:31:31 2013
@@ -4,7 +4,7 @@
#include <stdint.h>
#include <vector>
-#include "vmkit/allocator.h"
+#include "j3/j3symbol.h"
namespace llvm {
class FunctionType;
@@ -46,12 +46,18 @@ namespace j3 {
}
};
- struct trampolin_t {
- uint8_t code[1];
+ class J3MethodCode : public J3Symbol {
+ public:
+ J3Method* self;
+
+ J3MethodCode(J3Method* _self) { self = _self; }
+
+ int isMethodPointer() { return 1; }
};
- class J3Method : public vmkit::PermanentObject {
+ class J3Method : public J3Symbol {
public:
+ J3MethodCode _selfCode;
uint16_t _access;
J3Class* _cl;
const vmkit::Name* _name;
@@ -80,6 +86,8 @@ namespace j3 {
public:
J3Method(uint16_t access, J3Class* cl, const vmkit::Name* name, const vmkit::Name* sign);
+ int isMethodDescriptor() { return 1; }
+
static J3Method* newMethod(vmkit::BumpAllocator* allocator,
uint16_t access,
J3Class* cl,
Added: vmkit/branches/mcjit/include/j3/j3symbol.h
URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/mcjit/include/j3/j3symbol.h?rev=195633&view=auto
==============================================================================
--- vmkit/branches/mcjit/include/j3/j3symbol.h (added)
+++ vmkit/branches/mcjit/include/j3/j3symbol.h Mon Nov 25 04:31:31 2013
@@ -0,0 +1,15 @@
+#ifndef _J3_SYMBOL_H_
+#define _J3_SYMBOL_H_
+
+#include "vmkit/allocator.h"
+
+namespace j3 {
+ class J3Symbol : public vmkit::PermanentObject {
+ public:
+ virtual int isMethodPointer() { return 0; }
+ virtual int isMethodDescriptor() { return 0; }
+ virtual int isTypeDescriptor() { return 0; }
+ };
+};
+
+#endif
Modified: vmkit/branches/mcjit/lib/j3/vm/j3method.cc
URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/mcjit/lib/j3/vm/j3method.cc?rev=195633&r1=195632&r2=195633&view=diff
==============================================================================
--- vmkit/branches/mcjit/lib/j3/vm/j3method.cc (original)
+++ vmkit/branches/mcjit/lib/j3/vm/j3method.cc Mon Nov 25 04:31:31 2013
@@ -31,7 +31,8 @@ J3MethodType::J3MethodType(J3Type** args
_llvmType = llvm::FunctionType::get(out()->llvmType(), in, 0);
}
-J3Method::J3Method(uint16_t access, J3Class* cl, const vmkit::Name* name, const vmkit::Name* sign) {
+J3Method::J3Method(uint16_t access, J3Class* cl, const vmkit::Name* name, const vmkit::Name* sign) :
+ _selfCode(this) {
_access = access;
_cl = cl;
_name = name;
More information about the vmkit-commits
mailing list