<div dir="ltr">Hi David,<div><br></div><div> can you please delete this for me? ANother example of inadvertently nudging the mouse and changing keyboard focus. Got to update my image to pull in Karl's fix pronto :-)</div>
</div><div class="gmail_extra"><br><br><div class="gmail_quote">On Sat, Jun 28, 2014 at 7:20 PM, <span dir="ltr"><<a href="mailto:commits@source.squeak.org" target="_blank">commits@source.squeak.org</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
Eliot Miranda uploaded a new version of VMMaker to project VM Maker:<br>
<a href="http://source.squeak.org/VMMaker/Fix" target="_blank">http://source.squeak.org/VMMaker/Fix</a> VMMaker.oscog-eem.787.mcz<br>
<br>
==================== Summary ====================<br>
<br>
Name: Fix VMMaker.oscog-eem.787<br>
Author: eem<br>
Time: 28 June 2014, 7:19:54.984 pm<br>
UUID: a9fe951c-7914-49b0-a008-20c39417cae0<br>
Ancestors: VMMaker.oscog-eem.786<br>
<br>
Fix return types for positive[64/32]BitValueOf: in InterpreterProxy<br>
(& hence in sqVirtualMachine.[ch] soon).<br>
<br>
Use positiveMachineIntegerValueOf: to decode arg in<br>
primitiveNewWithArg and ensure positiveMachineIntegerValueOf:<br>
is inlined there-in.<br>
<br>
=============== Diff against VMMaker.oscog-eem.786 ===============<br>
<br>
Item was changed:<br>
----- Method: InterpreterPrimitives>>positiveMachineIntegerValueOf: (in category 'primitive support') -----<br>
positiveMachineIntegerValueOf: oop<br>
"Answer a value of an integer in address range, i.e up to the size of a machine word.<br>
The object may be either a positive SmallInteger or a LargePositiveInteger of size <= word size."<br>
<returnTypeC: #'unsigned long'><br>
+ <inline: true> "only two callers & one is primitiveNewWithArg"<br>
| value bs ok |<br>
(objectMemory isIntegerObject: oop) ifTrue:<br>
[value := objectMemory integerValueOf: oop.<br>
value < 0 ifTrue: [^self primitiveFail].<br>
^value].<br>
<br>
ok := objectMemory<br>
isClassOfNonImm: oop<br>
equalTo: (objectMemory splObj: ClassLargePositiveInteger)<br>
compactClassIndex: ClassLargePositiveIntegerCompactIndex.<br>
(ok and: [(bs := objectMemory lengthOf: oop) <= (self sizeof: #'unsigned long')]) ifFalse:<br>
[^self primitiveFail].<br>
<br>
((self sizeof: #'unsigned long') = 8<br>
and: [bs > 4]) ifTrue:<br>
[^ (objectMemory fetchByte: 0 ofObject: oop)<br>
+ ((objectMemory fetchByte: 1 ofObject: oop) << 8)<br>
+ ((objectMemory fetchByte: 2 ofObject: oop) << 16)<br>
+ ((objectMemory fetchByte: 3 ofObject: oop) << 24)<br>
+ ((objectMemory fetchByte: 4 ofObject: oop) << 32)<br>
+ ((objectMemory fetchByte: 5 ofObject: oop) << 40)<br>
+ ((objectMemory fetchByte: 6 ofObject: oop) << 48)<br>
+ ((objectMemory fetchByte: 7 ofObject: oop) << 56)].<br>
<br>
^ (objectMemory fetchByte: 0 ofObject: oop)<br>
+ ((objectMemory fetchByte: 1 ofObject: oop) << 8)<br>
+ ((objectMemory fetchByte: 2 ofObject: oop) << 16)<br>
+ ((objectMemory fetchByte: 3 ofObject: oop) << 24)!<br>
<br>
Item was changed:<br>
----- Method: InterpreterPrimitives>>primitiveNewWithArg (in category 'object access primitives') -----<br>
primitiveNewWithArg<br>
"Allocate a new indexable instance. Fail if the allocation would leave less than lowSpaceThreshold bytes free. May cause a GC."<br>
| size spaceOkay |<br>
+ size := self positiveMachineIntegerValueOf: self stackTop.<br>
- size := self positive32BitValueOf: self stackTop.<br>
self cppIf: NewspeakVM<br>
ifTrue: "For the mirror prims check that the class obj is actually a valid class."<br>
[(argumentCount < 2<br>
or: [self addressCouldBeClassObj: (self stackValue: 1)]) ifFalse:<br>
[self primitiveFailFor: PrimErrBadArgument]].<br>
+ self successful "positiveMachineIntegerValueOf: succeeds only for non-negative integers."<br>
- self successful "positive32BitValueOf: succeds only for non-negative integers < 2^32"<br>
ifTrue:<br>
[objectMemory hasSpurMemoryManagerAPI<br>
ifTrue:<br>
[(objectMemory instantiateClass: (self stackValue: 1) indexableSize: size)<br>
ifNotNil: [:obj| self pop: argumentCount + 1 thenPush: obj]<br>
ifNil: [self primitiveFailFor: PrimErrNoMemory]]<br>
ifFalse:<br>
[spaceOkay := objectMemory sufficientSpaceToInstantiate: (self stackValue: 1) indexableSize: size.<br>
spaceOkay<br>
ifTrue:<br>
[self<br>
pop: argumentCount + 1<br>
thenPush: (objectMemory instantiateClass: (self stackValue: 1) indexableSize: size)]<br>
ifFalse:<br>
[self primitiveFailFor: PrimErrNoMemory]]]<br>
ifFalse:<br>
[self primitiveFailFor: PrimErrBadArgument]!<br>
<br>
Item was changed:<br>
----- Method: InterpreterProxy>>positive32BitValueOf: (in category 'converting') -----<br>
positive32BitValueOf: oop<br>
+ <returnTypeC: #usqInt><br>
oop isInteger ifFalse:[self error:'Not an integer object'].<br>
oop < 0<br>
ifTrue:[self primitiveFail. ^0]<br>
ifFalse:[^oop]!<br>
<br>
Item was changed:<br>
----- Method: InterpreterProxy>>positive64BitValueOf: (in category 'converting') -----<br>
positive64BitValueOf: oop<br>
+ <returnTypeC: #usqLong><br>
- <returnTypeC: #sqLong><br>
oop isInteger ifFalse:[self error:'Not an integer object'].<br>
oop < 0<br>
ifTrue:[self primitiveFail. ^0]<br>
ifFalse:[^oop]!<br>
<br>
</blockquote></div><br><br clear="all"><div><br></div>-- <br>best,<div>Eliot</div>
</div>