• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1/**
2 * Copyright (c) 2024 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 */
15
16% Runtime.intrinsics.select{ |i| i.static && !i.signature.stackrange && !i.is_stub && !i.compiler_only && i.has_impl? &&
17%         !i.clear_flags.include?('call') }.each do |intrinsic|
18    case ark::compiler::RuntimeInterface::IntrinsicId::INTRINSIC_<%= intrinsic.enum_name %>: {
19%       types = intrinsic.signature.args.map { |i| i.gsub("\\[", "[]") } + [intrinsic.signature.ret]
20%       # `inspect` escapes possible backslashes in ret type descriptor
21%       plugin_opts = Common::plugins[intrinsic.space.upcase]
22%       sep = plugin_opts ? plugin_opts["class_name_separator"] : nil
23%       class_name = intrinsic.class_name
24%       signature = types.join(';')
25%       if sep && sep != '.' then
26%         class_name = class_name.gsub('.', sep)
27%         signature = signature.gsub('.', sep)
28%       end
29        CodeGenStatic::CallHandler(visitor, inst, <%= "#{class_name}.#{intrinsic.method_name}:#{signature};".inspect %>);
30        break;
31    }
32% end
33