-
-
Notifications
You must be signed in to change notification settings - Fork 670
Implement reference counting #592
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Conversation
This file contains hidden or 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
Makes arrays instead of iterators for now
Does not implement combinations like 'import theDefault, *' yet
petersalomonsen
added a commit
to petersalomonsen/javascriptmusic
that referenced
this pull request
Jun 7, 2019
new song "good times" adjustments for memory allocations in assemblyscript ref: AssemblyScript/assemblyscript#592 more instruments
jewel528
added a commit
to jewel528/Jsmusic
that referenced
this pull request
Feb 15, 2024
new song "good times" adjustments for memory allocations in assemblyscript ref: AssemblyScript/assemblyscript#592 more instruments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
As a continuation of the runtime branch. this is the new tracking PR for everything runtime and RC. What this essentially does is implement and integrate reference counting, best explained by this test case resulting in this output.
Changes to master are significant in that
LOAD
are gone because one can now simply do aload
instead.import "..."
but instead has to select an appropriate runtime implementation. By default that'sfull
, which is essentially TLSF + PureRC,half
which is the same but without exported runtime hooks,stub
which is essentially Arena + no GC andnone
which is the same without exported runtime hooks. The none implementation, even though runtime hooks are still inserted by the compiler, essentially evaporates after optimizations. Also, though unlikely, custom implementations are possible by means of--runtime yourRuntimeImplementation
which implements all the runtime hooks.memory.allocate
andmemory.free
anymore. When done, the recommended way of allocating a chunk of raw memory will benew ArrayBuffer
.instanceof
(i.e.animal instanceof Cat
) is implemented on top of runtime type information, that is embedded as a memory segment. For each class there are 4 bytes base class id + 4 bytes flags with alignments, managed status etc..--noLib
is gone. This significantly reduces the amount of checks the compiler has to do when doing anything standard library related. This doesn't matter effectively, because if one doesn't use let's say Strings nothing of the related library components becomes compiled anyway.--noTreeShaking
is gone. We'll eventually want to replace this with a pre-pass checker anyway.There's probably quite a lot more that I don't remember anymore because this has clearly taken too long already. The test case linked above gives an overview of what's still to do on the integration side, plus I have yet to test the actual "full" runtime implementation. The concept should be figured out now, though.
to be continued...