Try parsing signatures only if node is callable, see #149; Minor refactoring

This commit is contained in:
dcodeIO 2018-06-24 01:04:24 +02:00
parent 7a8995b18b
commit 188b4e48ce
14 changed files with 933 additions and 813 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -17,6 +17,9 @@ function asmFunc(global, env, buffer) {
var Math_floor = global.Math.floor; var Math_floor = global.Math.floor;
var Math_ceil = global.Math.ceil; var Math_ceil = global.Math.ceil;
var Math_sqrt = global.Math.sqrt; var Math_sqrt = global.Math.sqrt;
var abort = env.abort;
var nan = global.NaN;
var infinity = global.Infinity;
var $lib_env_abort = env.abort; var $lib_env_abort = env.abort;
var $lib_allocator_arena_startOffset = 0; var $lib_allocator_arena_startOffset = 0;
var $lib_allocator_arena_offset = 0; var $lib_allocator_arena_offset = 0;
@ -25,7 +28,7 @@ function asmFunc(global, env, buffer) {
var i64toi32_i32$HIGH_BITS = 0; var i64toi32_i32$HIGH_BITS = 0;
function $lib_allocator_arena_allocate_memory($0) { function $lib_allocator_arena_allocate_memory($0) {
$0 = $0 | 0; $0 = $0 | 0;
var $3 = 0, $1 = 0, $2 = 0, wasm2asm_i32$0 = 0, wasm2asm_i32$1 = 0, wasm2asm_i32$2 = 0; var $1 = 0, $2 = 0, $3 = 0, wasm2asm_i32$0 = 0, wasm2asm_i32$1 = 0, wasm2asm_i32$2 = 0;
if ($0) { if ($0) {
if ($0 >>> 0 > 1073741824 >>> 0) abort(); if ($0 >>> 0 > 1073741824 >>> 0) abort();
$1 = $lib_allocator_arena_offset; $1 = $lib_allocator_arena_offset;
@ -33,7 +36,7 @@ function asmFunc(global, env, buffer) {
$2 = __wasm_current_memory(); $2 = __wasm_current_memory();
if ($0 >>> 0 > ($2 << 16 | 0) >>> 0) { if ($0 >>> 0 > ($2 << 16 | 0) >>> 0) {
$3 = ((($0 - $1 | 0) + 65535 | 0) & 4294901760 | 0) >>> 16 | 0; $3 = ((($0 - $1 | 0) + 65535 | 0) & 4294901760 | 0) >>> 16 | 0;
if ((__wasm_grow_memory((wasm2asm_i32$2 = ($2 | 0) > ($3 | 0), wasm2asm_i32$0 = $2, wasm2asm_i32$1 = $3, wasm2asm_i32$2 ? wasm2asm_i32$0 : wasm2asm_i32$1) | 0) | 0) < (0 | 0)) if ((__wasm_grow_memory($3 | 0) | 0) < (0 | 0)) abort();; if ((__wasm_grow_memory((wasm2asm_i32$0 = $2, wasm2asm_i32$1 = $3, wasm2asm_i32$2 = ($2 | 0) > ($3 | 0), wasm2asm_i32$2 ? wasm2asm_i32$0 : wasm2asm_i32$1) | 0) | 0) < (0 | 0)) if ((__wasm_grow_memory($3 | 0) | 0) < (0 | 0)) abort();;
} }
$lib_allocator_arena_offset = $0; $lib_allocator_arena_offset = $0;
return $1 | 0; return $1 | 0;
@ -50,66 +53,131 @@ function asmFunc(global, env, buffer) {
$5 = +$5; $5 = +$5;
$6 = +$6; $6 = +$6;
$7 = +$7; $7 = +$7;
var $8 = 0, $29 = 0; var wasm2asm_i32$0 = 0, wasm2asm_f64$0 = 0.0;
if ($0) $29 = $0; else { if (($0 | 0) == (0 | 0)) {
$8 = $lib_allocator_arena_allocate_memory(56 | 0) | 0; $0 = $lib_allocator_arena_allocate_memory(56 | 0) | 0;
HEAPF64[$8 >> 3] = $1; wasm2asm_i32$0 = $0;
HEAPF64[($8 + 8 | 0) >> 3] = $2; wasm2asm_f64$0 = $1;
HEAPF64[($8 + 16 | 0) >> 3] = $3; HEAPF64[wasm2asm_i32$0 >> 3] = wasm2asm_f64$0;
HEAPF64[($8 + 24 | 0) >> 3] = $4; wasm2asm_i32$0 = $0;
HEAPF64[($8 + 32 | 0) >> 3] = $5; wasm2asm_f64$0 = $2;
HEAPF64[($8 + 40 | 0) >> 3] = $6; HEAPF64[(wasm2asm_i32$0 + 8 | 0) >> 3] = wasm2asm_f64$0;
HEAPF64[($8 + 48 | 0) >> 3] = $7; wasm2asm_i32$0 = $0;
$29 = $8; wasm2asm_f64$0 = $3;
HEAPF64[(wasm2asm_i32$0 + 16 | 0) >> 3] = wasm2asm_f64$0;
wasm2asm_i32$0 = $0;
wasm2asm_f64$0 = $4;
HEAPF64[(wasm2asm_i32$0 + 24 | 0) >> 3] = wasm2asm_f64$0;
wasm2asm_i32$0 = $0;
wasm2asm_f64$0 = $5;
HEAPF64[(wasm2asm_i32$0 + 32 | 0) >> 3] = wasm2asm_f64$0;
wasm2asm_i32$0 = $0;
wasm2asm_f64$0 = $6;
HEAPF64[(wasm2asm_i32$0 + 40 | 0) >> 3] = wasm2asm_f64$0;
wasm2asm_i32$0 = $0;
wasm2asm_f64$0 = $7;
HEAPF64[(wasm2asm_i32$0 + 48 | 0) >> 3] = wasm2asm_f64$0;
} }
return $29 | 0; return $0 | 0;
} }
function $lib_memory_set_memory($0, $1, $2) { function $lib_memory_set_memory($0, $1, $2) {
$0 = $0 | 0; $0 = $0 | 0;
$1 = $1 | 0; $1 = $1 | 0;
$2 = $2 | 0; $2 = $2 | 0;
var i64toi32_i32$2 = 0, i64toi32_i32$0 = 0, $4 = 0, i64toi32_i32$1 = 0, i64toi32_i32$4 = 0, i64toi32_i32$3 = 0, $3 = 0, $14 = 0, $126 = 0, $126$hi = 0, $129$hi = 0, $3$hi = 0, wasm2asm_i32$0 = 0, wasm2asm_i32$1 = 0; var i64toi32_i32$2 = 0, i64toi32_i32$0 = 0, $3 = 0, $4 = 0, i64toi32_i32$1 = 0, i64toi32_i32$4 = 0, i64toi32_i32$3 = 0, $4$hi = 0, $14 = 0, $121 = 0, $121$hi = 0, $123$hi = 0, wasm2asm_i32$0 = 0, wasm2asm_i32$1 = 0, wasm2asm_i32$2 = 0, wasm2asm_i32$3 = 0;
if (($2 | 0) == (0 | 0)) return; if (($2 | 0) == (0 | 0)) return;
HEAP8[$0 >> 0] = $1; wasm2asm_i32$0 = $0;
HEAP8[(($0 + $2 | 0) - 1 | 0) >> 0] = $1; wasm2asm_i32$1 = $1;
HEAP8[wasm2asm_i32$0 >> 0] = wasm2asm_i32$1;
wasm2asm_i32$0 = ($0 + $2 | 0) - 1 | 0;
wasm2asm_i32$1 = $1;
HEAP8[wasm2asm_i32$0 >> 0] = wasm2asm_i32$1;
if ($2 >>> 0 <= 2 >>> 0) return; if ($2 >>> 0 <= 2 >>> 0) return;
HEAP8[($0 + 1 | 0) >> 0] = $1; wasm2asm_i32$0 = $0 + 1 | 0;
HEAP8[($0 + 2 | 0) >> 0] = $1; wasm2asm_i32$1 = $1;
HEAP8[(($0 + $2 | 0) - 2 | 0) >> 0] = $1; HEAP8[wasm2asm_i32$0 >> 0] = wasm2asm_i32$1;
HEAP8[(($0 + $2 | 0) - 3 | 0) >> 0] = $1; wasm2asm_i32$0 = $0 + 2 | 0;
wasm2asm_i32$1 = $1;
HEAP8[wasm2asm_i32$0 >> 0] = wasm2asm_i32$1;
$3 = $0 + $2 | 0;
wasm2asm_i32$0 = $3 - 2 | 0;
wasm2asm_i32$1 = $1;
HEAP8[wasm2asm_i32$0 >> 0] = wasm2asm_i32$1;
wasm2asm_i32$0 = $3 - 3 | 0;
wasm2asm_i32$1 = $1;
HEAP8[wasm2asm_i32$0 >> 0] = wasm2asm_i32$1;
if ($2 >>> 0 <= 6 >>> 0) return; if ($2 >>> 0 <= 6 >>> 0) return;
HEAP8[($0 + 3 | 0) >> 0] = $1; wasm2asm_i32$0 = $0 + 3 | 0;
HEAP8[(($0 + $2 | 0) - 4 | 0) >> 0] = $1; wasm2asm_i32$1 = $1;
HEAP8[wasm2asm_i32$0 >> 0] = wasm2asm_i32$1;
wasm2asm_i32$0 = ($0 + $2 | 0) - 4 | 0;
wasm2asm_i32$1 = $1;
HEAP8[wasm2asm_i32$0 >> 0] = wasm2asm_i32$1;
if ($2 >>> 0 <= 8 >>> 0) return; if ($2 >>> 0 <= 8 >>> 0) return;
$4 = (0 - $0 | 0) & 3 | 0; $3 = (0 - $0 | 0) & 3 | 0;
$0 = $0 + $4 | 0; $2 = $2 - $3 | 0;
$0 = $0 + $3 | 0;
$1 = Math_imul($1 & 255 | 0, 16843009); $1 = Math_imul($1 & 255 | 0, 16843009);
HEAP32[$0 >> 2] = $1; wasm2asm_i32$0 = $0;
$2 = ($2 - $4 | 0) & 4294967292 | 0; wasm2asm_i32$1 = $1;
HEAP32[(($0 + $2 | 0) - 4 | 0) >> 2] = $1; HEAP32[wasm2asm_i32$0 >> 2] = wasm2asm_i32$1;
$2 = $2 & 4294967292 | 0;
wasm2asm_i32$0 = ($0 + $2 | 0) - 4 | 0;
wasm2asm_i32$1 = $1;
HEAP32[wasm2asm_i32$0 >> 2] = wasm2asm_i32$1;
if ($2 >>> 0 <= 8 >>> 0) return; if ($2 >>> 0 <= 8 >>> 0) return;
HEAP32[($0 + 4 | 0) >> 2] = $1; wasm2asm_i32$0 = $0 + 4 | 0;
HEAP32[($0 + 8 | 0) >> 2] = $1; wasm2asm_i32$1 = $1;
HEAP32[(($0 + $2 | 0) - 12 | 0) >> 2] = $1; HEAP32[wasm2asm_i32$0 >> 2] = wasm2asm_i32$1;
HEAP32[(($0 + $2 | 0) - 8 | 0) >> 2] = $1; wasm2asm_i32$0 = $0 + 8 | 0;
wasm2asm_i32$1 = $1;
HEAP32[wasm2asm_i32$0 >> 2] = wasm2asm_i32$1;
$3 = $0 + $2 | 0;
wasm2asm_i32$0 = $3 - 12 | 0;
wasm2asm_i32$1 = $1;
HEAP32[wasm2asm_i32$0 >> 2] = wasm2asm_i32$1;
wasm2asm_i32$0 = $3 - 8 | 0;
wasm2asm_i32$1 = $1;
HEAP32[wasm2asm_i32$0 >> 2] = wasm2asm_i32$1;
if ($2 >>> 0 <= 24 >>> 0) return; if ($2 >>> 0 <= 24 >>> 0) return;
HEAP32[($0 + 12 | 0) >> 2] = $1; wasm2asm_i32$0 = $0 + 12 | 0;
HEAP32[($0 + 16 | 0) >> 2] = $1; wasm2asm_i32$1 = $1;
HEAP32[($0 + 20 | 0) >> 2] = $1; HEAP32[wasm2asm_i32$0 >> 2] = wasm2asm_i32$1;
HEAP32[($0 + 24 | 0) >> 2] = $1; wasm2asm_i32$0 = $0 + 16 | 0;
HEAP32[(($0 + $2 | 0) - 28 | 0) >> 2] = $1; wasm2asm_i32$1 = $1;
HEAP32[(($0 + $2 | 0) - 24 | 0) >> 2] = $1; HEAP32[wasm2asm_i32$0 >> 2] = wasm2asm_i32$1;
HEAP32[(($0 + $2 | 0) - 20 | 0) >> 2] = $1; wasm2asm_i32$0 = $0 + 20 | 0;
HEAP32[(($0 + $2 | 0) - 16 | 0) >> 2] = $1; wasm2asm_i32$1 = $1;
$4 = ($0 & 4 | 0) + 24 | 0; HEAP32[wasm2asm_i32$0 >> 2] = wasm2asm_i32$1;
$0 = $0 + $4 | 0; wasm2asm_i32$0 = $0 + 24 | 0;
$2 = $2 - $4 | 0; wasm2asm_i32$1 = $1;
i64toi32_i32$0 = 0; HEAP32[wasm2asm_i32$0 >> 2] = wasm2asm_i32$1;
$126 = $1; $3 = $0 + $2 | 0;
$126$hi = i64toi32_i32$0; wasm2asm_i32$0 = $3 - 28 | 0;
wasm2asm_i32$1 = $1;
HEAP32[wasm2asm_i32$0 >> 2] = wasm2asm_i32$1;
wasm2asm_i32$0 = $3 - 24 | 0;
wasm2asm_i32$1 = $1;
HEAP32[wasm2asm_i32$0 >> 2] = wasm2asm_i32$1;
wasm2asm_i32$0 = $3 - 20 | 0;
wasm2asm_i32$1 = $1;
HEAP32[wasm2asm_i32$0 >> 2] = wasm2asm_i32$1;
wasm2asm_i32$0 = $3 - 16 | 0;
wasm2asm_i32$1 = $1;
HEAP32[wasm2asm_i32$0 >> 2] = wasm2asm_i32$1;
$3 = ($0 & 4 | 0) + 24 | 0;
$0 = $0 + $3 | 0;
$2 = $2 - $3 | 0;
i64toi32_i32$0 = 0; i64toi32_i32$0 = 0;
i64toi32_i32$0 = i64toi32_i32$0; i64toi32_i32$0 = i64toi32_i32$0;
$4 = $1;
$4$hi = i64toi32_i32$0;
i64toi32_i32$0 = i64toi32_i32$0;
$121 = $1;
$121$hi = i64toi32_i32$0;
i64toi32_i32$0 = i64toi32_i32$0;
i64toi32_i32$0 = i64toi32_i32$0;
i64toi32_i32$2 = $1; i64toi32_i32$2 = $1;
i64toi32_i32$1 = 0; i64toi32_i32$1 = 0;
i64toi32_i32$3 = 32; i64toi32_i32$3 = 32;
@ -121,37 +189,53 @@ function asmFunc(global, env, buffer) {
i64toi32_i32$1 = ((1 << i64toi32_i32$4 | 0) - 1 | 0) & (i64toi32_i32$2 >>> (32 - i64toi32_i32$4 | 0) | 0) | 0 | (i64toi32_i32$0 << i64toi32_i32$4 | 0) | 0; i64toi32_i32$1 = ((1 << i64toi32_i32$4 | 0) - 1 | 0) & (i64toi32_i32$2 >>> (32 - i64toi32_i32$4 | 0) | 0) | 0 | (i64toi32_i32$0 << i64toi32_i32$4 | 0) | 0;
$14 = i64toi32_i32$2 << i64toi32_i32$4 | 0; $14 = i64toi32_i32$2 << i64toi32_i32$4 | 0;
} }
$129$hi = i64toi32_i32$1; $123$hi = i64toi32_i32$1;
i64toi32_i32$1 = $126$hi; i64toi32_i32$1 = $121$hi;
i64toi32_i32$0 = $126; i64toi32_i32$0 = $121;
i64toi32_i32$2 = $129$hi; i64toi32_i32$2 = $123$hi;
i64toi32_i32$3 = $14; i64toi32_i32$3 = $14;
i64toi32_i32$2 = i64toi32_i32$1 | i64toi32_i32$2 | 0; i64toi32_i32$2 = i64toi32_i32$1 | i64toi32_i32$2 | 0;
i64toi32_i32$2 = i64toi32_i32$2; i64toi32_i32$2 = i64toi32_i32$2;
$3 = i64toi32_i32$0 | i64toi32_i32$3 | 0; $4 = i64toi32_i32$0 | i64toi32_i32$3 | 0;
$3$hi = i64toi32_i32$2; $4$hi = i64toi32_i32$2;
continue_0 : do { continue_0 : do {
if ($2 >>> 0 >= 32 >>> 0) { if ($2 >>> 0 >= 32 >>> 0) {
i64toi32_i32$2 = $3$hi; i64toi32_i32$2 = $4$hi;
i64toi32_i32$0 = $0; i64toi32_i32$0 = $0;
i64toi32_i32$2 = i64toi32_i32$2; i64toi32_i32$2 = i64toi32_i32$2;
HEAP32[$0 >> 2] = $3; wasm2asm_i32$0 = $0;
(wasm2asm_i32$0 = $0, wasm2asm_i32$1 = i64toi32_i32$2), ((HEAP8[(wasm2asm_i32$0 + 4 | 0) >> 0] = wasm2asm_i32$1 & 255 | 0, HEAP8[(wasm2asm_i32$0 + 5 | 0) >> 0] = (wasm2asm_i32$1 >>> 8 | 0) & 255 | 0), HEAP8[(wasm2asm_i32$0 + 6 | 0) >> 0] = (wasm2asm_i32$1 >>> 16 | 0) & 255 | 0), HEAP8[(wasm2asm_i32$0 + 7 | 0) >> 0] = (wasm2asm_i32$1 >>> 24 | 0) & 255 | 0; wasm2asm_i32$1 = $4;
HEAP32[wasm2asm_i32$0 >> 2] = wasm2asm_i32$1;
wasm2asm_i32$0 = $0;
wasm2asm_i32$1 = i64toi32_i32$2;
(wasm2asm_i32$2 = wasm2asm_i32$0, wasm2asm_i32$3 = wasm2asm_i32$1), ((HEAP8[(wasm2asm_i32$2 + 4 | 0) >> 0] = wasm2asm_i32$3 & 255 | 0, HEAP8[(wasm2asm_i32$2 + 5 | 0) >> 0] = (wasm2asm_i32$3 >>> 8 | 0) & 255 | 0), HEAP8[(wasm2asm_i32$2 + 6 | 0) >> 0] = (wasm2asm_i32$3 >>> 16 | 0) & 255 | 0), HEAP8[(wasm2asm_i32$2 + 7 | 0) >> 0] = (wasm2asm_i32$3 >>> 24 | 0) & 255 | 0;
i64toi32_i32$2 = i64toi32_i32$2; i64toi32_i32$2 = i64toi32_i32$2;
i64toi32_i32$0 = $0 + 8 | 0; i64toi32_i32$0 = $0 + 8 | 0;
i64toi32_i32$2 = i64toi32_i32$2; i64toi32_i32$2 = i64toi32_i32$2;
HEAP32[i64toi32_i32$0 >> 2] = $3; wasm2asm_i32$0 = i64toi32_i32$0;
(wasm2asm_i32$0 = i64toi32_i32$0, wasm2asm_i32$1 = i64toi32_i32$2), ((HEAP8[(wasm2asm_i32$0 + 4 | 0) >> 0] = wasm2asm_i32$1 & 255 | 0, HEAP8[(wasm2asm_i32$0 + 5 | 0) >> 0] = (wasm2asm_i32$1 >>> 8 | 0) & 255 | 0), HEAP8[(wasm2asm_i32$0 + 6 | 0) >> 0] = (wasm2asm_i32$1 >>> 16 | 0) & 255 | 0), HEAP8[(wasm2asm_i32$0 + 7 | 0) >> 0] = (wasm2asm_i32$1 >>> 24 | 0) & 255 | 0; wasm2asm_i32$1 = $4;
HEAP32[wasm2asm_i32$0 >> 2] = wasm2asm_i32$1;
wasm2asm_i32$0 = i64toi32_i32$0;
wasm2asm_i32$1 = i64toi32_i32$2;
(wasm2asm_i32$2 = wasm2asm_i32$0, wasm2asm_i32$3 = wasm2asm_i32$1), ((HEAP8[(wasm2asm_i32$2 + 4 | 0) >> 0] = wasm2asm_i32$3 & 255 | 0, HEAP8[(wasm2asm_i32$2 + 5 | 0) >> 0] = (wasm2asm_i32$3 >>> 8 | 0) & 255 | 0), HEAP8[(wasm2asm_i32$2 + 6 | 0) >> 0] = (wasm2asm_i32$3 >>> 16 | 0) & 255 | 0), HEAP8[(wasm2asm_i32$2 + 7 | 0) >> 0] = (wasm2asm_i32$3 >>> 24 | 0) & 255 | 0;
i64toi32_i32$2 = i64toi32_i32$2; i64toi32_i32$2 = i64toi32_i32$2;
i64toi32_i32$0 = $0 + 16 | 0; i64toi32_i32$0 = $0 + 16 | 0;
i64toi32_i32$2 = i64toi32_i32$2; i64toi32_i32$2 = i64toi32_i32$2;
HEAP32[i64toi32_i32$0 >> 2] = $3; wasm2asm_i32$0 = i64toi32_i32$0;
(wasm2asm_i32$0 = i64toi32_i32$0, wasm2asm_i32$1 = i64toi32_i32$2), ((HEAP8[(wasm2asm_i32$0 + 4 | 0) >> 0] = wasm2asm_i32$1 & 255 | 0, HEAP8[(wasm2asm_i32$0 + 5 | 0) >> 0] = (wasm2asm_i32$1 >>> 8 | 0) & 255 | 0), HEAP8[(wasm2asm_i32$0 + 6 | 0) >> 0] = (wasm2asm_i32$1 >>> 16 | 0) & 255 | 0), HEAP8[(wasm2asm_i32$0 + 7 | 0) >> 0] = (wasm2asm_i32$1 >>> 24 | 0) & 255 | 0; wasm2asm_i32$1 = $4;
HEAP32[wasm2asm_i32$0 >> 2] = wasm2asm_i32$1;
wasm2asm_i32$0 = i64toi32_i32$0;
wasm2asm_i32$1 = i64toi32_i32$2;
(wasm2asm_i32$2 = wasm2asm_i32$0, wasm2asm_i32$3 = wasm2asm_i32$1), ((HEAP8[(wasm2asm_i32$2 + 4 | 0) >> 0] = wasm2asm_i32$3 & 255 | 0, HEAP8[(wasm2asm_i32$2 + 5 | 0) >> 0] = (wasm2asm_i32$3 >>> 8 | 0) & 255 | 0), HEAP8[(wasm2asm_i32$2 + 6 | 0) >> 0] = (wasm2asm_i32$3 >>> 16 | 0) & 255 | 0), HEAP8[(wasm2asm_i32$2 + 7 | 0) >> 0] = (wasm2asm_i32$3 >>> 24 | 0) & 255 | 0;
i64toi32_i32$2 = i64toi32_i32$2; i64toi32_i32$2 = i64toi32_i32$2;
i64toi32_i32$0 = $0 + 24 | 0; i64toi32_i32$0 = $0 + 24 | 0;
i64toi32_i32$2 = i64toi32_i32$2; i64toi32_i32$2 = i64toi32_i32$2;
HEAP32[i64toi32_i32$0 >> 2] = $3; wasm2asm_i32$0 = i64toi32_i32$0;
(wasm2asm_i32$0 = i64toi32_i32$0, wasm2asm_i32$1 = i64toi32_i32$2), ((HEAP8[(wasm2asm_i32$0 + 4 | 0) >> 0] = wasm2asm_i32$1 & 255 | 0, HEAP8[(wasm2asm_i32$0 + 5 | 0) >> 0] = (wasm2asm_i32$1 >>> 8 | 0) & 255 | 0), HEAP8[(wasm2asm_i32$0 + 6 | 0) >> 0] = (wasm2asm_i32$1 >>> 16 | 0) & 255 | 0), HEAP8[(wasm2asm_i32$0 + 7 | 0) >> 0] = (wasm2asm_i32$1 >>> 24 | 0) & 255 | 0; wasm2asm_i32$1 = $4;
HEAP32[wasm2asm_i32$0 >> 2] = wasm2asm_i32$1;
wasm2asm_i32$0 = i64toi32_i32$0;
wasm2asm_i32$1 = i64toi32_i32$2;
(wasm2asm_i32$2 = wasm2asm_i32$0, wasm2asm_i32$3 = wasm2asm_i32$1), ((HEAP8[(wasm2asm_i32$2 + 4 | 0) >> 0] = wasm2asm_i32$3 & 255 | 0, HEAP8[(wasm2asm_i32$2 + 5 | 0) >> 0] = (wasm2asm_i32$3 >>> 8 | 0) & 255 | 0), HEAP8[(wasm2asm_i32$2 + 6 | 0) >> 0] = (wasm2asm_i32$3 >>> 16 | 0) & 255 | 0), HEAP8[(wasm2asm_i32$2 + 7 | 0) >> 0] = (wasm2asm_i32$3 >>> 24 | 0) & 255 | 0;
$2 = $2 - 32 | 0; $2 = $2 - 32 | 0;
$0 = $0 + 32 | 0; $0 = $0 + 32 | 0;
continue continue_0; continue continue_0;
@ -163,31 +247,39 @@ function asmFunc(global, env, buffer) {
function $lib_array_Array_Body__constructor($0, $1) { function $lib_array_Array_Body__constructor($0, $1) {
$0 = $0 | 0; $0 = $0 | 0;
$1 = $1 | 0; $1 = $1 | 0;
var $2 = 0, $3 = 0, $4 = 0; var $2 = 0, $3 = 0, wasm2asm_i32$0 = 0, wasm2asm_i32$1 = 0;
if ($1 >>> 0 > 268435454 >>> 0) { if ($1 >>> 0 > 268435454 >>> 0) {
$lib_env_abort(0 | 0, 8 | 0, 23 | 0, 39 | 0); $lib_env_abort(0 | 0, 8 | 0, 23 | 0, 39 | 0);
abort(); abort();
} }
$3 = $1 << 2 | 0; $2 = $1 << 2 | 0;
$2 = $3; $3 = $lib_allocator_arena_allocate_memory(1 << (32 - Math_clz32($2 + 7 | 0) | 0) | 0 | 0) | 0;
$4 = $lib_allocator_arena_allocate_memory(1 << (32 - Math_clz32($2 + 7 | 0) | 0) | 0 | 0) | 0; wasm2asm_i32$0 = $3;
HEAP32[$4 >> 2] = $2; wasm2asm_i32$1 = $2;
$2 = $4; HEAP32[wasm2asm_i32$0 >> 2] = wasm2asm_i32$1;
if (($0 | 0) == (0 | 0)) { if (($0 | 0) == (0 | 0)) {
$0 = $lib_allocator_arena_allocate_memory(8 | 0) | 0; $0 = $lib_allocator_arena_allocate_memory(8 | 0) | 0;
HEAP32[$0 >> 2] = 0; wasm2asm_i32$0 = $0;
HEAP32[($0 + 4 | 0) >> 2] = 0; wasm2asm_i32$1 = 0;
HEAP32[wasm2asm_i32$0 >> 2] = wasm2asm_i32$1;
wasm2asm_i32$0 = $0;
wasm2asm_i32$1 = 0;
HEAP32[(wasm2asm_i32$0 + 4 | 0) >> 2] = wasm2asm_i32$1;
} }
HEAP32[$0 >> 2] = $2; wasm2asm_i32$0 = $0;
HEAP32[($0 + 4 | 0) >> 2] = $1; wasm2asm_i32$1 = $3;
$lib_memory_set_memory($2 + 8 | 0 | 0, 0 | 0, $3 | 0); HEAP32[wasm2asm_i32$0 >> 2] = wasm2asm_i32$1;
wasm2asm_i32$0 = $0;
wasm2asm_i32$1 = $1;
HEAP32[(wasm2asm_i32$0 + 4 | 0) >> 2] = wasm2asm_i32$1;
$lib_memory_set_memory($3 + 8 | 0 | 0, 0 | 0, $2 | 0);
return $0 | 0; return $0 | 0;
} }
function assembly_index_NBodySystem_constructor($0, $1) { function assembly_index_NBodySystem_constructor($0, $1) {
$0 = $0 | 0; $0 = $0 | 0;
$1 = $1 | 0; $1 = $1 | 0;
var $2 = 0, $3 = 0, $4 = 0.0, $5 = 0.0, $6 = 0.0, $7 = 0.0, $72 = 0, $8 = 0, $50 = 0; var $2 = 0, $3 = 0, $4 = 0.0, $5 = 0.0, $6 = 0.0, $7 = 0.0, $8 = 0, $50 = 0, wasm2asm_i32$0 = 0, wasm2asm_f64$0 = 0.0, wasm2asm_i32$1 = 0;
$8 = HEAP32[($1 + 4 | 0) >> 2] | 0; $8 = HEAP32[($1 + 4 | 0) >> 2] | 0;
break_0 : { break_0 : {
repeat_0 : do { repeat_0 : do {
@ -205,31 +297,48 @@ function asmFunc(global, env, buffer) {
$2 = HEAPU32[$1 >> 2] | 0; $2 = HEAPU32[$1 >> 2] | 0;
if (0 >>> 0 < ((HEAP32[$2 >> 2] | 0) >>> 2 | 0) >>> 0) $50 = HEAPU32[($2 + 8 | 0) >> 2] | 0; else abort(); if (0 >>> 0 < ((HEAP32[$2 >> 2] | 0) >>> 2 | 0) >>> 0) $50 = HEAPU32[($2 + 8 | 0) >> 2] | 0; else abort();
$2 = $50; $2 = $50;
HEAPF64[($2 + 24 | 0) >> 3] = -$5 / 39.47841760435743; wasm2asm_i32$0 = $2;
HEAPF64[($2 + 32 | 0) >> 3] = -$6 / 39.47841760435743; wasm2asm_f64$0 = -$5 / 39.47841760435743;
HEAPF64[($2 + 40 | 0) >> 3] = -$7 / 39.47841760435743; HEAPF64[(wasm2asm_i32$0 + 24 | 0) >> 3] = wasm2asm_f64$0;
if ($0) $72 = $0; else { wasm2asm_i32$0 = $2;
wasm2asm_f64$0 = -$6 / 39.47841760435743;
HEAPF64[(wasm2asm_i32$0 + 32 | 0) >> 3] = wasm2asm_f64$0;
wasm2asm_i32$0 = $2;
wasm2asm_f64$0 = -$7 / 39.47841760435743;
HEAPF64[(wasm2asm_i32$0 + 40 | 0) >> 3] = wasm2asm_f64$0;
if (($0 | 0) == (0 | 0)) {
$2 = $lib_allocator_arena_allocate_memory(4 | 0) | 0; $2 = $lib_allocator_arena_allocate_memory(4 | 0) | 0;
HEAP32[$2 >> 2] = $1; wasm2asm_i32$0 = $2;
$72 = $2; wasm2asm_i32$1 = $1;
HEAP32[wasm2asm_i32$0 >> 2] = wasm2asm_i32$1;
$0 = $2;
} }
return $72 | 0; return $0 | 0;
} }
function assembly_index_init() { function assembly_index_init() {
var $0 = 0, $1 = 0, $2 = 0; var $0 = 0, $1 = 0, wasm2asm_i32$0 = 0, wasm2asm_i32$1 = 0;
$1 = $lib_array_Array_Body__constructor(0 | 0, 5 | 0) | 0; $1 = $lib_array_Array_Body__constructor(0 | 0, 5 | 0) | 0;
$0 = $1; $0 = assembly_index_Body_constructor(0 | 0, +(0.0), +(0.0), +(0.0), +(0.0), +(0.0), +(0.0), +(39.47841760435743)) | 0;
$2 = assembly_index_Body_constructor(0 | 0, +(0.0), +(0.0), +(0.0), +(0.0), +(0.0), +(0.0), +(39.47841760435743)) | 0; wasm2asm_i32$0 = HEAPU32[$1 >> 2] | 0;
HEAP32[((HEAPU32[$1 >> 2] | 0) + 8 | 0) >> 2] = $2; wasm2asm_i32$1 = $0;
HEAP32[(wasm2asm_i32$0 + 8 | 0) >> 2] = wasm2asm_i32$1;
$0 = assembly_index_Body_constructor(0 | 0, +(4.841431442464721), +(-1.1603200440274284), +(-.10362204447112311), +(.606326392995832), +(2.81198684491626), +(-.02521836165988763), +(.03769367487038949)) | 0; $0 = assembly_index_Body_constructor(0 | 0, +(4.841431442464721), +(-1.1603200440274284), +(-.10362204447112311), +(.606326392995832), +(2.81198684491626), +(-.02521836165988763), +(.03769367487038949)) | 0;
HEAP32[(((HEAPU32[$1 >> 2] | 0) + 4 | 0) + 8 | 0) >> 2] = $0; wasm2asm_i32$0 = (HEAPU32[$1 >> 2] | 0) + 4 | 0;
wasm2asm_i32$1 = $0;
HEAP32[(wasm2asm_i32$0 + 8 | 0) >> 2] = wasm2asm_i32$1;
$0 = assembly_index_Body_constructor(0 | 0, +(8.34336671824458), +(4.124798564124305), +(-.4035234171143214), +(-1.0107743461787924), +(1.8256623712304119), +(.008415761376584154), +(.011286326131968767)) | 0; $0 = assembly_index_Body_constructor(0 | 0, +(8.34336671824458), +(4.124798564124305), +(-.4035234171143214), +(-1.0107743461787924), +(1.8256623712304119), +(.008415761376584154), +(.011286326131968767)) | 0;
HEAP32[(((HEAPU32[$1 >> 2] | 0) + 8 | 0) + 8 | 0) >> 2] = $0; wasm2asm_i32$0 = (HEAPU32[$1 >> 2] | 0) + 8 | 0;
wasm2asm_i32$1 = $0;
HEAP32[(wasm2asm_i32$0 + 8 | 0) >> 2] = wasm2asm_i32$1;
$0 = assembly_index_Body_constructor(0 | 0, +(12.894369562139131), +(-15.111151401698631), +(-.22330757889265573), +(1.0827910064415354), +(.8687130181696082), +(-.010832637401363636), +(1.7237240570597112e-03)) | 0; $0 = assembly_index_Body_constructor(0 | 0, +(12.894369562139131), +(-15.111151401698631), +(-.22330757889265573), +(1.0827910064415354), +(.8687130181696082), +(-.010832637401363636), +(1.7237240570597112e-03)) | 0;
HEAP32[(((HEAPU32[$1 >> 2] | 0) + 12 | 0) + 8 | 0) >> 2] = $0; wasm2asm_i32$0 = (HEAPU32[$1 >> 2] | 0) + 12 | 0;
wasm2asm_i32$1 = $0;
HEAP32[(wasm2asm_i32$0 + 8 | 0) >> 2] = wasm2asm_i32$1;
$0 = assembly_index_Body_constructor(0 | 0, +(15.379697114850917), +(-25.919314609987964), +(.17925877295037118), +(.979090732243898), +(.5946989986476762), +(-.034755955504078104), +(2.0336868699246304e-03)) | 0; $0 = assembly_index_Body_constructor(0 | 0, +(15.379697114850917), +(-25.919314609987964), +(.17925877295037118), +(.979090732243898), +(.5946989986476762), +(-.034755955504078104), +(2.0336868699246304e-03)) | 0;
HEAP32[(((HEAPU32[$1 >> 2] | 0) + 16 | 0) + 8 | 0) >> 2] = $0; wasm2asm_i32$0 = (HEAPU32[$1 >> 2] | 0) + 16 | 0;
wasm2asm_i32$1 = $0;
HEAP32[(wasm2asm_i32$0 + 8 | 0) >> 2] = wasm2asm_i32$1;
assembly_index_system = assembly_index_NBodySystem_constructor(0 | 0, $1 | 0) | 0; assembly_index_system = assembly_index_NBodySystem_constructor(0 | 0, $1 | 0) | 0;
} }
@ -242,13 +351,14 @@ function asmFunc(global, env, buffer) {
if ($0 >>> 0 < ((HEAP32[$1 >> 2] | 0) >>> 2 | 0) >>> 0) $20 = HEAPU32[(($1 + ($0 << 2 | 0) | 0) + 8 | 0) >> 2] | 0; else abort(); if ($0 >>> 0 < ((HEAP32[$1 >> 2] | 0) >>> 2 | 0) >>> 0) $20 = HEAPU32[(($1 + ($0 << 2 | 0) | 0) + 8 | 0) >> 2] | 0; else abort();
$22 = $20; $22 = $20;
} else $22 = 0; } else $22 = 0;
return $22 | 0; $0 = $22;
return $0 | 0;
} }
function assembly_index_NBodySystem_advance($0, $1) { function assembly_index_NBodySystem_advance($0, $1) {
$0 = $0 | 0; $0 = $0 | 0;
$1 = +$1; $1 = +$1;
var $2 = 0, $3 = 0.0, $9 = 0.0, $4 = 0, $5 = 0.0, $6 = 0.0, $7 = 0.0, $8 = 0, $10 = 0.0, $11 = 0.0, $12 = 0.0, $13 = 0, $14 = 0, $15 = 0.0, $16 = 0.0, $17 = 0.0, $18 = 0.0; var $2 = 0, $3 = 0.0, $9 = 0.0, $4 = 0, $5 = 0.0, $6 = 0.0, $7 = 0.0, $8 = 0, $10 = 0.0, $11 = 0.0, $12 = 0.0, $13 = 0, $14 = 0, $19 = 0.0, $15 = 0.0, $16 = 0.0, $17 = 0.0, $18 = 0.0, wasm2asm_i32$0 = 0, wasm2asm_f64$0 = 0.0;
$13 = HEAPU32[$0 >> 2] | 0; $13 = HEAPU32[$0 >> 2] | 0;
$14 = HEAP32[($13 + 4 | 0) >> 2] | 0; $14 = HEAP32[($13 + 4 | 0) >> 2] | 0;
break_0 : { break_0 : {
@ -267,30 +377,50 @@ function asmFunc(global, env, buffer) {
repeat_1 : do { repeat_1 : do {
if ($8 >>> 0 >= $14 >>> 0) break break_1; if ($8 >>> 0 >= $14 >>> 0) break break_1;
$2 = HEAPU32[(((HEAPU32[$13 >> 2] | 0) + ($8 << 2 | 0) | 0) + 8 | 0) >> 2] | 0; $2 = HEAPU32[(((HEAPU32[$13 >> 2] | 0) + ($8 << 2 | 0) | 0) + 8 | 0) >> 2] | 0;
$10 = $15 - +HEAPF64[$2 >> 3]; $19 = $15 - +HEAPF64[$2 >> 3];
$11 = $16 - +HEAPF64[($2 + 8 | 0) >> 3]; $3 = $19;
$12 = $17 - +HEAPF64[($2 + 16 | 0) >> 3]; $10 = $16 - +HEAPF64[($2 + 8 | 0) >> 3];
$3 = $10 * $10 + $11 * $11 + $12 * $12; $11 = $17 - +HEAPF64[($2 + 16 | 0) >> 3];
$9 = $1 / ($3 * Math_sqrt($3)); $9 = $3 * $3 + $10 * $10 + $11 * $11;
$3 = $18 * $9; $12 = Math_sqrt($9);
$9 = +HEAPF64[($2 + 48 | 0) >> 3] * $9; $12 = $1 / ($9 * $12);
$5 = $5 - $10 * $9; $9 = +HEAPF64[($2 + 48 | 0) >> 3] * $12;
$6 = $6 - $11 * $9; $5 = $5 - $3 * $9;
$7 = $7 - $12 * $9; $6 = $6 - $10 * $9;
HEAPF64[($2 + 24 | 0) >> 3] = +HEAPF64[($2 + 24 | 0) >> 3] + $10 * $3; $7 = $7 - $11 * $9;
HEAPF64[($2 + 32 | 0) >> 3] = +HEAPF64[($2 + 32 | 0) >> 3] + $11 * $3; $3 = $18 * $12;
HEAPF64[($2 + 40 | 0) >> 3] = +HEAPF64[($2 + 40 | 0) >> 3] + $12 * $3; wasm2asm_i32$0 = $2;
wasm2asm_f64$0 = +HEAPF64[($2 + 24 | 0) >> 3] + $19 * $3;
HEAPF64[(wasm2asm_i32$0 + 24 | 0) >> 3] = wasm2asm_f64$0;
wasm2asm_i32$0 = $2;
wasm2asm_f64$0 = +HEAPF64[($2 + 32 | 0) >> 3] + $10 * $3;
HEAPF64[(wasm2asm_i32$0 + 32 | 0) >> 3] = wasm2asm_f64$0;
wasm2asm_i32$0 = $2;
wasm2asm_f64$0 = +HEAPF64[($2 + 40 | 0) >> 3] + $11 * $3;
HEAPF64[(wasm2asm_i32$0 + 40 | 0) >> 3] = wasm2asm_f64$0;
$8 = $8 + 1 | 0; $8 = $8 + 1 | 0;
continue repeat_1; continue repeat_1;
break repeat_1; break repeat_1;
} while (1); } while (1);
}; };
HEAPF64[($0 + 24 | 0) >> 3] = $5; wasm2asm_i32$0 = $0;
HEAPF64[($0 + 32 | 0) >> 3] = $6; wasm2asm_f64$0 = $5;
HEAPF64[($0 + 40 | 0) >> 3] = $7; HEAPF64[(wasm2asm_i32$0 + 24 | 0) >> 3] = wasm2asm_f64$0;
HEAPF64[$0 >> 3] = +HEAPF64[$0 >> 3] + $1 * $5; wasm2asm_i32$0 = $0;
HEAPF64[($0 + 8 | 0) >> 3] = +HEAPF64[($0 + 8 | 0) >> 3] + $1 * $6; wasm2asm_f64$0 = $6;
HEAPF64[($0 + 16 | 0) >> 3] = +HEAPF64[($0 + 16 | 0) >> 3] + $1 * $7; HEAPF64[(wasm2asm_i32$0 + 32 | 0) >> 3] = wasm2asm_f64$0;
wasm2asm_i32$0 = $0;
wasm2asm_f64$0 = $7;
HEAPF64[(wasm2asm_i32$0 + 40 | 0) >> 3] = wasm2asm_f64$0;
wasm2asm_i32$0 = $0;
wasm2asm_f64$0 = +HEAPF64[$0 >> 3] + $1 * $5;
HEAPF64[wasm2asm_i32$0 >> 3] = wasm2asm_f64$0;
wasm2asm_i32$0 = $0;
wasm2asm_f64$0 = +HEAPF64[($0 + 8 | 0) >> 3] + $1 * $6;
HEAPF64[(wasm2asm_i32$0 + 8 | 0) >> 3] = wasm2asm_f64$0;
wasm2asm_i32$0 = $0;
wasm2asm_f64$0 = +HEAPF64[($0 + 16 | 0) >> 3] + $1 * $7;
HEAPF64[(wasm2asm_i32$0 + 16 | 0) >> 3] = wasm2asm_f64$0;
$4 = $4 + 1 | 0; $4 = $4 + 1 | 0;
continue repeat_0; continue repeat_0;
break repeat_0; break repeat_0;

Binary file not shown.

View File

@ -26,7 +26,6 @@
(local $1 i32) (local $1 i32)
(local $2 i32) (local $2 i32)
(local $3 i32) (local $3 i32)
(local $4 i32)
(if (if
(get_local $0) (get_local $0)
(block (block
@ -65,26 +64,24 @@
(grow_memory (grow_memory
(select (select
(get_local $2) (get_local $2)
(tee_local $4 (tee_local $3
(tee_local $3 (i32.shr_u
(i32.shr_u (i32.and
(i32.and (i32.add
(i32.add (i32.sub
(i32.sub (get_local $0)
(get_local $0) (get_local $1)
(get_local $1)
)
(i32.const 65535)
) )
(i32.const -65536) (i32.const 65535)
) )
(i32.const 16) (i32.const -65536)
) )
(i32.const 16)
) )
) )
(i32.gt_s (i32.gt_s
(get_local $2) (get_local $2)
(get_local $4) (get_local $3)
) )
) )
) )
@ -112,13 +109,13 @@
(i32.const 0) (i32.const 0)
) )
(func $assembly/index/Body#constructor (; 2 ;) (type $iFFFFFFFi) (param $0 i32) (param $1 f64) (param $2 f64) (param $3 f64) (param $4 f64) (param $5 f64) (param $6 f64) (param $7 f64) (result i32) (func $assembly/index/Body#constructor (; 2 ;) (type $iFFFFFFFi) (param $0 i32) (param $1 f64) (param $2 f64) (param $3 f64) (param $4 f64) (param $5 f64) (param $6 f64) (param $7 f64) (result i32)
(local $8 i32) (if
(if (result i32) (i32.eqz
(get_local $0) (get_local $0)
(get_local $0) )
(block (result i32) (block
(f64.store (f64.store
(tee_local $8 (tee_local $0
(call $~lib/allocator/arena/allocate_memory (call $~lib/allocator/arena/allocate_memory
(i32.const 56) (i32.const 56)
) )
@ -126,36 +123,36 @@
(get_local $1) (get_local $1)
) )
(f64.store offset=8 (f64.store offset=8
(get_local $8) (get_local $0)
(get_local $2) (get_local $2)
) )
(f64.store offset=16 (f64.store offset=16
(get_local $8) (get_local $0)
(get_local $3) (get_local $3)
) )
(f64.store offset=24 (f64.store offset=24
(get_local $8) (get_local $0)
(get_local $4) (get_local $4)
) )
(f64.store offset=32 (f64.store offset=32
(get_local $8) (get_local $0)
(get_local $5) (get_local $5)
) )
(f64.store offset=40 (f64.store offset=40
(get_local $8) (get_local $0)
(get_local $6) (get_local $6)
) )
(f64.store offset=48 (f64.store offset=48
(get_local $8) (get_local $0)
(get_local $7) (get_local $7)
) )
(get_local $8)
) )
) )
(get_local $0)
) )
(func $~lib/memory/set_memory (; 3 ;) (type $iiiv) (param $0 i32) (param $1 i32) (param $2 i32) (func $~lib/memory/set_memory (; 3 ;) (type $iiiv) (param $0 i32) (param $1 i32) (param $2 i32)
(local $3 i64) (local $3 i32)
(local $4 i32) (local $4 i64)
(if (if
(i32.eqz (i32.eqz
(get_local $2) (get_local $2)
@ -199,9 +196,11 @@
) )
(i32.store8 (i32.store8
(i32.sub (i32.sub
(i32.add (tee_local $3
(get_local $0) (i32.add
(get_local $2) (get_local $0)
(get_local $2)
)
) )
(i32.const 2) (i32.const 2)
) )
@ -209,10 +208,7 @@
) )
(i32.store8 (i32.store8
(i32.sub (i32.sub
(i32.add (get_local $3)
(get_local $0)
(get_local $2)
)
(i32.const 3) (i32.const 3)
) )
(get_local $1) (get_local $1)
@ -248,19 +244,25 @@
) )
(return) (return)
) )
(set_local $2
(i32.sub
(get_local $2)
(tee_local $3
(i32.and
(i32.sub
(i32.const 0)
(get_local $0)
)
(i32.const 3)
)
)
)
)
(i32.store (i32.store
(tee_local $0 (tee_local $0
(i32.add (i32.add
(get_local $0) (get_local $0)
(tee_local $4 (get_local $3)
(i32.and
(i32.sub
(i32.const 0)
(get_local $0)
)
(i32.const 3)
)
)
) )
) )
(tee_local $1 (tee_local $1
@ -279,10 +281,7 @@
(get_local $0) (get_local $0)
(tee_local $2 (tee_local $2
(i32.and (i32.and
(i32.sub (get_local $2)
(get_local $2)
(get_local $4)
)
(i32.const -4) (i32.const -4)
) )
) )
@ -314,9 +313,11 @@
) )
(i32.store (i32.store
(i32.sub (i32.sub
(i32.add (tee_local $3
(get_local $0) (i32.add
(get_local $2) (get_local $0)
(get_local $2)
)
) )
(i32.const 12) (i32.const 12)
) )
@ -324,10 +325,7 @@
) )
(i32.store (i32.store
(i32.sub (i32.sub
(i32.add (get_local $3)
(get_local $0)
(get_local $2)
)
(i32.const 8) (i32.const 8)
) )
(get_local $1) (get_local $1)
@ -369,9 +367,11 @@
) )
(i32.store (i32.store
(i32.sub (i32.sub
(i32.add (tee_local $3
(get_local $0) (i32.add
(get_local $2) (get_local $0)
(get_local $2)
)
) )
(i32.const 28) (i32.const 28)
) )
@ -379,30 +379,21 @@
) )
(i32.store (i32.store
(i32.sub (i32.sub
(i32.add (get_local $3)
(get_local $0)
(get_local $2)
)
(i32.const 24) (i32.const 24)
) )
(get_local $1) (get_local $1)
) )
(i32.store (i32.store
(i32.sub (i32.sub
(i32.add (get_local $3)
(get_local $0)
(get_local $2)
)
(i32.const 20) (i32.const 20)
) )
(get_local $1) (get_local $1)
) )
(i32.store (i32.store
(i32.sub (i32.sub
(i32.add (get_local $3)
(get_local $0)
(get_local $2)
)
(i32.const 16) (i32.const 16)
) )
(get_local $1) (get_local $1)
@ -410,7 +401,7 @@
(set_local $0 (set_local $0
(i32.add (i32.add
(get_local $0) (get_local $0)
(tee_local $4 (tee_local $3
(i32.add (i32.add
(i32.and (i32.and
(get_local $0) (get_local $0)
@ -424,18 +415,18 @@
(set_local $2 (set_local $2
(i32.sub (i32.sub
(get_local $2) (get_local $2)
(get_local $4) (get_local $3)
) )
) )
(set_local $3 (set_local $4
(i64.or (i64.or
(i64.extend_u/i32 (tee_local $4
(get_local $1)
)
(i64.shl
(i64.extend_u/i32 (i64.extend_u/i32
(get_local $1) (get_local $1)
) )
)
(i64.shl
(get_local $4)
(i64.const 32) (i64.const 32)
) )
) )
@ -449,28 +440,28 @@
(block (block
(i64.store (i64.store
(get_local $0) (get_local $0)
(get_local $3) (get_local $4)
) )
(i64.store (i64.store
(i32.add (i32.add
(get_local $0) (get_local $0)
(i32.const 8) (i32.const 8)
) )
(get_local $3) (get_local $4)
) )
(i64.store (i64.store
(i32.add (i32.add
(get_local $0) (get_local $0)
(i32.const 16) (i32.const 16)
) )
(get_local $3) (get_local $4)
) )
(i64.store (i64.store
(i32.add (i32.add
(get_local $0) (get_local $0)
(i32.const 24) (i32.const 24)
) )
(get_local $3) (get_local $4)
) )
(set_local $2 (set_local $2
(i32.sub (i32.sub
@ -492,7 +483,6 @@
(func $~lib/array/Array<Body>#constructor (; 4 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) (func $~lib/array/Array<Body>#constructor (; 4 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32)
(local $2 i32) (local $2 i32)
(local $3 i32) (local $3 i32)
(local $4 i32)
(if (if
(i32.gt_u (i32.gt_u
(get_local $1) (get_local $1)
@ -509,7 +499,7 @@
) )
) )
(i32.store (i32.store
(tee_local $4 (tee_local $3
(call $~lib/allocator/arena/allocate_memory (call $~lib/allocator/arena/allocate_memory
(i32.shl (i32.shl
(i32.const 1) (i32.const 1)
@ -518,11 +508,9 @@
(i32.clz (i32.clz
(i32.add (i32.add
(tee_local $2 (tee_local $2
(tee_local $3 (i32.shl
(i32.shl (get_local $1)
(get_local $1) (i32.const 2)
(i32.const 2)
)
) )
) )
(i32.const 7) (i32.const 7)
@ -534,9 +522,6 @@
) )
(get_local $2) (get_local $2)
) )
(set_local $2
(get_local $4)
)
(if (if
(i32.eqz (i32.eqz
(get_local $0) (get_local $0)
@ -558,7 +543,7 @@
) )
(i32.store (i32.store
(get_local $0) (get_local $0)
(get_local $2) (get_local $3)
) )
(i32.store offset=4 (i32.store offset=4
(get_local $0) (get_local $0)
@ -566,11 +551,11 @@
) )
(call $~lib/memory/set_memory (call $~lib/memory/set_memory
(i32.add (i32.add
(get_local $2) (get_local $3)
(i32.const 8) (i32.const 8)
) )
(i32.const 0) (i32.const 0)
(get_local $3) (get_local $2)
) )
(get_local $0) (get_local $0)
) )
@ -701,10 +686,11 @@
(f64.const 39.47841760435743) (f64.const 39.47841760435743)
) )
) )
(if (result i32) (if
(get_local $0) (i32.eqz
(get_local $0) (get_local $0)
(block (result i32) )
(block
(i32.store (i32.store
(tee_local $2 (tee_local $2
(call $~lib/allocator/arena/allocate_memory (call $~lib/allocator/arena/allocate_memory
@ -713,172 +699,172 @@
) )
(get_local $1) (get_local $1)
) )
(get_local $2) (set_local $0
(get_local $2)
)
) )
) )
(get_local $0)
) )
(func $assembly/index/init (; 6 ;) (type $v) (func $assembly/index/init (; 6 ;) (type $v)
(local $0 i32) (local $0 i32)
(local $1 i32) (local $1 i32)
(local $2 i32) (set_local $1
(call $~lib/array/Array<Body>#constructor
(i32.const 0)
(i32.const 5)
)
)
(set_local $0
(call $assembly/index/Body#constructor
(i32.const 0)
(f64.const 0)
(f64.const 0)
(f64.const 0)
(f64.const 0)
(f64.const 0)
(f64.const 0)
(f64.const 39.47841760435743)
)
)
(i32.store offset=8
(i32.load
(get_local $1)
)
(get_local $0)
)
(set_local $0
(call $assembly/index/Body#constructor
(i32.const 0)
(f64.const 4.841431442464721)
(f64.const -1.1603200440274284)
(f64.const -0.10362204447112311)
(f64.const 0.606326392995832)
(f64.const 2.81198684491626)
(f64.const -0.02521836165988763)
(f64.const 0.03769367487038949)
)
)
(i32.store offset=8
(i32.add
(i32.load
(get_local $1)
)
(i32.const 4)
)
(get_local $0)
)
(set_local $0
(call $assembly/index/Body#constructor
(i32.const 0)
(f64.const 8.34336671824458)
(f64.const 4.124798564124305)
(f64.const -0.4035234171143214)
(f64.const -1.0107743461787924)
(f64.const 1.8256623712304119)
(f64.const 0.008415761376584154)
(f64.const 0.011286326131968767)
)
)
(i32.store offset=8
(i32.add
(i32.load
(get_local $1)
)
(i32.const 8)
)
(get_local $0)
)
(set_local $0
(call $assembly/index/Body#constructor
(i32.const 0)
(f64.const 12.894369562139131)
(f64.const -15.111151401698631)
(f64.const -0.22330757889265573)
(f64.const 1.0827910064415354)
(f64.const 0.8687130181696082)
(f64.const -0.010832637401363636)
(f64.const 1.7237240570597112e-03)
)
)
(i32.store offset=8
(i32.add
(i32.load
(get_local $1)
)
(i32.const 12)
)
(get_local $0)
)
(set_local $0
(call $assembly/index/Body#constructor
(i32.const 0)
(f64.const 15.379697114850917)
(f64.const -25.919314609987964)
(f64.const 0.17925877295037118)
(f64.const 0.979090732243898)
(f64.const 0.5946989986476762)
(f64.const -0.034755955504078104)
(f64.const 2.0336868699246304e-03)
)
)
(i32.store offset=8
(i32.add
(i32.load
(get_local $1)
)
(i32.const 16)
)
(get_local $0)
)
(set_global $assembly/index/system (set_global $assembly/index/system
(call $assembly/index/NBodySystem#constructor (call $assembly/index/NBodySystem#constructor
(i32.const 0) (i32.const 0)
(block (result i32) (get_local $1)
(set_local $0
(tee_local $1
(call $~lib/array/Array<Body>#constructor
(i32.const 0)
(i32.const 5)
)
)
)
(set_local $2
(call $assembly/index/Body#constructor
(i32.const 0)
(f64.const 0)
(f64.const 0)
(f64.const 0)
(f64.const 0)
(f64.const 0)
(f64.const 0)
(f64.const 39.47841760435743)
)
)
(i32.store offset=8
(i32.load
(get_local $0)
)
(get_local $2)
)
(set_local $0
(call $assembly/index/Body#constructor
(i32.const 0)
(f64.const 4.841431442464721)
(f64.const -1.1603200440274284)
(f64.const -0.10362204447112311)
(f64.const 0.606326392995832)
(f64.const 2.81198684491626)
(f64.const -0.02521836165988763)
(f64.const 0.03769367487038949)
)
)
(i32.store offset=8
(i32.add
(i32.load
(get_local $1)
)
(i32.const 4)
)
(get_local $0)
)
(set_local $0
(call $assembly/index/Body#constructor
(i32.const 0)
(f64.const 8.34336671824458)
(f64.const 4.124798564124305)
(f64.const -0.4035234171143214)
(f64.const -1.0107743461787924)
(f64.const 1.8256623712304119)
(f64.const 0.008415761376584154)
(f64.const 0.011286326131968767)
)
)
(i32.store offset=8
(i32.add
(i32.load
(get_local $1)
)
(i32.const 8)
)
(get_local $0)
)
(set_local $0
(call $assembly/index/Body#constructor
(i32.const 0)
(f64.const 12.894369562139131)
(f64.const -15.111151401698631)
(f64.const -0.22330757889265573)
(f64.const 1.0827910064415354)
(f64.const 0.8687130181696082)
(f64.const -0.010832637401363636)
(f64.const 1.7237240570597112e-03)
)
)
(i32.store offset=8
(i32.add
(i32.load
(get_local $1)
)
(i32.const 12)
)
(get_local $0)
)
(set_local $0
(call $assembly/index/Body#constructor
(i32.const 0)
(f64.const 15.379697114850917)
(f64.const -25.919314609987964)
(f64.const 0.17925877295037118)
(f64.const 0.979090732243898)
(f64.const 0.5946989986476762)
(f64.const -0.034755955504078104)
(f64.const 2.0336868699246304e-03)
)
)
(i32.store offset=8
(i32.add
(i32.load
(get_local $1)
)
(i32.const 16)
)
(get_local $0)
)
(get_local $1)
)
) )
) )
) )
(func $assembly/index/getBody (; 7 ;) (type $ii) (param $0 i32) (result i32) (func $assembly/index/getBody (; 7 ;) (type $ii) (param $0 i32) (result i32)
(local $1 i32) (local $1 i32)
(if (result i32) (tee_local $0
(i32.lt_u
(get_local $0)
(i32.load offset=4
(tee_local $1
(i32.load
(get_global $assembly/index/system)
)
)
)
)
(if (result i32) (if (result i32)
(i32.lt_u (i32.lt_u
(get_local $0) (get_local $0)
(i32.shr_u (i32.load offset=4
(i32.load (tee_local $1
(tee_local $1 (i32.load
(i32.load (get_global $assembly/index/system)
(get_local $1)
)
) )
) )
(i32.const 2)
) )
) )
(i32.load offset=8 (if (result i32)
(i32.add (i32.lt_u
(get_local $1) (get_local $0)
(i32.shl (i32.shr_u
(get_local $0) (i32.load
(tee_local $1
(i32.load
(get_local $1)
)
)
)
(i32.const 2) (i32.const 2)
) )
) )
(i32.load offset=8
(i32.add
(get_local $1)
(i32.shl
(get_local $0)
(i32.const 2)
)
)
)
(unreachable)
) )
(unreachable) (i32.const 0)
) )
(i32.const 0)
) )
) )
(func $assembly/index/NBodySystem#advance (; 8 ;) (type $iFv) (param $0 i32) (param $1 f64) (func $assembly/index/NBodySystem#advance (; 8 ;) (type $iFv) (param $0 i32) (param $1 f64)
@ -899,6 +885,7 @@
(local $16 f64) (local $16 f64)
(local $17 f64) (local $17 f64)
(local $18 f64) (local $18 f64)
(local $19 f64)
(set_local $14 (set_local $14
(i32.load offset=4 (i32.load offset=4
(tee_local $13 (tee_local $13
@ -977,67 +964,58 @@
(get_local $14) (get_local $14)
) )
) )
(set_local $3 (set_local $12
(f64.mul (f64.sqrt
(get_local $18)
(tee_local $9 (tee_local $9
(f64.div (f64.add
(get_local $1) (f64.add
(f64.mul (f64.mul
(tee_local $3 (tee_local $3
(f64.add (tee_local $19
(f64.add (f64.sub
(f64.mul (get_local $15)
(tee_local $10 (f64.load
(f64.sub (tee_local $2
(get_local $15) (i32.load offset=8
(f64.load (i32.add
(tee_local $2 (i32.load
(i32.load offset=8 (get_local $13)
(i32.add )
(i32.load (i32.shl
(get_local $13) (get_local $8)
) (i32.const 2)
(i32.shl
(get_local $8)
(i32.const 2)
)
)
) )
) )
) )
) )
) )
(get_local $10)
)
(f64.mul
(tee_local $11
(f64.sub
(get_local $16)
(f64.load offset=8
(get_local $2)
)
)
)
(get_local $11)
) )
) )
(f64.mul )
(tee_local $12 (get_local $3)
(f64.sub )
(get_local $17) (f64.mul
(f64.load offset=16 (tee_local $10
(get_local $2) (f64.sub
) (get_local $16)
) (f64.load offset=8
(get_local $2)
) )
(get_local $12) )
)
(get_local $10)
)
)
(f64.mul
(tee_local $11
(f64.sub
(get_local $17)
(f64.load offset=16
(get_local $2)
) )
) )
) )
(f64.sqrt (get_local $11)
(get_local $3)
)
) )
) )
) )
@ -1047,13 +1025,21 @@
(f64.sub (f64.sub
(get_local $5) (get_local $5)
(f64.mul (f64.mul
(get_local $10) (get_local $3)
(tee_local $9 (tee_local $9
(f64.mul (f64.mul
(f64.load offset=48 (f64.load offset=48
(get_local $2) (get_local $2)
) )
(get_local $9) (tee_local $12
(f64.div
(get_local $1)
(f64.mul
(get_local $9)
(get_local $12)
)
)
)
) )
) )
) )
@ -1063,7 +1049,7 @@
(f64.sub (f64.sub
(get_local $6) (get_local $6)
(f64.mul (f64.mul
(get_local $11) (get_local $10)
(get_local $9) (get_local $9)
) )
) )
@ -1072,7 +1058,7 @@
(f64.sub (f64.sub
(get_local $7) (get_local $7)
(f64.mul (f64.mul
(get_local $12) (get_local $11)
(get_local $9) (get_local $9)
) )
) )
@ -1084,8 +1070,13 @@
(get_local $2) (get_local $2)
) )
(f64.mul (f64.mul
(get_local $10) (get_local $19)
(get_local $3) (tee_local $3
(f64.mul
(get_local $18)
(get_local $12)
)
)
) )
) )
) )
@ -1096,7 +1087,7 @@
(get_local $2) (get_local $2)
) )
(f64.mul (f64.mul
(get_local $11) (get_local $10)
(get_local $3) (get_local $3)
) )
) )
@ -1108,7 +1099,7 @@
(get_local $2) (get_local $2)
) )
(f64.mul (f64.mul
(get_local $12) (get_local $11)
(get_local $3) (get_local $3)
) )
) )

View File

@ -188,9 +188,7 @@
) )
) )
;;@ ~lib/allocator/arena.ts:34:9 ;;@ ~lib/allocator/arena.ts:34:9
(return (i32.const 0)
(i32.const 0)
)
) )
(func $assembly/index/Body#constructor (; 2 ;) (type $iFFFFFFFi) (param $0 i32) (param $1 f64) (param $2 f64) (param $3 f64) (param $4 f64) (param $5 f64) (param $6 f64) (param $7 f64) (result i32) (func $assembly/index/Body#constructor (; 2 ;) (type $iFFFFFFFi) (param $0 i32) (param $1 f64) (param $2 f64) (param $3 f64) (param $4 f64) (param $5 f64) (param $6 f64) (param $7 f64) (result i32)
(local $8 i32) (local $8 i32)
@ -243,205 +241,188 @@
) )
(func $assembly/index/Sun (; 3 ;) (type $i) (result i32) (func $assembly/index/Sun (; 3 ;) (type $i) (result i32)
;;@ assembly/index.ts:31:21 ;;@ assembly/index.ts:31:21
(return (call $assembly/index/Body#constructor
;;@ assembly/index.ts:32:9 (i32.const 0)
(call $assembly/index/Body#constructor ;;@ assembly/index.ts:33:4
(i32.const 0) (f64.const 0)
;;@ assembly/index.ts:33:4 ;;@ assembly/index.ts:33:9
(f64.const 0) (f64.const 0)
;;@ assembly/index.ts:33:9 ;;@ assembly/index.ts:33:14
(f64.const 0) (f64.const 0)
;;@ assembly/index.ts:33:14 ;;@ assembly/index.ts:33:19
(f64.const 0) (f64.const 0)
;;@ assembly/index.ts:33:19 ;;@ assembly/index.ts:33:24
(f64.const 0) (f64.const 0)
;;@ assembly/index.ts:33:24 ;;@ assembly/index.ts:33:29
(f64.const 0) (f64.const 0)
;;@ assembly/index.ts:33:29 ;;@ assembly/index.ts:33:34
(f64.const 0) (f64.const 39.47841760435743)
;;@ assembly/index.ts:33:34
(f64.const 39.47841760435743)
)
) )
) )
(func $assembly/index/Jupiter (; 4 ;) (type $i) (result i32) (func $assembly/index/Jupiter (; 4 ;) (type $i) (result i32)
;;@ assembly/index.ts:37:25 ;;@ assembly/index.ts:37:25
(return (call $assembly/index/Body#constructor
;;@ assembly/index.ts:38:9 (i32.const 0)
(call $assembly/index/Body#constructor ;;@ assembly/index.ts:39:4
(i32.const 0) (f64.const 4.841431442464721)
;;@ assembly/index.ts:39:4 ;;@ assembly/index.ts:40:4
(f64.const 4.841431442464721) (f64.const -1.1603200440274284)
;;@ assembly/index.ts:40:4 ;;@ assembly/index.ts:41:4
(f64.const -1.1603200440274284) (f64.const -0.10362204447112311)
;;@ assembly/index.ts:41:4 ;;@ assembly/index.ts:42:4
(f64.const -0.10362204447112311) (f64.mul
;;@ assembly/index.ts:42:4 (f64.const 0.001660076642744037)
(f64.mul ;;@ assembly/index.ts:42:30
(f64.const 0.001660076642744037) (f64.const 365.24)
;;@ assembly/index.ts:42:30 )
(f64.const 365.24) ;;@ assembly/index.ts:43:4
) (f64.mul
;;@ assembly/index.ts:43:4 (f64.const 0.007699011184197404)
(f64.mul ;;@ assembly/index.ts:43:30
(f64.const 0.007699011184197404) (f64.const 365.24)
;;@ assembly/index.ts:43:30 )
(f64.const 365.24) ;;@ assembly/index.ts:44:4
) (f64.mul
;;@ assembly/index.ts:44:4 (f64.const -6.90460016972063e-05)
(f64.mul ;;@ assembly/index.ts:44:31
(f64.const -6.90460016972063e-05) (f64.const 365.24)
;;@ assembly/index.ts:44:31 )
(f64.const 365.24) ;;@ assembly/index.ts:45:4
) (f64.mul
;;@ assembly/index.ts:45:4 (f64.const 9.547919384243266e-04)
(f64.mul ;;@ assembly/index.ts:45:30
(f64.const 9.547919384243266e-04) (f64.const 39.47841760435743)
;;@ assembly/index.ts:45:30
(f64.const 39.47841760435743)
)
) )
) )
) )
(func $assembly/index/Saturn (; 5 ;) (type $i) (result i32) (func $assembly/index/Saturn (; 5 ;) (type $i) (result i32)
;;@ assembly/index.ts:49:24 ;;@ assembly/index.ts:49:24
(return (call $assembly/index/Body#constructor
;;@ assembly/index.ts:50:9 (i32.const 0)
(call $assembly/index/Body#constructor ;;@ assembly/index.ts:51:4
(i32.const 0) (f64.const 8.34336671824458)
;;@ assembly/index.ts:51:4 ;;@ assembly/index.ts:52:4
(f64.const 8.34336671824458) (f64.const 4.124798564124305)
;;@ assembly/index.ts:52:4 ;;@ assembly/index.ts:53:4
(f64.const 4.124798564124305) (f64.const -0.4035234171143214)
;;@ assembly/index.ts:53:4 ;;@ assembly/index.ts:54:4
(f64.const -0.4035234171143214) (f64.mul
;;@ assembly/index.ts:54:4 (f64.const -0.002767425107268624)
(f64.mul ;;@ assembly/index.ts:54:31
(f64.const -0.002767425107268624) (f64.const 365.24)
;;@ assembly/index.ts:54:31 )
(f64.const 365.24) ;;@ assembly/index.ts:55:4
) (f64.mul
;;@ assembly/index.ts:55:4 (f64.const 0.004998528012349172)
(f64.mul ;;@ assembly/index.ts:55:30
(f64.const 0.004998528012349172) (f64.const 365.24)
;;@ assembly/index.ts:55:30 )
(f64.const 365.24) ;;@ assembly/index.ts:56:4
) (f64.mul
;;@ assembly/index.ts:56:4 (f64.const 2.3041729757376393e-05)
(f64.mul ;;@ assembly/index.ts:56:30
(f64.const 2.3041729757376393e-05) (f64.const 365.24)
;;@ assembly/index.ts:56:30 )
(f64.const 365.24) ;;@ assembly/index.ts:57:4
) (f64.mul
;;@ assembly/index.ts:57:4 (f64.const 2.858859806661308e-04)
(f64.mul ;;@ assembly/index.ts:57:30
(f64.const 2.858859806661308e-04) (f64.const 39.47841760435743)
;;@ assembly/index.ts:57:30
(f64.const 39.47841760435743)
)
) )
) )
) )
(func $assembly/index/Uranus (; 6 ;) (type $i) (result i32) (func $assembly/index/Uranus (; 6 ;) (type $i) (result i32)
;;@ assembly/index.ts:61:24 ;;@ assembly/index.ts:61:24
(return (call $assembly/index/Body#constructor
;;@ assembly/index.ts:62:9 (i32.const 0)
(call $assembly/index/Body#constructor ;;@ assembly/index.ts:63:4
(i32.const 0) (f64.const 12.894369562139131)
;;@ assembly/index.ts:63:4 ;;@ assembly/index.ts:64:4
(f64.const 12.894369562139131) (f64.const -15.111151401698631)
;;@ assembly/index.ts:64:4 ;;@ assembly/index.ts:65:4
(f64.const -15.111151401698631) (f64.const -0.22330757889265573)
;;@ assembly/index.ts:65:4 ;;@ assembly/index.ts:66:4
(f64.const -0.22330757889265573) (f64.mul
;;@ assembly/index.ts:66:4 (f64.const 0.002964601375647616)
(f64.mul ;;@ assembly/index.ts:66:30
(f64.const 0.002964601375647616) (f64.const 365.24)
;;@ assembly/index.ts:66:30 )
(f64.const 365.24) ;;@ assembly/index.ts:67:4
) (f64.mul
;;@ assembly/index.ts:67:4 (f64.const 2.3784717395948095e-03)
(f64.mul ;;@ assembly/index.ts:67:30
(f64.const 2.3784717395948095e-03) (f64.const 365.24)
;;@ assembly/index.ts:67:30 )
(f64.const 365.24) ;;@ assembly/index.ts:68:4
) (f64.mul
;;@ assembly/index.ts:68:4 (f64.const -2.9658956854023756e-05)
(f64.mul ;;@ assembly/index.ts:68:31
(f64.const -2.9658956854023756e-05) (f64.const 365.24)
;;@ assembly/index.ts:68:31 )
(f64.const 365.24) ;;@ assembly/index.ts:69:4
) (f64.mul
;;@ assembly/index.ts:69:4 (f64.const 4.366244043351563e-05)
(f64.mul ;;@ assembly/index.ts:69:30
(f64.const 4.366244043351563e-05) (f64.const 39.47841760435743)
;;@ assembly/index.ts:69:30
(f64.const 39.47841760435743)
)
) )
) )
) )
(func $assembly/index/Neptune (; 7 ;) (type $i) (result i32) (func $assembly/index/Neptune (; 7 ;) (type $i) (result i32)
;;@ assembly/index.ts:73:25 ;;@ assembly/index.ts:73:25
(return (call $assembly/index/Body#constructor
;;@ assembly/index.ts:74:9 (i32.const 0)
(call $assembly/index/Body#constructor ;;@ assembly/index.ts:75:4
(i32.const 0) (f64.const 15.379697114850917)
;;@ assembly/index.ts:75:4 ;;@ assembly/index.ts:76:4
(f64.const 15.379697114850917) (f64.const -25.919314609987964)
;;@ assembly/index.ts:76:4 ;;@ assembly/index.ts:77:4
(f64.const -25.919314609987964) (f64.const 0.17925877295037118)
;;@ assembly/index.ts:77:4 ;;@ assembly/index.ts:78:4
(f64.const 0.17925877295037118) (f64.mul
;;@ assembly/index.ts:78:4 (f64.const 2.6806777249038932e-03)
(f64.mul ;;@ assembly/index.ts:78:30
(f64.const 2.6806777249038932e-03) (f64.const 365.24)
;;@ assembly/index.ts:78:30 )
(f64.const 365.24) ;;@ assembly/index.ts:79:4
) (f64.mul
;;@ assembly/index.ts:79:4 (f64.const 0.001628241700382423)
(f64.mul ;;@ assembly/index.ts:79:30
(f64.const 0.001628241700382423) (f64.const 365.24)
;;@ assembly/index.ts:79:30 )
(f64.const 365.24) ;;@ assembly/index.ts:80:4
) (f64.mul
;;@ assembly/index.ts:80:4 (f64.const -9.515922545197159e-05)
(f64.mul ;;@ assembly/index.ts:80:31
(f64.const -9.515922545197159e-05) (f64.const 365.24)
;;@ assembly/index.ts:80:31 )
(f64.const 365.24) ;;@ assembly/index.ts:81:4
) (f64.mul
;;@ assembly/index.ts:81:4 (f64.const 5.1513890204661145e-05)
(f64.mul ;;@ assembly/index.ts:81:30
(f64.const 5.1513890204661145e-05) (f64.const 39.47841760435743)
;;@ assembly/index.ts:81:30
(f64.const 39.47841760435743)
)
) )
) )
) )
(func $~lib/internal/arraybuffer/computeSize (; 8 ;) (type $ii) (param $0 i32) (result i32) (func $~lib/internal/arraybuffer/computeSize (; 8 ;) (type $ii) (param $0 i32) (result i32)
;;@ ~lib/internal/arraybuffer.ts:10:52 ;;@ ~lib/internal/arraybuffer.ts:10:52
(return (i32.shl
;;@ ~lib/internal/arraybuffer.ts:17:9 ;;@ ~lib/internal/arraybuffer.ts:17:9
(i32.shl (i32.const 1)
(i32.const 1) ;;@ ~lib/internal/arraybuffer.ts:17:21
;;@ ~lib/internal/arraybuffer.ts:17:21 (i32.sub
(i32.sub ;;@ ~lib/internal/arraybuffer.ts:17:29
;;@ ~lib/internal/arraybuffer.ts:17:29 (i32.const 32)
(i32.const 32) ;;@ ~lib/internal/arraybuffer.ts:17:39
;;@ ~lib/internal/arraybuffer.ts:17:39 (i32.clz
(i32.clz ;;@ ~lib/internal/arraybuffer.ts:17:48
;;@ ~lib/internal/arraybuffer.ts:17:48 (i32.sub
(i32.sub (i32.add
(i32.add (get_local $0)
(get_local $0) ;;@ ~lib/internal/arraybuffer.ts:17:61
;;@ ~lib/internal/arraybuffer.ts:17:61 (i32.const 8)
(i32.const 8)
)
;;@ ~lib/internal/arraybuffer.ts:17:75
(i32.const 1)
) )
;;@ ~lib/internal/arraybuffer.ts:17:75
(i32.const 1)
) )
) )
) )
@ -488,10 +469,7 @@
(get_local $0) (get_local $0)
) )
;;@ ~lib/internal/arraybuffer.ts:25:39 ;;@ ~lib/internal/arraybuffer.ts:25:39
(return (get_local $1)
;;@ ~lib/internal/arraybuffer.ts:25:9
(get_local $1)
)
) )
(func $~lib/memory/set_memory (; 10 ;) (type $iiiv) (param $0 i32) (param $1 i32) (param $2 i32) (func $~lib/memory/set_memory (; 10 ;) (type $iiiv) (param $0 i32) (param $1 i32) (param $2 i32)
(local $3 i32) (local $3 i32)
@ -1139,40 +1117,32 @@
) )
(func $~lib/array/Array<Body>#get:length (; 13 ;) (type $ii) (param $0 i32) (result i32) (func $~lib/array/Array<Body>#get:length (; 13 ;) (type $ii) (param $0 i32) (result i32)
;;@ ~lib/array.ts:35:20 ;;@ ~lib/array.ts:35:20
(return (i32.load offset=4
;;@ ~lib/array.ts:36:11 ;;@ ~lib/array.ts:36:11
(i32.load offset=4 (get_local $0)
(get_local $0)
)
) )
) )
(func $~lib/array/Array<Body>#__unchecked_get (; 14 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) (func $~lib/array/Array<Body>#__unchecked_get (; 14 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32)
(local $2 i32) (local $2 i32)
;;@ ~lib/array.ts:76:41 ;;@ ~lib/array.ts:76:41
(return (block $~lib/internal/arraybuffer/loadUnsafe<Body,Body>|inlined.0 (result i32)
;;@ ~lib/array.ts:77:11 (set_local $2
(block $~lib/internal/arraybuffer/loadUnsafe<Body,Body>|inlined.0 (result i32) ;;@ ~lib/array.ts:77:27
(set_local $2 (i32.load
;;@ ~lib/array.ts:77:27 (get_local $0)
(i32.load
(get_local $0)
)
) )
;;@ ~lib/internal/arraybuffer.ts:64:91 )
(br $~lib/internal/arraybuffer/loadUnsafe<Body,Body>|inlined.0 ;;@ ~lib/internal/arraybuffer.ts:64:91
;;@ ~lib/internal/arraybuffer.ts:64:9 (i32.load offset=8
(i32.load offset=8 ;;@ ~lib/internal/arraybuffer.ts:64:20
;;@ ~lib/internal/arraybuffer.ts:64:20 (i32.add
(i32.add (get_local $2)
(get_local $2) ;;@ ~lib/internal/arraybuffer.ts:64:48
;;@ ~lib/internal/arraybuffer.ts:64:48 (i32.shl
(i32.shl ;;@ ~lib/internal/arraybuffer.ts:64:49
;;@ ~lib/internal/arraybuffer.ts:64:49 (get_local $1)
(get_local $1) ;;@ ~lib/internal/arraybuffer.ts:64:65
;;@ ~lib/internal/arraybuffer.ts:64:65 (i32.const 2)
(i32.const 2)
)
)
) )
) )
) )
@ -1188,44 +1158,39 @@
) )
) )
;;@ ~lib/array.ts:72:23 ;;@ ~lib/array.ts:72:23
(return (if (result i32)
;;@ ~lib/array.ts:70:11 ;;@ ~lib/array.ts:70:11
(if (result i32) (i32.lt_u
(i32.lt_u (get_local $1)
(get_local $1) ;;@ ~lib/array.ts:70:24
;;@ ~lib/array.ts:70:24 (i32.shr_u
(i32.shr_u ;;@ ~lib/array.ts:70:30
;;@ ~lib/array.ts:70:30 (i32.load
(i32.load (get_local $2)
(get_local $2)
)
;;@ ~lib/array.ts:70:52
(i32.const 2)
) )
;;@ ~lib/array.ts:70:52
(i32.const 2)
) )
;;@ ~lib/array.ts:71:8
(block $~lib/internal/arraybuffer/loadUnsafe<Body,Body>|inlined.1 (result i32)
;;@ ~lib/internal/arraybuffer.ts:64:91
(br $~lib/internal/arraybuffer/loadUnsafe<Body,Body>|inlined.1
;;@ ~lib/internal/arraybuffer.ts:64:9
(i32.load offset=8
;;@ ~lib/internal/arraybuffer.ts:64:20
(i32.add
(get_local $2)
;;@ ~lib/internal/arraybuffer.ts:64:48
(i32.shl
;;@ ~lib/internal/arraybuffer.ts:64:49
(get_local $1)
;;@ ~lib/internal/arraybuffer.ts:64:65
(i32.const 2)
)
)
)
)
)
;;@ ~lib/array.ts:72:8
(unreachable)
) )
;;@ ~lib/array.ts:71:8
(block $~lib/internal/arraybuffer/loadUnsafe<Body,Body>|inlined.1 (result i32)
;;@ ~lib/internal/arraybuffer.ts:64:91
(i32.load offset=8
;;@ ~lib/internal/arraybuffer.ts:64:20
(i32.add
(get_local $2)
;;@ ~lib/internal/arraybuffer.ts:64:48
(i32.shl
;;@ ~lib/internal/arraybuffer.ts:64:49
(get_local $1)
;;@ ~lib/internal/arraybuffer.ts:64:65
(i32.const 2)
)
)
)
)
;;@ ~lib/array.ts:72:8
(unreachable)
) )
) )
(func $assembly/index/Body#offsetMomentum (; 16 ;) (type $iFFFi) (param $0 i32) (param $1 f64) (param $2 f64) (param $3 f64) (result i32) (func $assembly/index/Body#offsetMomentum (; 16 ;) (type $iFFFi) (param $0 i32) (param $1 f64) (param $2 f64) (param $3 f64) (result i32)
@ -1269,9 +1234,7 @@
) )
) )
;;@ assembly/index.ts:27:11 ;;@ assembly/index.ts:27:11
(return (get_local $0)
(get_local $0)
)
) )
(func $assembly/index/NBodySystem#constructor (; 17 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) (func $assembly/index/NBodySystem#constructor (; 17 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32)
(local $2 f64) (local $2 f64)
@ -1494,26 +1457,24 @@
) )
) )
;;@ assembly/index.ts:202:59 ;;@ assembly/index.ts:202:59
(return (if (result i32)
;;@ assembly/index.ts:202:9 ;;@ assembly/index.ts:202:9
(if (result i32) (i32.lt_u
(i32.lt_u (get_local $0)
(get_local $0) ;;@ assembly/index.ts:202:22
;;@ assembly/index.ts:202:22 (call $~lib/array/Array<Body>#get:length
(call $~lib/array/Array<Body>#get:length ;;@ assembly/index.ts:202:27
;;@ assembly/index.ts:202:27
(get_local $1)
)
)
;;@ assembly/index.ts:202:43
(call $~lib/array/Array<Body>#__get
(get_local $1) (get_local $1)
;;@ assembly/index.ts:202:50
(get_local $0)
) )
;;@ assembly/index.ts:202:59
(i32.const 0)
) )
;;@ assembly/index.ts:202:43
(call $~lib/array/Array<Body>#__get
(get_local $1)
;;@ assembly/index.ts:202:50
(get_local $0)
)
;;@ assembly/index.ts:202:59
(i32.const 0)
) )
) )
(func $assembly/index/NBodySystem#advance (; 20 ;) (type $iFv) (param $0 i32) (param $1 f64) (func $assembly/index/NBodySystem#advance (; 20 ;) (type $iFv) (param $0 i32) (param $1 f64)
@ -1728,12 +1689,9 @@
;;@ assembly/index.ts:131:23 ;;@ assembly/index.ts:131:23
(block $~lib/math/NativeMath.sqrt|inlined.0 (result f64) (block $~lib/math/NativeMath.sqrt|inlined.0 (result f64)
;;@ ~lib/math.ts:1076:30 ;;@ ~lib/math.ts:1076:30
(br $~lib/math/NativeMath.sqrt|inlined.0 (f64.sqrt
;;@ ~lib/math.ts:1076:11 ;;@ ~lib/math.ts:1076:29
(f64.sqrt (get_local $18)
;;@ ~lib/math.ts:1076:29
(get_local $18)
)
) )
) )
) )
@ -2190,12 +2148,9 @@
) )
) )
;;@ ~lib/math.ts:1076:30 ;;@ ~lib/math.ts:1076:30
(br $~lib/math/NativeMath.sqrt|inlined.1 (f64.sqrt
;;@ ~lib/math.ts:1076:11 ;;@ ~lib/math.ts:1076:29
(f64.sqrt (get_local $18)
;;@ ~lib/math.ts:1076:29
(get_local $18)
)
) )
) )
) )
@ -2242,9 +2197,7 @@
) )
) )
;;@ assembly/index.ts:184:11 ;;@ assembly/index.ts:184:11
(return (get_local $1)
(get_local $1)
)
) )
(func $assembly/index/step (; 22 ;) (type $F) (result f64) (func $assembly/index/step (; 22 ;) (type $F) (result f64)
;;@ assembly/index.ts:206:9 ;;@ assembly/index.ts:206:9
@ -2255,12 +2208,9 @@
(f64.const 0.01) (f64.const 0.01)
) )
;;@ assembly/index.ts:207:23 ;;@ assembly/index.ts:207:23
(return (call $assembly/index/NBodySystem#energy
;;@ assembly/index.ts:207:16 ;;@ assembly/index.ts:207:9
(call $assembly/index/NBodySystem#energy (get_global $assembly/index/system)
;;@ assembly/index.ts:207:9
(get_global $assembly/index/system)
)
) )
) )
(func $assembly/index/bench (; 23 ;) (type $iv) (param $0 i32) (func $assembly/index/bench (; 23 ;) (type $iv) (param $0 i32)

View File

@ -9,7 +9,7 @@ import {
STATIC_DELIMITER, STATIC_DELIMITER,
INSTANCE_DELIMITER, INSTANCE_DELIMITER,
LIBRARY_PREFIX LIBRARY_PREFIX
} from "./program"; } from "./common";
import { import {
Token, Token,
@ -110,6 +110,26 @@ export function nodeIsConstantValue(kind: NodeKind): bool {
return false; return false;
} }
/** Checks if a node might be callable. */
export function nodeIsCallable(kind: NodeKind): bool {
switch (kind) {
case NodeKind.IDENTIFIER:
case NodeKind.CALL:
case NodeKind.ELEMENTACCESS:
case NodeKind.PROPERTYACCESS: return true;
}
return false;
}
/** Checks if a node might be callable with generic arguments. */
export function nodeIsGenericCallable(kind: NodeKind): bool {
switch (kind) {
case NodeKind.IDENTIFIER:
case NodeKind.PROPERTYACCESS: return true;
}
return false;
}
/** Base class of all nodes. */ /** Base class of all nodes. */
export abstract class Node { export abstract class Node {

94
src/common.ts Normal file
View File

@ -0,0 +1,94 @@
/**
* Common constants.
* @module common
*//***/
/** Indicates traits of a {@link Node} or {@link Element}. */
export enum CommonFlags {
/** No flags set. */
NONE = 0,
// Basic modifiers
/** Has an `import` modifier. */
IMPORT = 1 << 0,
/** Has an `export` modifier. */
EXPORT = 1 << 1,
/** Has a `declare` modifier. */
DECLARE = 1 << 2,
/** Has a `const` modifier. */
CONST = 1 << 3,
/** Has a `let` modifier. */
LET = 1 << 4,
/** Has a `static` modifier. */
STATIC = 1 << 5,
/** Has a `readonly` modifier. */
READONLY = 1 << 6,
/** Has an `abstract` modifier. */
ABSTRACT = 1 << 7,
/** Has a `public` modifier. */
PUBLIC = 1 << 8,
/** Has a `private` modifier. */
PRIVATE = 1 << 9,
/** Has a `protected` modifier. */
PROTECTED = 1 << 10,
/** Has a `get` modifier. */
GET = 1 << 11,
/** Has a `set` modifier. */
SET = 1 << 12,
// Extended modifiers usually derived from basic modifiers
/** Is ambient, that is either declared or nested in a declared element. */
AMBIENT = 1 << 13,
/** Is generic. */
GENERIC = 1 << 14,
/** Is part of a generic context. */
GENERIC_CONTEXT = 1 << 15,
/** Is an instance member. */
INSTANCE = 1 << 16,
/** Is a constructor. */
CONSTRUCTOR = 1 << 17,
/** Is an arrow function. */
ARROW = 1 << 18,
/** Is a module export. */
MODULE_EXPORT = 1 << 19,
/** Is a module import. */
MODULE_IMPORT = 1 << 20,
// Compilation states
/** Is a builtin. */
BUILTIN = 1 << 21,
/** Is compiled. */
COMPILED = 1 << 22,
/** Has a constant value and is therefore inlined. */
INLINED = 1 << 23,
/** Is scoped. */
SCOPED = 1 << 24,
/** Is a trampoline. */
TRAMPOLINE = 1 << 25,
/** Is a virtual method. */
VIRTUAL = 1 << 26
}
/** Path delimiter inserted between file system levels. */
export const PATH_DELIMITER = "/";
/** Substitution used to indicate the parent directory. */
export const PARENT_SUBST = "..";
/** Function name prefix used for getters. */
export const GETTER_PREFIX = "get:";
/** Function name prefix used for setters. */
export const SETTER_PREFIX = "set:";
/** Delimiter used between class names and instance members. */
export const INSTANCE_DELIMITER = "#";
/** Delimiter used between class and namespace names and static members. */
export const STATIC_DELIMITER = ".";
/** Delimiter used between a function and its inner elements. */
export const INNER_DELIMITER = "~";
/** Substitution used to indicate a library directory. */
export const LIBRARY_SUBST = "~lib";
/** Library directory prefix. */
export const LIBRARY_PREFIX = LIBRARY_SUBST + PATH_DELIMITER;
/** Prefix used to indicate a filespace element. */
export const FILESPACE_PREFIX = "file:";

View File

@ -36,6 +36,16 @@ import {
getGetLocalIndex getGetLocalIndex
} from "./module"; } from "./module";
import {
CommonFlags,
PATH_DELIMITER,
INNER_DELIMITER,
INSTANCE_DELIMITER,
STATIC_DELIMITER,
GETTER_PREFIX,
SETTER_PREFIX
} from "./common";
import { import {
Program, Program,
ClassPrototype, ClassPrototype,
@ -54,18 +64,10 @@ import {
Property, Property,
VariableLikeElement, VariableLikeElement,
FlowFlags, FlowFlags,
CommonFlags,
ConstantValueKind, ConstantValueKind,
Flow, Flow,
OperatorKind, OperatorKind,
DecoratorFlags, DecoratorFlags
PATH_DELIMITER,
INNER_DELIMITER,
INSTANCE_DELIMITER,
STATIC_DELIMITER,
GETTER_PREFIX,
SETTER_PREFIX
} from "./program"; } from "./program";
import { import {
@ -1487,17 +1489,11 @@ export class Compiler extends DiagnosticEmitter {
this.currentFunction.flow = blockFlow; this.currentFunction.flow = blockFlow;
var stmts = this.compileStatements(statements); var stmts = this.compileStatements(statements);
var lastType: NativeType;
var stmt = stmts.length == 0 var stmt = stmts.length == 0
? this.module.createNop() ? this.module.createNop()
: stmts.length == 1 : stmts.length == 1
? stmts[0] ? stmts[0]
: this.module.createBlock(null, stmts, : this.module.createBlock(null, stmts,getExpressionType(stmts[stmts.length - 1]));
// if the last expression is a value, annotate the block's return value
(lastType = getExpressionType(stmts[stmts.length - 1])) == NativeType.None
? NativeType.None
: lastType
);
// Switch back to the parent flow // Switch back to the parent flow
var parentFlow = blockFlow.leaveBranchOrScope(); var parentFlow = blockFlow.leaveBranchOrScope();

View File

@ -3,10 +3,13 @@
* @module definitions * @module definitions
*//***/ *//***/
import {
CommonFlags
} from "./common";
import { import {
Program, Program,
Element, Element,
CommonFlags,
ElementKind, ElementKind,
Global, Global,
Enum, Enum,

View File

@ -92,7 +92,7 @@ import {
import { import {
CommonFlags CommonFlags
} from "../program"; } from "../common";
/** An AST builder. */ /** An AST builder. */
export class ASTBuilder { export class ASTBuilder {

View File

@ -34,8 +34,7 @@ import {
} from "./parser"; } from "./parser";
import { import {
Program, Program
LIBRARY_PREFIX
} from "./program"; } from "./program";
/** Parses a source file. If `parser` has been omitted a new one is created. */ /** Parses a source file. If `parser` has been omitted a new one is created. */
@ -168,4 +167,4 @@ export function buildTSD(program: Program): string {
} }
/** Prefix indicating a library file. */ /** Prefix indicating a library file. */
export { LIBRARY_PREFIX }; export { LIBRARY_PREFIX } from "./common";

View File

@ -4,10 +4,13 @@
*//***/ *//***/
import { import {
Program,
CommonFlags, CommonFlags,
LIBRARY_PREFIX, LIBRARY_PREFIX,
PATH_DELIMITER PATH_DELIMITER
} from "./common";
import {
Program
} from "./program"; } from "./program";
import { import {
@ -77,7 +80,9 @@ import {
VoidStatement, VoidStatement,
WhileStatement, WhileStatement,
mangleInternalPath mangleInternalPath,
nodeIsCallable,
nodeIsGenericCallable
} from "./ast"; } from "./ast";
const builtinsFile = LIBRARY_PREFIX + "builtins.ts"; const builtinsFile = LIBRARY_PREFIX + "builtins.ts";
@ -3113,16 +3118,18 @@ export class Parser extends DiagnosticEmitter {
if (!expr) return null; if (!expr) return null;
var startPos = expr.range.start; var startPos = expr.range.start;
// CallExpression with type arguments // CallExpression?
var typeArguments: CommonTypeNode[] | null; if (nodeIsCallable(expr.kind)) {
while ( let typeArguments: CommonTypeNode[] | null = null;
// there might be better ways to distinguish a LESSTHAN from a CALL with type arguments while (
(typeArguments = this.tryParseTypeArgumentsBeforeArguments(tn)) || tn.skip(Token.OPENPAREN)
tn.skip(Token.OPENPAREN) ||
) { nodeIsGenericCallable(expr.kind) && (typeArguments = this.tryParseTypeArgumentsBeforeArguments(tn)) !== null
let args = this.parseArguments(tn); ) {
if (!args) return null; let args = this.parseArguments(tn);
expr = Node.createCallExpression(expr, typeArguments, args, tn.range(startPos, tn.pos)); if (!args) return null;
expr = Node.createCallExpression(expr, typeArguments, args, tn.range(startPos, tn.pos)); // is again callable
}
} }
var token: Token; var token: Token;

View File

@ -3,6 +3,17 @@
* @module program * @module program
*//***/ *//***/
import {
CommonFlags,
PATH_DELIMITER,
STATIC_DELIMITER,
INSTANCE_DELIMITER,
LIBRARY_PREFIX,
GETTER_PREFIX,
SETTER_PREFIX,
FILESPACE_PREFIX
} from "./common";
import { import {
Options Options
} from "./compiler"; } from "./compiler";
@ -18,7 +29,6 @@ import {
TypeKind, TypeKind,
TypeFlags, TypeFlags,
Signature, Signature,
typesToString typesToString
} from "./types"; } from "./types";
@ -105,27 +115,6 @@ import {
CharCode CharCode
} from "./util"; } from "./util";
/** Path delimiter inserted between file system levels. */
export const PATH_DELIMITER = "/";
/** Substitution used to indicate the parent directory. */
export const PARENT_SUBST = "..";
/** Function name prefix used for getters. */
export const GETTER_PREFIX = "get:";
/** Function name prefix used for setters. */
export const SETTER_PREFIX = "set:";
/** Delimiter used between class names and instance members. */
export const INSTANCE_DELIMITER = "#";
/** Delimiter used between class and namespace names and static members. */
export const STATIC_DELIMITER = ".";
/** Delimiter used between a function and its inner elements. */
export const INNER_DELIMITER = "~";
/** Substitution used to indicate a library directory. */
export const LIBRARY_SUBST = "~lib";
/** Library directory prefix. */
export const LIBRARY_PREFIX = LIBRARY_SUBST + PATH_DELIMITER;
/** Prefix used to indicate a filespace element. */
export const FILESPACE_PREFIX = "file:";
/** Represents a yet unresolved import. */ /** Represents a yet unresolved import. */
class QueuedImport { class QueuedImport {
localName: string; localName: string;
@ -2415,6 +2404,16 @@ export class Program extends DiagnosticEmitter {
); );
return null; return null;
} }
// resolveExpressionType(
// expression: Expression,
// contextualFunction: Function
// ): Type {
// var element = this.resolveExpression(expression, contextualFunction);
// switch (element.kind) {
// }
// }
} }
/** Indicates the specific kind of an {@link Element}. */ /** Indicates the specific kind of an {@link Element}. */
@ -2453,75 +2452,6 @@ export enum ElementKind {
FILESPACE, FILESPACE,
} }
/** Indicates traits of a {@link Node} or {@link Element}. */
export enum CommonFlags {
/** No flags set. */
NONE = 0,
// Basic modifiers
/** Has an `import` modifier. */
IMPORT = 1 << 0,
/** Has an `export` modifier. */
EXPORT = 1 << 1,
/** Has a `declare` modifier. */
DECLARE = 1 << 2,
/** Has a `const` modifier. */
CONST = 1 << 3,
/** Has a `let` modifier. */
LET = 1 << 4,
/** Has a `static` modifier. */
STATIC = 1 << 5,
/** Has a `readonly` modifier. */
READONLY = 1 << 6,
/** Has an `abstract` modifier. */
ABSTRACT = 1 << 7,
/** Has a `public` modifier. */
PUBLIC = 1 << 8,
/** Has a `private` modifier. */
PRIVATE = 1 << 9,
/** Has a `protected` modifier. */
PROTECTED = 1 << 10,
/** Has a `get` modifier. */
GET = 1 << 11,
/** Has a `set` modifier. */
SET = 1 << 12,
// Extended modifiers usually derived from basic modifiers
/** Is ambient, that is either declared or nested in a declared element. */
AMBIENT = 1 << 13,
/** Is generic. */
GENERIC = 1 << 14,
/** Is part of a generic context. */
GENERIC_CONTEXT = 1 << 15,
/** Is an instance member. */
INSTANCE = 1 << 16,
/** Is a constructor. */
CONSTRUCTOR = 1 << 17,
/** Is an arrow function. */
ARROW = 1 << 18,
/** Is a module export. */
MODULE_EXPORT = 1 << 19,
/** Is a module import. */
MODULE_IMPORT = 1 << 20,
// Compilation states
/** Is a builtin. */
BUILTIN = 1 << 21,
/** Is compiled. */
COMPILED = 1 << 22,
/** Has a constant value and is therefore inlined. */
INLINED = 1 << 23,
/** Is scoped. */
SCOPED = 1 << 24,
/** Is a trampoline. */
TRAMPOLINE = 1 << 25,
/** Is a virtual method. */
VIRTUAL = 1 << 26
}
export enum DecoratorFlags { export enum DecoratorFlags {
/** No flags set. */ /** No flags set. */
NONE = 0, NONE = 0,