mirror of
				https://github.com/LadybirdBrowser/ladybird.git
				synced 2025-10-29 04:14:16 +00:00 
			
		
		
		
	 a6dfc74e93
			
		
	
	
		a6dfc74e93
		
	
	
	
	
		
			
			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.
		
			
				
	
	
		
			37 lines
		
	
	
	
		
			999 B
		
	
	
	
		
			C++
		
	
	
	
	
	
			
		
		
	
	
			37 lines
		
	
	
	
		
			999 B
		
	
	
	
		
			C++
		
	
	
	
	
	
| /*
 | |
|  * Copyright (c) 2024, Jelle Raaijmakers <jelle@ladybird.org>
 | |
|  * Copyright (c) 2024, Aliaksandr Kalenik <kalenik.aliaksandr@gmail.com>
 | |
|  * Copyright (c) 2024, Luke Wilde <luke@ladybird.org>
 | |
|  *
 | |
|  * SPDX-License-Identifier: BSD-2-Clause
 | |
|  */
 | |
| 
 | |
| #include <LibJS/Runtime/Realm.h>
 | |
| #include <LibWeb/Bindings/Intrinsics.h>
 | |
| #include <LibWeb/Bindings/WebGLUniformLocationPrototype.h>
 | |
| #include <LibWeb/WebGL/WebGLUniformLocation.h>
 | |
| 
 | |
| namespace Web::WebGL {
 | |
| 
 | |
| GC_DEFINE_ALLOCATOR(WebGLUniformLocation);
 | |
| 
 | |
| GC::Ref<WebGLUniformLocation> WebGLUniformLocation::create(JS::Realm& realm, GLuint handle)
 | |
| {
 | |
|     return realm.create<WebGLUniformLocation>(realm, handle);
 | |
| }
 | |
| 
 | |
| WebGLUniformLocation::WebGLUniformLocation(JS::Realm& realm, GLuint handle)
 | |
|     : Bindings::PlatformObject(realm)
 | |
|     , m_handle(handle)
 | |
| {
 | |
| }
 | |
| 
 | |
| WebGLUniformLocation::~WebGLUniformLocation() = default;
 | |
| 
 | |
| void WebGLUniformLocation::initialize(JS::Realm& realm)
 | |
| {
 | |
|     WEB_SET_PROTOTYPE_FOR_INTERFACE(WebGLUniformLocation);
 | |
|     Base::initialize(realm);
 | |
| }
 | |
| 
 | |
| }
 |