The Inbox: Kernel-ct.1366.mcz

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

The Inbox: Kernel-ct.1366.mcz

commits-2
A new version of Kernel was added to project The Inbox:
http://source.squeak.org/inbox/Kernel-ct.1366.mcz

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

Name: Kernel-ct.1366
Author: ct
Time: 14 November 2020, 8:01:50.976394 pm
UUID: a199c41b-1cc3-3d46-bb2b-82bba86f684a
Ancestors: Kernel-eem.1361

Complements Compiler-ct.453 and Compiler-ct.452 (both in inbox at this moment).

=============== Diff against Kernel-eem.1361 ===============

Item was changed:
  ----- Method: Behavior>>recompile:from: (in category 'compiling') -----
  recompile: selector from: oldClass
  "Compile the method associated with selector in the receiver's method dictionary."
  "ar 7/10/1999: Use oldClass compiledMethodAt: not self compiledMethodAt:"
  | method trailer methodNode |
  method := oldClass compiledMethodAt: selector.
  trailer := method trailer.
  methodNode := self newCompiler
+ compile: (oldClass sourceCodeAt: selector)
+ in: self.
- compile: (oldClass sourceCodeAt: selector)
- in: self
- notifying: nil
- ifFail: [^ self].   "Assume OK after proceed from SyntaxError"
  selector == methodNode selector ifFalse: [self error: 'selector changed!!'].
+ self basicAddSelector: selector withMethod: (methodNode generate: trailer).!
- self basicAddSelector: selector withMethod: (methodNode generate: trailer).
- !

Item was changed:
  ----- Method: Behavior>>recompileNonResidentMethod:atSelector:from: (in category 'compiling') -----
  recompileNonResidentMethod: method atSelector: selector from: oldClass
  "Recompile the method supplied in the context of this class."
 
  | trailer methodNode |
  trailer := method trailer.
  methodNode := self newCompiler
+ compile: (method getSourceFor: selector in: oldClass)
+ in: self.
- compile: (method getSourceFor: selector in: oldClass)
- in: self
- notifying: nil
- ifFail: ["We're in deep doo-doo if this fails (syntax error).
- Presumably the user will correct something and proceed,
- thus installing the result in this methodDict.  We must
- retrieve that new method, and restore the original (or remove)
- and then return the method we retrieved."
- ^ self error: 'see comment'].
  selector == methodNode selector ifFalse: [self error: 'selector changed!!'].
+ ^ methodNode generate: trailer!
- ^ methodNode generate: trailer
- !

Item was changed:
  ----- Method: Behavior>>sourceMatchesBytecodeAt: (in category 'testing') -----
  sourceMatchesBytecodeAt: selector
  "Answers true if the source code at the selector compiles to the bytecode at the selector, and false otherwise. Implemented to detect an error where Monticello did not recompile sources when the class shape changed"
  "This code was copied from #recompile:from:, with few changes. Several methods would benefit from a method which turned a selector and class into a CompiledMethod, without  installing it into the methodDictionary"
 
  | method trailer methodNode |
  method := self compiledMethodAt: selector.
  trailer := method trailer.
  methodNode := self newCompiler
+ compile: (self sourceCodeAt: selector)
+ in: self.
- compile: (self sourceCodeAt: selector)
- in: self
- notifying: nil
- ifFail: [^ false].   "Assume OK after proceed from SyntaxError"
  selector == methodNode selector ifFalse: [self error: 'selector changed!!'].
  ^ (methodNode generate: trailer) = method!