IRInstruction.st
changeset 23 377bc46cad12
parent 10 0fd549e0c784
child 26 db19d89eef60
equal deleted inserted replaced
22:6d3c5fd122e3 23:377bc46cad12
     1 "{ Package: 'stx:goodies/newcompiler' }"
     1 "{ Package: 'cvut:stx/goodies/newcompiler' }"
     2 
     2 
     3 Link subclass:#IRInstruction
     3 Link subclass:#IRInstruction
     4 	instanceVariableNames:'sourceNode bytecodeIndex sequence'
     4 	instanceVariableNames:'sourceNode bytecodeIndex sequence'
     5 	classVariableNames:''
     5 	classVariableNames:''
     6 	poolDictionaries:''
     6 	poolDictionaries:''
     7 	category:'NewCompiler-IR'
     7 	category:'NewCompiler-IR'
     8 !
     8 !
     9 
     9 
    10 IRInstruction comment:'I am an instruction in the IR (intermediate representation) language.  The IR serves as the intermediary between the Smalltalk language and the bytecode language.  It is easier to optimize and translate to/from this language than it is to optimize/translate directly from Smalltalk to bytecodes.  The IR is generic and simple consisting of just twelve instructions.  They are:
    10 IRInstruction comment:'I am an instruction in the IR (intermediate representation) language.  The IR serves as the intermediary between the Smalltalk language and the bytecode language.  It is easier to optimize and translate to/from this language than it is to optimize/translate directly from Smalltalk to bytecodes.  The IR is generic and simple consisting of just twelve instructions.  They are:
    11 
       
    12 	goto: labelNum
    11 	goto: labelNum
    13 	if: boolean goto: labelNum1 otherwise: labelNum2
    12 	if: boolean goto: labelNum1 otherwise: labelNum2
    14 	label: labelNum
    13 	label: labelNum
    15 	popTop
    14 	popTop
    16 	pushDup
    15 	pushDup
    21 	remoteReturn
    20 	remoteReturn
    22 	returnTop
    21 	returnTop
    23 	send: selector
    22 	send: selector
    24 	send: selector toSuperOf: behavior
    23 	send: selector toSuperOf: behavior
    25 	storeTemp: tempIndex
    24 	storeTemp: tempIndex
    26 
       
    27 Each instruction is reified as an instance of one of my eight subclasses and grouped by basic block (IRSequence) into an IRMethod.  IRInterpreter visits each instruction in a IRMethod responding to the above instruction messages sent to it.
    25 Each instruction is reified as an instance of one of my eight subclasses and grouped by basic block (IRSequence) into an IRMethod.  IRInterpreter visits each instruction in a IRMethod responding to the above instruction messages sent to it.
    28 '
    26 '
    29 !
    27 !
    30 
    28 
    31 
    29 
   409 ! !
   407 ! !
   410 
   408 
   411 !IRInstruction class methodsFor:'documentation'!
   409 !IRInstruction class methodsFor:'documentation'!
   412 
   410 
   413 version
   411 version
   414     ^'$Id$'
   412     ^ '$Header: /cvs/stx/cvut/stx/goodies/newcompiler/IRInstruction.st,v 1.3 2009/10/08 11:55:09 fm Exp $'
   415 ! !
   413 !
       
   414 
       
   415 version_CVS
       
   416     ^ '$Header: /cvs/stx/cvut/stx/goodies/newcompiler/IRInstruction.st,v 1.3 2009/10/08 11:55:09 fm Exp $'
       
   417 !
       
   418 
       
   419 version_SVN
       
   420     ^'§Id: IRInstruction.st 13 2009-04-16 12:48:33Z vranyj1 §'
       
   421 ! !