Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
home:Ledest:erlang:25
erlang
2362-beam_disasm-Resolve-bs_start_match3-as-tes...
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File 2362-beam_disasm-Resolve-bs_start_match3-as-test-5.patch of Package erlang
From 322f33ebb3f4b887fb94edd4467d8d32af07ea55 Mon Sep 17 00:00:00 2001 From: Michael Davis <mcarsondavis@gmail.com> Date: Thu, 10 Nov 2022 11:19:06 -0600 Subject: [PATCH 2/8] beam_disasm: Resolve bs_start_match3 as test/5 This translation matches the expected format in `beam_validator:vi/2` and the translation in `beam_ssa_codegen:cg_block/3` as well as the output of `erl -S`. For example: kind(<<"a">>) -> a; kind(<<"b">>) -> b. Has the asm: {function, kind, 1, 2}. {label,1}. {line,[{location,"start_match.erl",3}]}. {func_info,{atom,start_match},{atom,kind},1}. {label,2}. {'%',{var_info,{x,0},[accepts_match_context]}}. {test,bs_start_match3,{f,1},1,[{x,0}],{x,1}}. {bs_get_position,{x,1},{x,0},2}. {bs_match,{f,5}, {x,1}, {commands,[{ensure_at_least,8,1}, {integer,2,{literal,[]},8,1,{x,2}}]}}. {select_val,{tr,{x,2},{t_integer,{0,255}}}, {f,5}, {list,[{integer,97},{f,4},{integer,98},{f,3}]}}. {label,3}. {bs_match,{f,5},{x,1},{commands,[{ensure_exactly,0}]}}. {move,{atom,b},{x,0}}. return. {label,4}. {bs_match,{f,5},{x,1},{commands,[{ensure_exactly,0}]}}. {move,{atom,a},{x,0}}. return. {label,5}. {bs_set_position,{x,1},{x,0}}. {bs_get_tail,{x,1},{x,0},2}. {jump,{f,1}}. --- lib/compiler/src/beam_disasm.erl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/compiler/src/beam_disasm.erl b/lib/compiler/src/beam_disasm.erl index bd48b40c4e..485cab4c5b 100644 --- a/lib/compiler/src/beam_disasm.erl +++ b/lib/compiler/src/beam_disasm.erl @@ -1222,8 +1222,8 @@ resolve_inst({get_tl,[Src,Dst]},_,_,_) -> resolve_inst({put_tuple2,[Dst,{{z,1},{u,_},List0}]},_,_,_) -> List = resolve_args(List0), {put_tuple2,Dst,{list,List}}; -resolve_inst({bs_start_match3,[Fail,Bin,Live,Dst]},_,_,_) -> - {bs_start_match3,Fail,Bin,Live,Dst}; +resolve_inst({bs_start_match3=I,[Fail,Bin,{u,Live},Dst]},_,_,_) -> + {test,I,Fail,Live,[Bin],Dst}; resolve_inst({bs_get_tail,[Src,Dst,Live]},_,_,_) -> {bs_get_tail,Src,Dst,Live}; resolve_inst({bs_get_position,[Src,Dst,Live]},_,_,_) -> -- 2.35.3
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor