dotgnu-pnet
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Pnet-developers] Java compiler issues


From: Gopal V
Subject: [Pnet-developers] Java compiler issues
Date: Sun, 4 May 2003 19:48:48 +0530
User-agent: Mutt/1.2.5i

Hi All,
        So here are the current road blocks to the java compiler design 
right now ... I'm putting this down now because I hope to get some 
quick answers in tonight's meeting.

Let me start by mentioning what we arrived at in the last meeting .

The idea was to use a builtin library in the compiler which will
imitate the libraries to  be replaced during later stages.

Hopefully a library written in C# marked with various [Java*Map]
attributes can be used to correctly update the builtin library as
well as generate a replacement table. Otherwise the process will
get out of hand very very easily ...

Replacement table will be similar to the internal call table , with
all methods returning ILNode* replacements for methods.

BEGIN_REPLACE_TABLE("java.lang.Object")
        IL_CTOR(".ctor", "()V", _java_lang_Object_ctor)
        IL_METHOD("equals", "(Tjava.lang.Object;)V", _java_lang_Object_equals,
                                        _java_lang_Object_equals_Override)
END_REPACE_TABLE

BEGIN_REPLACE_TABLE("java.lang.String")
        IL_FIELD("CASE_INSENSITIVE_ORDER", "Tjava.util.Comparator;", 
_java_lang_String_CASE_INSENSITIVE_ORDER_get , 
_java_lang_String_CASE_INSENSITIVE_ORDER_set)
END_REPACE_TABLE

ILNode * _java_lang_Object_ctor(ILGenInfo *info,ILNode *ctorExpression)
{
        ILNode* ident =ILNode_SystemType_create("Object");
        return ILNode_ObjectCreationExpression(ident,NULL);
}

Which are unfortunately needed for each & every replacement ... (since
each of them are subtly different in some way). But this would be a nice
way for people to chip-in and help.

All the equals() method override will therefore need an .override 
System.Object::Equals() which should be done in type gathering...

To determine which class will be obtained where , ie where shall I get 
java.lang.Object and where System.Object , is a mind bogglingly complicated
question here.

And last but not least , how the heck do I generate the right error 
messages on compilation ?. For that I'd need a backwards hashtable
of the replace table as well. 

It's soooo complicated that I feel like quitting or going on with the
wrapped object format I have ...

And this is all replacing things that work 75% of the cases ... JNI is
another bag of tough nuts ... Even a pnet-specific to spec IL JNI system
sounds impossible.

Is there some other easier way  ?
Gopal
-- 
The difference between insanity and genius is measured by success


reply via email to

[Prev in Thread] Current Thread [Next in Thread]