aboutsummaryrefslogtreecommitdiffstats
path: root/lib/compiler/src/beam_block.erl
diff options
context:
space:
mode:
authorBjörn Gustavsson <[email protected]>2012-05-16 10:50:30 +0200
committerBjörn-Egil Dahlberg <[email protected]>2014-01-28 15:56:25 +0100
commit64ee859fc4c17259ab95192abf7493fed8f2b0ac (patch)
tree8506892a03635fa44f523f4daf470c4845e63e77 /lib/compiler/src/beam_block.erl
parentd3ece60d52880fb273da3c4aa07655a0eeddeafb (diff)
downloadotp-64ee859fc4c17259ab95192abf7493fed8f2b0ac.tar.gz
otp-64ee859fc4c17259ab95192abf7493fed8f2b0ac.tar.bz2
otp-64ee859fc4c17259ab95192abf7493fed8f2b0ac.zip
Implement support for maps in the compiler
To make it possible to build the entire OTP system, also define dummys for the instructions in ops.tab.
Diffstat (limited to 'lib/compiler/src/beam_block.erl')
-rw-r--r--lib/compiler/src/beam_block.erl5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/compiler/src/beam_block.erl b/lib/compiler/src/beam_block.erl
index 402fbe2e2e..f9e90b81d2 100644
--- a/lib/compiler/src/beam_block.erl
+++ b/lib/compiler/src/beam_block.erl
@@ -152,6 +152,10 @@ collect({get_tuple_element,S,I,D}) -> {set,[D],[S],{get_tuple_element,I}};
collect({set_tuple_element,S,D,I}) -> {set,[],[S,D],{set_tuple_element,I}};
collect({get_list,S,D1,D2}) -> {set,[D1,D2],[S],get_list};
collect(remove_message) -> {set,[],[],remove_message};
+collect({put_map,F,S,D,R,{list,Puts}}) ->
+ {set,[D],[S|Puts],{alloc,R,{put_map,F}}};
+collect({get_map_element,F,S,K,D}) ->
+ {set,[D],[S],{get_map_element,K,F}};
collect({'catch',R,L}) -> {set,[R],[],{'catch',L}};
collect(fclearerror) -> {set,[],[],fclearerror};
collect({fcheckerror,{f,0}}) -> {set,[],[],fcheckerror};
@@ -383,6 +387,7 @@ gen_init(Fs, Regs, Y, Acc) ->
init_yreg([{set,_,_,{bif,_,_}}|_], Reg) -> Reg;
init_yreg([{set,_,_,{alloc,_,{gc_bif,_,_}}}|_], Reg) -> Reg;
+init_yreg([{set,_,_,{alloc,_,{put_map,_}}}|_], Reg) -> Reg;
init_yreg([{set,Ds,_,_}|Is], Reg) -> init_yreg(Is, add_yregs(Ds, Reg));
init_yreg(_Is, Reg) -> Reg.