You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fix HHBBC start-up to allow for const folding in distributed mode
Summary:
HHVM startup is a bit of a mess. You have to call a bunch of
functions in exactly the right order or things will break. This dance
was not done properly in process_init(), meaning the runtime was not
properly initialized. As a result, all attempts to const-fold (by
calling builtins) silently failed (the stack was not set up properly
so everything failed with a stack overflow). This required calling
hphp_request_init().
However, this caused a different problem. It turns out, due to quirks
of how RDS is initialized, that you can never call into the
interpreter/JIT from the process initial thread, no matter how you
initialize the runtime. This isn't a problem in general since we do
all the work on other threads. For distributed HHBBC though, the
thread doing the analysis is the initial thread.
Untangling this provided difficult. I fixed it for distributed HHBBC
by pre-initializing RDS before anything else, then providing a flag to
hphp_process_init() to tell it *not* to re-initialize RDS.
Reviewed By: mdko
Differential Revision: D89994296
fbshipit-source-id: 94da25d06ac217c2883554f1e58254056569e0ff
0 commit comments