[FIX][BC] Minor BC fixes

Anthony Hannan tony.hannan at verizon.net
Thu May 30 16:39:04 UTC 2002


from preamble:

Change Set:		MinorBCFixes-ajh
Date:			30 May 2002
Author:			Anthony Hannan

Minor fixes to CompiledMethod2 #= and MethodContext2 #isDead that was causing problems for Ken Dickey.  Thanks to Ken for finding the bugs.

Ken, this will fix your latest problem.

Cheers,
Anthony

------=____1022776744750_J7GehbJMvk
Content-Type: text/plain;
	name="MinorBCFixes-ajh.cs"
Content-Disposition: inline;
	filename="MinorBCFixes-ajh.cs"

'From Squeak3.2gamma[BC] of 15 January 2002 [latest update: #4743] on 30 May 2002 at 12:33:41 pm'!
"Change Set:		MinorBCFixes-ajh
Date:			30 May 2002
Author:			Anthony Hannan

Minor fixes to CompiledMethod2 #= and MethodContext2 #isDead that was causing problems for Ken Dickey.  Thanks to Ken for finding the bugs."!


!CompiledMethod2 methodsFor: 'testing' stamp: 'ajh 5/30/2002 12:22'!
= method
	"Answer whether the receiver implements the same code as method."

	(method isKindOf: CompiledMethod2) ifFalse: [^ false].
	self size = method size ifFalse: [^ false].
	header = method header ifFalse: [^ false].
	bytecodes = method bytecodes ifFalse: [^ false].
	1 to: self size do: [:i |
		(self at: i) = (method at: i) ifFalse: [^ false]].
	^ true! !

!CompiledMethod2 methodsFor: 'testing' stamp: 'ajh 5/30/2002 12:23'!
hash

	^ bytecodes hash! !


!MethodContext2 methodsFor: 'testing' stamp: 'ajh 5/24/2002 11:00'!
isDead
	"A frame becomes dead once execution returns from it (once it is popped)"

	stack size < (frameIndex + FrameActiveOffset) ifTrue: [^ true].
	(stack at: frameIndex + FrameActiveOffset) == self ifFalse: [^ true].
	"very rare but the above could be true even if self is dead, if it just happened to be put on the stack by another frame in the same place where it used to reside."
	(stack at: frameIndex + FrameMethodOffset) class == CompiledMethod2 ifFalse: [^ true].
	"The last two conditions combined are very very rare if self is dead, so we can assume self is not dead"
	^ false! !


More information about the Squeak-dev mailing list