Comments (1)
Just to document it, here it is.
The interpreter is made so all functions/methods are inlined by default by slang if possible.
This way, there are as few exit points from the interpreter function as possible.
However, this can create code explosion for long methods that are shared by many bytecodes.
This is for example the case for the send bytecodes that all call the long routine to lookup + activate.
To avoid this, instead of inlining long methods into the interpreter loop, some of these code paths are inlined once and shared by all the users using a goto
.
The pragma sharedCodeInCase:
controls this. It tells that the function should be inlined only once in the context of the bytecode given as parameter of the pragma. Then, Slang will translate all calls to this function to a goto
if they are not the owner of the shared case.
Now, the point is that since this sharedCodeInCase:
is implemented through goto
s, this means that control jumps to the shared code but it's not easy to make it come back.
This means that this only works when the shared code is the tail of the bytecode: we don't need its return value, and we don't need control to come back. That's why shared code cases will in general be responsible for fetching the next instruction or doing the corresponding stack manipulation (pushes/pops).
-- EDIT--
also just FTR, why this is an issue in #743 (comment)
The thing is that to be able to translate booleanCheatTrueSistaV1
et al correctly in Druid, we need to have a single pop instruction and not two (one at the end of each tail. The refactored code does that by extracting the pop to the caller, and using the return value of the offending function. But this breaks the premise of the sharedCodeInCase:
.
from pharo-vm.
Related Issues (20)
- Bug in InterpreterPrimitives >> primitiveNotIdentical HOT 1
- VM breaks Pharo integration into Mac Os [menu bar] HOT 2
- Add library versions to SystemReporter HOT 1
- Druid should consider temps defined in blocks HOT 1
- Get info about the primitive table HOT 2
- Unresolved external symbol S_ISDIR when compiling using MSVC HOT 1
- Docu for building on Windows is incomplete HOT 6
- Compilation warning: Wno-unused-variable
- Compilation warning: unused-function
- Improve Slang to not generate functions with no senders *after* doing the inlinings
- Slang should not allow asserta: to be used outside of a top level statement
- Compiler warning: -Wno-pointer-integer-compare
- Compiler warning: Wsometimes-uninitialized
- Building on MacOS11 tries to use SDK for MacOS12 HOT 2
- Problem with completion in the tutorial HOT 3
- File modification time is wrong for half the year (especially in Linux) HOT 3
- 10.2.1 not tagged HOT 1
- Deadlock when signalling external semaphores HOT 10
- Commandline argument --edenSize is misnamed
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pharo-vm.