[squeak-dev] The Trunk: Kernel-nice.542.mcz

commits at source.squeak.org commits at source.squeak.org
Fri Feb 4 00:01:26 UTC 2011


Nicolas Cellier uploaded a new version of Kernel to project The Trunk:
http://source.squeak.org/trunk/Kernel-nice.542.mcz

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

Name: Kernel-nice.542
Author: nice
Time: 4 February 2011, 1:00:46.508 am
UUID: ea1d8beb-aa2d-4cf3-8389-2072df48f6e3
Ancestors: Kernel-ul.541

thu shalt not invoke super in vain

=============== Diff against Kernel-ul.541 ===============

Item was changed:
  Dictionary variableSubclass: #MethodDictionary
  	instanceVariableNames: ''
  	classVariableNames: ''
  	poolDictionaries: ''
  	category: 'Kernel-Methods'!
  
+ !MethodDictionary commentStamp: 'nice 2/1/2011 02:47' prior: 0!
+ I am a special dictionary holding methods. I am just like a normal Dictionary, except that I am implemented differently.  Each Class has an instance of MethodDictionary to hold the correspondence between selectors (names of methods) and methods themselves.
- !MethodDictionary commentStamp: 'ul 10/30/2009 04:43' prior: 0!
- I am just like a normal Dictionary, except that I am implemented differently.  Each Class has an instances of MethodDictionary to hold the correspondence between selectors (names of methods) and methods themselves.
  
  In a normal Dictionary, the instance variable 'array' holds an array of Associations.  Since there are thousands of methods in the system, these Associations waste space.  
  
  Each MethodDictionary is a variable object, with the list of keys (selector Symbols) in the variable part of the instance.  The variable 'array' holds the values, which are CompiledMethods.
  
  I also maintain the following invariant: (self basicAt: index) isNil = (array at: index) isNil.!

Item was changed:
  ----- Method: MethodDictionary>>includesKey: (in category 'accessing') -----
  includesKey: aSymbol
+ 	"This override assumes that instVarsInclude: uses a fast primitive"
- 	"This override assumes that pointsTo is a fast primitive"
  
  	aSymbol ifNil: [^ false].
+ 	^ self instVarsInclude: aSymbol!
- 	^ super instVarsInclude: aSymbol!




More information about the Squeak-dev mailing list