mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-05-05 06:32:30 +02:00
LibJS: Avoid function call if @@hasInstance is default implementation
This makes the instanceof operator signficantly faster by avoiding a generic function call to @@hasInstance unless it has been overridden. 1.15x speed-up on Octane/earley-boyer.js
This commit is contained in:
committed by
Andreas Kling
parent
5a7b0a07cb
commit
0e4450f4b3
Notes:
github-actions[bot]
2025-10-13 15:18:08 +00:00
Author: https://github.com/awesomekling Commit: https://github.com/LadybirdBrowser/ladybird/commit/0e4450f4b3d Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/6463
@@ -49,6 +49,8 @@ public:
|
||||
bool is_set_prototype_next_builtin() const { return m_builtin.has_value() && *m_builtin == Bytecode::Builtin::SetIteratorPrototypeNext; }
|
||||
bool is_string_prototype_next_builtin() const { return m_builtin.has_value() && *m_builtin == Bytecode::Builtin::StringIteratorPrototypeNext; }
|
||||
|
||||
Optional<Bytecode::Builtin> builtin() const { return m_builtin; }
|
||||
|
||||
protected:
|
||||
NativeFunction(Utf16FlyString name, Object& prototype);
|
||||
NativeFunction(AK::Function<ThrowCompletionOr<Value>(VM&)>, Object* prototype, Realm& realm, Optional<Bytecode::Builtin> builtin);
|
||||
|
||||
Reference in New Issue
Block a user