Skip to content

Feat/improving ffi - #924

Open
tesonep wants to merge 24 commits into
pharo-project:pharo-12from
evref-inria:feat/improving-FFI
Open

tesonep wants to merge 24 commits into
pharo-project:pharo-12from
evref-inria:feat/improving-FFI

Conversation

@tesonep

@tesonep tesonep commented Mar 1, 2025

Copy link
Copy Markdown
Collaborator
  • Adding new Bytecode to perform SameThread callouts
  • Having a JIT implementation of the bytecode
  • Support for optimizations on specific set of signatures
  • Supported in ARM32, ARM64 and X86_64

…ject. It pins the object if it is not pinned.

- Adding JIT version of this primitive 
- Adding tests
- Adding a new bytecode for SameThreadCallout
- Adding general JIT implementation using a trampoline
- Adding Tests

Based in the work and experiments of Juan Ignacio Bianchi
- Fixing issues with callbacks
- Annotating the bytecode correctly
- Starting to add support for optimizations
…calized variables (they leave the interpreter)
- Improving optimized code
- Adding tests 
- Fixing types
- Implementing some optimizations
- Implementing it for ARM32 / ARM64 / X64 (SysV & WIN)
- Supporting flags to optimize the code
PalumboN
PalumboN previously approved these changes Jun 18, 2025

@PalumboN PalumboN left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Beautiful ninja magic 🥷 🪄 ✨

👏 👏 👏 👏

printedString := String streamContents: [ :str | cast prettyPrintOn: str ].

self assert: printedString equals:
self assert: printedString trimBoth trimBoth equals:

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

More more trimBoth :P

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This class should be in Slang-Tests package (now it is not running on the CI). I though that I already moved it 🤔

Comment on lines 39 to 41
^ self new
codeGenerator: aCodeGenerator;
codeGenerator: aCodeGenerator
yourself

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this ok?

Comment on lines +4 to +7
InstructionClient >> sameThreadCallout: literalIndex [


]

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

???

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

😱

]

{ #category : 'tests - primitiveGetAddressOfOOPPinningIfNeeded' }
VMPrimitiveTest >> testPrimitiveGetAddressOfOOPPinningIfNeededReturnsAddressAndPinsIfObjectIsNotPinned [

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If not pinned this primitive pin it on the interpreter but not on the JIT, right?

…he code compaction and the movements of machine code methods
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants