<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head><body dir="auto"><div>Hi Nicolas,<br><br><br></div><div><br>On Apr 7, 2016, at 11:50 PM, Nicolas Cellier &lt;<a href="mailto:nicolas.cellier.aka.nice@gmail.com">nicolas.cellier.aka.nice@gmail.com</a>&gt; wrote:<br></div><blockquote type="cite"><div><div dir="ltr"><div class="gmail_extra"><br><div class="gmail_quote">2016-04-08 2:26 GMT+02:00  <span dir="ltr">&lt;<a href="mailto:commits@source.squeak.org" target="_blank">commits@source.squeak.org</a>&gt;</span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
Eliot Miranda uploaded a new version of VMMaker to project VM Maker:<br>
<a href="http://source.squeak.org/VMMaker/VMMaker.oscog-eem.1779.mcz" rel="noreferrer" target="_blank">http://source.squeak.org/VMMaker/VMMaker.oscog-eem.1779.mcz</a><br>
<br>
==================== Summary ====================<br>
<br>
Name: VMMaker.oscog-eem.1779<br>
Author: eem<br>
Time: 7 April 2016, 5:26:14.093395 pm<br>
UUID: eb3139fc-9d6f-432c-83b9-099675dcb37d<br>
Ancestors: VMMaker.oscog-eem.1778<br>
<br>
Fix simulation of the LargeIntegersPlugin.&nbsp; The issue is that interpreterProxy firstIndexableField: answers a CArray whose unitSize reflects the object's unit size, and becuase LargeIntegers are byte objects, the CArray is a byte accssor by default.&nbsp; So add InterpreterPlugin&gt;&gt;firstIndexableField:as:, which uses cCoerce:to: to provide a CArray typed as requested, and use it everywhere the LargeIntegersPlugin takes the firstIndexableField of a LargeInteger, and cast to #'unsigned int *'.<br>
<br>
Go some way to speed up the warppers by<br>
a) improving CArray&gt;at:[put:] to assume unitSize is a suitable power of two, and<br>
b) add CFloatArray to access float or double<br>
<br>
Later on we can add CUnsignedIntegerArray, as required.<br>
<br>
<br>
N.B.&nbsp; While this fixes simulation of the LargeIntegerPlugin there is still something wrong under simulation in whatever produces large fonts.&nbsp; Start up the Squeak 5.0 release image with the "Squeak 5.0 Release Notes" text in huge letters in a workspace towards the front and you'll notice that in the simulator none of the large fonts are displayed, although the text from "Fast Become" works fine.<br>
<br>
=============== Diff against VMMaker.oscog-eem.1778 ===============<br><br></blockquote></div></div></div></div></blockquote>...<br><blockquote type="cite"><div><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Item was changed:<br>
&nbsp; ----- Method: Integer&gt;&gt;coerceTo:sim: (in category '*VMMaker-interpreter simulator') -----<br>
&nbsp; coerceTo: cTypeString sim: interpreter<br>
<br>
&nbsp; &nbsp; &nbsp; &nbsp; | unitSize |<br>
&nbsp; &nbsp; &nbsp; &nbsp; cTypeString last = $* ifTrue:&nbsp; "C pointer"<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; [unitSize := cTypeString caseOf: {<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ['char *'] -&gt; [1].<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ['short *'] -&gt; [2].<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ['int *'] -&gt; [4].<br>
+&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;['float *'] -&gt; [^CFloatArray basicNew interpreter: interpreter address: self unitSize: 4; yourself].<br>
+&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;['double *'] -&gt; [^CFloatArray basicNew interpreter: interpreter address: self unitSize: 8; yourself].<br>
-&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;['long *'] -&gt; [interpreter wordSize].<br></blockquote><div><br></div><div>Hi Eliot,<br></div><div>I presume you suppressed long * and do not need unsigned long * because they are handled in otherwise.<br></div><div>But there's also no (unsigned) long long * / (u)sqLong *<br></div><div>We never coerce to these types (or only inside cCode: []), or this is handled elsewhere?<br></div></div></div></div></div></blockquote><div><br></div>It's just that the existing method didn't handle it. &nbsp;Right now I have other priorities with ClĂ©ment (better block model for Sista plus a proper register allocator) but... &nbsp;<div>- it seems wrong that there are two cCoerce:to: implementations that differ; they should be the same</div><div>- they should be complete</div><div>- CArray can be a hierarchy so we can minimize the use of CPluggableAccessor</div><div>- we should bite the bullet and have byteAt: shortAt: long32At: <span style="background-color: rgba(255, 255, 255, 0);">long64At: &nbsp;&amp;&nbsp;longAt: agree on signedness both in the simulator and in C and provide signedByteAt: &amp; unsignedByteAt: et al</span></div><div><span style="background-color: rgba(255, 255, 255, 0);">- there should be tests other than just running the simulator</span></div><div><span style="background-color: rgba(255, 255, 255, 0);">- the default implementation of firstIndexableField: in the object memory simulators that answers a CArray whose unit type depends on the underlying element size of the object is highly questionable given that the type of&nbsp;firstIndexableField: is void *</span></div><div>- we should choose either 'float *' et al or <span style="background-color: rgba(255, 255, 255, 0);">'float*' et al, not both (I'm used to&nbsp;'float *' et al) and slang should issue warnings for the alternative we reject.</span></div><div>- we have to choose whether char * is signed or not even if C compilers disagree; let's choose gcc's or clang's (hopefully they do agree)</div><div><br></div><div><br></div><div><blockquote type="cite"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
-&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;['float *'] -&gt; [4].<br>
-&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;['double *'] -&gt; [8].<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ['unsigned *'] -&gt; [4].<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ['unsigned int *'] -&gt; [4].<br>
+&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;['unsigned char *'] -&gt; [1].<br>
+&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;['signed char *'] -&gt; [1].<br>
+&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;['unsigned short *'] -&gt; [2].<br>
-&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;['unsigned char *'] -&gt; [4].<br>
-&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;['unsigned short *'] -&gt; [4].<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ['oop *'] -&gt; [interpreter bytesPerOop].<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br>
+&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;otherwise: [interpreter wordSize].<br>
-&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;otherwise: [ (cTypeString beginsWith: 'char') ifTrue: [1] ifFalse: [interpreter wordSize] ].<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ^CArray basicNew<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; interpreter: interpreter address: self unitSize: unitSize;<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; yourself].<br>
+&nbsp; &nbsp; &nbsp; &nbsp;^self&nbsp; "C number (int, char, float, etc)"!<br>
-&nbsp; &nbsp; &nbsp; &nbsp;^ self&nbsp; "C number (int, char, float, etc)"!<br>
<br>
Item was added:<br>
+ ----- Method: InterpreterPlugin&gt;&gt;firstIndexableField:as: (in category 'casting support') -----<br>
+ firstIndexableField: obj as: cType<br>
+&nbsp; &nbsp; &nbsp; &nbsp;&lt;inline: true&gt;<br>
+&nbsp; &nbsp; &nbsp; &nbsp;^interpreterProxy cCoerce: (interpreterProxy firstIndexableField: obj) to: cType!<br></blockquote></div></div></div></blockquote>...<br><blockquote type="cite"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
<br>
</blockquote></div></div></div>
</blockquote></div></body></html>