The Inbox: VMMaker-MattSpr.361.mcz

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

The Inbox: VMMaker-MattSpr.361.mcz

commits-2
A new version of VMMaker was added to project The Inbox:
http://source.squeak.org/inbox/VMMaker-MattSpr.361.mcz

==================== Summary ====================

Name: VMMaker-MattSpr.361
Author: MattSpr
Time: 29 April 2015, 6:20:36.436 pm
UUID: 07e06652-e637-41d1-8d69-dac0bd244406
Ancestors: VMMaker-tfel.360

Call primitive 255 in InterpreterProxy to indicate failing primitive simulations to the VM (if supported).

=============== Diff against VMMaker-tfel.360 ===============

Item was changed:
  ----- Method: InterpreterProxy>>primitiveFailFor: (in category 'other') -----
  primitiveFailFor: reasonCode
+ "Set specific primitive failure. N.B. primitiveFailFor: PrimNoErr is expected to clear the primFailCode.
+ Primitive 255 is called to indicate that we are currently simulating a primitive that should fail and the VM should handle that case appropriately (if supported by the VM)."
+ <primitive: 255>
+ (self confirm: 'A primitive is failing -- Stop simulation?') ifTrue: [self halt].
+ ^ primFailCode := reasonCode!
- "Set specific primitive failure.
- N.B. primitiveFailFor: PrimNoErr is expected to clear the primFailCode."
- (self confirm:'A primitive is failing -- Stop simulation?') ifTrue:[self halt].
- ^primFailCode := reasonCode!

Item was changed:
  ----- Method: InterpreterProxy>>success: (in category 'other') -----
  success: aBoolean
+ self failed ifTrue: [^ self].
+ aBoolean ifFalse: [self primitiveFailFor: 1].!
- self failed ifTrue:[^self].
- aBoolean ifFalse: [
- primFailCode := 1.
- (self confirm:'A primitive is failing -- Stop simulation?') ifTrue:[self halt]]
- !


Reply | Threaded
Open this post in threaded view
|

Re: The Inbox: VMMaker-MattSpr.361.mcz

matthias.springer
Hi,

I made this change to support simulating primitives in the RSqueak VM. Some primitives in RSqueak are implemented in the image, i.e., the primitive handler in the VM calls the simulation code in the image. If this simulation code fails, it will raise "primitive: 255" which will tell the VM to execute the fallback code for the original primitive.

Other Squeak VMs should not be affected by this change, since primitive 255 is not used anywhere else.

Best,
Matthias