-
Notifications
You must be signed in to change notification settings - Fork 71
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #304 from tesonep/fix-asFloat-when-no-more-memory
Primitive asFloat should fail and callback to the C function.
- Loading branch information
Showing
5 changed files
with
64 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
40 changes: 40 additions & 0 deletions
40
smalltalksrc/VMMakerTests/VMJittedBoxFloatPrimitivesTest.class.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
Class { | ||
#name : #VMJittedBoxFloatPrimitivesTest, | ||
#superclass : #VMJittedPrimitivesTest, | ||
#pools : [ | ||
'CogRTLOpcodes' | ||
], | ||
#category : #'VMMakerTests-JitTests' | ||
} | ||
|
||
{ #category : #tests } | ||
VMJittedBoxFloatPrimitivesTest >> testAsFloat [ | ||
|
||
cogit receiverTags: memory smallIntegerTag. | ||
|
||
self compile: [ cogit objectRepresentation genPrimitiveAsFloat ]. | ||
|
||
self executePrimitiveWithReceiver: (self memory integerObjectOf: 27). | ||
|
||
self | ||
assert: (memory floatValueOf: machineSimulator receiverRegisterValue) | ||
equals: 27.0 | ||
] | ||
|
||
{ #category : #tests } | ||
VMJittedBoxFloatPrimitivesTest >> testAsFloatWhenThereIsNotSpaceFailsPrimitive [ | ||
|
||
| stop | | ||
cogit receiverTags: memory smallIntegerTag. | ||
|
||
memory freeStart: memory scavengeThreshold. | ||
|
||
self compile: [ | ||
cogit objectRepresentation genPrimitiveAsFloat. | ||
stop := cogit Stop ]. | ||
|
||
self prepareStackForSendReceiver: (self memory integerObjectOf: 27) arguments: #(). | ||
self runFrom: initialAddress until: stop address. | ||
self assert: machineSimulator instructionPointerValue equals: stop address | ||
|
||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters