Eliot Miranda uploaded a new version of Kernel to project The Trunk:
http://source.squeak.org/trunk/Kernel-eem.703.mcz==================== Summary ====================
Name: Kernel-eem.703
Author: eem
Time: 4 July 2012, 1:52:09.978 pm
UUID: 072b8788-6194-499e-99f3-877f353d3f8e
Ancestors: Kernel-bf.702
Fix copying of the AdditionalMethodState on CompiledMethod
copy. Fix setting copied pragmas' methods to the copied
method for both CompiledMethod>>copyWithTrailerBytes: and
CompiledMethod>>copy.
=============== Diff against Kernel-bf.702 ===============
Item was changed:
+ ----- Method: CompiledMethod>>copyWithTrailerBytes: (in category 'copying') -----
- ----- Method: CompiledMethod>>copyWithTrailerBytes: (in category 'initialize-release') -----
copyWithTrailerBytes: trailer
"Testing:
(CompiledMethod compiledMethodAt: #copyWithTrailerBytes:)
tempNamesPut: 'copy end '
"
| copy end start penultimateLiteral |
start := self initialPC.
end := self endPC.
copy := trailer createMethod: end - start + 1 class: self class header: self header.
1 to: self numLiterals do: [:i | copy literalAt: i put: (self literalAt: i)].
(penultimateLiteral := self penultimateLiteral) isMethodProperties ifTrue:
[copy penultimateLiteral: (penultimateLiteral copy
setMethod: copy;
+ yourself).
+ self pragmas do:
+ [:p| p setMethod: self]].
- yourself)].
start to: end do: [:i | copy at: i put: (self at: i)].
^copy!
Item was added:
+ ----- Method: CompiledMethod>>postCopy (in category 'copying') -----
+ postCopy
+ | penultimateLiteral |
+ (penultimateLiteral := self penultimateLiteral) isMethodProperties ifTrue:
+ [self penultimateLiteral: (penultimateLiteral copy
+ setMethod: self;
+ yourself).
+ self pragmas do:
+ [:p| p setMethod: self]]!
Item was removed:
- ----- Method: CompiledMethodTrailer>>createMethod:header: (in category 'creating a method') -----
- createMethod: numberOfBytesForAllButTrailer header: headerWord
- | meth |
-
- encodedData ifNil: [ self encode ].
-
- "without >>self compiledMethodClass<<, subclassing CompiledMethod is duplicating code"
- meth := self compiledMethodClass newMethod: numberOfBytesForAllButTrailer + size header: headerWord.
-
- "copy the encoded trailer data"
-
- 1 to: size do:
- [:i | meth at: meth size - size + i put: (encodedData at: i)].
-
- ^ meth!