<div dir="ltr">And let me remind you what i proposed back then:<br><br>:)<br>===========<br>About immediates zoo.
<br><br>Keep in mind, that the more immediates we have, the more complex implementation
<br>tends to be.
<br><br>I would just keep 2 data types:
<br> - integers
<br> - floats
<br><br>and third, special &#39;arbitrary&#39; immediate , which seen by VM as a 60-bit value.
<br>The interpretation of this value depends on lookup in range-table,
<br>where developer specifying the correspondence between the value
<br>interval and class:
<br>[min .. max] -&gt; class
<br><br>intervals, of course, cannot overlap.
<br>Determining a class of such immediate might be slower - O(log2(n)) at
<br>best (where n is size of range table), but from other side,
<br>how many different kinds of immediates you can fit into 60-bit value?
<br>Right, it is 2^60. Much more than proposed 8 isn&#39;t? :)
<br><br>And this extra cost can be mitigated completely by inline cache.
<br>- in case of regular reference, you must fetch the object&#39;s class and
<br>then compare it with one, stored in cache.
<br>- in case of immediate reference, you compare immediate value with min
<br>and max stored in cache fields.
<br>And if value is in range, you got a cache hit, and free to proceed.
<br>So, its just 1 extra comparison comparing to &#39;classic&#39; inline cache.
<br><br>And, after thinking how inline cache is organized, now you can scratch
<br>the first my paragraph related to  immediates!
<br>We really don&#39;t need to discriminate between small integers/floats/rest!!
<br>They could also be nothing more than just one of a range(s) defined in
<br>our zoo of &#39;special&#39; immediates!
<br><br>So, at the end we will have just two kinds of references:
<br> - zero bit == 0 -- an object pointer
<br> - zero bit == 1 -- an immediate
<br><br>Voila!.
<br><br>We can have real zoo of immediates, and simple implementation to support them.
<br>And not saying that range-table is provided by language-side, so we&#39;re
<br>free to rearrange them at any moment.
<br><br>And of course, it doesn&#39;t means that VM could not reserve some of the
<br>ranges for own &#39;contracted&#39;
<br>immediates, like Characters, and even class reference for example.
<br>Think about it :)
<br><br></div><div class="gmail_extra"><br><br><div class="gmail_quote">On 12 November 2013 11:56, Henrik Johansen <span dir="ltr">&lt;<a href="mailto:henrik.s.johansen@veloxit.no" target="_blank">henrik.s.johansen@veloxit.no</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"> <br><div style="word-wrap:break-word"><br><div><div>On 12 Nov 2013, at 11:55 , Henrik Johansen &lt;<a href="mailto:henrik.s.johansen@veloxit.no" target="_blank">henrik.s.johansen@veloxit.no</a>&gt; wrote:</div>
<br><blockquote type="cite"><div><span style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;float:none;display:inline!important">nterest ~= time and: [skills]<span> </span></span></div>
</blockquote></div><br><div>OT: I swear, missing parenthesis will be the death of me!</div></div><br></blockquote></div><br><br clear="all"><br>-- <br>Best regards,<br>Igor Stasenko.
</div>