porffor 0.16.0-688a50c13 → 0.16.0-79cd8c0c8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CONTRIBUTING.md +1 -1
- package/compiler/builtins/date.ts +4 -2
- package/compiler/builtins/set.ts +4 -2
- package/compiler/codegen.js +291 -195
- package/compiler/cyclone.js +11 -11
- package/compiler/generated_builtins.js +18 -18
- package/compiler/opt.js +5 -7
- package/compiler/parse.js +1 -1
- package/compiler/precompile.js +6 -11
- package/compiler/prefs.js +1 -1
- package/compiler/prototype.js +43 -34
- package/compiler/wrap.js +15 -15
- package/package.json +4 -2
- package/runner/index.js +3 -8
- package/a.txt +0 -457
- package/b.txt +0 -457
- package/compiler/allocators/grow.js +0 -26
- package/compiler/allocators/index.js +0 -10
- package/compiler/allocators/static.js +0 -42
package/CONTRIBUTING.md
CHANGED
@@ -26,7 +26,7 @@ You can also swap out `node` in the alias to use another runtime like Deno (`den
|
|
26
26
|
|
27
27
|
### Precompile
|
28
28
|
|
29
|
-
**If you update any file inside `compiler/builtins` you will need to do this for it to update inside Porffor otherwise your changes will have no effect.** Run
|
29
|
+
**If you update any file inside `compiler/builtins` you will need to do this for it to update inside Porffor otherwise your changes will have no effect.** Run `node compiler/precompile.js` to precompile. It may error during this, if so, you might have an error in your code or there could be a compiler error with Porffor (feel free to ask for help as soon as you encounter any errors with it).
|
30
30
|
|
31
31
|
<br>
|
32
32
|
|
@@ -722,10 +722,12 @@ export const __Porffor_date_allocate = (): Date => {
|
|
722
722
|
const hack: bytestring = '';
|
723
723
|
|
724
724
|
if (hack.length == 0) {
|
725
|
-
hack.length = Porffor.wasm`
|
726
|
-
i32.const 1
|
725
|
+
hack.length = Porffor.wasm`i32.const 1
|
727
726
|
memory.grow 0
|
728
727
|
drop
|
728
|
+
memory.size 0
|
729
|
+
i32.const 1
|
730
|
+
i32.sub
|
729
731
|
i32.const 65536
|
730
732
|
i32.mul
|
731
733
|
i32.from_u`;
|
package/compiler/builtins/set.ts
CHANGED
@@ -2,10 +2,12 @@ import type {} from './porffor.d.ts';
|
|
2
2
|
|
3
3
|
// dark wasm magic for dealing with memory, sorry.
|
4
4
|
export const __Porffor_allocate = (): number => {
|
5
|
-
Porffor.wasm`
|
6
|
-
i32.const 1
|
5
|
+
Porffor.wasm`i32.const 1
|
7
6
|
memory.grow 0
|
8
7
|
drop
|
8
|
+
memory.size 0
|
9
|
+
i32.const 1
|
10
|
+
i32.sub
|
9
11
|
i32.const 65536
|
10
12
|
i32.mul
|
11
13
|
i32.from_u
|