Skip to content

Commit ecbd5ad

Browse files
authored
Merge pull request ruby#71 from goyox86/goyox86/ujit-to-yjit
[YJIT] Renamed ujit to yjit
2 parents a6be545 + 15dd31a commit ecbd5ad

36 files changed

+1310
-1310
lines changed

.gitignore

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -229,5 +229,5 @@ lcov*.info
229229
/mjit_config.h
230230
/include/ruby-*/*/rb_mjit_min_header-*.h
231231

232-
# UJIT
233-
/ujit_hooks.inc
232+
# YJIT
233+
/yjit_hooks.inc

common.mk

Lines changed: 822 additions & 822 deletions
Large diffs are not rendered by default.

inits.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ rb_call_builtin_inits(void)
9797
BUILTIN(array);
9898
BUILTIN(kernel);
9999
BUILTIN(timev);
100-
BUILTIN(ujit);
100+
BUILTIN(yjit);
101101
Init_builtin_prelude();
102102
}
103103
#undef CALL

iseq.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
#include "ruby/util.h"
3939
#include "vm_core.h"
4040
#include "vm_callinfo.h"
41-
#include "ujit.h"
41+
#include "yjit.h"
4242

4343
#include "builtin.h"
4444
#include "insns.inc"
@@ -110,7 +110,7 @@ rb_iseq_free(const rb_iseq_t *iseq)
110110
if (iseq && iseq->body) {
111111
struct rb_iseq_constant_body *const body = iseq->body;
112112
mjit_free_iseq(iseq); /* Notify MJIT */
113-
rb_ujit_iseq_free(body);
113+
rb_yjit_iseq_free(body);
114114
ruby_xfree((void *)body->iseq_encoded);
115115
ruby_xfree((void *)body->insns_info.body);
116116
if (body->insns_info.positions) ruby_xfree((void *)body->insns_info.positions);
@@ -323,7 +323,7 @@ rb_iseq_update_references(rb_iseq_t *iseq)
323323
#if USE_MJIT
324324
mjit_update_references(iseq);
325325
#endif
326-
rb_ujit_iseq_update_references(body);
326+
rb_yjit_iseq_update_references(body);
327327
}
328328
}
329329

@@ -404,7 +404,7 @@ rb_iseq_mark(const rb_iseq_t *iseq)
404404
#if USE_MJIT
405405
mjit_mark_cc_entries(body);
406406
#endif
407-
rb_ujit_iseq_mark(body);
407+
rb_yjit_iseq_mark(body);
408408
}
409409

410410
if (FL_TEST_RAW((VALUE)iseq, ISEQ_NOT_LOADED_YET)) {
@@ -3145,7 +3145,7 @@ static insn_data_t insn_data[VM_INSTRUCTION_SIZE/2];
31453145

31463146

31473147

3148-
#include "ujit_asm.h"
3148+
#include "yjit_asm.h"
31493149

31503150

31513151

@@ -3410,7 +3410,7 @@ trace_set_i(void *vstart, void *vend, size_t stride, void *data)
34103410
}
34113411

34123412
void
3413-
rb_ujit_empty_func_with_ec(rb_control_frame_t *cfp, rb_execution_context_t *ec)
3413+
rb_yjit_empty_func_with_ec(rb_control_frame_t *cfp, rb_execution_context_t *ec)
34143414
{
34153415
// it's put in this file instead of say, compile.c to dodge long C compile time.
34163416
// it just needs to be in a different unit from vm.o so the compiler can't see the definition

iseq.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,7 @@ VALUE rb_iseq_defined_string(enum defined_type type);
302302
/* vm.c */
303303
VALUE rb_iseq_local_variables(const rb_iseq_t *iseq);
304304

305-
NOINLINE(void rb_ujit_empty_func_with_ec(rb_control_frame_t *cfp, rb_execution_context_t *ec));
305+
NOINLINE(void rb_yjit_empty_func_with_ec(rb_control_frame_t *cfp, rb_execution_context_t *ec));
306306

307307
RUBY_SYMBOL_EXPORT_END
308308

mjit.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
#include "debug_counter.h"
1818
#include "ruby.h"
1919
#include "vm_core.h"
20-
#include "ujit.h"
20+
#include "yjit.h"
2121

2222
// Special address values of a function generated from the
2323
// corresponding iseq by MJIT:
@@ -147,15 +147,15 @@ mjit_exec(rb_execution_context_t *ec)
147147
const rb_iseq_t *iseq;
148148
struct rb_iseq_constant_body *body;
149149

150-
if (mjit_call_p || rb_ujit_enabled_p()) {
150+
if (mjit_call_p || rb_yjit_enabled_p()) {
151151
iseq = ec->cfp->iseq;
152152
body = iseq->body;
153153
body->total_calls++;
154154
}
155155

156156
#ifndef MJIT_HEADER
157-
if (rb_ujit_enabled_p() && !mjit_call_p && body->total_calls == rb_ujit_call_threshold()) {
158-
rb_ujit_compile_iseq(iseq, ec);
157+
if (rb_yjit_enabled_p() && !mjit_call_p && body->total_calls == rb_yjit_call_threshold()) {
158+
rb_yjit_compile_iseq(iseq, ec);
159159
return Qundef;
160160
}
161161
#endif

ractor.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
#include "variable.h"
1717
#include "gc.h"
1818
#include "transient_heap.h"
19-
#include "ujit.h"
19+
#include "yjit.h"
2020

2121
VALUE rb_cRactor;
2222

@@ -1608,7 +1608,7 @@ ractor_create(rb_execution_context_t *ec, VALUE self, VALUE loc, VALUE name, VAL
16081608
r->verbose = cr->verbose;
16091609
r->debug = cr->debug;
16101610

1611-
rb_ujit_before_ractor_spawn();
1611+
rb_yjit_before_ractor_spawn();
16121612
rb_thread_create_ractor(r, args, block);
16131613

16141614
RB_GC_GUARD(rv);

ruby.c

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@
5959
#include "internal/process.h"
6060
#include "internal/variable.h"
6161
#include "mjit.h"
62-
#include "ujit.h"
62+
#include "yjit.h"
6363
#include "ruby/encoding.h"
6464
#include "ruby/thread.h"
6565
#include "ruby/util.h"
@@ -103,7 +103,7 @@ void rb_warning_category_update(unsigned int mask, unsigned int bits);
103103
SEP \
104104
X(jit) \
105105
SEP \
106-
X(ujit)
106+
X(yjit)
107107
/* END OF FEATURES */
108108
#define EACH_DEBUG_FEATURES(X, SEP) \
109109
X(frozen_string_literal) \
@@ -187,7 +187,7 @@ struct ruby_cmdline_options {
187187
#if USE_MJIT
188188
struct mjit_options mjit;
189189
#endif
190-
struct rb_ujit_options ujit;
190+
struct rb_yjit_options yjit;
191191

192192
int sflag, xflag;
193193
unsigned int warning: 1;
@@ -232,7 +232,7 @@ cmdline_options_init(ruby_cmdline_options_t *opt)
232232
#ifdef MJIT_FORCE_ENABLE /* to use with: ./configure cppflags="-DMJIT_FORCE_ENABLE" */
233233
opt->features.set |= FEATURE_BIT(jit);
234234
#endif
235-
opt->features.set |= FEATURE_BIT(ujit);
235+
opt->features.set |= FEATURE_BIT(yjit);
236236
return opt;
237237
}
238238

@@ -330,7 +330,7 @@ usage(const char *name, int help, int highlight, int columns)
330330
M("rubyopt", "", "RUBYOPT environment variable (default: enabled)"),
331331
M("frozen-string-literal", "", "freeze all string literals (default: disabled)"),
332332
M("jit", "", "JIT compiler (default: disabled)"),
333-
M("ujit", "", "in-process JIT compiler (default: enabled)"),
333+
M("yjit", "", "in-process JIT compiler (default: enabled)"),
334334
};
335335
static const struct message warn_categories[] = {
336336
M("deprecated", "", "deprecated features"),
@@ -1023,20 +1023,20 @@ set_option_encoding_once(const char *type, VALUE *name, const char *e, long elen
10231023
opt_match(s, l, name) && (*(s) ? 1 : (rb_raise(rb_eRuntimeError, "--jit-" name " needs an argument"), 0))
10241024

10251025
static void
1026-
setup_ujit_options(const char *s, struct rb_ujit_options *ujit_opt)
1026+
setup_yjit_options(const char *s, struct rb_yjit_options *yjit_opt)
10271027
{
10281028
if (*s != '-') return;
10291029
const size_t l = strlen(++s);
10301030

10311031
if (opt_match_arg(s, l, "call-threshold")) {
1032-
ujit_opt->call_threshold = atoi(s + 1);
1032+
yjit_opt->call_threshold = atoi(s + 1);
10331033
}
10341034
else if (opt_match_noarg(s, l, "stats")) {
1035-
ujit_opt->gen_stats = true;
1035+
yjit_opt->gen_stats = true;
10361036
}
10371037
else {
10381038
rb_raise(rb_eRuntimeError,
1039-
"invalid ujit option `%s' (--help will show valid ujit options)", s);
1039+
"invalid yjit option `%s' (--help will show valid yjit options)", s);
10401040
}
10411041
}
10421042

@@ -1453,9 +1453,9 @@ proc_options(long argc, char **argv, ruby_cmdline_options_t *opt, int envopt)
14531453
rb_warn("MJIT support is disabled.");
14541454
#endif
14551455
}
1456-
else if (strncmp("ujit", s, 4) == 0) {
1457-
FEATURE_SET(opt->features, FEATURE_BIT(ujit));
1458-
setup_ujit_options(s + 4, &opt->ujit);
1456+
else if (strncmp("yjit", s, 4) == 0) {
1457+
FEATURE_SET(opt->features, FEATURE_BIT(yjit));
1458+
setup_yjit_options(s + 4, &opt->yjit);
14591459
}
14601460
else if (strcmp("yydebug", s) == 0) {
14611461
if (envopt) goto noenvopt_long;
@@ -1801,8 +1801,8 @@ process_options(int argc, char **argv, ruby_cmdline_options_t *opt)
18011801
*/
18021802
rb_warning("-K is specified; it is for 1.8 compatibility and may cause odd behavior");
18031803

1804-
if (opt->features.set & FEATURE_BIT(ujit))
1805-
rb_ujit_init(&opt->ujit);
1804+
if (opt->features.set & FEATURE_BIT(yjit))
1805+
rb_yjit_init(&opt->yjit);
18061806
#if USE_MJIT
18071807
if (opt->features.set & FEATURE_BIT(jit)) {
18081808
opt->mjit.on = TRUE; /* set mjit.on for ruby_show_version() API and check to call mjit_init() */

template/Makefile.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -583,7 +583,7 @@ update-known-errors:
583583
$(IFCHANGE) $(srcdir)/defs/known_errors.def -
584584

585585
INSNS = opt_sc.inc optinsn.inc optunifs.inc insns.inc insns_info.inc \
586-
vmtc.inc vm.inc mjit_compile.inc ujit_hooks.inc
586+
vmtc.inc vm.inc mjit_compile.inc yjit_hooks.inc
587587

588588
$(INSNS): $(srcdir)/insns.def vm_opts.h \
589589
$(srcdir)/defs/opt_operand.def $(srcdir)/defs/opt_insn_unif.def \

test_asm.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
clear
55

6-
clang -std=gnu99 -Wall -Werror -Wshorten-64-to-32 ujit_asm.c ujit_asm_tests.c -o asm_test
6+
clang -std=gnu99 -Wall -Werror -Wshorten-64-to-32 yjit_asm.c yjit_asm_tests.c -o asm_test
77

88
./asm_test
99

0 commit comments

Comments
 (0)