VaKeR CYBER ARMY
Logo of a company Server : Apache/2.4.41 (Ubuntu)
System : Linux absol.cf 5.4.0-198-generic #218-Ubuntu SMP Fri Sep 27 20:18:53 UTC 2024 x86_64
User : www-data ( 33)
PHP Version : 7.4.33
Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare,
Directory :  /usr/share/emscripten/src/experimental/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //usr/share/emscripten/src/experimental/batching.diff
diff --git a/src/jsifier.js b/src/jsifier.js
index df2ae43..9f8d06a 100644
--- a/src/jsifier.js
+++ b/src/jsifier.js
@@ -108,6 +108,7 @@ function JSify(data, functionsOnly, givenFunctions) {
     }
   });
 
+/*
   // TODO: batch small functions
   for (var i = 0; i < data.unparsedFunctions.length; i++) {
     var func = data.unparsedFunctions[i];
@@ -119,6 +120,7 @@ function JSify(data, functionsOnly, givenFunctions) {
     if (DEBUG_MEMORY) MemoryDebugger.tick('func ' + func.ident);
   }
   func = null; // Do not hold on to anything from inside that loop (JS function scoping..)
+*/
   data.unparsedFunctions = null;
 
   // Actors
@@ -1107,8 +1109,22 @@ function JSify(data, functionsOnly, givenFunctions) {
     print(postParts[0]);
 
     // Print out global variables and postsets TODO: batching
-    JSify(analyzer(intertyper(data.unparsedGlobalss[0].lines, true)), true, Functions);
+//printErr('pre globals!'); sleep(1);
+var MAX_BATCH_SIZE = 1000;//Infinity;
+    while (data.unparsedGlobalss[0].lines.length > 0) {
+      var currLines = [], currSize = 0;
+      while (data.unparsedGlobalss[0].lines.length > 0 && (currSize == 0 || currSize + data.unparsedGlobalss[0].lines[0].length <= MAX_BATCH_SIZE)) {
+        currLines.push(data.unparsedGlobalss[0].lines.shift());
+        currSize += currLines[currLines.length-1].length;
+      }
+//printErr('zz batch size: ' + currSize);
+      JSify(analyzer(intertyper(currLines, true)), true, Functions);
+    }
+throw "ok!";
+printErr('post globals 1! '); sleep(10);
+    currLines = [];
     data.unparsedGlobalss = null;
+printErr('post globals 2!'); sleep(10);
 
     print(Functions.generateIndexing()); // done last, as it may rely on aliases set in postsets
     print(postParts[1]);

VaKeR 2022