Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: AssemblyScript/assemblyscript
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v0.27.5
Choose a base ref
...
head repository: AssemblyScript/assemblyscript
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v0.27.6
Choose a head ref
  • 1 commit
  • 153 files changed
  • 1 contributor

Commits on Jul 18, 2023

  1. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    382aabe View commit details
Showing with 4,712 additions and 4,302 deletions.
  1. +13 −11 std/assembly/rt/tlsf.ts
  2. +16 −16 tests/compiler/bindings/esm.debug.wat
  3. +31 −28 tests/compiler/bindings/esm.release.wat
  4. +39 −38 tests/compiler/bindings/noExportRuntime.debug.wat
  5. +32 −25 tests/compiler/bindings/noExportRuntime.release.wat
  6. +16 −16 tests/compiler/bindings/raw.debug.wat
  7. +31 −28 tests/compiler/bindings/raw.release.wat
  8. +39 −38 tests/compiler/call-super.debug.wat
  9. +32 −25 tests/compiler/call-super.release.wat
  10. +39 −38 tests/compiler/class-implements.debug.wat
  11. +32 −25 tests/compiler/class-implements.release.wat
  12. +39 −38 tests/compiler/class-overloading-cast.debug.wat
  13. +7 −7 tests/compiler/class-overloading-cast.release.wat
  14. +39 −38 tests/compiler/class-overloading.debug.wat
  15. +7 −7 tests/compiler/class-overloading.release.wat
  16. +39 −38 tests/compiler/class.debug.wat
  17. +32 −25 tests/compiler/class.release.wat
  18. +39 −38 tests/compiler/constructor.debug.wat
  19. +32 −25 tests/compiler/constructor.release.wat
  20. +39 −38 tests/compiler/do.debug.wat
  21. +7 −7 tests/compiler/do.release.wat
  22. +39 −38 tests/compiler/duplicate-fields.debug.wat
  23. +32 −25 tests/compiler/duplicate-fields.release.wat
  24. +39 −38 tests/compiler/empty-exportruntime.debug.wat
  25. +32 −25 tests/compiler/empty-exportruntime.release.wat
  26. +40 −39 tests/compiler/empty-new.debug.wat
  27. +7 −7 tests/compiler/empty-new.release.wat
  28. +39 −38 tests/compiler/exportstar-rereexport.debug.wat
  29. +7 −7 tests/compiler/exportstar-rereexport.release.wat
  30. +39 −38 tests/compiler/extends-baseaggregate.debug.wat
  31. +32 −25 tests/compiler/extends-baseaggregate.release.wat
  32. +40 −39 tests/compiler/extends-recursive.debug.wat
  33. +32 −25 tests/compiler/extends-recursive.release.wat
  34. +39 −38 tests/compiler/field-initialization.debug.wat
  35. +32 −25 tests/compiler/field-initialization.release.wat
  36. +40 −39 tests/compiler/field.debug.wat
  37. +32 −25 tests/compiler/field.release.wat
  38. +39 −38 tests/compiler/for.debug.wat
  39. +7 −7 tests/compiler/for.release.wat
  40. +39 −38 tests/compiler/function-call.debug.wat
  41. +7 −7 tests/compiler/function-call.release.wat
  42. +39 −38 tests/compiler/function-expression.debug.wat
  43. +7 −7 tests/compiler/function-expression.release.wat
  44. +39 −38 tests/compiler/getter-call.debug.wat
  45. +7 −7 tests/compiler/getter-call.release.wat
  46. +39 −38 tests/compiler/heap.debug.wat
  47. +32 −25 tests/compiler/heap.release.wat
  48. +39 −38 tests/compiler/infer-array.debug.wat
  49. +32 −25 tests/compiler/infer-array.release.wat
  50. +39 −38 tests/compiler/infer-generic.debug.wat
  51. +32 −25 tests/compiler/infer-generic.release.wat
  52. +39 −38 tests/compiler/inlining.debug.wat
  53. +32 −25 tests/compiler/inlining.release.wat
  54. +39 −38 tests/compiler/instanceof.debug.wat
  55. +7 −7 tests/compiler/instanceof.release.wat
  56. +39 −38 tests/compiler/issues/1095.debug.wat
  57. +32 −25 tests/compiler/issues/1095.release.wat
  58. +39 −38 tests/compiler/issues/1225.debug.wat
  59. +7 −7 tests/compiler/issues/1225.release.wat
  60. +39 −38 tests/compiler/issues/1699.debug.wat
  61. +32 −25 tests/compiler/issues/1699.release.wat
  62. +39 −38 tests/compiler/issues/2166.debug.wat
  63. +7 −7 tests/compiler/issues/2166.release.wat
  64. +39 −38 tests/compiler/issues/2322/index.debug.wat
  65. +32 −25 tests/compiler/issues/2322/index.release.wat
  66. +39 −38 tests/compiler/issues/2622.debug.wat
  67. +7 −7 tests/compiler/issues/2622.release.wat
  68. +39 −38 tests/compiler/logical.debug.wat
  69. +7 −7 tests/compiler/logical.release.wat
  70. +39 −38 tests/compiler/managed-cast.debug.wat
  71. +7 −7 tests/compiler/managed-cast.release.wat
  72. +39 −38 tests/compiler/new.debug.wat
  73. +7 −7 tests/compiler/new.release.wat
  74. +39 −38 tests/compiler/object-literal.debug.wat
  75. +32 −25 tests/compiler/object-literal.release.wat
  76. +39 −38 tests/compiler/optional-typeparameters.debug.wat
  77. +7 −7 tests/compiler/optional-typeparameters.release.wat
  78. +39 −38 tests/compiler/reexport.debug.wat
  79. +7 −7 tests/compiler/reexport.release.wat
  80. +39 −38 tests/compiler/rereexport.debug.wat
  81. +7 −7 tests/compiler/rereexport.release.wat
  82. +39 −38 tests/compiler/resolve-access.debug.wat
  83. +32 −25 tests/compiler/resolve-access.release.wat
  84. +39 −38 tests/compiler/resolve-binary.debug.wat
  85. +32 −25 tests/compiler/resolve-binary.release.wat
  86. +39 −38 tests/compiler/resolve-elementaccess.debug.wat
  87. +32 −25 tests/compiler/resolve-elementaccess.release.wat
  88. +39 −38 tests/compiler/resolve-function-expression.debug.wat
  89. +94 −87 tests/compiler/resolve-function-expression.release.wat
  90. +39 −38 tests/compiler/resolve-new.debug.wat
  91. +7 −7 tests/compiler/resolve-new.release.wat
  92. +39 −38 tests/compiler/resolve-propertyaccess.debug.wat
  93. +32 −25 tests/compiler/resolve-propertyaccess.release.wat
  94. +39 −38 tests/compiler/resolve-ternary.debug.wat
  95. +32 −25 tests/compiler/resolve-ternary.release.wat
  96. +39 −38 tests/compiler/resolve-unary.debug.wat
  97. +32 −25 tests/compiler/resolve-unary.release.wat
  98. +39 −38 tests/compiler/return-unreachable.debug.wat
  99. +32 −25 tests/compiler/return-unreachable.release.wat
  100. +38 −37 tests/compiler/rt/alloc-large-memory.debug.wat
  101. +31 −24 tests/compiler/rt/alloc-large-memory.release.wat
  102. +39 −38 tests/compiler/rt/finalize.debug.wat
  103. +7 −7 tests/compiler/rt/finalize.release.wat
  104. +39 −38 tests/compiler/rt/runtime-incremental-export.debug.wat
  105. +32 −25 tests/compiler/rt/runtime-incremental-export.release.wat
  106. +39 −38 tests/compiler/rt/runtime-minimal-export.debug.wat
  107. +32 −25 tests/compiler/rt/runtime-minimal-export.release.wat
  108. +40 −39 tests/compiler/simd.debug.wat
  109. +32 −25 tests/compiler/simd.release.wat
  110. +39 −38 tests/compiler/std/array-literal.debug.wat
  111. +32 −25 tests/compiler/std/array-literal.release.wat
  112. +39 −38 tests/compiler/std/array.debug.wat
  113. +32 −25 tests/compiler/std/array.release.wat
  114. +39 −38 tests/compiler/std/arraybuffer.debug.wat
  115. +32 −25 tests/compiler/std/arraybuffer.release.wat
  116. +39 −38 tests/compiler/std/dataview.debug.wat
  117. +32 −25 tests/compiler/std/dataview.release.wat
  118. +39 −38 tests/compiler/std/date.debug.wat
  119. +32 −25 tests/compiler/std/date.release.wat
  120. +39 −38 tests/compiler/std/map.debug.wat
  121. +32 −25 tests/compiler/std/map.release.wat
  122. +39 −38 tests/compiler/std/new.debug.wat
  123. +7 −7 tests/compiler/std/new.release.wat
  124. +39 −38 tests/compiler/std/operator-overloading.debug.wat
  125. +7 −7 tests/compiler/std/operator-overloading.release.wat
  126. +39 −38 tests/compiler/std/set.debug.wat
  127. +32 −25 tests/compiler/std/set.release.wat
  128. +39 −38 tests/compiler/std/static-array.debug.wat
  129. +32 −25 tests/compiler/std/static-array.release.wat
  130. +39 −38 tests/compiler/std/staticarray.debug.wat
  131. +32 −25 tests/compiler/std/staticarray.release.wat
  132. +39 −38 tests/compiler/std/string-casemapping.debug.wat
  133. +32 −25 tests/compiler/std/string-casemapping.release.wat
  134. +39 −38 tests/compiler/std/string-encoding.debug.wat
  135. +32 −25 tests/compiler/std/string-encoding.release.wat
  136. +39 −38 tests/compiler/std/string.debug.wat
  137. +32 −25 tests/compiler/std/string.release.wat
  138. +39 −38 tests/compiler/std/symbol.debug.wat
  139. +32 −25 tests/compiler/std/symbol.release.wat
  140. +39 −38 tests/compiler/std/typedarray.debug.wat
  141. +32 −25 tests/compiler/std/typedarray.release.wat
  142. +39 −38 tests/compiler/std/uri.debug.wat
  143. +32 −25 tests/compiler/std/uri.release.wat
  144. +39 −38 tests/compiler/super-inline.debug.wat
  145. +7 −7 tests/compiler/super-inline.release.wat
  146. +39 −38 tests/compiler/templateliteral.debug.wat
  147. +32 −25 tests/compiler/templateliteral.release.wat
  148. +4 −4 tests/compiler/throw.debug.wat
  149. +3 −3 tests/compiler/throw.release.wat
  150. +39 −38 tests/compiler/typeof.debug.wat
  151. +7 −7 tests/compiler/typeof.release.wat
  152. +40 −39 tests/compiler/while.debug.wat
  153. +7 −7 tests/compiler/while.release.wat
24 changes: 13 additions & 11 deletions std/assembly/rt/tlsf.ts
Original file line number Diff line number Diff line change
@@ -307,6 +307,15 @@ function removeBlock(root: Root, block: Block): void {
// must perform those updates.
}

function roundSize(size: usize): usize {
const halfMaxSize = BLOCK_MAXSIZE >> 1; // don't round last fl
const inv: usize = sizeof<usize>() * 8 - 1;
const invRound = inv - SL_BITS;
return size < halfMaxSize
? size + (1 << (invRound - clz<usize>(size))) - 1
: size;
}

/** Searches for a free block of at least the specified size. */
function searchBlock(root: Root, size: usize): Block | null {
// size was already asserted by caller
@@ -317,13 +326,8 @@ function searchBlock(root: Root, size: usize): Block | null {
fl = 0;
sl = <u32>(size >> AL_BITS);
} else {
const halfMaxSize = BLOCK_MAXSIZE >> 1; // don't round last fl
const inv: usize = sizeof<usize>() * 8 - 1;
const invRound = inv - SL_BITS;
let requestSize = size < halfMaxSize
? size + (1 << (invRound - clz<usize>(size))) - 1
: size;
fl = inv - clz<usize>(requestSize);
const requestSize = roundSize(size);
fl = sizeof<usize>() * 8 - 1 - clz<usize>(requestSize);
sl = <u32>((requestSize >> (fl - SL_BITS)) ^ (1 << SL_BITS));
fl -= SB_BITS - 1;
}
@@ -428,10 +432,8 @@ function growMemory(root: Root, size: usize): void {
return;
}
// Here, both rounding performed in searchBlock ...
const halfMaxSize = BLOCK_MAXSIZE >> 1;
if (size < halfMaxSize) { // don't round last fl
const invRound = (sizeof<usize>() * 8 - 1) - SL_BITS;
size += (1 << (invRound - clz<usize>(size))) - 1;
if (size >= SB_SIZE) {
size = roundSize(size);
}
// and additional BLOCK_OVERHEAD must be taken into account. If we are going
// to merge with the tail block, that's one time, otherwise it's two times.
32 changes: 16 additions & 16 deletions tests/compiler/bindings/esm.debug.wat
Original file line number Diff line number Diff line change
@@ -2026,22 +2026,6 @@
(local $pagesAfter i32)
i32.const 0
drop
local.get $size
i32.const 536870910
i32.lt_u
if
local.get $size
i32.const 1
i32.const 27
local.get $size
i32.clz
i32.sub
i32.shl
i32.const 1
i32.sub
i32.add
local.set $size
end
memory.size $0
local.set $pagesBefore
local.get $size
@@ -2063,6 +2047,22 @@
i32.add
local.set $size
local.get $size
i32.const 536870910
i32.lt_u
if
local.get $size
i32.const 1
i32.const 27
local.get $size
i32.clz
i32.sub
i32.shl
i32.const 1
i32.sub
i32.add
local.set $size
end
local.get $size
i32.const 65535
i32.add
i32.const 65535
59 changes: 31 additions & 28 deletions tests/compiler/bindings/esm.release.wat
Original file line number Diff line number Diff line change
@@ -1386,7 +1386,7 @@
call $~lib/rt/tlsf/initialize
end
global.get $~lib/rt/tlsf/ROOT
local.set $4
local.set $3
local.get $0
i32.const 16
i32.add
@@ -1401,7 +1401,7 @@
call $~lib/builtins/abort
unreachable
end
local.get $4
local.get $3
i32.const 12
local.get $2
i32.const 19
@@ -1421,8 +1421,9 @@
if
memory.size $0
local.tee $2
local.get $5
i32.const 4
local.get $4
local.get $3
i32.load $0 offset=1568
local.get $2
i32.const 16
@@ -1431,46 +1432,48 @@
i32.sub
i32.ne
i32.shl
local.get $5
i32.const 1
i32.const 27
local.get $5
i32.clz
i32.sub
i32.shl
i32.const 1
i32.sub
i32.add
local.get $5
local.get $5
local.tee $4
i32.const 536870910
i32.lt_u
select
i32.add
if (result i32)
local.get $4
i32.const 1
i32.const 27
local.get $4
i32.clz
i32.sub
i32.shl
i32.const 1
i32.sub
i32.add
else
local.get $4
end
i32.const 65535
i32.add
i32.const -65536
i32.and
i32.const 16
i32.shr_u
local.tee $3
local.tee $4
local.get $2
local.get $3
local.get $4
i32.gt_s
select
memory.grow $0
i32.const 0
i32.lt_s
if
local.get $3
local.get $4
memory.grow $0
i32.const 0
i32.lt_s
if
unreachable
end
end
local.get $4
local.get $3
local.get $2
i32.const 16
i32.shl
@@ -1479,7 +1482,7 @@
i64.const 16
i64.shl
call $~lib/rt/tlsf/addMemory
local.get $4
local.get $3
local.get $5
call $~lib/rt/tlsf/searchBlock
local.tee $2
@@ -1507,12 +1510,12 @@
call $~lib/builtins/abort
unreachable
end
local.get $4
local.get $3
local.get $2
call $~lib/rt/tlsf/removeBlock
local.get $2
i32.load $0
local.set $3
local.set $4
local.get $5
i32.const 4
i32.add
@@ -1526,7 +1529,7 @@
call $~lib/builtins/abort
unreachable
end
local.get $3
local.get $4
i32.const -4
i32.and
local.get $5
@@ -1537,7 +1540,7 @@
if
local.get $2
local.get $5
local.get $3
local.get $4
i32.const 2
i32.and
i32.or
@@ -1547,19 +1550,19 @@
i32.add
local.get $5
i32.add
local.tee $3
local.tee $4
local.get $6
i32.const 4
i32.sub
i32.const 1
i32.or
i32.store $0
local.get $4
local.get $3
local.get $4
call $~lib/rt/tlsf/insertBlock
else
local.get $2
local.get $3
local.get $4
i32.const -2
i32.and
i32.store $0
Loading