mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-21 23:20:20 +00:00
LibJS/Bytecode: Flatten the interpreter main loop (Clang only)
This means inlining all the things. This yields a 40% speedup on the for loop microbenchmark, and everything else gets faster as well. :^) This makes compilation take foreeeever with GCC, so I'm only enabling it for Clang in this commit. We should figure out how to make GCC compile this without timing out CI, since the speedup is amazing.
This commit is contained in:
parent
f4af056aa9
commit
7b93b8cea7
Notes:
sideshowbarker
2024-07-17 07:43:44 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/7b93b8cea7 Pull-request: https://github.com/SerenityOS/serenity/pull/24240 Reviewed-by: https://github.com/Hendiadyoin1 Reviewed-by: https://github.com/trflynn89 ✅
1 changed files with 8 additions and 1 deletions
|
@ -330,7 +330,14 @@ Interpreter::HandleExceptionResponse Interpreter::handle_exception(size_t& progr
|
|||
VERIFY_NOT_REACHED();
|
||||
}
|
||||
|
||||
void Interpreter::run_bytecode(size_t entry_point)
|
||||
// FIXME: GCC takes a *long* time to compile with flattening, and it will time out our CI. :|
|
||||
#if defined(AK_COMPILER_CLANG)
|
||||
# define FLATTEN_ON_CLANG FLATTEN
|
||||
#else
|
||||
# define FLATTEN_ON_CLANG
|
||||
#endif
|
||||
|
||||
FLATTEN_ON_CLANG void Interpreter::run_bytecode(size_t entry_point)
|
||||
{
|
||||
auto& running_execution_context = vm().running_execution_context();
|
||||
auto* locals = running_execution_context.locals.data();
|
||||
|
|
Loading…
Reference in a new issue