VM Maker: VMMaker-John M McIntosh.184.mcz

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

VM Maker: VMMaker-John M McIntosh.184.mcz

squeak-dev-noreply
 
John M McIntosh uploaded a new version of VMMaker to project VM Maker:
http://www.squeaksource.com/VMMaker/VMMaker-John M McIntosh.184.mcz

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

Name: VMMaker-John M McIntosh.184
Author: John M McIntosh
Time: 8 July 2010, 12:07:01 pm
UUID: c45c8f70-913f-45c5-83b1-49d7d9203618
Ancestors: VMMaker-dtl.183

Alter primitiveGetNextEvent so that Complex event types are passed up as object pointers versus Integers. This enables the VM  to create objects and pass up to the smalltalk code for the event type Complex. This is needed for passing touch events for the iPhone VM.

Other event types are processed using the original code base.

=============== Diff against VMMaker-dtl.183 ===============

Item was changed:
  ----- Method: Interpreter>>primitiveGetNextEvent (in category 'I/O primitives') -----
  primitiveGetNextEvent
  "Primitive. Return the next input event from the VM event queue."
+ | evtBuf arg value eventTypeIs |
- | evtBuf arg value |
  self var: #evtBuf declareC:'int evtBuf[8] = { 0, 0, 0, 0, 0, 0, 0, 0 }'.
  self cCode:'' inSmalltalk:[evtBuf := CArrayAccessor on: (IntegerArray new: 8)].
  arg := self stackTop.
  ((self isArray: arg) and:[(self slotSizeOf: arg) = 8])  ifFalse:[^self primitiveFail].
 
  self ioGetNextEvent: (self cCoerce: evtBuf to: 'sqInputEvent*').
  successFlag ifFalse:[^nil].
 
  "Event type"
+ eventTypeIs := evtBuf at: 0.
  self storeInteger: 0 ofObject: arg withValue: (evtBuf at: 0).
  successFlag ifFalse:[^nil].
 
+ "Event is Complex, assume evtBuf is populated correctly and return"
+ eventTypeIs = 6 ifTrue:
+ [1 to: 7 do: [:i |
+ value := evtBuf at: i.
+ self storePointer: i ofObject: arg withValue: value]]
+ ifFalse: [
+ "Event time stamp"
+ self storeInteger: 1 ofObject: arg withValue: ((evtBuf at: 1) bitAnd: MillisecondClockMask).
+ successFlag ifFalse:[^nil].
- "Event time stamp"
- self storeInteger: 1 ofObject: arg withValue: ((evtBuf at: 1) bitAnd: MillisecondClockMask).
- successFlag ifFalse:[^nil].
-
- "Event arguments"
- 2 to: 7 do:[:i|
- value := evtBuf at: i.
- (self isIntegerValue: value)
- ifTrue:[self storeInteger: i ofObject: arg withValue: value]
- ifFalse:["Need to remap because allocation may cause GC"
- self pushRemappableOop: arg.
- value := self positive32BitIntegerFor: value.
- arg := self popRemappableOop.
- self storePointer: i ofObject: arg withValue: value]].
 
+ "Event arguments"
+ 2 to: 7 do:[:i|
+ value := evtBuf at: i.
+ (self isIntegerValue: value)
+ ifTrue:[self storeInteger: i ofObject: arg withValue: value]
+ ifFalse:["Need to remap because allocation may cause GC"
+ self pushRemappableOop: arg.
+ value := self positive32BitIntegerFor: value.
+ arg := self popRemappableOop.
+ self storePointer: i ofObject: arg withValue: value]]].
+ successFlag ifFalse:[^nil].
- successFlag ifFalse:[^nil].
  self pop: 1.!

Item was changed:
  ----- Method: VMMaker class>>versionString (in category 'version testing') -----
  versionString
 
  "VMMaker versionString"
 
+ ^'4.2.6'!
- ^'4.2.5'!