fetchClassOf & commonSend?
John M McIntosh
johnmci at smalltalkconsulting.com
Fri Dec 14 02:25:13 UTC 2001
>ave a point here. Just for experimentation I hacked a little CS
>(attached) that should handle all cases pretty well - it makes use of a
>#timerPending flag which is set if we encounter situations that make the
>call to the high-res clock worthwhile (including GCs and some other obscure
>situations).
>
>While the tinyBenchmarks are hardly affected at all, I did find a consistent
>speedup of ~5% within the macro benchmarks. I'd be interested if others (in
>particular on U**x and Mac platforms) find similar results. Please let me
>know - if the results are the same then it seems pretty worthwhile.
>
>Cheers,
> - Andreas
>
>
>Attachment converted: Lamie:VMTimerPending-ar.2.zip (pZIP/pZIP) (0008731C)
Hi first I noticed in primitiveResponse we have the comment
"Thus, we use a fast, low-resolution (1/60th second) clock"
But you removed the ioLowResMSec call and replaced it with an ioMSecs call.
Was that intentional?
(timerPending and:[nextWakeupTick ~= 0]) ifTrue: [
"check for possible timer interrupts"
((self ioMSecs bitAnd: MillisecondClockMask) >=
nextWakeupTick) ifTrue: [
Also you are missing the VMMaker change set to allow for security to
be a plugin
primitiveImageName
"When called with a single string argument, record the string
as the current image file name. When called with zero arguments,
return a string containing the current image file name."
| s sz sCRIfn okToRename |
timerPending _ true. "dunno how long it'll take"
argumentCount = 1 ifTrue: [
"If the security plugin can be loaded, use it to
check for rename permission.
If not, assume it's ok"
sCRIfn _ self ioLoadFunction: 'secCanRenameImage'
From: 'SecurityPlugin'.
sCRIfn ~= 0 ifTrue:[okToRename _ self cCode:' ((int
(*) (void)) sCRIfn)()'.
okToRename ifFalse:[^self primitiveFail]].
s _ self stackTop.
self assertClassOf: s is: (self splObj: ClassString).
successFlag ifTrue: [
sz _ self stSizeOf: s.
self imageNamePut: (s + BaseHeaderSize) Length: sz.
self pop: 1. "pop s, leave rcvr on stack"
].
] ifFalse: [
sz _ self imageNameSize.
s _ self instantiateClass: (self splObj: ClassString)
indexableSize: sz.
self imageNameGet: (s + BaseHeaderSize) Length: sz.
self pop: 1. "rcvr"
self push: s.
].
--
--
===========================================================================
John M. McIntosh <johnmci at smalltalkconsulting.com> 1-800-477-2659
Corporate Smalltalk Consulting Ltd. http://www.smalltalkconsulting.com
===========================================================================
More information about the Squeak-dev
mailing list
|