[squeak-dev] The Trunk: Compiler-tfel.75.mcz

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[squeak-dev] The Trunk: Compiler-tfel.75.mcz

commits-2
Andreas Raab uploaded a new version of Compiler to project The Trunk:
http://source.squeak.org/trunk/Compiler-tfel.75.mcz

==================== Summary ====================

Name: Compiler-tfel.75
Author: tfel
Time: 1 September 2009, 5:13:15 am
UUID: c0548007-a567-49ac-81ed-f0df3a098e65
Ancestors: Compiler-tfel.74

MethodNode>>generateWith:using:

Nuked the method according to Andreas' request on the mailinglist

=============== Diff against Compiler-cwp.73 ===============

Item was removed:
- ----- Method: MethodNode>>generateWith:using: (in category 'code generation') -----
- generateWith: trailer using: aCompiledMethodClass
- "The receiver is the root of a parse tree. Answer a CompiledMethod. The
- argument, trailer, is the references to the source code that is stored with
- every CompiledMethod."
-
- | blkSize nLits stack strm nArgs method |
- self generate: trailer ifQuick:
- [:m |  method := m.
- method properties: properties.
- ^ method].
- nArgs := arguments size.
- blkSize := block sizeForEvaluatedValue: encoder.
- literals := encoder allLiterals.
- nLits := literals size.
- method := aCompiledMethodClass "Dummy to allocate right size"
- newBytes: blkSize
- trailerBytes: trailer
- nArgs: nArgs
- nTemps: encoder maxTemp
- nStack: 0
- nLits: nLits
- primitive: primitive.
- strm := ReadWriteStream with: method.
- strm position: method initialPC - 1.
- stack := ParseStack new init.
- block emitForEvaluatedValue: stack on: strm.
- stack position ~= 1 ifTrue: [^self error: 'Compiler stack
- discrepancy'].
- strm position ~= (method size - trailer size)
- ifTrue: [^self error: 'Compiler code size discrepancy'].
- method needsFrameSize: stack size.
- 1 to: nLits do: [:lit | method literalAt: lit put: (literals at: lit)].
- method properties: properties.
- ^ method!