From e4c65ec49c5e2cba537f2d9ee00888c5dfbcac34 Mon Sep 17 00:00:00 2001 From: Maxime Chevalier-Boisvert Date: Tue, 8 Dec 2020 16:54:41 -0500 Subject: Refactor uJIT code into more files for readability --- tool/ruby_vm/views/ujit_examples.inc.erb | 24 ------------------------ tool/ruby_vm/views/ujit_hooks.inc.erb | 24 ++++++++++++++++++++++++ 2 files changed, 24 insertions(+), 24 deletions(-) delete mode 100644 tool/ruby_vm/views/ujit_examples.inc.erb create mode 100644 tool/ruby_vm/views/ujit_hooks.inc.erb (limited to 'tool/ruby_vm') diff --git a/tool/ruby_vm/views/ujit_examples.inc.erb b/tool/ruby_vm/views/ujit_examples.inc.erb deleted file mode 100644 index 9409c996b1..0000000000 --- a/tool/ruby_vm/views/ujit_examples.inc.erb +++ /dev/null @@ -1,24 +0,0 @@ -/* -*- 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 MicroJIT generate code', - edit: __FILE__, -} -%> - -% success, byte_arrays = RubyVM::MicroJIT.scrape -static const uint8_t ujit_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 diff --git a/tool/ruby_vm/views/ujit_hooks.inc.erb b/tool/ruby_vm/views/ujit_hooks.inc.erb new file mode 100644 index 0000000000..9409c996b1 --- /dev/null +++ b/tool/ruby_vm/views/ujit_hooks.inc.erb @@ -0,0 +1,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 MicroJIT generate code', + edit: __FILE__, +} -%> + +% success, byte_arrays = RubyVM::MicroJIT.scrape +static const uint8_t ujit_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 -- cgit v1.2.1