-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Extend interop with BigInteger, meta parents, and readBuffer
- Loading branch information
Showing
38 changed files
with
126 additions
and
18 deletions.
There are no files selected for viewing
3 changes: 3 additions & 0 deletions
3
src/TruffleSqueak-Core.package/Behavior.extension/instance/interopGetMetaParents.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,3 @@ | ||
*TruffleSqueak-Core-meta-object | ||
interopGetMetaParents | ||
^ {self superclass} |
3 changes: 3 additions & 0 deletions
3
src/TruffleSqueak-Core.package/Behavior.extension/instance/interopHasMetaParents.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,3 @@ | ||
*TruffleSqueak-Core-meta-object | ||
interopHasMetaParents | ||
^ true |
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
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
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
6 changes: 6 additions & 0 deletions
6
src/TruffleSqueak-Core.package/Interop.class/class/asBigInteger..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,6 @@ | ||
primitives numbers | ||
asBigInteger: anObject | ||
<primitive: 'primitiveAsBigInteger' module: 'PolyglotPlugin'> | ||
^ (self fitsInBigInteger: anObject) | ||
ifTrue: [ anObject interopAsBigInteger ] | ||
ifFalse: [ self error: 'Object does not fit in BigInteger' ] |
4 changes: 4 additions & 0 deletions
4
src/TruffleSqueak-Core.package/Interop.class/class/fitsInBigInteger..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,4 @@ | ||
primitives numbers | ||
fitsInBigInteger: anObject | ||
<primitive: 'primitiveFitsInBigInteger' module: 'PolyglotPlugin'> | ||
^ anObject interopFitsInBigInteger |
6 changes: 6 additions & 0 deletions
6
src/TruffleSqueak-Core.package/Interop.class/class/getMetaParents..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,6 @@ | ||
primitives meta-data | ||
getMetaParents: anObject | ||
<primitive: 'primitiveGetMetaParents' module: 'PolyglotPlugin'> | ||
^ (self hasMetaParents: anObject) | ||
ifTrue: [ anObject interopGetMetaParents ] | ||
ifFalse: [ self error: 'Object has no meta parents' ] |
6 changes: 6 additions & 0 deletions
6
src/TruffleSqueak-Core.package/Interop.class/class/hasMetaParents..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,6 @@ | ||
primitives meta-data | ||
hasMetaParents: anObject | ||
<primitive: 'primitiveHasMetaParents' module: 'PolyglotPlugin'> | ||
^ (self isMetaObject: anObject) | ||
ifTrue: [ anObject interopHasMetaParents ] | ||
ifFalse: [ self error: 'Object is not a meta object' ] |
8 changes: 8 additions & 0 deletions
8
...ackage/Interop.class/class/readBuffer.byteOffset.destination.destinationOffset.length..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,8 @@ | ||
primitives buffers | ||
readBuffer: anObject byteOffset: byteOffset destination: destination destinationOffset: destinationOffset length: length | ||
<primitive: 'primitiveReadBuffer' module: 'PolyglotPlugin'> | ||
^ (self hasBufferElements: anObject) | ||
ifTrue: [ anObject isForeignObject | ||
ifTrue: [ PolyglotError signal ] | ||
ifFalse: [ anObject interopReadBuffer: byteOffset - 1 destination: destination destinationOffset: destinationOffset - 1 length: length ] ] | ||
ifFalse: [ self error: 'Object does not have buffer elements' ] |
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
4 changes: 4 additions & 0 deletions
4
src/TruffleSqueak-Core.package/Java.class/class/asBigInteger..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,4 @@ | ||
primitives internal | ||
asBigInteger: aLargeInteger | ||
<primitive: 'primitiveToJavaBigInteger' module: 'PolyglotPlugin'> | ||
^ aLargeInteger |
2 changes: 1 addition & 1 deletion
2
src/TruffleSqueak-Core.package/Java.class/class/asHostObject..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 |
---|---|---|
@@ -1,6 +1,6 @@ | ||
primitives internal | ||
asHostObject: aGuestObject | ||
<primitive: 'primitiveToHostObject' module: 'PolyglotPlugin'> | ||
(self isHostObject: self) | ||
(Interop isHostObject: aGuestObject) | ||
ifFalse: [ self error: 'Object not a host object' ] | ||
ifTrue: [ self error: 'Unexpected error' ] |
3 changes: 2 additions & 1 deletion
3
src/TruffleSqueak-Core.package/Java.class/methodProperties.json
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
3 changes: 3 additions & 0 deletions
3
...TruffleSqueak-Core.package/LargePositiveInteger.extension/instance/interopAsBigInteger.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,3 @@ | ||
*TruffleSqueak-Core-number | ||
interopAsBigInteger | ||
^ Java asBigInteger: self |
3 changes: 3 additions & 0 deletions
3
...fleSqueak-Core.package/LargePositiveInteger.extension/instance/interopFitsInBigInteger.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,3 @@ | ||
*TruffleSqueak-Core-number | ||
interopFitsInBigInteger | ||
^ true |
6 changes: 6 additions & 0 deletions
6
src/TruffleSqueak-Core.package/LargePositiveInteger.extension/methodProperties.json
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,6 @@ | ||
{ | ||
"class" : { | ||
}, | ||
"instance" : { | ||
"interopAsBigInteger" : "fn 10/22/2024 11:58", | ||
"interopFitsInBigInteger" : "fn 10/22/2024 09:13" } } |
2 changes: 2 additions & 0 deletions
2
src/TruffleSqueak-Core.package/LargePositiveInteger.extension/properties.json
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,2 @@ | ||
{ | ||
"name" : "LargePositiveInteger" } |
3 changes: 3 additions & 0 deletions
3
src/TruffleSqueak-Core.package/Object.extension/instance/interopAsBigInteger.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,3 @@ | ||
*TruffleSqueak-Core-number | ||
interopAsBigInteger | ||
self subclassResponsibility |
3 changes: 3 additions & 0 deletions
3
src/TruffleSqueak-Core.package/Object.extension/instance/interopFitsInBigInteger.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,3 @@ | ||
*TruffleSqueak-Core-number | ||
interopFitsInBigInteger | ||
^ false |
3 changes: 3 additions & 0 deletions
3
src/TruffleSqueak-Core.package/Object.extension/instance/interopGetMetaParents.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,3 @@ | ||
*TruffleSqueak-Core-meta-object | ||
interopGetMetaParents | ||
^ self subclassResponsibility |
3 changes: 3 additions & 0 deletions
3
src/TruffleSqueak-Core.package/Object.extension/instance/interopHasMetaParents.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,3 @@ | ||
*TruffleSqueak-Core-meta-object | ||
interopHasMetaParents | ||
^ false |
3 changes: 3 additions & 0 deletions
3
...kage/Object.extension/instance/interopReadBuffer.destination.destinationOffset.length..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,3 @@ | ||
*TruffleSqueak-Core-buffers | ||
interopReadBuffer: byteOffset destination: destination destinationOffset: destinationOffset length: length | ||
self subclassResponsibility |
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
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
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
Oops, something went wrong.