File tree 4 files changed +15
-6
lines changed
4 files changed +15
-6
lines changed Original file line number Diff line number Diff line change @@ -48,6 +48,10 @@ if (typeof WebAssembly != 'object') {
48
48
#include "runtime_safe_heap.js"
49
49
#endif
50
50
51
+ #if SHARED_MEMORY && ALLOW_MEMORY_GROWTH
52
+ #include "growableHeap.js"
53
+ #endif
54
+
51
55
#if USE_ASAN
52
56
#include "runtime_asan.js"
53
57
#endif
Original file line number Diff line number Diff line change 8
8
#include "runtime_safe_heap.js"
9
9
#endif
10
10
11
+ #if SHARED_MEMORY && ALLOW_MEMORY_GROWTH
12
+ #include "growableHeap.js"
13
+ #endif
14
+
11
15
#if USE_ASAN
12
16
#include "runtime_asan.js"
13
17
#endif
Original file line number Diff line number Diff line change @@ -1251,6 +1251,12 @@ function littleEndianHeap(ast) {
1251
1251
// in each access), see #8365.
1252
1252
function growableHeap ( ast ) {
1253
1253
recursiveWalk ( ast , {
1254
+ FunctionDeclaration ( node , c ) {
1255
+ // Do not recurse into to GROWABLE_HEAP_ helper functions themselves.
1256
+ if ( ! ( node . id . type === 'Identifier' && node . id . name . startsWith ( 'GROWABLE_HEAP_' ) ) ) {
1257
+ c ( node . body ) ;
1258
+ }
1259
+ } ,
1254
1260
AssignmentExpression : ( node ) => {
1255
1261
if ( node . left . type === 'Identifier' && isEmscriptenHEAP ( node . left . name ) ) {
1256
1262
// Don't transform initial setup of the arrays.
Original file line number Diff line number Diff line change @@ -1055,12 +1055,7 @@ def little_endian_heap(js_file):
1055
1055
1056
1056
def apply_wasm_memory_growth (js_file ):
1057
1057
logger .debug ('supporting wasm memory growth with pthreads' )
1058
- fixed = acorn_optimizer (js_file , ['growableHeap' ])
1059
- ret = js_file + '.pgrow.js'
1060
- fixed = utils .read_file (fixed )
1061
- support_code = utils .read_file (path_from_root ('src/growableHeap.js' ))
1062
- utils .write_file (ret , support_code + '\n ' + fixed )
1063
- return ret
1058
+ return acorn_optimizer (js_file , ['growableHeap' ])
1064
1059
1065
1060
1066
1061
def use_unsigned_pointers_in_js (js_file ):
You can’t perform that action at this time.
0 commit comments