help-smalltalk
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Help-smalltalk] ReadOnly


From: Paolo Bonzini
Subject: Re: [Help-smalltalk] ReadOnly
Date: Thu, 07 Nov 2013 14:31:19 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130923 Thunderbird/17.0.9

Il 06/11/2013 20:56, Gwenaël Casaccio ha scritto:
> 
> Yes I agree for the stack, I'm thinking about the bytecode combination
> if in the bc 80
> I send a message when it leave the message the ip is the next ip and it
> will go to the next
> instruction and for the bc 80 it's bad because it's the last
> instruction, if I'm  right.

Ah, I see now.

In general if a (basic) bytecode can send, it can only be the
last message of a compound bytecode.  See this part of superops.cc

    " allSuperoperatorBreaks ["
    "     | breaks |"
    "     breaks := SortedCollection new."
    "     self allByteCodeIndicesDo: [ :i :b :op |"
    ///////// "Split where jumps land"
    "         (b >= 40 and: [ b <= 43 ])"
    "            ifTrue: [ breaks add: (self jumpDestinationAt: i forward: b > 
40) ]."

    ///////// "Split after returns"
    "         (b >= 50 and: [ b <= 51 ])"
    "            ifTrue: [ breaks add: (self nextBytecodeIndex: i) ]."

    ///////// "Split after jumps"
    "         (b >= 40 and: [ b <= 43 ])"
    "            ifTrue: [ breaks add: (self nextBytecodeIndex: i) ]."

    ///////// "Split after push/store literal variable"
    "         (b = 34 or: [ b = 38 ])"
    "            ifTrue: [ breaks add: (self nextBytecodeIndex: i) ]."

    ///////// "Split after sends"
    "         (b < 32 and: [ (b + 12 bitAnd: 250) ~= 32 ])"
    "            ifTrue: [ breaks add: (self nextBytecodeIndex: i) ]"
    "     ]."
    "     ^breaks ]"

It splits after push/store literal variable because it sends #value and
#value: respectively.  You would have to split after store instance variable
too, and regenerate the superoperators.

Paolo



reply via email to

[Prev in Thread] Current Thread [Next in Thread]