@@ -14282,23 +14282,52 @@ def test_pthread_kill(self):
1428214282 @node_pthreads
1428314283 @parameterized({
1428414284 '': ([], 1),
14285+ 'growable_arraybuffers': (['-sGROWABLE_ARRAYBUFFERS', '-Wno-experimental'], 1),
1428514286 'proxy': (['-sPROXY_TO_PTHREAD', '-sEXIT_RUNTIME'], 2),
1428614287 })
1428714288 def test_pthread_growth_mainthread(self, cflags, pthread_pool_size):
14289+ if '-sGROWABLE_ARRAYBUFFERS' in cflags:
14290+ self.node_args.append('--experimental-wasm-rab-integration')
14291+ self.v8_args.append('--experimental-wasm-rab-integration')
14292+ self.require_node_canary()
14293+ else:
14294+ self.cflags.append('-Wno-pthreads-mem-growth')
1428814295 self.set_setting('PTHREAD_POOL_SIZE', pthread_pool_size)
14289- self.do_runf('pthread/test_pthread_memory_growth_mainthread.c', cflags=['-Wno-pthreads-mem-growth', '-pthread', '-sALLOW_MEMORY_GROWTH', '-sINITIAL_MEMORY=32MB', '-sMAXIMUM_MEMORY=256MB'] + cflags)
14296+ self.do_runf('pthread/test_pthread_memory_growth_mainthread.c', cflags=['-pthread', '-sALLOW_MEMORY_GROWTH', '-sINITIAL_MEMORY=32MB', '-sMAXIMUM_MEMORY=256MB'] + cflags)
14297+
14298+ @requires_node_canary
14299+ def test_growable_arraybuffers(self):
14300+ self.node_args.append('--experimental-wasm-rab-integration')
14301+ self.v8_args.append('--experimental-wasm-rab-integration')
14302+ self.do_runf('hello_world.c',
14303+ cflags=['-O2', '-pthread', '-sALLOW_MEMORY_GROWTH', '-sGROWABLE_ARRAYBUFFERS', '-Wno-experimental'],
14304+ output_basename='growable')
14305+ self.do_runf('hello_world.c',
14306+ cflags=['-O2', '-pthread', '-sALLOW_MEMORY_GROWTH', '-Wno-pthreads-mem-growth'],
14307+ output_basename='no_growable')
14308+ growable_size = os.path.getsize('growable.js')
14309+ no_growable_size = os.path.getsize('no_growable.js')
14310+ print('growable:', growable_size, 'no_growable:', no_growable_size)
14311+ self.assertLess(growable_size, no_growable_size)
1429014312
1429114313 # Tests memory growth in a pthread.
1429214314 @node_pthreads
1429314315 @parameterized({
1429414316 '': ([],),
14317+ 'growable_arraybuffers': (['-sGROWABLE_ARRAYBUFFERS', '-Wno-experimental'],),
1429514318 'assert': (['-sASSERTIONS'],),
1429614319 'proxy': (['-sPROXY_TO_PTHREAD', '-sEXIT_RUNTIME'], 2),
1429714320 'minimal': (['-sMINIMAL_RUNTIME', '-sMODULARIZE', '-sEXPORT_NAME=MyModule'],),
1429814321 })
1429914322 def test_pthread_growth(self, cflags, pthread_pool_size = 1):
1430014323 self.set_setting('PTHREAD_POOL_SIZE', pthread_pool_size)
14301- self.do_runf('pthread/test_pthread_memory_growth.c', cflags=['-Wno-pthreads-mem-growth', '-pthread', '-sALLOW_MEMORY_GROWTH', '-sINITIAL_MEMORY=32MB', '-sMAXIMUM_MEMORY=256MB'] + cflags)
14324+ if '-sGROWABLE_ARRAYBUFFERS' in cflags:
14325+ self.node_args.append('--experimental-wasm-rab-integration')
14326+ self.v8_args.append('--experimental-wasm-rab-integration')
14327+ self.require_node_canary()
14328+ else:
14329+ self.cflags.append('-Wno-pthreads-mem-growth')
14330+ self.do_runf('pthread/test_pthread_memory_growth.c', cflags=['-pthread', '-sALLOW_MEMORY_GROWTH', '-sINITIAL_MEMORY=32MB', '-sMAXIMUM_MEMORY=256MB'] + cflags)
1430214331
1430314332 @node_pthreads
1430414333 def test_emscripten_set_interval(self):
0 commit comments