The Inbox: Kernel-ul.978.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-ul.978.mcz

commits-2
Levente Uzonyi uploaded a new version of Kernel to project The Inbox:
http://source.squeak.org/inbox/Kernel-ul.978.mcz

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

Name: Kernel-ul.978
Author: ul
Time: 10 January 2016, 10:59:22.308768 pm
UUID: 7bfcfeab-67b7-498a-80ef-f1f4db04e8a5
Ancestors: Kernel-ul.977

Cleaned up #flushCache usage as suggested by Eliot.

=============== Diff against Kernel-ul.977 ===============

Item was changed:
  ----- Method: Behavior>>basicAddSelector:withMethod: (in category 'adding/removing methods') -----
  basicAddSelector: selector withMethod: compiledMethod
  "Add the message selector with the corresponding compiled method to the
  receiver's method dictionary.
  Do this without sending system change notifications"
 
- | oldMethodOrNil |
- oldMethodOrNil := self lookupSelector: selector.
  self methodDict at: selector put: compiledMethod.
  compiledMethod methodClass: self.
  compiledMethod selector: selector.
 
+ "Flush the method cache entries for this selector."
- "Now flush Squeak's method cache, either by selector or by method"
- oldMethodOrNil == nil ifFalse: [oldMethodOrNil flushCache].
  selector flushCache.!

Item was changed:
  ----- Method: Behavior>>basicRemoveSelector: (in category 'adding/removing methods') -----
  basicRemoveSelector: selector
  "Assuming that the argument, selector (a Symbol), is a message selector
  in my method dictionary, remove it and its method. Returns the old method
  if found, nil otherwise."
 
  | oldMethod |
  oldMethod := self methodDict at: selector ifAbsent: [^ nil].
  self methodDict removeKey: selector.
 
+ "Flush the method cache entries for this selector."
- "Now flush Squeak's method cache, either by selector or by method"
- oldMethod flushCache.
  selector flushCache.
  ^oldMethod!

Item was changed:
  ----- Method: MethodDictionary>>at:put: (in category 'accessing') -----
  at: key put: value
  "Set the value at key to be value."
 
  | index |
  index := self scanFor: key.
+ (self basicAt: index) ifNotNil: [
+ ^array at: index put: value ].
+ ^self
+ basicAt: index put: key;
+ atNewIndex: index put: value!
- (self basicAt: index)
- ifNil: [
- self
- basicAt: index put: key;
- atNewIndex: index put: value ]
- ifNotNil: [
- (array at: index) flushCache.
- array at: index put: value ].
- ^value!