The Trunk: Kernel-ul.1177.mcz

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

The Trunk: Kernel-ul.1177.mcz

commits-2
Levente Uzonyi uploaded a new version of Kernel to project The Trunk:
http://source.squeak.org/trunk/Kernel-ul.1177.mcz

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

Name: Kernel-ul.1177
Author: ul
Time: 13 June 2018, 1:03:47.457054 pm
UUID: dc254e2c-2779-4559-a782-f47fbcebf69a
Ancestors: Kernel-ul.1176

ClassDescription changes
- move compilation logic from all compile* methods to #compile:environment:classified:withStamp:notifying:logSource:
- added #compileSilently:environment:classified:notifying:, which let's you specify the environment while compiling a method silently

=============== Diff against Kernel-ul.1176 ===============

Item was changed:
  ----- Method: ClassDescription>>compile:classified:withStamp:notifying:logSource: (in category 'compiling') -----
  compile: text classified: category withStamp: changeStamp notifying: requestor logSource: logSource
+
+ ^self
+ compile: text
+ environment: (CurrentEnvironment signal ifNil: [ self environment ])
+ classified: category
+ withStamp: changeStamp
- | methodAndNode selector |
- methodAndNode := self
- compile: text asString
  notifying: requestor
+ logSource: logSource!
- trailer: (self defaultMethodTrailerIfLogSource: logSource)
- ifFail: [ ^ nil ].
- selector := methodAndNode selector.
- logSource ifTrue:
- [ self
- logMethodSource: text
- forMethodWithNode: methodAndNode
- inCategory: category
- withStamp: changeStamp
- notifying: requestor.
- RecentMessages default
- recordSelector: selector
- forClass: methodAndNode method methodClass
- inEnvironment: CurrentEnvironment signal ].
- self
- addAndClassifySelector: selector
- withMethod: methodAndNode method
- inProtocol: category
- notifying: requestor.
- self instanceSide
- noteCompilationOf: selector
- meta: self isClassSide.
- ^ selector!

Item was changed:
  ----- Method: ClassDescription>>compile:environment:classified:withStamp:notifying:logSource: (in category 'compiling') -----
  compile: text environment: anEnvironment classified: category withStamp: changeStamp notifying: requestor logSource: logSource
+
+ | methodAndNode context methodNode selector |
- | methodAndNode context methodNode |
  context := CompilationCue
  source: text
  class: self
  environment: anEnvironment
  requestor: requestor.
  methodNode := self newCompiler compile: context ifFail: [^ nil].
  methodAndNode := CompiledMethodWithNode
  generateMethodFromNode: methodNode
  trailer: (self defaultMethodTrailerIfLogSource: logSource).
+ selector := methodAndNode selector.
-
  logSource ifTrue: [
+ self
+ logMethodSource: text
+ forMethodWithNode: methodAndNode
+ inCategory: category
+ withStamp: changeStamp
+ notifying: requestor.
+ RecentMessages default
+ recordSelector: selector
+ forClass: methodAndNode method methodClass
+ inEnvironment: anEnvironment ].
+ self
+ addAndClassifySelector: selector
+ withMethod: methodAndNode method
+ inProtocol: category
+ notifying: requestor.
+ self instanceSide
+ noteCompilationOf: selector
+ meta: self isClassSide.
+ ^selector!
- self logMethodSource: text forMethodWithNode: methodAndNode
- inCategory: category withStamp: changeStamp notifying: requestor.
- ].
- self addAndClassifySelector: methodAndNode selector withMethod: methodAndNode
- method inProtocol: category notifying: requestor.
- self instanceSide noteCompilationOf: methodAndNode selector meta: self isClassSide.
- ^ methodAndNode selector!

Item was changed:
  ----- Method: ClassDescription>>compileSilently:classified:notifying: (in category 'compiling') -----
  compileSilently: code classified: category notifying: requestor
  "Compile the code and classify the resulting method in the given category, leaving no trail in the system log, nor in any change set, nor in the 'recent submissions' list. This should only be used when you know for sure that the compilation will succeed."
 
+ ^self
+ compileSilently: code
+ environment: (CurrentEnvironment signal ifNil: [ self environment ])
+ classified: category
+ notifying: requestor!
- ^ SystemChangeNotifier uniqueInstance
- doSilently: [self compile: code classified: category withStamp: nil notifying: requestor logSource: false].!

Item was added:
+ ----- Method: ClassDescription>>compileSilently:environment:classified:notifying: (in category 'compiling') -----
+ compileSilently: code environment: anEnvironment classified: category notifying: requestor
+ "Compile the code and classify the resulting method in the given category, leaving no trail in the system log, nor in any change set, nor in the 'recent submissions' list. This should only be used when you know for sure that the compilation will succeed."
+
+ ^SystemChangeNotifier uniqueInstance doSilently: [
+ self
+ compile: code
+ environment: anEnvironment
+ classified: category
+ withStamp: nil
+ notifying: requestor
+ logSource: false ]!