summaryrefslogtreecommitdiff
path: root/tool/ruby_vm/views/yjit_hooks.inc.erb
blob: 1abd281491bb5d80475e3ccc039b510d4639a5d3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
/* -*- C -*- */

%# Copyright (c) 2020 Wu, Alan.  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.
<%= render 'copyright' %>
<%= render 'notice', locals: {
    this_file: 'contains raw instruction bytes that helps YJIT generate code',
    edit: __FILE__,
} -%>

% success, byte_arrays = RubyVM::YJIT.scrape
static const uint8_t yjit_scrape_successful = <%= success %>;
% byte_arrays.each do |(prefix, scrape_result)|
// Disassembly:
%   scrape_result.disassembly_lines.each do |line|
// <%= line %>
%   end
static const uint8_t <%= prefix %>_pre_call_bytes[] = { <%= scrape_result.pre_call_bytes %> };
static const uint8_t <%= prefix %>_post_call_bytes[] = { <%= scrape_result.post_call_bytes  %> };
% end