Eliot Miranda uploaded a new version of Kernel to project The Trunk:
http://source.squeak.org/trunk/Kernel-eem.470.mcz ==================== Summary ==================== Name: Kernel-eem.470 Author: eem Time: 2 July 2010, 10:42:57.84 am UUID: c0ed6502-acb0-4ab5-a352-16274fceec1a Ancestors: Kernel-eem.469 Fix the other dependencies of asContextWithSender: =============== Diff against Kernel-eem.469 =============== Item was changed: ----- Method: BlockClosure>>value:value: (in category 'evaluating') ----- value: firstArg value: secondArg "Activate the receiver, creating a closure activation (MethodContext) + whose closure is the receiver and whose caller is the sender of this + message. Supply the arguments and copied values to the activation + as its arguments and copied temps. Primitive. Essential." + <primitive: 205> + | newContext | - whose closure is the receiver and whose caller is the sender of this message. - Supply the arguments and copied values to the activation as its arguments and copied temps. - Primitive. Optional (but you're going to want this for performance)." - | newContext ncv | - <primitive: 203> numArgs ~= 2 ifTrue: [self numArgsError: 2]. + false + ifTrue: "Old code to simulate the closure value primitive on VMs that lack it." + [newContext := self asContextWithSender: thisContext sender. + newContext at: 1 put: firstArg. + newContext at: 2 put: secondArg. + thisContext privSender: newContext] + ifFalse: [self primitiveFailed]! - newContext := self asContextWithSender: thisContext sender. - ncv := self numCopiedValues. - newContext stackp: ncv + 2. - newContext at: 1 put: firstArg. - newContext at: 2 put: secondArg. - 1 to: ncv do: - [:i| newContext at: i + 2 put: (self at: i)]. - thisContext privSender: newContext! Item was changed: ----- Method: BlockClosure>>value:value:value:value: (in category 'evaluating') ----- value: firstArg value: secondArg value: thirdArg value: fourthArg "Activate the receiver, creating a closure activation (MethodContext) + whose closure is the receiver and whose caller is the sender of this + message. Supply the arguments and copied values to the activation + as its arguments and copied temps. Primitive. Essential." - whose closure is the receiver and whose caller is the sender of this message. - Supply the arguments and copied values to the activation as its arguments and copied temps. - Primitive. Optional (but you're going to want this for performance)." - | newContext ncv | <primitive: 205> + | newContext | numArgs ~= 4 ifTrue: [self numArgsError: 4]. + false + ifTrue: "Old code to simulate the closure value primitive on VMs that lack it." + [newContext := self asContextWithSender: thisContext sender. + newContext at: 1 put: firstArg. + newContext at: 2 put: secondArg. + newContext at: 3 put: thirdArg. + newContext at: 4 put: fourthArg. + thisContext privSender: newContext] + ifFalse: [self primitiveFailed]! - newContext := self asContextWithSender: thisContext sender. - ncv := self numCopiedValues. - newContext stackp: ncv + 4. - newContext at: 1 put: firstArg. - newContext at: 2 put: secondArg. - newContext at: 3 put: thirdArg. - newContext at: 4 put: fourthArg. - 1 to: ncv do: - [:i| newContext at: i + 4 put: (self at: i)]. - thisContext privSender: newContext! Item was changed: ----- Method: BlockClosure>>value:value:value: (in category 'evaluating') ----- value: firstArg value: secondArg value: thirdArg "Activate the receiver, creating a closure activation (MethodContext) + whose closure is the receiver and whose caller is the sender of this + message. Supply the arguments and copied values to the activation + as its arguments and copied temps. Primitive. Essential." + <primitive: 205> + | newContext | - whose closure is the receiver and whose caller is the sender of this message. - Supply the arguments and copied values to the activation as its arguments and copied temps. - Primitive. Optional (but you're going to want this for performance)." - | newContext ncv | - <primitive: 204> numArgs ~= 3 ifTrue: [self numArgsError: 3]. + false + ifTrue: "Old code to simulate the closure value primitive on VMs that lack it." + [newContext := self asContextWithSender: thisContext sender. + newContext at: 1 put: firstArg. + newContext at: 2 put: secondArg. + newContext at: 3 put: thirdArg. + thisContext privSender: newContext] + ifFalse: [self primitiveFailed]! - newContext := self asContextWithSender: thisContext sender. - ncv := self numCopiedValues. - newContext stackp: ncv + 3. - newContext at: 1 put: firstArg. - newContext at: 2 put: secondArg. - newContext at: 3 put: thirdArg. - 1 to: ncv do: - [:i| newContext at: i + 3 put: (self at: i)]. - thisContext privSender: newContext! Item was changed: ----- Method: BlockClosure>>value (in category 'evaluating') ----- value "Activate the receiver, creating a closure activation (MethodContext) + whose closure is the receiver and whose caller is the sender of this + message. Supply the copied values to the activation as its copied + temps. Primitive. Essential." + <primitive: 205> + | newContext | + numArgs ~= 1 ifTrue: + [self numArgsError: 1]. + false + ifTrue: "Old code to simulate the closure value primitive on VMs that lack it." + [newContext := self asContextWithSender: thisContext sender. + thisContext privSender: newContext] + ifFalse: [self primitiveFailed]! - whose closure is the receiver and whose caller is the sender of this message. - Supply the copied values to the activation as its arguments and copied temps. - Primitive. Optional (but you're going to want this for performance)." - | newContext ncv | - <primitive: 201> - numArgs ~= 0 ifTrue: - [self numArgsError: 0]. - newContext := self asContextWithSender: thisContext sender. - (ncv := self numCopiedValues) > 0 ifTrue: - [newContext stackp: ncv. - 1 to: ncv do: "nil basicSize = 0" - [:i| newContext at: i put: (self at: i)]]. - thisContext privSender: newContext! Item was changed: ----- Method: MethodContext>>pushArgs:from: (in category 'system simulation') ----- pushArgs: args "<Array>" from: sendr "<ContextPart>" "Helps simulate action of the value primitive for closures. This is used by ContextPart>>runSimulated:contextAtEachStep:" + closureOrNil + ifNil: [self error: 'context needs a closure!!'] + ifNotNil: + ["See BlockClosure>>asContextWithSender:" + stackp ~= (closureOrNil numArgs + closureOrNil numCopiedValues) ifTrue: + [self error: 'stack pointer is incorrect!!'].]. + + 1 to: closureOrNil numArgs do: + [:i| self at: i put: (args at: i)]. - stackp ~= 0 ifTrue: - [self error: 'stack pointer should be zero!!']. - closureOrNil ifNil: - [self error: 'context needs a closure!!']. - args do: [:arg| self push: arg]. - 1 to: closureOrNil numCopiedValues do: - [:i| - self push: (closureOrNil copiedValueAt: i)]. sender := sendr! Item was changed: ----- Method: BlockClosure>>value: (in category 'evaluating') ----- + value: firstArg - value: anArg "Activate the receiver, creating a closure activation (MethodContext) + whose closure is the receiver and whose caller is the sender of this + message. Supply the argument and copied values to the activation + as its argument and copied temps. Primitive. Essential." + <primitive: 205> + | newContext | - whose closure is the receiver and whose caller is the sender of this message. - Supply the argument and copied values to the activation as its arguments and copied temps. - Primitive. Optional (but you're going to want this for performance)." - | newContext ncv | - <primitive: 202> numArgs ~= 1 ifTrue: [self numArgsError: 1]. + false + ifTrue: "Old code to simulate the closure value primitive on VMs that lack it." + [newContext := self asContextWithSender: thisContext sender. + newContext at: 1 put: firstArg. + thisContext privSender: newContext] + ifFalse: [self primitiveFailed]! - newContext := self asContextWithSender: thisContext sender. - ncv := self numCopiedValues. - newContext stackp: ncv + 1. - newContext at: 1 put: anArg. - 1 to: ncv do: - [:i| newContext at: i + 1 put: (self at: i)]. - thisContext privSender: newContext! Item was changed: ----- Method: BlockClosure>>valueWithArguments: (in category 'evaluating') ----- valueWithArguments: anArray "Activate the receiver, creating a closure activation (MethodContext) + whose closure is the receiver and whose caller is the sender of this + message. Supply the arguments in an anArray and copied values to + the activation as its arguments and copied temps. Primitive. Essential." - whose closure is the receiver and whose caller is the sender of this message. - Supply the arguments in an anArray and copied values to the activation as its arguments and copied temps. - Primitive. Optional (but you're going to want this for performance)." - | newContext ncv | <primitive: 206> + | newContext | numArgs ~= anArray size ifTrue: [self numArgsError: anArray size]. + false + ifTrue: "Old code to simulate the closure value primitive on VMs that lack it." + [newContext := self asContextWithSender: thisContext sender. + 1 to: numArgs do: + [:i| newContext at: i put: (anArray at: i)]. + thisContext privSender: newContext] + ifFalse: [self primitiveFailed]! - newContext := self asContextWithSender: thisContext sender. - ncv := self numCopiedValues. - newContext stackp: ncv + numArgs. - 1 to: numArgs do: - [:i| newContext at: i put: (anArray at: i)]. - 1 to: ncv do: - [:i| newContext at: i + numArgs put: (self at: i)]. - thisContext privSender: newContext! |
Free forum by Nabble | Edit this page |