[Vm-dev] VM Maker: VMMaker.oscog-eem.2442.mcz
commits at source.squeak.org
commits at source.squeak.org
Wed Sep 19 16:23:12 UTC 2018
Eliot Miranda uploaded a new version of VMMaker to project VM Maker:
http://source.squeak.org/VMMaker/VMMaker.oscog-eem.2442.mcz
==================== Summary ====================
Name: VMMaker.oscog-eem.2442
Author: eem
Time: 19 September 2018, 9:22:37.266528 am
UUID: f7e49724-6cf7-484b-a024-25d028888354
Ancestors: VMMaker.oscog-eem.2441
Final piece of Pharo compatibility to allow e.g. the REPL startreader images to run in Pharo 6.1. Split the input dialog for FakeStdinStream so it works both on Pharo and Squeak.
=============== Diff against VMMaker.oscog-eem.2441 ===============
Item was added:
+ ----- Method: FakeStdinStream>>isFakeStdinStream (in category 'testing') -----
+ isFakeStdinStream
+ ^true!
Item was changed:
----- Method: FakeStdinStream>>next (in category 'accessing') -----
next
"Answer the next object in the Stream represented by the receiver.
If there are no more elements in the stream fill up the buffer by prompting for input"
| sem threadIndex inputLine next |
position >= readLimit ifTrue:
[simulator isThreadedVM
ifTrue:
["(simulator cogit singleStep not
and: [UIManager confirm: 'Single step?']) ifTrue:
[simulator cogit singleStep: true]."
threadIndex := simulator disownVM: DisownVMLockOutFullGC.
simulator forceInterruptCheckFromHeartbeat.
sem := Semaphore new.
WorldState addDeferredUIMessage:
[inputLine := UIManager default request: 'Input please!!'.
sem signal].
sem wait]
ifFalse: "simulate line-oriented input"
+ [inputLine := ((Smalltalk classNamed: #FillInTheBlankMorph)
+ ifNotNil: "Squeak"
+ [:fITBM|
+ fITBM
+ request: 'Input please!!'
+ initialAnswer: ''
+ centerAt: ActiveHand cursorPoint
+ inWorld: ActiveWorld
+ onCancelReturn: nil
+ acceptOnCR: true]
+ ifNil: "Pharo; onCancelReturn: nil is the default here"
+ [UIManager default
+ request: 'Input please!!'
+ initialAnswer: '']).
- [inputLine := FillInTheBlankMorph
- request: 'Input please!!'
- initialAnswer: ''
- centerAt: ActiveHand cursorPoint
- inWorld: ActiveWorld
- onCancelReturn: nil
- acceptOnCR: true.
inputLine ifNil: [self atEnd: true. ^nil]].
collection size <= inputLine size ifTrue:
[collection := collection species new: inputLine size + 1].
collection
replaceFrom: 1 to: inputLine size with: inputLine startingAt: 1;
at: (readLimit := inputLine size + 1) put: Character lf.
position := 0.
simulator isThreadedVM ifTrue:
[simulator ownVM: threadIndex]].
next := collection at: (position := position + 1).
"This is set temporarily to allow (FilePluginSimulator>>#sqFile:Read:Into:At:
to brwak out of its loop. sqFile:Read:Into:At: resets it on the way out."
atEnd := position >= readLimit.
^next
" This does it with workspaces:
| ws r s |
s := Semaphore new.
ws := Workspace new contents: ''.
ws acceptAction: [:t| r := t asString. s signal].
[ws openLabel: 'Yo!!'; shouldStyle: false.
(ws dependents detect: [:dep | dep isKindOf: PluggableTextMorph] ifNone: [nil]) ifNotNil:
[:textMorph| textMorph acceptOnCR: true; hasUnacceptedEdits: true]] fork.
Processor activeProcess == Project uiProcess
ifTrue: [[r isNil] whileTrue: [World doOneCycle]]
ifFalse: [s wait].
ws topView delete.
s wait. s signal.
r"!
Item was added:
+ ----- Method: Stream>>isFakeStdinStream (in category '*VMMaker-JITSimulation-testing') -----
+ isFakeStdinStream
+ ^false!
More information about the Vm-dev
mailing list