[squeak-dev] The Trunk: Compiler-jcg.87.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-jcg.87.mcz

commits-2
Joshua Gargus uploaded a new version of Compiler to project The Trunk:
http://source.squeak.org/trunk/Compiler-jcg.87.mcz

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

Name: Compiler-jcg.87
Author: jcg
Time: 30 September 2009, 11:21:53 am
UUID: 71bf4e8d-f9f3-4371-a218-ad31a985cfd8
Ancestors: Compiler-ul.86

Revert to lazy-initialization of method properties, which is used by the externally-maintained Prolog package (which loads cleanly into 3.10.2, but not trunk).

Part 2 of 2... need to load -jcg.85 first (this is taken care of by the Monticello Configuration update-jcg.32.mcm)

=============== Diff against Compiler-ul.86 ===============

Item was changed:
  ----- Method: Parser>>addPragma: (in category 'pragmas') -----
  addPragma: aPragma
+ properties := self properties copyWith: aPragma!
- properties := properties copyWith: aPragma!

Item was changed:
  ----- Method: Parser>>method:context:encoder: (in category 'expression types') -----
  method: doit context: ctxt encoder: encoderToUse
  " pattern [ | temporaries ] block => MethodNode."
 
  | sap blk prim temps messageComment methodNode |
- properties := AdditionalMethodState new.
  encoder := encoderToUse.
  sap := self pattern: doit inContext: ctxt.
  "sap={selector, arguments, precedence}"
+ self properties selector: (sap at: 1).
- properties selector: (sap at: 1).
  encoder selector: (sap at: 1).
  (sap at: 2) do: [:argNode | argNode beMethodArg].
  doit ifFalse: [self pragmaSequence].
  temps := self temporaries.
  messageComment := currentComment.
  currentComment := nil.
  doit ifFalse: [self pragmaSequence].
  prim := self pragmaPrimitives.
  self statements: #() innerBlock: doit.
  blk := parseNode.
  doit ifTrue: [blk returnLast]
  ifFalse: [blk returnSelfIfNoOther: encoder].
  hereType == #doIt ifFalse: [^self expected: 'Nothing more'].
  self interactive ifTrue: [self removeUnusedTemps].
  methodNode := self newMethodNode comment: messageComment.
  ^methodNode
  selector: (sap at: 1)
  arguments: (sap at: 2)
  precedence: (sap at: 3)
  temporaries: temps
  block: blk
  encoder: encoder
  primitive: prim
  properties: properties!

Item was changed:
  ----- Method: MethodNode>>selector:arguments:precedence:temporaries:block:encoder:primitive: (in category 'initialize-release') -----
  selector: selOrFalse arguments: args precedence: p temporaries: temps block: blk encoder: anEncoder primitive: prim
+
+ self
+ selector: selOrFalse
+ arguments: args
+ precedence: p
+ temporaries: temps
+ block: blk encoder:
+ anEncoder
+ primitive: prim
+ properties: AdditionalMethodState new.!
- "Initialize the receiver with respect to the arguments given."
-
- encoder := anEncoder.
- selectorOrFalse := selOrFalse.
- precedence := p.
- arguments := args.
- temporaries := temps.
- block := blk.
- primitive := prim!

Item was changed:
  ----- Method: Parser>>pragmaPrimitives (in category 'pragmas') -----
  pragmaPrimitives
  | primitives |
+ self properties isEmpty ifTrue:
- properties isEmpty ifTrue:
  [^0].
  primitives := properties pragmas select:
  [:pragma|
  self class primitivePragmaSelectors includes: pragma keyword].
  primitives isEmpty ifTrue:
  [^0].
  primitives size > 1 ifTrue:
  [^self notify: 'Ambigous primitives'].
  ^self perform: primitives first keyword withArguments: primitives first arguments!