[Pkg] The Trunk: Kernel-bf.673.mcz

commits at source.squeak.org commits at source.squeak.org
Mon Mar 19 19:08:13 UTC 2012

Bert Freudenberg uploaded a new version of Kernel to project The Trunk:

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

Name: Kernel-bf.673
Author: bf
Time: 19 March 2012, 8:07:23.064 pm
UUID: ed8f09cb-8fd5-4bbe-b9a6-1aab2d7f0dc0
Ancestors: Kernel-cmm.672

Fix decompileWithTemps (moving the better logic the Browser used into CompiledMethod), and use it when getting a method node. This makes the Debugger see the same decompiled source as the Browser.

=============== Diff against Kernel-cmm.672 ===============

Item was changed:
  ----- Method: CompiledMethod>>decompileWithTemps (in category 'decompiling') -----
  	"Return the decompiled parse tree that represents self, but get the temp names
  	 by compiling the sourcecode..."
+ 	|  class selector tempNames |
- 	|  class selector |
  	class := self methodClass ifNil: [Object].
  	selector := self selector ifNil: [self defaultSelector].
  	(self fileIndex > 0 and: [(SourceFiles at: self fileIndex) isNil]) ifTrue: [
  			"Emergency or no source file -- decompile without temp names "
  			^self decompile.
+ 	tempNames := (class newCompiler
+ 									parse: self getSourceFromFile asString
+ 									in: class
+ 									notifying: nil)
+ 										generate: CompiledMethodTrailer defaultMethodTrailer;
+ 										schematicTempNamesString.
+ 	^((self decompilerClass new withTempNames: tempNames)
- 	^((self decompilerClass new withTempNames: self methodNode schematicTempNamesString)
  						decompile: selector
  						in: class
  						method: self methodForDecompile)!

Item was changed:
  ----- Method: CompiledMethod>>methodNode (in category 'decompiling') -----
  	"Return the parse tree that represents self. If parsing fails, decompile the method."
  	| aClass source |
  	aClass := self methodClass.
  	source := self
  				getSourceFor: (self selector ifNil: [self defaultSelector])
  				in: aClass.
  	^[(aClass newParser
  		encoderClass: (self isBlueBookCompiled
  						ifTrue: [EncoderForV3]
  						ifFalse: [EncoderForV3PlusClosures]);
  		parse: source class: aClass)
  			sourceText: source;
  		on: SyntaxErrorNotification
+ 		do: [:ex | ex return: self decompileWithTemps].!
- 		do: [:ex | ex return: self decompile].!

More information about the Packages mailing list