mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-03 15:16:14 +00:00
LibJS+LibWeb: Move script parse time logging from JS::Script to LibWeb
Let's only log HTML::ClassicScript parse times for now. Otherwise things will get excessively noisy in test-js and the test262 runner.
This commit is contained in:
@@ -4,7 +4,6 @@
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
||||
#include <LibCore/ElapsedTimer.h>
|
||||
#include <LibJS/AST.h>
|
||||
#include <LibJS/Lexer.h>
|
||||
#include <LibJS/Parser.h>
|
||||
@@ -15,11 +14,6 @@ namespace JS {
|
||||
// 16.1.5 ParseScript ( sourceText, realm, hostDefined ), https://tc39.es/ecma262/#sec-parse-script
|
||||
Result<NonnullRefPtr<Script>, Vector<Parser::Error>> Script::parse(StringView source_text, Realm& realm, StringView filename)
|
||||
{
|
||||
auto timer = Core::ElapsedTimer::start_new();
|
||||
ScopeGuard timer_guard([&] {
|
||||
dbgln("JS::Script: Parsed {} in {}ms", filename, timer.elapsed());
|
||||
});
|
||||
|
||||
// 1. Let body be ParseText(sourceText, Script).
|
||||
auto parser = Parser(Lexer(source_text, filename));
|
||||
auto body = parser.parse_program();
|
||||
|
||||
Reference in New Issue
Block a user