[Vm-dev] Re: ARM Cog progress

Eliot Miranda eliot.miranda at gmail.com
Sun Jun 7 18:17:40 UTC 2015


On Sat, Jun 6, 2015 at 10:38 AM, tim Rowledge <tim at rowledge.org> wrote:

>
> On 06-06-2015, at 10:18 AM, Eliot Miranda <eliot.miranda at gmail.com> wrote:
> >
> > Ha!  Turns out that at least for sends we're in the clear for
> out-of-line literal load.  i.e. from
> https://www.raspberrypi.org/forums/viewtopic.php?f=72&t=78090
>
> Excellent. So the only ‘fun’ is creating, managing and accessing the pools
> of out of line constants. Where should we place the pool though? My first
> thought was just in front of the ‘entry’ address but that would screw the
> assorted entry/nocheck offsets we have as constants. At the end, just
> before the metadata?
>

The idea is to dump them somewhere inconspicuours.  The natural place is at
the head of an else block, i.e. after an unconditional forward branch, or
immediately following a return.  Here's Object>>printOn: as an example:

41 <70> self
42 <C7> send: class
43 <D0> send: name
44 <69> popIntoTemp: 1
45 <10> pushTemp: 0
46 <88> dup
47 <11> pushTemp: 1
48 <D5> send: first
49 <D4> send: isVowel
50 <99> jumpFalse: 53
51 <23> pushConstant: 'an '
52 <90> jumpTo: 54

**put literals here**

53 <22> pushConstant: 'a '
54 <E1> send: nextPutAll:
55 <87> pop
56 <11> pushTemp: 1
57 <E1> send: nextPutAll:
58 <87> pop
59 <78> returnSelf

**and put literals here**

The pushConstant: 'a ' at 53 is only reached from the jump at 50. So
dumping literals after the jump at 52 is good, as is after the final return.

However, if code is jump-less and return-less and refers to lots of
literals a jump past a run of literals can be inserted as an emergency
measure.

-- 
best,
Eliot
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/vm-dev/attachments/20150607/5de79ec1/attachment-0001.htm


More information about the Vm-dev mailing list