LibWeb: Only set prototype once for object with IDL interface

Before this change, we were going through the chain of base classes for
each IDL interface object and having them set the prototype to their
prototype.

Instead of doing that, reorder things so that we set the right prototype
immediately in Foo::initialize(), and then don't bother in all the base
class overrides.

This knocks off a ~1% profile item on Speedometer 3.
This commit is contained in:
Andreas Kling 2025-04-20 16:22:57 +02:00 committed by Andreas Kling
commit a6dfc74e93
Notes: github-actions[bot] 2025-04-20 16:44:17 +00:00
417 changed files with 423 additions and 423 deletions

View file

@ -51,8 +51,8 @@ void ANGLEInstancedArrays::draw_elements_instanced_angle(GLenum mode, GLsizei co
void ANGLEInstancedArrays::initialize(JS::Realm& realm)
{
Base::initialize(realm);
WEB_SET_PROTOTYPE_FOR_INTERFACE(ANGLEInstancedArrays);
Base::initialize(realm);
}
void ANGLEInstancedArrays::visit_edges(Visitor& visitor)

View file

@ -29,8 +29,8 @@ EXTBlendMinMax::EXTBlendMinMax(JS::Realm& realm, GC::Ref<WebGLRenderingContext>
void EXTBlendMinMax::initialize(JS::Realm& realm)
{
Base::initialize(realm);
WEB_SET_PROTOTYPE_FOR_INTERFACE(EXTBlendMinMax);
Base::initialize(realm);
}
void EXTBlendMinMax::visit_edges(Visitor& visitor)

View file

@ -29,8 +29,8 @@ EXTColorBufferFloat::EXTColorBufferFloat(JS::Realm& realm, GC::Ref<WebGL2Renderi
void EXTColorBufferFloat::initialize(JS::Realm& realm)
{
Base::initialize(realm);
WEB_SET_PROTOTYPE_FOR_INTERFACE(EXTColorBufferFloat);
Base::initialize(realm);
}
void EXTColorBufferFloat::visit_edges(Visitor& visitor)

View file

@ -93,8 +93,8 @@ void OESVertexArrayObject::bind_vertex_array_oes(GC::Root<WebGLVertexArrayObject
void OESVertexArrayObject::initialize(JS::Realm& realm)
{
Base::initialize(realm);
WEB_SET_PROTOTYPE_FOR_INTERFACE(OESVertexArrayObject);
Base::initialize(realm);
}
void OESVertexArrayObject::visit_edges(Visitor& visitor)

View file

@ -30,8 +30,8 @@ WebGLCompressedTextureS3tc::WebGLCompressedTextureS3tc(JS::Realm& realm, WebGLRe
void WebGLCompressedTextureS3tc::initialize(JS::Realm& realm)
{
Base::initialize(realm);
WEB_SET_PROTOTYPE_FOR_INTERFACE(WebGLCompressedTextureS3tc);
Base::initialize(realm);
}
void WebGLCompressedTextureS3tc::visit_edges(Visitor& visitor)

View file

@ -39,8 +39,8 @@ void WebGLDrawBuffers::draw_buffers_webgl(Vector<GLenum> buffers)
void WebGLDrawBuffers::initialize(JS::Realm& realm)
{
Base::initialize(realm);
WEB_SET_PROTOTYPE_FOR_INTERFACE(WebGLDrawBuffers);
Base::initialize(realm);
}
void WebGLDrawBuffers::visit_edges(Visitor& visitor)

View file

@ -28,8 +28,8 @@ WebGLVertexArrayObjectOES::~WebGLVertexArrayObjectOES() = default;
void WebGLVertexArrayObjectOES::initialize(JS::Realm& realm)
{
Base::initialize(realm);
WEB_SET_PROTOTYPE_FOR_INTERFACE(WebGLVertexArrayObjectOES);
Base::initialize(realm);
}
}