I added a simple called function tracker. It works by emitting stores into 
a preallocated memory segment. Since my code base makes substantial use of 
duplicate function elimination, there's some hacks to allow dead functions 
to still be eliminated. I'll see if I can tease that out and make the 
changes available.

On Monday, October 31, 2016 at 8:50:46 AM UTC-7, caiiiycuk wrote:
>
> I want to implement PGO on js-optimizer step. But it hard to understand 
> format of AST, is there are some docs about it? Currently I try to simply 
> call PGO_INVOKE(1) in beginning of each function:
> function pgo(ast) {
>   var PATCHED_FUNCS = set();
>   traverseGeneratedFunctions(ast, function(func) {
>     var sig = func[1];
>     if (sig in PATCHED_FUNCS) return null;
>     var children = func[3];
>     children.unshift(['call', ['name', 'PGO_INVOKE'], [['num', 1]]]);
>     PATCHED_FUNCS[sig] = 1;
>   });
> }
>
> But after pgo step, I see an error:
> bad, seeing a var in need of fixing
> bad, seeing a var in need of fixing: ["defun", 
> "__ZNSt3__26vectorI5VideoNS_9allocatorIS1_EEE21__push_back_slow_pathIRKS1_EEvOT_",
>  
> ["$0", "$1"], [["call", ["name", "PGO_INVOKE"], [["num", 1]]], ["stat", 
> ["assign", true, ["name", "$0"], ["binary", "|", ["name", "$0"], ["num", 
> 0]]]], ["stat", bad, seeing a var in need of fixing["assign": , 
> ["defuntrue, ", "__ZN9Texture2D11imageLoadedEPviib", ["name", "[$1""]$0", , 
> [""$1"binary", ", "$2", "$3|"", , "["name$4""], ", [$1"][, "call["", 
> num"[", 0name", "PGO_INVOKE"], [[]"num]"]], , 1[]]], ["stat", ["assign"", 
> true...
>
> Can you give me some advice?
>

-- 
You received this message because you are subscribed to the Google Groups 
"emscripten-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to emscripten-discuss+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to