note description: "Access to an argument." legal: "See notice at end of class." status: "See notice at end of class." class ARGUMENT_B inherit ACCESS_B redefine enlarged, is_argument, is_local, register_name, array_descriptor, pre_inlined_code, print_register, print_checked_target_register, is_fast_as_local, is_predefined end; feature -- Visitor process (v: BYTE_NODE_VISITOR) -- Process current element. do v.process_argument_b (Current) end feature position: INTEGER; -- Position of the argument. set_position (i: INTEGER) -- Set `position' to `i' do position := i; end; type: TYPE_A -- Argument type do Result := context.byte_code.arguments.item (position); end; is_predefined: BOOLEAN = True -- Is Current a predefined entity ? is_argument: BOOLEAN -- Is Current an access to an argument ? do Result := True end is_local: BOOLEAN = False -- Is Current an access to a local variable ? same (other: ACCESS_B): BOOLEAN -- Is `other' the same access as Current ? do if attached {ARGUMENT_B} other as argument_b then Result := position = argument_b.position end end enlarged: ARGUMENT_B -- Enlarge current node local arg_bl: ARGUMENT_BL do create arg_bl; arg_bl.fill_from (Current); Result := arg_bl end; register_name: STRING -- The "arg" string do create Result.make (10) if context.real_type (type).is_true_expanded then -- Expanded argument are copied into -- a local variable `earg'. Result.append_character ('e') end Result.append ("arg"); Result.append (position.out); end; print_register -- Print argument do buffer.put_string (register_name) end feature {REGISTRABLE} -- C code generation print_checked_target_register -- local buf: like {BYTE_CONTEXT}.buffer do buf := context.buffer if context.real_type (type).is_true_expanded then -- Expanded argument are copied into -- a local variable `earg'. buf.put_string ({C_CONST}.rtcw_earg) else buf.put_string ({C_CONST}.rtcw_arg) end buf.put_integer (position) buf.put_character (')') end feature -- IL code generation is_fast_as_local: BOOLEAN = true -- Is expression calculation as fast as loading a local? feature -- Array optimization array_descriptor: INTEGER do Result := position end feature -- Inlining pre_inlined_code: INLINED_ARG_B do create Result; Result.fill_from (Current) end note copyright: "Copyright (c) 1984-2019, Eiffel Software" license: "GPL version 2 (see http://www.eiffel.com/licensing/gpl.txt)" licensing_options: "http://www.eiffel.com/licensing" copying: "[ This file is part of Eiffel Software's Eiffel Development Environment. Eiffel Software's Eiffel Development Environment is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2 of the License (available at the URL listed under "license" above). Eiffel Software's Eiffel Development Environment is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with Eiffel Software's Eiffel Development Environment; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA ]" source: "[ Eiffel Software 5949 Hollister Ave., Goleta, CA 93117 USA Telephone 805-685-1006, Fax 805-685-6869 Website http://www.eiffel.com Customer support http://support.eiffel.com ]" end