Eliot Miranda uploaded a new version of Compiler to project The Trunk:
http://source.squeak.org/trunk/Compiler-eem.401.mcz
==================== Summary ====================
Name: Compiler-eem.401
Author: eem
Time: 19 March 2019, 9:28:16.827407 am
UUID: 7920c007-0974-48a7-b1b3-b4de923b90d4
Ancestors: Compiler-eem.400
Fix a slip in EncoderForSistaV1 class>>isTempStoreAt:in:, and fix a couple of typos nearby.
=============== Diff against Compiler-eem.400 ===============
Item was changed:
----- Method: BytecodeEncoder class>>pcPreviousTo:in:for: (in category 'bytecode decoding') -----
pcPreviousTo: thePC in: method for: anInstructionStreamOrContext
"Answer the pc of the bytecode before the bytecode at thePC.
Unlike CompiledMethod>>pcPreviousTo:, this version answers nil for
the first bytecode of an embedded block, and answers the pc of the
block creation bytecode for a bytecode following an embedded block."
| pc nextPc prevPc byte createClosureCode |
thePC > method endPC ifTrue:
[^method endPC].
pc := method initialPC.
"We could save time by scanning from the block creation bytecode of an embedded block,
using the following, but it saves less time than it loses in additional tests."
"(anInstructionStreamOrContext isContext
and: [anInstructionStreamOrContext isClosureContext
and: [(nextPc := anInstructionStreamOrContext startpc) > pc]]) ifTrue:
[pc := self pcOfBlockCreationBytecodeForBlockStartingAt: nextPc in: method]."
createClosureCode := self createClosureCode.
[pc < thePC] whileTrue:
[byte := method at: (prevPc := pc).
+ [pc := createClosureCode = byte
- [pc := createClosureCode == byte
ifTrue:
[nextPc := self pcFollowingBlockAt: pc in: method.
nextPc = thePC ifTrue: "first bytecode following block"
[^prevPc].
nextPc > thePC
ifTrue:
[pc + (self bytecodeSize: byte) = thePC ifTrue: "first bytecode of block"
[^nil].
pc + (self bytecodeSize: byte)]
ifFalse: [nextPc]]
ifFalse: [pc + (self bytecodeSize: byte)].
self isExtension: byte] whileTrue:
[byte := method at: pc]].
^prevPc
"Here's code to measure the effect of short-cutting scanning for blocks by starting at the startpc.
+ It measures how much time is used to scan for the pcs from the last block to the end of all methods containing blocks. Uncomment out the short-cut above to compare time with the optimization and time without. I see approximately 290ms for all such methods with the optimization and 292 ms without, so given that this slows down the substantial majority of methods without blocks, we KISS."
- It measures how much time is used to scan for the pcs from the last block to the end of all mwetods containing blocks. Uncomment out the short-cut above to compare time with the optimization and time without. I see approximately 290ms for all such methods with the optimization and 292 ms without, so given that this slows down the substantial majority of methods without blocks, we KISS."
"| candidates |
candidates := Dictionary new.
self systemNavigation allSelect:
[:m| | ebc |
(m isQuick or: [(ebc := m embeddedBlockClosures) isEmpty]) ifFalse:
[candidates at: m put: { ebc last.
Array streamContents:
[:s| | is |
(is:= InstructionStream on: m)
pc: ebc last startpc;
scanFor:
[:b|
s nextPut: is pc.
false]] }].
false].
(1 to: 10) collect:
[:ign|
{ [candidates keysAndValuesDo:
[:m :tuple|
[:ebc :pcs| | c |
c := ebc outerContext.
pcs do:
[:pc| m encoderClass pcPreviousTo: pc in: m for: c]] valueWithArguments: tuple]] timeToRun.
[candidates keysAndValuesDo:
[:m :tuple|
[:ebc :pcs| | c |
c := ebc outerContext.
pcs do:
[:pc| m encoderClass pcPreviousTo: pc in: m for: nil]] valueWithArguments: tuple]] timeToRun. }]"!
Item was changed:
----- Method: EncoderForSistaV1 class>>isTempStoreAt:in: (in category 'instruction stream support') -----
isTempStoreAt: pc in: method
"Answer if the bytecode at pc is a store or store-pop into a temporary variable.
208-215 11010 iii Pop and Store Temporary Variable #iii
242 11110010 iiiiiiii Pop and Store Temporary Variable #iiiiiiii
245 11110110 iiiiiiii Store Temporary Variable #iiiiiiii"
| byte |
byte := method at: pc.
^byte >= 208
and: [byte <= 215
+ or: [byte = 242 or: [byte = 245]]]!
- or: [byte = 242 and: [byte = 245]]]!
Eliot Miranda uploaded a new version of Tools to project The Trunk:
http://source.squeak.org/trunk/Tools-kks.845.mcz
==================== Summary ====================
Name: Tools-kks.845
Author: kks
Time: 11 March 2019, 4:28:38.697611 pm
UUID: f95a6695-03f2-4dfc-a80b-e8bc6df8b6ce
Ancestors: Tools-pre.844
Simplify addItem in Model: to open a method browser directly on the specified class and method. This should make creating hotlinks for method references in workspaces and help text.
=============== Diff against Tools-pre.844 ===============
Item was changed:
----- Method: Model>>addItem: (in category '*Tools') -----
addItem: classAndMethod
+ "Open a browser directly on the given class and method
- "Make a linked message list and put this method in it"
+ Model new addItem: 'Model addItem:'
+ Model new addItem: 'Model>>addItem:'
+ "
+
-
self flag: #mref. "classAndMethod is a String"
-
MessageSet
parse: classAndMethod
+ toClassAndSelector: [ :class :sel |
- toClassAndSelector: [ :class :sel | | list |
class ifNil: [^self].
+ Browser newOnClass: class selector: sel
- list := OrderedCollection with: (
- MethodReference new
- setClass: class
- methodSymbol: sel
- stringVersion: classAndMethod
- ).
- ToolSet
- browseMessageSet: list
- name: 'Linked by HyperText'
- autoSelect: nil
]
!
Fabio Niephaus uploaded a new version of KernelTests to project The Trunk:
http://source.squeak.org/trunk/KernelTests-fn.356.mcz
==================== Summary ====================
Name: KernelTests-fn.356
Author: fn
Time: 13 March 2019, 11:01:08.662302 am
UUID: 2a86580c-d4e1-4478-b564-5d2a2c3679bd
Ancestors: KernelTests-eem.355
Add a test for https://github.com/OpenSmalltalk/opensmalltalk-vm/issues/376.
=============== Diff against KernelTests-eem.355 ===============
Item was changed:
----- Method: FloatTest>>testFloatTruncated (in category 'testing - conversion') -----
testFloatTruncated
"(10 raisedTo: 16) asFloat has an exact representation (no round off error).
It should convert back to integer without loosing bits.
This is a no regression test on http://bugs.impara.de/view.php?id=3504"
| x y int r |
int := 10 raisedTo: 16.
x := int asFloat.
y := (5 raisedTo: 16) asFloat timesTwoPower: 16.
self assert: x = y.
self assert: x asInteger = int.
"this one should be true for any float"
self assert: x asInteger = x asTrueFraction asInteger.
"a random test"
r := Random new.
10000 timesRepeat: [
x := r next * 1.9999e16 + 1.0e12 .
+ self assert: x truncated = x asTrueFraction truncated].
+
+ "test an edge case (see https://github.com/OpenSmalltalk/opensmalltalk-vm/issues/376)"
+ self assert: SmallInteger maxVal + 1 equals: (SmallInteger maxVal + 1) asFloat asInteger!
- self assert: x truncated = x asTrueFraction truncated]!
Eliot Miranda uploaded a new version of KernelTests to project The Trunk:
http://source.squeak.org/trunk/KernelTests-eem.355.mcz
==================== Summary ====================
Name: KernelTests-eem.355
Author: eem
Time: 6 March 2019, 3:16:05.445238 pm
UUID: 6dcbdd43-dbe7-4ddf-8142-ec9c7fb4296c
Ancestors: KernelTests-tonyg.354
Avoid using a deprecated message (includesSubString:) in a test.
=============== Diff against KernelTests-tonyg.354 ===============
Item was changed:
----- Method: AllocationTest>>testOutOfMemorySignal (in category 'tests') -----
testOutOfMemorySignal
"Ensure that OutOfMemory is signaled eventually"
| sz |
self setFreeSpaceLimitOf: 1024 * 1024 * 1024 * (Smalltalk wordSize = 8
ifTrue: [4]
ifFalse: [1.5])
around:
[sz := 512*1024*1024. "work around the 1GB alloc bug"
self should: [(1 to: 2000) collect: [:i| Array new: sz]] raise: OutOfMemory].
"Call me when this test fails, I want your machine."
"Current (2017) Spur VMs fail new: & basicNew: with #'bad argument' if given other than a non-negative SmallInteger."
sz := 1024*1024*1024*1024.
self should: [Array new: sz]
raise: OutOfMemory, Error
withExceptionDo:
[:ex|
ex class == Error ifTrue:
+ [self assert: [ex messageText includesSubstring: 'basicNew: with invalid argument']]]!
- [self assert: [ex messageText includesSubString: 'basicNew: with invalid argument']]]!