Guillermo Adrián Molina writes:
Once everything is compiled I generate an assembler file for every
class,
for example ClassName.s. This could be a little confusing. I already compiled everything, why would I need to generate assembler files?
Because
assembler files are very handy to represent the image, take a look into
a
real method:
/* Test>>test Method bytecodes */ .global Test_Class_test_bytecodes Test_Class_test_bytecodes: .int ByteArray + 1 .int 154 /* Number: 77 */ .int 17888 /* Number: 8944 */ .global _Test_Class_test_bytecodes _Test_Class_test_bytecodes: .byte 85, 137, 229, 139, 69, 8, 80, 184 .int Test_Class_test_literals + 1 .byte 139, 64, 11, 232 .int getMethodIP - 4 - . .byte 255, 208, 129, 196, 4, 0, 0, 0, 139, 69, 8, 80, 184 .int Test_Class_test_literals + 1 .byte 139, 64, 15, 232 .int getMethodIP - 4 - . .byte 255, 208, 129, 196, 4, 0, 0, 0, 80, 184 .int Test_Class_test_literals + 1 .byte 139, 64, 19, 232 .int getMethodIP - 4 - . .byte 255, 208, 129, 196, 4, 0, 0, 0, 201, 195 .align 2
The first versions of Exupery generated gas assembly which I compiled then linked against C support code. Even after Exupery could compile inline I kept the code around to generate assembly instructions for several releases. It eventually got deleted as it wasn't adding any value.
If you're planning on continuing generating assembly then it might be worthwhile to try and find the code to produce assembly and update it to deal with the current instruction selector and the instructions that have been added since I stopped maintaining it.
Well, it is good to know that, but I need to generate machine code, not assembler code. I am generating assembler files just to make it easier to mantain the relationship between objects. As you can see from the code, the C compiler doesn't know (at compile time) what are those bytes. Before I used exupery, I was generating assembler, but thanks to exupery, that step isn't necessary. In the future I am planning to generate some kind of relocatable objects (instead of assembler files), that could be loaded on demand at run time.
Cheers, Guille
Bryce _______________________________________________ Exupery mailing list Exupery@lists.squeakfoundation.org http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/exupery