'From Cuis 1.0 of 28 November 2009 [latest update: #337] on 9 December 2009 at 12:14:17 am'!

!Object methodsFor: 'as yet unclassified' stamp: 'jmv 12/9/2009 00:13'!
isMethodProperties
	^false! !


!AbstractEvent methodsFor: 'testing' stamp: 'jmv 12/9/2009 00:10'!
isDoIt

	^false! !


!AbstractEvent class methodsFor: 'testing' stamp: 'jmv 12/9/2009 00:09'!
isModified

	^false! !


!CompiledMethod methodsFor: 'literals' stamp: 'jmv 12/9/2009 00:03'!
literalAt: index put: value
	"Replace the literal indexed by the first argument with the second 
	argument. Answer the second argument."

	^self objectAt: index + 1 put: value! !

!CompiledMethod methodsFor: 'literals' stamp: 'jmv 12/9/2009 00:10'!
objectAt: index put: value
	"Primitive. Store the value argument into a literal in the receiver. An 
	index of 2 corresponds to the first literal. Fails if the index is less than 2 
	or greater than the number of literals. Answer the value as the result. 
	Normally only the compiler sends this message, because only the 
	compiler stores values in CompiledMethods. Essential. See Object 
	documentation whatIsAPrimitive."

	<primitive: 69>
	self primitiveFailed! !


!CompiledMethod class methodsFor: 'instance creation' stamp: 'md 7/14/2006 21:21'!
newBytes: numberOfBytes trailerBytes: trailer nArgs: nArgs nTemps: nTemps nStack: stackSize nLits: nLits primitive: primitiveIndex
	"Answer an instance of me. The header is specified by the message 
	arguments. The remaining parts are not as yet determined."
	| largeBit primBits method |
	nTemps > 63 ifTrue:
		[^ self error: 'Cannot compile -- too many temporary variables'].	
	nLits > 255 ifTrue:
		[^ self error: 'Cannot compile -- too many literals variables'].	
	largeBit := (nTemps + stackSize) > SmallFrame ifTrue: [1] ifFalse: [0].
	primBits := primitiveIndex <= 16r1FF
		ifTrue: [primitiveIndex]
		ifFalse: ["For now the high bit of primitive no. is in the 29th bit of header"
				primitiveIndex > 16r3FF ifTrue: [self error: 'prim num too large'].
				(primitiveIndex bitAnd: 16r1FF) + ((primitiveIndex bitAnd: 16r200) bitShift: 19)].
	method := self newMethod: numberOfBytes + trailer size
		header: (nArgs bitShift: 24) +
				(nTemps bitShift: 18) +
				(largeBit bitShift: 17) +
				(nLits bitShift: 9) +
				primBits.
	1 to: trailer size do:  "Copy the source code trailer to the end"
		[:i | method at: method size - trailer size + i put: (trailer at: i)].
	^ method! !

!CompiledMethod class methodsFor: 'instance creation' stamp: 'md 7/14/2006 21:21'!
newBytes: numberOfBytes trailerBytes: trailer nArgs: nArgs nTemps: nTemps nStack: stackSize nLits: nLits primitive: primitiveIndex flag: flag
	"Answer an instance of me. The header is specified by the message 
	arguments. The remaining parts are not as yet determined."
	| largeBit primBits method flagBit |
	nTemps > 63 ifTrue:
		[^ self error: 'Cannot compile -- too many temporary variables'].	
	nLits > 255 ifTrue:
		[^ self error: 'Cannot compile -- too many literals variables'].	
	largeBit := (nTemps + stackSize) > SmallFrame ifTrue: [1] ifFalse: [0].

	"For now the high bit of the primitive no. is in a high bit of the header"
	primBits := (primitiveIndex bitAnd: 16r1FF) + ((primitiveIndex bitAnd: 16r200) bitShift: 19).

	flagBit := flag ifTrue: [ 1 ] ifFalse: [ 0 ].

	method := self newMethod: numberOfBytes + trailer size
		header: (nArgs bitShift: 24) +
				(nTemps bitShift: 18) +
				(largeBit bitShift: 17) +
				(nLits bitShift: 9) +
				primBits +
				(flagBit bitShift: 29).

	"Copy the source code trailer to the end"
	1 to: trailer size do:
		[:i | method at: method size - trailer size + i put: (trailer at: i)].

	^ method! !

!CompiledMethod class methodsFor: 'instance creation' stamp: 'md 8/5/2005 17:06'!
toReturnConstant: index trailerBytes: trailer
	"Answer an instance of me that is a quick return of the constant
	indexed in (true false nil -1 0 1 2)."

	^ self newBytes: 0 trailerBytes: trailer nArgs: 0 nTemps: 0 nStack: 0 nLits: 2 primitive: 256 + index
! !

!CompiledMethod class methodsFor: 'instance creation' stamp: 'md 8/5/2005 17:06'!
toReturnField: field trailerBytes: trailer
	"Answer an instance of me that is a quick return of the instance variable 
	indexed by the argument, field."

	^ self newBytes: 0 trailerBytes: trailer nArgs: 0 nTemps: 0 nStack: 0 nLits: 2 primitive: 264 + field
! !

!CompiledMethod class methodsFor: 'instance creation' stamp: 'md 8/5/2005 17:05'!
toReturnSelfTrailerBytes: trailer
	"Answer an instance of me that is a quick return of the instance (^self)."

	^ self newBytes: 0 trailerBytes: trailer nArgs: 0 nTemps: 0 nStack: 0 nLits: 2 primitive: 256
! !


!Inspector methodsFor: 'selecting' stamp: 'jmv 12/8/2009 23:58'!
selectedSlotName

	^ self fieldList at: (self selectionIndex ifNil: [^nil]) ifAbsent: []! !


!LazyListMorph methodsFor: 'list management' stamp: 'jmv 12/8/2009 23:57'!
drawBoundsForRow: row
	"calculate the bounds that row should be drawn at.  This might be outside our bounds!!"
	| topLeft drawBounds |
	row ifNil: [^self].
	topLeft := self topLeft x @ (self topLeft y + ((row - 1) * (font height))).
	drawBounds := topLeft extent: self width @ font height.
	^drawBounds! !


!MethodReference class methodsFor: 'instance creation' stamp: 'jmv 12/8/2009 23:23'!
class: aClass selector: aSelector
	^ self new setStandardClass: aClass methodSymbol: aSelector! !


!NonClosureParser methodsFor: 'as yet unclassified' stamp: 'jmv 12/8/2009 23:59'!
encoderClass: anEncoderClass
! !


!Preferences class methodsFor: 'standard queries' stamp: 'jmv 12/9/2009 00:13'!
fullScreenLeavesDeskMargins
	^ self
		valueOfFlag: #fullScreenLeavesDeskMargins
		ifAbsent: [true]! !


!SystemDictionary methodsFor: 'Compiler swapping' stamp: 'jmv 12/9/2009 00:00'!
usingClosureCompiler
	^false not! !


!MethodReference class reorganize!
('instance creation' class:selector:)
!

