aboutsummaryrefslogtreecommitdiffstats
path: root/lib/hipe/icode/hipe_beam_to_icode.erl
diff options
context:
space:
mode:
authorBjörn-Egil Dahlberg <[email protected]>2017-03-24 10:54:53 +0100
committerBjörn-Egil Dahlberg <[email protected]>2017-03-24 10:54:53 +0100
commit513a14e3f8225aa35ced7c0a1753d287bae1b707 (patch)
tree8404345447bc0a9bb7e033e3a1e4aa167b8a86e6 /lib/hipe/icode/hipe_beam_to_icode.erl
parent84be7e0ec7c0c64f1beb418cdd09879822aca4b0 (diff)
parent63289176d5555903b72776dd96b38b3a13a257ab (diff)
downloadotp-513a14e3f8225aa35ced7c0a1753d287bae1b707.tar.gz
otp-513a14e3f8225aa35ced7c0a1753d287bae1b707.tar.bz2
otp-513a14e3f8225aa35ced7c0a1753d287bae1b707.zip
Merge branch 'egil/compiler/is_tagged_tuple/OTP-12148'
* egil/compiler/is_tagged_tuple/OTP-12148: Update primary bootstrap compiler: Cover beam_record in tests hipe: Transform is_tagged_tuple instruction compiler: Add is_tagged_tuple instruction
Diffstat (limited to 'lib/hipe/icode/hipe_beam_to_icode.erl')
-rw-r--r--lib/hipe/icode/hipe_beam_to_icode.erl13
1 files changed, 13 insertions, 0 deletions
diff --git a/lib/hipe/icode/hipe_beam_to_icode.erl b/lib/hipe/icode/hipe_beam_to_icode.erl
index 610578dfbc..2abecf7f18 100644
--- a/lib/hipe/icode/hipe_beam_to_icode.erl
+++ b/lib/hipe/icode/hipe_beam_to_icode.erl
@@ -513,6 +513,19 @@ trans_fun([{test,test_arity,{f,Lbl},[Reg,N]}|Instructions], Env) ->
I = hipe_icode:mk_type([trans_arg(Reg)],{tuple,N},
hipe_icode:label_name(True),map_label(Lbl)),
[I,True | trans_fun(Instructions,Env)];
+%%--- test_is_tagged_tuple ---
+trans_fun([{test,is_tagged_tuple,{f,Lbl},[Reg,N,Atom]}|Instructions], Env) ->
+ TrueArity = mk_label(new),
+ IArity = hipe_icode:mk_type([trans_arg(Reg)],{tuple,N},
+ hipe_icode:label_name(TrueArity),map_label(Lbl)),
+ Var = hipe_icode:mk_new_var(),
+ IGet = hipe_icode:mk_primop([Var],
+ #unsafe_element{index=1},
+ [trans_arg(Reg)]),
+ TrueAtom = mk_label(new),
+ IEQ = hipe_icode:mk_type([Var], Atom, hipe_icode:label_name(TrueAtom),
+ map_label(Lbl)),
+ [IArity,TrueArity,IGet,IEQ,TrueAtom | trans_fun(Instructions,Env)];
%%--- is_map ---
trans_fun([{test,is_map,{f,Lbl},[Arg]}|Instructions], Env) ->
{Code,Env1} = trans_type_test(map,Lbl,Arg,Env),