mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-06 00:25:12 +00:00
Ladybird+LibJS: Add CLI option to run browser with LibJS bytecode VM
This required quite a bit of plumbing, but now you can run
ladybird --use-bytecode
This commit is contained in:
@@ -19,6 +19,7 @@
|
||||
#include <LibCore/System.h>
|
||||
#include <LibCore/SystemServerTakeover.h>
|
||||
#include <LibIPC/ConnectionFromClient.h>
|
||||
#include <LibJS/Bytecode/Interpreter.h>
|
||||
#include <LibMain/Main.h>
|
||||
#include <LibWeb/Bindings/MainThreadVM.h>
|
||||
#include <LibWeb/Loader/ContentFilter.h>
|
||||
@@ -69,12 +70,16 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
|
||||
|
||||
int webcontent_fd_passing_socket { -1 };
|
||||
bool is_layout_test_mode = false;
|
||||
bool use_javascript_bytecode = false;
|
||||
|
||||
Core::ArgsParser args_parser;
|
||||
args_parser.add_option(webcontent_fd_passing_socket, "File descriptor of the passing socket for the WebContent connection", "webcontent-fd-passing-socket", 'c', "webcontent_fd_passing_socket");
|
||||
args_parser.add_option(is_layout_test_mode, "Is layout test mode", "layout-test-mode", 0);
|
||||
args_parser.add_option(use_javascript_bytecode, "Enable JavaScript bytecode VM", "use-bytecode", 0);
|
||||
args_parser.parse(arguments);
|
||||
|
||||
JS::Bytecode::Interpreter::set_enabled(use_javascript_bytecode);
|
||||
|
||||
VERIFY(webcontent_fd_passing_socket >= 0);
|
||||
|
||||
Web::Platform::FontPlugin::install(*new Ladybird::FontPluginQt(is_layout_test_mode));
|
||||
|
||||
Reference in New Issue
Block a user