mirror of
				https://github.com/LadybirdBrowser/ladybird.git
				synced 2025-10-31 05:10:57 +00:00 
			
		
		
		
	 3a73eb99ac
			
		
	
	
		3a73eb99ac
		
	
	
	
	
		
			
			Instead of storing a BasicBlock* and forcing the size of Label to be sizeof(BasicBlock*), we now store the basic block index as a u32. This means the final version of the bytecode is able to keep labels at sizeof(u32), shrinking the size of many instructions. :^)
		
			
				
	
	
		
			17 lines
		
	
	
	
		
			331 B
		
	
	
	
		
			C++
		
	
	
	
	
	
			
		
		
	
	
			17 lines
		
	
	
	
		
			331 B
		
	
	
	
		
			C++
		
	
	
	
	
	
| /*
 | |
|  * Copyright (c) 2024, Andreas Kling <kling@serenityos.org>
 | |
|  *
 | |
|  * SPDX-License-Identifier: BSD-2-Clause
 | |
|  */
 | |
| 
 | |
| #include <LibJS/Bytecode/BasicBlock.h>
 | |
| #include <LibJS/Bytecode/Label.h>
 | |
| 
 | |
| namespace JS::Bytecode {
 | |
| 
 | |
| Label::Label(Bytecode::BasicBlock const& basic_block)
 | |
|     : m_address_or_basic_block_index(basic_block.index())
 | |
| {
 | |
| }
 | |
| 
 | |
| }
 |