1# plugin interpreter_handlers 2# Copyright (c) 2021-2023 Huawei Device Co., Ltd. 3# Licensed under the Apache License, Version 2.0 (the "License"); 4# you may not use this file except in compliance with the License. 5# You may obtain a copy of the License at 6# 7# http://www.apache.org/licenses/LICENSE-2.0 8# 9# Unless required by applicable law or agreed to in writing, software 10# distributed under the License is distributed on an "AS IS" BASIS, 11# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12# See the License for the specific language governing permissions and 13# limitations under the License. 14 15include_relative '../../plugins/ets/irtoc_scripts/common.irt' 16 17['static', 'virt'].each do |dispatch| 18 ['short', 'long', 'range'].each do |flavor| 19 macro(:"handle_ets_launch_#{dispatch}_#{flavor}") do |v, id| 20 # TODO(mbolshov): verify method 21 method_ptr = get_callee(id, dispatch == 'virt', false, v) 22 verify(method_ptr, false) 23 set_acc_object(call_runtime("LaunchFromInterpreter#{flavor.capitalize}", method_ptr, %frame, pc).ptr) 24 If(acc, 0).EQ { 25 move_to_exception 26 } 27 end 28 end 29end 30 31macro(:handle_ets_ldundefined) do 32 set_acc_object(ets_undefined).ref 33end 34 35macro(:handle_ets_movundefined) do |vd| 36 set_object(vd, ets_undefined).ref 37end 38 39macro(:handle_ets_isundefined) do 40 set_acc_primitive(btou32(Compare(acc.ref, ets_undefined).b)) 41end 42