[squeak-dev] The Trunk: Kernel-eem.1032.mcz

commits at source.squeak.org commits at source.squeak.org
Thu Jul 7 18:37:18 UTC 2016


Eliot Miranda uploaded a new version of Kernel to project The Trunk:
http://source.squeak.org/trunk/Kernel-eem.1032.mcz

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

Name: Kernel-eem.1032
Author: eem
Time: 7 July 2016, 11:36:43.185017 am
UUID: 0e4a81f4-1688-419a-b951-f0bc7a0b33fd
Ancestors: Kernel-eem.1031

Faster method creation in CompiledMethodTrailer.
Provide CompiledMethod>>voidCogVMState with a fail-over to flushCache, for safe modification of methods.
Provide BlockClosure>>isNestedeWithin: for testing block nesting.

=============== Diff against Kernel-eem.1031 ===============

Item was added:
+ ----- Method: BlockClosure>>isNestedWithin: (in category 'testing') -----
+ isNestedWithin: aContextOrBlock
+ 	"Answer if the receiver is nested within aContextOrBlock, which may be ither a Context, or a BlockClosure."
+ 	aContextOrBlock ifNotNil:
+ 		[self outerContextsDo:
+ 			[:ctxt|
+ 			 (ctxt == aContextOrBlock
+ 			  or: [ctxt closureOrNil = aContextOrBlock]) ifTrue: [^true]]].
+ 	^false!

Item was added:
+ ----- Method: CompiledMethod>>voidCogVMState (in category 'cleaning') -----
+ voidCogVMState
+ 	"Tell the VM to remove all references to any machine code form of the method.
+ 	 This primitive must be called whenever a method is in use and modified.  This is
+ 	 more aggressive (and *much* more costly) than flushCache since it must search
+ 	 through all context objects, making sure that none have a (hidden) machine code pc
+ 	 in the receiver.  Since modifying a method will likely change the generated machine code,
+ 	 modifying a method (rather than redefining it) requires this more aggressive flush."
+ 
+ 	<primitive: 215>
+ 	^self flushCache!

Item was changed:
  ----- Method: CompiledMethodTrailer>>createMethod:class:header: (in category 'creating a method') -----
  createMethod: numberOfBytesForAllButTrailer class: aCompiledMethodClass header: headerWord 
+ 	| meth delta |
- 	| meth |
  	encodedData ifNil: [self encode].
+ 
- 	
  	meth := aCompiledMethodClass newMethod: numberOfBytesForAllButTrailer + size header: headerWord.
  	"copy the encoded trailer data"
+ 	delta := meth size - size.
  	1 to: size do:
+ 		[:i | meth at: delta + i put: (encodedData at: i)].
- 		[:i | meth at: meth size - size + i put: (encodedData at: i)].
  
  	^meth!



More information about the Squeak-dev mailing list