[Pkg] The Trunk: Compiler-eem.155.mcz

commits at source.squeak.org commits at source.squeak.org
Sun Aug 15 01:21:20 UTC 2010

Eliot Miranda uploaded a new version of Compiler to project The Trunk:

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

Name: Compiler-eem.155
Author: eem
Time: 14 August 2010, 6:21:02.179 pm
UUID: e1d7ed32-bfbf-47c8-9a5e-8420449259ba
Ancestors: Compiler-eem.154

Fix comment and computation of error temp push in
BytecodeAgnosticMethodNode>>generate:.  Remove
a couple of unused methods.

=============== Diff against Compiler-eem.154 ===============

Item was changed:
  ----- Method: BytecodeAgnosticMethodNode>>generate: (in category 'code generation (new scheme)') -----
  generate: trailer 
  	"The receiver is the root of a parse tree. Answer a CompiledMethod.
+ 	 The argument, trailer, is arbitrary but is typically either the reference
+ 	 to the source code that is stored with every CompiledMethod, or an
+ 	 encoding of the method's temporary names."
- 	 The argument, trailer, is the reference to the source code that is
- 	 stored with every CompiledMethod."
  	| primErrNode blkSize nLits literals stack method |
  	self generate: trailer ifQuick:
  			[:m |
  			  m	literalAt: 2 put: encoder associationForClass;
  				properties: properties.
  	primErrNode := self primitiveErrorVariableName ifNotNil:
  						[encoder fixTemp: self primitiveErrorVariableName].
  	encoder supportsClosureOpcodes ifTrue:
  		[self ensureClosureAnalysisDone.
  		 encoder rootNode: self. "this is for BlockNode>>sizeCodeForClosureValue:"].
  	blkSize := (block sizeCodeForEvaluatedValue: encoder)
+ 				+ (primErrNode
+ 					ifNil: [0]
+ 					ifNotNil: [primErrNode sizeCodeForStore: encoder "The VM relies on storeIntoTemp: (129)"]).
- 				+ (primErrNode ifNil: [0] ifNotNil: [2 "We force store-long (129)"]).
  	method := CompiledMethod
  				newBytes: blkSize
  				trailerBytes: trailer 
  				nArgs: arguments size
  				nTemps: (encoder supportsClosureOpcodes
  							ifTrue: [| locals |
  									locals := arguments,
  												ifNil: [#()]
  												ifNotNil: [{primErrNode}]).
  										noteBlockExtent: block blockExtent
  										hasLocals: locals.
  									locals size]
  							ifFalse: [encoder maxTemp])
  				nStack: 0
  				nLits: (nLits := (literals := encoder allLiterals) size)
  				primitive: primitive.
  	nLits > 255 ifTrue:
  		[^self error: 'Too many literals referenced'].
  	1 to: nLits do: [:lit | method literalAt: lit put: (literals at: lit)].
  	encoder streamToMethod: method.
  	stack := ParseStack new init.
  	primErrNode ifNotNil: [primErrNode emitCodeForStore: stack encoder: encoder].
  	stack position: method numTemps.
  	block emitCodeForEvaluatedValue: stack encoder: encoder.
  	stack position ~= (method numTemps + 1) ifTrue:
  		[^self error: 'Compiler stack discrepancy'].
  	encoder methodStreamPosition ~= (method size - trailer size) ifTrue:
  		[^self error: 'Compiler code size discrepancy'].
  	method needsFrameSize: stack size - method numTemps.
  	method properties: properties.

Item was removed:
- ----- Method: TempVariableNode>>cleanUpForRegeneration (in category 'debugger access') -----
- cleanUpForRegeneration
- 	remoteNode := nil.
- 	definingScope := writingScopes := readingScopes := nil!

Item was removed:
- ----- Method: BytecodeEncoder>>schematicTempNamesOn:blockExtents:fromIndex: (in category 'results') -----
- schematicTempNamesOn: aStream blockExtents: blockExtents fromIndex: startIndex
- 	"Print the locals in the blockExtent startIndex, recursing to print any locals in nested blockExtents.
- 	 Answer the index of the last blockExtent printed."
- 	| blockExtent subsequentIndex |
- 	blockExtent := blockExtents at: startIndex.
- 	((blockExtentsToLocals at: blockExtent) reject: [:local| local isRemote]) do:
- 		[:local|
- 		local isIndirectTempVector
- 			ifTrue: [local remoteTemps do:
- 						[:remoteLocal| aStream nextPut: remoteLocal key]]
- 			ifFalse: [aStream nextPut: local key]].
- 	subsequentIndex := startIndex + 1.
- 	[subsequentIndex <= blockExtents size
- 	 and: [(blockExtents at: subsequentIndex) last < blockExtent last]] whileTrue:
- 		[aStream nextPut: (Array streamContents:
- 				[:nestedTempStream|
- 				subsequentIndex := self schematicTempNamesOn: nestedTempStream
- 										blockExtents: blockExtents
- 										fromIndex: subsequentIndex])].
- 	^subsequentIndex!

More information about the Packages mailing list