[squeak-dev] The Trunk: Compiler-fbs.183.mcz

commits at source.squeak.org commits at source.squeak.org
Sun Feb 13 18:23:23 UTC 2011

Nicolas Cellier uploaded a new version of Compiler to project The Trunk:

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

Name: Compiler-fbs.183
Author: fbs
Time: 19 December 2010, 10:28:02.599 pm
UUID: 99e9d7d8-0347-5941-8b10-3a187432806e
Ancestors: Compiler-ul.182

Fix for 7588: Decompiler>>interpretNextInstructionFor: bitrot:

If you change the first statement in the above-mentioned method to

  false ifTrue: [^ super interpretNextInstructionFor: client].

you will print out debug information. Or you would if you didn't get an exception printing out the bytecode. "code copyFrom: 4 to: code size" fails because it tries to make a String of size -2. That's because code at this point is something like '70' if you're currently interpreting bytecode 112.

Changing the offending line to "nextPutAll: '<', code, '>' fixes things.

=============== Diff against Compiler-ul.182 ===============

Item was changed:
  ----- Method: Decompiler>>interpretNextInstructionFor: (in category 'private') -----
  interpretNextInstructionFor: client
  	| code varNames |
  "Change false here will trace all state in Transcript."
  true ifTrue: [^ super interpretNextInstructionFor: client].
  	varNames := self class allInstVarNames.
  	code := (self method at: pc) radix: 16.
  	Transcript cr; cr; print: pc; space;
+ 		nextPutAll: '<' , code, '>'.
- 		nextPutAll: '<' , (code copyFrom: 4 to: code size), '>'.
  	8 to: varNames size do:
  		[:i | i <= 10 ifTrue: [Transcript cr]
  				ifFalse: [Transcript space; space].
  		Transcript nextPutAll: (varNames at: i);
  				nextPutAll: ': '; print: (self instVarAt: i)].
  	Transcript endEntry.
  	^ super interpretNextInstructionFor: client!

More information about the Squeak-dev mailing list