mirror of
				https://github.com/RGBCube/serenity
				synced 2025-10-31 03:12:44 +00:00 
			
		
		
		
	 1d8ec677a3
			
		
	
	
		1d8ec677a3
		
	
	
	
	
		
			
			We can now stay in machine code for environment variable read accesses as long as they are cached and initialized. 20% speed-up on Octane/zlib.js :^)
		
			
				
	
	
		
			26 lines
		
	
	
	
		
			611 B
		
	
	
	
		
			C++
		
	
	
	
	
	
			
		
		
	
	
			26 lines
		
	
	
	
		
			611 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 };
 | |
| 
 | |
|     static FlatPtr hops_offset() { return OFFSET_OF(EnvironmentCoordinate, hops); }
 | |
|     static FlatPtr index_offset() { return OFFSET_OF(EnvironmentCoordinate, index); }
 | |
| 
 | |
|     bool is_valid() const { return hops != invalid_marker && index != invalid_marker; }
 | |
| 
 | |
|     static constexpr u32 invalid_marker = 0xfffffffe;
 | |
| };
 | |
| 
 | |
| }
 |