VM Maker: Cog-eem.134.mcz

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

VM Maker: Cog-eem.134.mcz

commits-2
 
Eliot Miranda uploaded a new version of Cog to project VM Maker:
http://source.squeak.org/VMMaker/Cog-eem.134.mcz

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

Name: Cog-eem.134
Author: eem
Time: 6 February 2014, 3:11:45.304 pm
UUID: 0c1023d1-6676-4f09-a5e0-f80c13b6d2c7
Ancestors: Cog-eem.133

Spur bootstrap:
Fix selectors of replacement methods; these used to be a string
containing ClassPROTOTYPEselector...

Add WideString at: & at:put: primitives.

=============== Diff against Cog-eem.133 ===============

Item was added:
+ ----- Method: SpurBootstrap class>>WideStringPROTOTYPEat: (in category 'method prototypes') -----
+ WideStringPROTOTYPEat: index
+ "Answer the Character stored in the field of the receiver indexed by the
+ argument.  Primitive.  Fail if the index argument is not an Integer or is out
+ of bounds.  Essential.  See Object documentation whatIsAPrimitive."
+
+ <primitive: 63>
+ ^index isInteger
+ ifTrue:
+ [self errorSubscriptBounds: index]
+ ifFalse:
+ [index isNumber
+ ifTrue: [self at: index asInteger]
+ ifFalse: [self errorNonIntegerIndex]]!

Item was added:
+ ----- Method: SpurBootstrap class>>WideStringPROTOTYPEat:put: (in category 'method prototypes') -----
+ WideStringPROTOTYPEat: index put: aCharacter
+ "Store the Character into the field of the receiver indicated by the index.
+ Primitive.  Fail if the index is not an Integer or is out of bounds, or if the
+ argument is not a Character.  Essential.  See Object documentation whatIsAPrimitive."
+
+ <primitive: 64>
+ ^aCharacter isCharacter
+ ifTrue:
+ [index isInteger
+ ifTrue: [self errorSubscriptBounds: index]
+ ifFalse: [self errorNonIntegerIndex]]
+ ifFalse:
+ [self errorImproperStore]!

Item was changed:
  ----- Method: SpurBootstrap>>installableMethodFor:selector:className:isMeta: (in category 'bootstrap methods') -----
  installableMethodFor: aCompiledMethod selector: selector className: className isMeta: isMeta
+ "Create a sourceless method to install in the bootstrapped image.  It will allow the
+ bootstrap to limp along until the relevant transformed Monticello package is loaded."
+ | compiledMethodClass sourcelessMethod bytes newMethod |
- | compiledMethodClass sourcelessMethod bytes newMethod methodClass |
  compiledMethodClass := self findClassNamed: (self findSymbol: #CompiledMethod).
+ "the prototypes have source pointers.  the Character methods to be replaced don't."
- "the prototypes hve source pointers.  the Character methods to be replaced don't."
  sourcelessMethod := aCompiledMethod trailer hasSourcePointer
  ifTrue: [aCompiledMethod copyWithTempsFromMethodNode: aCompiledMethod methodNode]
  ifFalse: [aCompiledMethod].
  bytes := sourcelessMethod size - sourcelessMethod initialPC + 1.
  newMethod := self
  interpreter: oldInterpreter
  object: compiledMethodClass
  perform: (self findSymbol: #newMethod:header:)
  withArguments: { oldHeap integerObjectOf: bytes.
    oldHeap integerObjectOf: sourcelessMethod header }.
+ 1 to: sourcelessMethod numLiterals - 2 do:
- 1 to: sourcelessMethod numLiterals - 1 do:
  [:i| | literal oop |
  literal := sourcelessMethod literalAt: i.
- literal isMethodProperties ifTrue:
- [literal := selector].
  oop := (literal isLiteral or: [literal isVariableBinding])
  ifTrue:
  [literal isInteger
  ifTrue: [oldHeap integerObjectOf: literal]
  ifFalse: [literalMap at: literal ifAbsent: [self findLiteral: literal]]]
  ifFalse: "should be a VMObjectProxy"
  [literal oop].
  oldHeap storePointer: i ofObject: newMethod withValue: oop].
+ oldHeap
+ storePointer: sourcelessMethod numLiterals - 1
+ ofObject: newMethod
+ withValue: (selector isSymbol
+ ifTrue: [self findSymbol: selector]
+ ifFalse: [selector oop]);
+ storePointer: sourcelessMethod numLiterals
+ ofObject: newMethod
+ withValue: (self methodClassForClassName: className
+ isMeta: isMeta).
- methodClass := self methodClassForClassName: className isMeta: isMeta.
- oldHeap storePointer: sourcelessMethod numLiterals ofObject: newMethod withValue: methodClass.
  sourcelessMethod initialPC to: sourcelessMethod size do:
  [:i|
  oldHeap storeByte: i - 1 ofObject: newMethod withValue: (sourcelessMethod byteAt: i)].
  ^newMethod!