On Nov 25, 2011, at 10:03 PM, Toon Verwaest wrote:
To reply to the question from our pov:
In Pinocchio we actually need that nil, true and false fall within the first 4gb of virtual memory space, since our native code directly addresses those objects; and AMD64 code can only use 32bits for direct addresses.
This is kinda sucky since OSX thinks it's a good idea to reserve the whole first 4gb virtual address space as "null memory", to ensure they really really really capture all accidental NULL-pointer dereferences. And obviously the standard 4K isn't enough for OSX developers. Oh well, we managed to fix that with some ld flag on OSX.
We do this since it gives a very slight advantage in performance, and we don't seriously expect nil, true and false to ever change. And if they do... we can still visit all code in the system and change it :)
right now I just need a placeholder after I imagine that the specialObjectArray and system tracer can let me specify what I want in the resulting image. And may be I could use mate explicit object format description to migrate (instead of systemTracer).
cheers, Toon
On 11/23/2011 11:25 PM, Stefan Marr wrote:
Hi:
On 23 Nov 2011, at 22:59, Stéphane Ducasse wrote:
imagine that I want to bootstrap our nice kernel. I will need to somehow create a new nil, true, false, instances of new classes Undefined, True, False. Such instances will then be put on the SpecialObjectArray somehow. Something kind of related:
When debugging the VM, I am happy that I always encounter the same object as the first object in the heap. It is some strange string (think it encodes an error message or so).
However, my thought was, also for other purposes, would it be possible to have these special objects sorted to the beginning? Especially, the nilObj would be very handy to have as the first object.
That would need special VM support to arrange it that way, but knowing the nilObj from the very beginning would allow my to initialize some of my hacks more consistently, avoiding C-level NULLs and runtime checks.
Just an idea, vaguely related to the question.
Would be interesting to hear whether there are any historical insights with regard to ordering objects in the image. Guess it is not done because nobody needed it. (and then there isn't really a primitive for it, and a moving GC might also be contra-productive, etc.)
Best regards Stefan
Stef