ruby/tool/ruby_vm/views/insns.inc.erb
Takashi Kokubun 0f3d6ee578
ZJIT: Disable ZJIT instructions when USE_ZJIT is 0 (#13199)
* ZJIT: Disable ZJIT instructions when USE_ZJIT is 0

* Test the order of ZJIT instructions

* Add more jobs that disable JITs

* Show instruction names in the message
2025-04-29 11:03:13 -07:00

42 lines
1.0 KiB
Plaintext

/* -*- C -*- */
%# Copyright (c) 2017 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.
%
% zjit_insns, insns = RubyVM::Instructions.partition { |i| i.name.start_with?('zjit_') }
%
<%= render 'copyright' %>
<%= render 'notice', locals: {
this_file: 'contains YARV instruction list',
edit: __FILE__,
} -%>
#ifndef INSNS_INC
#define INSNS_INC 1
/* BIN : Basic Instruction Name */
#define BIN(n) YARVINSN_##n
enum ruby_vminsn_type {
% insns.each do |i|
<%= i.bin %>,
% end
#if USE_ZJIT
% zjit_insns.each do |i|
<%= i.bin %>,
% end
#endif
VM_INSTRUCTION_SIZE
};
#define VM_BARE_INSTRUCTION_SIZE <%= RubyVM::Instructions.count { |i| i.name !~ /\A(trace|zjit)_/ } %>
#define ASSERT_VM_INSTRUCTION_SIZE(array) \
STATIC_ASSERT(numberof_##array, numberof(array) == VM_INSTRUCTION_SIZE)
#endif