summaryrefslogtreecommitdiff
path: root/tool/ruby_vm/views/_mjit_compile_invokebuiltin.erb
blob: f935f799cb65dc1912893ee1e6a891d266ecd3eb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
% # -*- C -*-
% # Copyright (c) 2020 Urabe, Shyouhei.  All rights reserved.
% #
% # This file is a part of  the programming language Ruby.  Permission is hereby
% # granted, to either  redistribute and/or modify this file,  provided that the
% # conditions mentioned  in the  file COPYING  are met.   Consult the  file for
% # details.
%
    /* <%= insn.name %> */
    const struct rb_builtin_function *bf = (const void *)operands[0];
%
% if insn.name == 'invokebuiltin' then
    const rb_num_t index = -1;
% else
    const rb_num_t index = (rb_num_t)operands[1];
% end
%
    if (bf->compiler) {
        bf->compiler(f, index);
    }
    else {
        mjit_invokebuiltin_default_compiler(f, bf, index);
    }