mirror of
				https://github.com/RGBCube/serenity
				synced 2025-10-31 15:32:46 +00:00 
			
		
		
		
	LibJS: Rename Bytecode::ExecutionUnit => Bytecode::Executable
This commit is contained in:
		
							parent
							
								
									597e0d95fe
								
							
						
					
					
						commit
						b61f198d22
					
				
					 6 changed files with 14 additions and 14 deletions
				
			
		|  | @ -21,7 +21,7 @@ Generator::~Generator() | |||
| { | ||||
| } | ||||
| 
 | ||||
| ExecutionUnit Generator::generate(ASTNode const& node) | ||||
| Executable Generator::generate(ASTNode const& node) | ||||
| { | ||||
|     Generator generator; | ||||
|     generator.switch_to_basic_block(generator.make_block()); | ||||
|  |  | |||
|  | @ -16,14 +16,14 @@ | |||
| 
 | ||||
| namespace JS::Bytecode { | ||||
| 
 | ||||
| struct ExecutionUnit { | ||||
| struct Executable { | ||||
|     NonnullOwnPtrVector<BasicBlock> basic_blocks; | ||||
|     size_t number_of_registers { 0 }; | ||||
| }; | ||||
| 
 | ||||
| class Generator { | ||||
| public: | ||||
|     static ExecutionUnit generate(ASTNode const&); | ||||
|     static Executable generate(ASTNode const&); | ||||
| 
 | ||||
|     Register allocate_register(); | ||||
| 
 | ||||
|  |  | |||
|  | @ -33,9 +33,9 @@ Interpreter::~Interpreter() | |||
|     s_current = nullptr; | ||||
| } | ||||
| 
 | ||||
| Value Interpreter::run(ExecutionUnit const& execution_unit) | ||||
| Value Interpreter::run(Executable const& executable) | ||||
| { | ||||
|     dbgln_if(JS_BYTECODE_DEBUG, "Bytecode::Interpreter will run unit {:p}", &execution_unit); | ||||
|     dbgln_if(JS_BYTECODE_DEBUG, "Bytecode::Interpreter will run unit {:p}", &executable); | ||||
| 
 | ||||
|     CallFrame global_call_frame; | ||||
|     if (vm().call_stack().is_empty()) { | ||||
|  | @ -50,9 +50,9 @@ Value Interpreter::run(ExecutionUnit const& execution_unit) | |||
|         VERIFY(!vm().exception()); | ||||
|     } | ||||
| 
 | ||||
|     auto block = &execution_unit.basic_blocks.first(); | ||||
|     auto block = &executable.basic_blocks.first(); | ||||
|     m_register_windows.append(make<RegisterWindow>()); | ||||
|     registers().resize(execution_unit.number_of_registers); | ||||
|     registers().resize(executable.number_of_registers); | ||||
| 
 | ||||
|     for (;;) { | ||||
|         Bytecode::InstructionStreamIterator pc(block->instruction_stream()); | ||||
|  | @ -80,7 +80,7 @@ Value Interpreter::run(ExecutionUnit const& execution_unit) | |||
|             break; | ||||
|     } | ||||
| 
 | ||||
|     dbgln_if(JS_BYTECODE_DEBUG, "Bytecode::Interpreter did run unit {:p}", &execution_unit); | ||||
|     dbgln_if(JS_BYTECODE_DEBUG, "Bytecode::Interpreter did run unit {:p}", &executable); | ||||
| 
 | ||||
|     if constexpr (JS_BYTECODE_DEBUG) { | ||||
|         for (size_t i = 0; i < registers().size(); ++i) { | ||||
|  |  | |||
|  | @ -28,7 +28,7 @@ public: | |||
|     GlobalObject& global_object() { return m_global_object; } | ||||
|     VM& vm() { return m_vm; } | ||||
| 
 | ||||
|     Value run(Bytecode::ExecutionUnit const&); | ||||
|     Value run(Bytecode::Executable const&); | ||||
| 
 | ||||
|     ALWAYS_INLINE Value& accumulator() { return reg(Register::accumulator()); } | ||||
|     Value& reg(Register const& r) { return registers()[r.index()]; } | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Andreas Kling
						Andreas Kling