mirror of
				https://github.com/RGBCube/serenity
				synced 2025-10-31 12:22:44 +00:00 
			
		
		
		
	LibWasm: Use the current configuration to run call ops
This should make it easier to implement multiple types of interpreters on top of a configuration, and also give a small speed boost in not initialising as many Stack objects.
This commit is contained in:
		
							parent
							
								
									b2bd5132c4
								
							
						
					
					
						commit
						f91fa79fc5
					
				
					 3 changed files with 40 additions and 5 deletions
				
			
		|  | @ -125,11 +125,13 @@ void Interpreter::call_address(Configuration& configuration, FunctionAddress add | |||
|     for (size_t i = 0; i < type->parameters().size(); ++i) { | ||||
|         args.prepend(move(configuration.stack().pop().get<Value>())); | ||||
|     } | ||||
|     Configuration function_configuration { configuration.store() }; | ||||
|     function_configuration.pre_interpret_hook = pre_interpret_hook; | ||||
|     function_configuration.post_interpret_hook = post_interpret_hook; | ||||
|     function_configuration.depth() = configuration.depth() + 1; | ||||
|     auto result = function_configuration.call(address, move(args)); | ||||
| 
 | ||||
|     Result result { Trap {} }; | ||||
|     { | ||||
|         Configuration::CallFrameHandle handle { configuration }; | ||||
|         result = configuration.call(address, move(args)); | ||||
|     } | ||||
| 
 | ||||
|     if (result.is_trap()) { | ||||
|         m_do_trap = true; | ||||
|         return; | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Ali Mohammad Pur
						Ali Mohammad Pur