Skip to content
Closed
Changes from 1 commit
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
dc9ce32
test/ruby/test_optimization.rb: fix compile kwarg
Feb 14, 2018
7606806
compile.c: drop freezestring insn on String#-@
Feb 14, 2018
8df47f8
configure.ac: Use `pthread_create` to determine if pthread is available
mame Feb 15, 2018
50700c4
thread_pthread.c: Use `getpagesize()` when `pthread_attr_getguardsize…
mame Feb 15, 2018
b4b4b94
gc.c: force STACK_GROW_DIRECTION for emscripten
mame Feb 15, 2018
0efd8bb
test/io/console/test_io_console.rb (test_oflush): Avoid race condition
mame Feb 15, 2018
9a9a4e8
Benchmarks for Array#values_at
nobu Feb 15, 2018
41e9e19
Array#values_at optimization
nobu Feb 15, 2018
d6db2d9
Avoid using `@` in macro substitution that confuses FreeBSD make
knu Feb 15, 2018
80c850e
Iterate over the catch table, and mark iseq in the table
tenderlove Jan 12, 2018
881ea05
Disasm instruction sequences and mark things managed by the GC
tenderlove Jan 12, 2018
969ccfd
Only add objects to the compile time mark array
tenderlove Jan 12, 2018
aaaffa4
Only de-reference when we need to check the object type
tenderlove Jan 17, 2018
5fa1733
Private function should be static, no return in `void`
tenderlove Jan 18, 2018
d3f6c51
CDHASH needs to stay in the mark array until compilation finishes
tenderlove Jan 18, 2018
9bed499
Fix bug when marking iseq before instruction have been translated
tenderlove Jan 19, 2018
8aeb2b8
Directly mark `once` instruction values
tenderlove Feb 2, 2018
65c9fc9
stop using a mark array
tenderlove Feb 2, 2018
6649dc4
Set a compile time flag so iseq marking knows about markables
tenderlove Feb 5, 2018
d6ca1ce
Introduce TS_ISE operand
tenderlove Feb 5, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Only add objects to the compile time mark array
Now that marking is done directly on the iseq, we just need to keep
objects alive during compile time via a mark array.  This commit
switches iseq mark to push on to the compile time mark array, then stops
adding the iseq to iseq mark arrays
  • Loading branch information
tenderlove committed Feb 15, 2018
commit 969ccfd5deddf2c318ff3e111ade17dd473d6761
23 changes: 2 additions & 21 deletions compile.c
Original file line number Diff line number Diff line change
Expand Up @@ -562,15 +562,6 @@ APPEND_ELEM(ISEQ_ARG_DECLARE LINK_ANCHOR *const anchor, LINK_ELEMENT *before, LI
#define APPEND_ELEM(anchor, before, elem) APPEND_ELEM(iseq, (anchor), (before), (elem))
#endif

static int
iseq_add_mark_object(const rb_iseq_t *iseq, VALUE v)
{
if (!SPECIAL_CONST_P(v)) {
rb_iseq_add_mark_object(iseq, v);
}
return COMPILE_OK;
}

static int
iseq_add_mark_object_compile_time(const rb_iseq_t *iseq, VALUE v)
{
Expand Down Expand Up @@ -1235,7 +1226,7 @@ new_child_iseq(rb_iseq_t *iseq, const NODE *const node,
rb_iseq_path(iseq), rb_iseq_realpath(iseq),
INT2FIX(line_no), parent, type, ISEQ_COMPILE_DATA(iseq)->option);
debugs("[new_child_iseq]< ---------------------------------------\n");
iseq_add_mark_object(iseq, (VALUE)ret_iseq);
iseq_add_mark_object_compile_time(iseq, (VALUE)ret_iseq);
return ret_iseq;
}

Expand All @@ -1250,7 +1241,7 @@ new_child_iseq_ifunc(rb_iseq_t *iseq, const struct vm_ifunc *ifunc,
rb_iseq_path(iseq), rb_iseq_realpath(iseq),
INT2FIX(line_no), parent, type, ISEQ_COMPILE_DATA(iseq)->option);
debugs("[new_child_iseq_ifunc]< ---------------------------------------\n");
iseq_add_mark_object(iseq, (VALUE)ret_iseq);
iseq_add_mark_object_compile_time(iseq, (VALUE)ret_iseq);
return ret_iseq;
}

Expand Down Expand Up @@ -1501,7 +1492,6 @@ iseq_set_arguments_keywords(rb_iseq_t *iseq, LINK_ANCHOR *const optargs,
switch (nd_type(val_node)) {
case NODE_LIT:
dv = val_node->nd_lit;
iseq_add_mark_object(iseq, dv);
break;
case NODE_NIL:
dv = Qnil;
Expand Down Expand Up @@ -2044,7 +2034,6 @@ iseq_set_sequence(rb_iseq_t *iseq, LINK_ANCHOR *const anchor)
VALUE v = operands[j];
generated_iseq[code_index + 1 + j] = v;
/* to mark ruby object */
iseq_add_mark_object(iseq, v);
break;
}
case TS_IC: /* inline cache */
Expand Down Expand Up @@ -4822,7 +4811,6 @@ compile_case(rb_iseq_t *iseq, LINK_ANCHOR *const ret, const NODE *const orig_nod
}

if (only_special_literals) {
iseq_add_mark_object(iseq, literals);

ADD_INSN(ret, nd_line(orig_node), dup);
ADD_INSN2(ret, nd_line(orig_node), opt_case_dispatch, literals, elselabel);
Expand Down Expand Up @@ -7538,7 +7526,6 @@ iseq_build_load_iseq(const rb_iseq_t *iseq, VALUE op)
}

loaded_iseq = rb_iseqw_to_iseq(iseqw);
iseq_add_mark_object(iseq, (VALUE)loaded_iseq);
return loaded_iseq;
}

Expand Down Expand Up @@ -7669,7 +7656,6 @@ iseq_build_from_ary_body(rb_iseq_t *iseq, LINK_ANCHOR *const anchor,
break;
case TS_VALUE:
argv[j] = op;
iseq_add_mark_object(iseq, op);
break;
case TS_ISEQ:
{
Expand Down Expand Up @@ -7716,7 +7702,6 @@ iseq_build_from_ary_body(rb_iseq_t *iseq, LINK_ANCHOR *const anchor,
}
RB_GC_GUARD(op);
argv[j] = map;
rb_iseq_add_mark_object(iseq, map);
}
break;
case TS_FUNCPTR:
Expand Down Expand Up @@ -9320,7 +9305,6 @@ ibf_load_object(const struct ibf_load *load, VALUE object_index)

rb_ary_store(load->obj_list, (long)object_index, obj);
}
iseq_add_mark_object(load->iseq, obj);
return obj;
}
}
Expand Down Expand Up @@ -9507,9 +9491,6 @@ ibf_load_iseq(const struct ibf_load *load, const rb_iseq_t *index_iseq)
ibf_load_iseq_complete(iseq);
#endif /* !USE_LAZY_LOAD */

if (load->iseq) {
iseq_add_mark_object(load->iseq, (VALUE)iseq);
}
return iseq;
}
}
Expand Down