<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<div class="moz-cite-prefix"><tt>Hi Julien,<br>
<br>
I found out what was missing for adding a field to JavaClass.<br>
<br>
While precompiling Java code (JavaAOTCompiler) we create an
equivalent LLVM Constant object for each class.<br>
So modifying the internal representation of a class means that
you also have to modify the AOTCompiler.</tt><br>
<tt><br>
Here is a patch with a tiny example where an int is added to
JavaClass.<br>
If you want to add more complex structures, take a look at how
intrinsics are managed (J3Intrinsics).<br>
<br>
</tt>
<pre class="moz-signature" cols="72">Harris Bakiras
</pre>
On 04/16/2013 06:56 PM, Harris BAKIRAS wrote:<br>
</div>
<blockquote cite="mid:516D82D2.1020809@gmail.com" type="cite">
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
<div class="moz-cite-prefix"><tt>Hi Julien,<br>
<br>
I also tried to add a field and get the same error as you.<br>
<br>
In theory, to add a field in JavaClass or JavaCommonClass you
have to put your field at the end of the declaration list (in
order to minimize index changes in J3Intrinsics)<br>
in C++ code and in LLVMRuntime/runtime-single.ll<br>
<br>
We are working on this issue to see what is going wrong.<br>
The problem is the fact that the error is not deterministic
which makes it difficult to solve.<br>
<br>
I will tell you more as soon as I solve the issue.<br>
</tt>
<pre class="moz-signature" cols="72">Harris Bakiras
</pre>
On 04/15/2013 05:25 PM, Julien Pagès wrote:<br>
</div>
<blockquote
cite="mid:CACp1unEzTDaRciCA=Pjg70948x2xSXH4+FrOSNZZULER5u2+qg@mail.gmail.com"
type="cite">
<div dir="ltr">
<div>Hi all,</div>
<div><br>
</div>
<div>I am currently working with vmkit (especially on J3) for
a student project, </div>
<div>I want to made some experimentations on J3.</div>
<div>I see in the file lib/j3/VMCore/JavaClass.h that if I
want to add some attributes in the class JavaClass I must
change a few thing in LLVMRuntime/* and in JnjvmModule.cpp.</div>
<div><br>
</div>
<div>But JnjvmModule.cpp does not exist anymore. So my first
question is : what is the equivalent of JnjvmModule.cpp
right now ?</div>
<div><br>
</div>
<div>Secondly, I also want to add attributes in class
JavaVirtualClass. When I do I immediately got this error :</div>
<div>vmjc: JavaClass.cpp:492: j3::JavaObject
*j3::Class::doNew(j3::Jnjvm *): Assertion `this &&
"No class when allocating."' failed.</div>
<div><br>
</div>
<div>I tried to change offsets in the class (like
getDepthIndex(), getOffsetIndex()) but I still have this
error. </div>
<div><br>
</div>
<div>Do you know what I must change to fix this ? Maybe that I
forgot to made the changes in another file like with
JavaClass ?</div>
<div><br>
</div>
<div>Thanks,</div>
<div><br>
</div>
<div>Julien</div>
</div>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
LLVM Developers mailing list
<a moz-do-not-send="true" class="moz-txt-link-abbreviated" href="mailto:LLVMdev@cs.uiuc.edu">LLVMdev@cs.uiuc.edu</a> <a moz-do-not-send="true" class="moz-txt-link-freetext" href="http://llvm.cs.uiuc.edu">http://llvm.cs.uiuc.edu</a>
<a moz-do-not-send="true" class="moz-txt-link-freetext" href="http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev">http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev</a>
</pre>
</blockquote>
<br>
</blockquote>
<br>
</body>
</html>