diff options
author | Fredrik Gustafsson <[email protected]> | 2013-06-03 16:11:15 +0200 |
---|---|---|
committer | Fredrik Gustafsson <[email protected]> | 2013-06-03 16:11:15 +0200 |
commit | 46c45db2558cda8e36dc7d977db722b1b8d8c86f (patch) | |
tree | 65c03ebbb51bce37721aefb8ffd7aab122ae0552 /erts/preloaded/src/prim_eval.S | |
parent | 7628e12e131be700af0b695d03e4cd1d73d03d6b (diff) | |
parent | 833600ed0a140983eaa87810131356739f8484ff (diff) | |
download | otp-46c45db2558cda8e36dc7d977db722b1b8d8c86f.tar.gz otp-46c45db2558cda8e36dc7d977db722b1b8d8c86f.tar.bz2 otp-46c45db2558cda8e36dc7d977db722b1b8d8c86f.zip |
Merge branch 'nox/erl_eval-receive/OTP-11137' into maint
* nox/erl_eval-receive/OTP-11137:
Updated primary bootstrap for erl_eval
Added preloaded prim_eval
Fix receive support in erl_eval with a BEAM module
Diffstat (limited to 'erts/preloaded/src/prim_eval.S')
-rw-r--r-- | erts/preloaded/src/prim_eval.S | 70 |
1 files changed, 70 insertions, 0 deletions
diff --git a/erts/preloaded/src/prim_eval.S b/erts/preloaded/src/prim_eval.S new file mode 100644 index 0000000000..958a79a1da --- /dev/null +++ b/erts/preloaded/src/prim_eval.S @@ -0,0 +1,70 @@ +%% +%% %CopyrightBegin% +%% +%% Copyright Ericsson AB 2013. All Rights Reserved. +%% +%% The contents of this file are subject to the Erlang Public License, +%% Version 1.1, (the "License"); you may not use this file except in +%% compliance with the License. You should have received a copy of the +%% Erlang Public License along with this software. If not, it can be +%% retrieved online at http://www.erlang.org/. +%% +%% Software distributed under the License is distributed on an "AS IS" +%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See +%% the License for the specific language governing rights and limitations +%% under the License. +%% +%% %CopyrightEnd% +%% +{module, prim_eval}. + +%% This module uses low-level BEAM instructions for the message queue facility +%% to allow erl_eval to evaluate receive expressions correctly. + +{exports, [{'receive',2},{module_info,0},{module_info,1}]}. + +{attributes, []}. + +{labels, 10}. + + +{function, 'receive', 2, 2}. + {label,1}. + {func_info,{atom,prim_eval},{atom,'receive'},2}. + {label,2}. + {allocate,2,2}. + {move,{x,1},{y,0}}. + {move,{x,0},{y,1}}. + {label,3}. + {loop_rec,{f,5},{x,0}}. + {move,{y,1},{x,1}}. + {call_fun,1}. + {test,is_ne_exact,{f,4},[{x,0},{atom,nomatch}]}. + remove_message. + {deallocate,2}. + return. + {label,4}. + {loop_rec_end,{f,3}}. + {label,5}. + {wait_timeout,{f,3},{y,0}}. + timeout. + {move,{atom,timeout},{x,0}}. + {deallocate,2}. + return. + + +{function, module_info, 0, 8}. + {label,6}. + {func_info,{atom,prim_eval},{atom,module_info},0}. + {label,7}. + {move,{atom,prim_eval},{x,0}}. + {call_ext_only,1,{extfunc,erlang,get_module_info,1}}. + + +{function, module_info, 1, 10}. + {label,8}. + {func_info,{atom,prim_eval},{atom,module_info},1}. + {label,9}. + {move,{x,0},{x,1}}. + {move,{atom,prim_eval},{x,0}}. + {call_ext_only,2,{extfunc,erlang,get_module_info,2}}. |