<div dir="ltr">Hi Tobias,<div><br></div><div> done. I've made it match Alien class>>ensureInSpecialObjectsArray and so it only looks in VMObjectIndices. But this should be OK right?</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Feb 23, 2018 at 11:45 AM, Tobias Pape <span dir="ltr"><<a href="mailto:Das.Linux@gmx.de" target="_blank">Das.Linux@gmx.de</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
Hi,<br>
<br>
can someone with commit rights on Alien please change the following method?<br>
<br>
<br>
UnsafeAlien class>><wbr>ensureInSpecialObjectsArray<br>
"UnsafeAlien must be in the specialObjectsArray to enable the Newsqueak FFI.<br>
Because of the bootstrap the specialObjectsArray may already have been<br>
partially initialized with the callback selector and to be large enough (as part of<br>
loading immutability), but it will be missing UnsafeAlien until UnsafeAlien is loaded.<br>
So check if the specialObjectsArray is of the expected size before recreating<br>
and slam UnsafeAlien in if the specialObjectsArray is already large enough."<br>
<br>
| index |<br>
self ~~ UnsafeAlien ifTrue: [^self].<br>
<br>
index := 55.<br>
(((Smalltalk includesKey: #VMObjectIndices)<br>
and: [((Smalltalk at: #VMObjectIndices) classPool at: #ClassUnsafeAlien ifAbsent: []) == (index - 1)])<br>
or: [<br>
((Smalltalk includesKey: #ObjectMemory)<br>
and: [((Smalltalk at: #ObjectMemory) classPool at: #ClassUnsafeAlien ifAbsent: []) == (index - 1)])])<br>
ifFalse:<br>
[self error: 'index probably wrong'].<br>
<br>
Smalltalk specialObjectsArray size < index ifTrue:<br>
[Smalltalk recreateSpecialObjectsArray].<br>
<br>
(Smalltalk specialObjectsArray size < index<br>
or: [(Smalltalk specialObjectsArray at: index) ~~ nil<br>
and: [(Smalltalk specialObjectsArray at: index) ~~ self]]) ifTrue:<br>
[self error: 'SystemDictionary>><wbr>recreateSpecialObjectsArray appears incompatible'].<br>
<br>
(Smalltalk specialObjectsArray at: index) == nil ifTrue:<br>
[Smalltalk specialObjectsArray at: index put: self]<br>
<br>
<br>
This is necessary as in the current spur architecture the #Class.... class variables are no longer in ObjectMemory but in a Shared Pool.<br>
<br>
Hence, it breaks on loading.<br>
<br>
<br>
Best regards<br>
<span class="HOEnZb"><font color="#888888"> -Tobias</font></span></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><span style="font-size:small;border-collapse:separate"><div>_,,,^..^,,,_<br></div><div>best, Eliot</div></span></div></div></div>
</div>