[Vm-dev] VM Maker: VMMaker.oscog-cb.1820.mcz
commits at source.squeak.org
commits at source.squeak.org
Tue Apr 19 16:34:18 UTC 2016
ClementBera uploaded a new version of VMMaker to project VM Maker:
http://source.squeak.org/VMMaker/VMMaker.oscog-cb.1820.mcz
==================== Summary ====================
Name: VMMaker.oscog-cb.1820
Author: cb
Time: 19 April 2016, 9:32:35.692708 am
UUID: ce04560e-30f7-4eb5-ab6b-4863985954bb
Ancestors: VMMaker.oscog-eem.1819
- use option:IMMUTABILITY instead of ccpIf: to make it look better.
- fixed a bug in receiver accessing in immutability primitive for mirror primitive.
=============== Diff against VMMaker.oscog-eem.1819 ===============
Item was changed:
----- Method: InterpreterPrimitives>>primitiveGetImmutability (in category 'object access primitives') -----
primitiveGetImmutability
+ <option: #IMMUTABILITY>
+ | rcvr |
+ rcvr := self stackValue: argumentCount.
+ self pop: argumentCount + 1 thenPushBool: (objectMemory isOopImmutable: rcvr)!
- self cppIf: #IMMUTABILITY
- ifTrue:
- [| rcvr |
- rcvr := self stackValue: 0.
- self pop: argumentCount + 1 thenPushBool: (objectMemory isOopImmutable: rcvr)]
- ifFalse:
- [self primitiveFailFor: PrimErrUnsupported]!
Item was changed:
----- Method: InterpreterPrimitives>>primitiveSetImmutability (in category 'object access primitives') -----
primitiveSetImmutability
+ <option: #IMMUTABILITY>
+ | rcvr wasImmutable |
+ rcvr := self stackValue: argumentCount.
+ (objectMemory isImmediate: rcvr) ifTrue:
+ [^self primitiveFailFor: PrimErrBadReceiver].
+ wasImmutable := objectMemory isObjImmutable: rcvr.
+ self stackTop = objectMemory trueObject
- self cppIf: #IMMUTABILITY
ifTrue:
+ [(self canBeImmutable: rcvr) ifFalse:
+ [^self primitiveFailFor: PrimErrInappropriate].
+ objectMemory setIsImmutableOf: rcvr to: true]
+ ifFalse: [
+ self stackTop = objectMemory falseObject
+ ifTrue: [objectMemory setIsImmutableOf: rcvr to: false]
+ ifFalse:
+ [^self primitiveFailFor: PrimErrBadArgument]].
+ self pop: argumentCount + 1 thenPushBool: wasImmutable!
- [| rcvr wasImmutable |
- rcvr := self stackValue: 1.
- (objectMemory isImmediate: rcvr) ifTrue:
- [^self primitiveFailFor: PrimErrBadReceiver].
- wasImmutable := objectMemory isObjImmutable: rcvr.
- self stackTop = objectMemory trueObject
- ifTrue:
- [(self canBeImmutable: rcvr) ifFalse:
- [^self primitiveFailFor: PrimErrInappropriate].
- objectMemory setIsImmutableOf: rcvr to: true]
- ifFalse: [
- self stackTop = objectMemory falseObject
- ifTrue: [objectMemory setIsImmutableOf: rcvr to: false]
- ifFalse:
- [^self primitiveFailFor: PrimErrBadArgument]].
- self pop: argumentCount + 1 thenPushBool: wasImmutable]
- ifFalse:
- [self primitiveFailFor: PrimErrUnsupported]!
More information about the Vm-dev
mailing list