Notes |
(0008782 - 748 - 760 - 760 - 760 - 760 - 760)
lewis
12-31-06 20:40
|
Additional notes: sqMemoryBase is defined only when building the 64 bit host/32 bit image combination. The patch I provided makes an explicit reference to sqMemoryBase, and this works fine on Linux (both 32 bit and 64 bit host) even if the SocketPlugin is built as an external plugin. However, I am not confident that it will work properly on other platforms, and I tested only on Linux.
Presumably it would be better to make sqMemoryBase visible through the interpreterProxy struct, rather than relying on an explicit reference (but this requires bumping the VM_PROXY_MINOR version), or alternatively make it a variable in ObjectMemory. But perhaps it would be better to just get rid of #cPtrAsOop entirely, and update all the effected plugins? |
|
(0011136 - 926 - 1489 - 1489 - 1489 - 1489 - 1489)
tim
09-17-07 20:51
|
Dave's code is:-
generateCPtrAsOop: aNode on: aStream indent: anInteger
"sqMemoryBase is declared as (char *) in platforms/Cross/vm/sqMemoryAccess.h"
aStream nextPutAll: '((usqInt)(long)((char *)'.
self emitCExpression: aNode receiver on: aStream.
aStream nextPutAll: ' - sqMemoryBase ) - ';
nextPutAll: ObjectMemory baseHeaderSize printString;
nextPut: $)
Which as mentioned explicitly refers to sqMemoryBase. I'm going to suggest indirecting that just a little to use the pre-existing oopForPointer()
generateCPtrAsOop: aNode on: aStream indent: anInteger
"derive the proper Oop for a C ptr - use oopForPointer to deal with any base offset"
aStream nextPutAll: '((usqInt)(long)((char *)'.
aStream nextPutAll: 'oopForPointer( '.
self emitCExpression: aNode receiver on: aStream.
aStream nextPutAll: ' ) - ';
nextPutAll: ObjectMemory baseHeaderSize printString;
nextPut: $) |
|
(0011137 - 41 - 41 - 41 - 41 - 41 - 41)
lewis
09-18-07 00:22
|
Using oopForPointer() sounds right to me. |
|
(0011138 - 151 - 151 - 151 - 151 - 151 - 151)
tim
09-18-07 01:58
|
I don't suppose you'd like to hack your code base to try it out while I get on with the miserably delayed putting-together-stuff-wot-others-wrote part? |
|
(0011143 - 167 - 167 - 167 - 167 - 167 - 167)
lewis
09-18-07 11:03
|
I'll check it out on 32 and 64 bit host configurations, but I will be out of town and may not get to it until next week (will respond by Sept 26 at the latest though). |
|
(0011146 - 414 - 414 - 414 - 414 - 414 - 414)
lewis
09-19-07 00:45
|
The oopForPointer() change works fine on H32/I32 and H64/I32, modulo a missing close paren, but I did not test H32/I64 or H64/I64. However this leaves a bunch of slimey typecasts in the method that probably are not necessary. Will try to fix this next week when I get home, mean time I suggest just apply my first change set if you want to update VMM right away, or wait until next week and I'll check it properly. |
|
(0011147 - 288 - 336 - 336 - 336 - 336 - 336)
lewis
09-19-07 01:47
edited on: 09-19-07 01:48
|
Update attached: Fix64BitSmartSyntaxPluginCodeGenerator-0005688-tpr-dtl.cs
This has the oopForPointer() fix plus deuglifier ointment to remove extraneous type casts.
Tested on H32/I32, H32/I64, H64/I32, H64/I64. Confirmed that the VM crash problem is gone for H64/I32.
Ship it.
|
|
(0011596 - 18 - 18 - 18 - 18 - 18 - 18)
tim
12-27-07 23:58
|
In VMMaker-tpr.65 |
|
(0013023 - 50 - 50 - 50 - 50 - 50 - 50)
lewis
03-08-09 13:36
|
Included in VMMaker-tpr.65 on SqueakSource VMMaker |
|