Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* rename Return[Nez]Many to Return[Nez]Span * fix spelling issue * adjust Instruction type for new copy encoding This adds some instructions or instruction parameters to account for the new planned copy semantics that replace consecutive copy instructions with a single instruction that handles all the necessary copying between registers. This will fix a bug that cannot be fixed with the current copy semantics that involves unavoidable overlapping copy instructions. Newly added instruction parameters are: - Register2 - Register3 - RegisterList Newly added instructions are: - ReturnReg2 - ReturnReg3 - ReturnMany - ReturnNezReg2 - ReturnNezMany - Copy2 - CopyMany Removing one instruction parameter: - CallParams Also the PR associated to this commit will adjust call instruction parameter encodings. This commit does not include execution implementations or execution implementation adjustments of the newly added or changed instructions respectively. * implement execution of Instruction::Copy2 * implement execution of Instruction::CopyMany * implement Instruction::ReturnReg{2,3} execution * implement Instruction::ReturnNezReg2 execution * replace path with use * clean up of new copy execution implementation * implement Instruction::Return[Nez]Many execution * implement new call param copy semantics Adjustments for instruction pointer updates is still missing that needs to be altered since amount of parameters is only discovered upon call param copying during execution and no longer before. * no longer update instruction pointer for tail calls This is not needed since the caller call frame is discarded during the operation anyways. * remove ResolvedCallIndirectParams type * improve panic message * properly update instruction pointer on non-tail calls * apply rustfmt * add InstructionPtr::pull and use it where applicable * refactor fetch_call_indirect_params * refactor CallIndirectParams Also move the Instruction variants to the other instruction parameter variants. * add constructors for new Instruction::Register{1,2,3,List} * add constructors for new instructions * adjust call_[imported,internal] parameter encoding * adjust Instruction::[return_]call_indirect encoding * adjust Instruction::[return_]call translation and tests * implement new encoding for return instructions * remove no longer needed Instruction::CallParams * adjust br_if encoding when conditionally returning * implement new copy semantics for copy instructions * remove invalid update to instr_ptr in call execution * fix panic message * remove InstructionPtr::pull method Its use is discouraged since misusing it caused a bug in copying of call parameters. * clean up call execution implementation a bit * respect overlapping copy spans in execution implementation * minor cleanup * add copy_span instruction variant for non-overlapping spans The non-overlapping copy_span variants can easily precomputed at compile time and does not require a temporary buffer to avoid invalid copy overwrites. * add Instruction::CopyManyNonOverlapping variant This is an optimized version of Instruction::CopyMany that does not require to store its values into a temporary buffer since it assumes that both results and values do not overlap. This assumption is asserted during compilation. * rename test * improve copy_span overlap detection The new function does a better job at detecting actual copy overlaps. The former function checked if both spans overlapped without respecting the copy operation that only needs to check if the values are overwritten by the results. * implement host function parameter passing Parameter passing for host functions called from root are not yet implemented. * add tests for calling host functions from the host side * implement host function calling from host side through executor
- Loading branch information