mirror of
				https://github.com/RGBCube/serenity
				synced 2025-10-26 04:22:07 +00:00 
			
		
		
		
	 640d48255b
			
		
	
	
		640d48255b
		
	
	
	
	
		
			
			This optimization was no longer helpful after the bug fix for missing
invalidation on global delete was introduced in 331f6a9e6, since we
now have to check bindings for presence in the global environment every
time anyway.
Since the bytecode VM now has fast GetGlobal in most cases, let's not
even worry about this and just remove the unhelpful "optimization".
In fact, removing this is actually an *optimization*, since we avoid
a redundant has_binding() check on every global variable access. :^)
		
	
			
		
			
				
	
	
		
			23 lines
		
	
	
	
		
			440 B
		
	
	
	
		
			C++
		
	
	
	
	
	
			
		
		
	
	
			23 lines
		
	
	
	
		
			440 B
		
	
	
	
		
			C++
		
	
	
	
	
	
| /*
 | |
|  * Copyright (c) 2021, Andreas Kling <kling@serenityos.org>
 | |
|  *
 | |
|  * SPDX-License-Identifier: BSD-2-Clause
 | |
|  */
 | |
| 
 | |
| #pragma once
 | |
| 
 | |
| #include <AK/Types.h>
 | |
| #include <LibJS/Forward.h>
 | |
| 
 | |
| namespace JS {
 | |
| 
 | |
| struct EnvironmentCoordinate {
 | |
|     u32 hops { invalid_marker };
 | |
|     u32 index { invalid_marker };
 | |
| 
 | |
|     bool is_valid() const { return hops != invalid_marker && index != invalid_marker; }
 | |
| 
 | |
|     static constexpr u32 invalid_marker = 0xfffffffe;
 | |
| };
 | |
| 
 | |
| }
 |