From 8080670b38a8feb935f178cdc3f40fdd22ca9500 Mon Sep 17 00:00:00 2001 From: Reini Urban Date: Wed, 23 Apr 2014 15:12:18 -0500 Subject: [PATCH] [pmc] partially use new WB markers --- src/pmc/arrayiterator.pmc | 36 +++++++++++----- src/pmc/capture.pmc | 88 ++++++++++++++++++++------------------- 2 files changed, 71 insertions(+), 53 deletions(-) diff --git a/src/pmc/arrayiterator.pmc b/src/pmc/arrayiterator.pmc index fd5b7198c4..d449e57226 100644 --- a/src/pmc/arrayiterator.pmc +++ b/src/pmc/arrayiterator.pmc @@ -141,6 +141,7 @@ Marks the current idx/key and the aggregate as live. GET_ATTR_reverse(INTERP, SELF, reverse); clone = Parrot_pmc_new_init(INTERP, enum_class_ArrayIterator, array); + PARROT_GC_WRITE_BARRIER(INTERP, SELF); SET_ATTR_pos(INTERP, clone, pos); SET_ATTR_reverse(INTERP, clone, reverse); @@ -180,12 +181,14 @@ Returns the number of remaining elements in the array. if (reverse) { INTVAL pos; GET_ATTR_pos(INTERP, SELF, pos); + PARROT_GC_WRITE_BARRIER(INTERP, SELF); return pos; } else { INTVAL pos, length; GET_ATTR_length(INTERP, SELF, length); GET_ATTR_pos(INTERP, SELF, pos); + PARROT_GC_WRITE_BARRIER(INTERP, SELF); return length - pos; } } @@ -207,7 +210,7 @@ Reset the Iterator. C must be one of */ - VTABLE void set_integer_native(INTVAL value) { + VTABLE void set_integer_native(INTVAL value) :no_wb { PMC *array; INTVAL element; GET_ATTR_array(INTERP, SELF, array); @@ -243,6 +246,7 @@ Returns this Iterator's array. VTABLE PMC *get_pmc() { PMC *array; GET_ATTR_array(INTERP, SELF, array); + PARROT_GC_WRITE_BARRIER(INTERP, SELF); return array ? array : PMCNULL; } @@ -269,6 +273,7 @@ the next one. GET_ATTR_array(INTERP, SELF, array); SET_ATTR_pos(INTERP, SELF, pos+1); + PARROT_GC_WRITE_BARRIER(INTERP, SELF); return VTABLE_get_integer_keyed_int(INTERP, array, pos); } @@ -292,6 +297,7 @@ the next one. GET_ATTR_array(INTERP, SELF, array); SET_ATTR_pos(INTERP, SELF, pos+1); + PARROT_GC_WRITE_BARRIER(INTERP, SELF); return VTABLE_get_number_keyed_int(INTERP, array, pos); } @@ -316,6 +322,7 @@ the next one. GET_ATTR_array(INTERP, SELF, array); SET_ATTR_pos(INTERP, SELF, pos+1); + PARROT_GC_WRITE_BARRIER(INTERP, SELF); return VTABLE_get_string_keyed_int(INTERP, array, pos); } @@ -343,6 +350,7 @@ the next one. GET_ATTR_array(INTERP, SELF, array); SET_ATTR_pos(INTERP, SELF, pos+1); + PARROT_GC_WRITE_BARRIER(INTERP, SELF); return VTABLE_get_pmc_keyed_int(INTERP, array, pos); } @@ -371,6 +379,7 @@ the next one. GET_ATTR_array(INTERP, SELF, array); SET_ATTR_pos(INTERP, SELF, --pos); + PARROT_GC_WRITE_BARRIER(INTERP, SELF); return VTABLE_get_integer_keyed_int(INTERP, array, pos); } @@ -394,6 +403,7 @@ the next one. GET_ATTR_array(INTERP, SELF, array); SET_ATTR_pos(INTERP, SELF, --pos); + PARROT_GC_WRITE_BARRIER(INTERP, SELF); return VTABLE_get_number_keyed_int(INTERP, array, pos); } @@ -418,6 +428,7 @@ the next one. GET_ATTR_array(INTERP, SELF, array); SET_ATTR_pos(INTERP, SELF, --pos); + PARROT_GC_WRITE_BARRIER(INTERP, SELF); return VTABLE_get_string_keyed_int(INTERP, array, pos); } @@ -444,6 +455,7 @@ the next one. GET_ATTR_array(INTERP, SELF, array); SET_ATTR_pos(INTERP, SELF, --pos); + PARROT_GC_WRITE_BARRIER(INTERP, SELF); return VTABLE_get_pmc_keyed_int(INTERP, array, pos); } @@ -458,7 +470,7 @@ Returns the element for C<*key>. */ - VTABLE PMC *get_pmc_keyed(PMC *key) { + VTABLE PMC *get_pmc_keyed(PMC *key) :no_wb { return STATICSELF.get_pmc_keyed_int(VTABLE_get_integer(INTERP, key)); } @@ -472,7 +484,7 @@ Returns the element for C. */ - VTABLE PMC *get_pmc_keyed_int(INTVAL idx) { + VTABLE PMC *get_pmc_keyed_int(INTVAL idx) :no_wb { INTVAL pos; GET_ATTR_pos(INTERP, SELF, pos); @@ -488,7 +500,7 @@ Returns the element for C. */ - VTABLE INTVAL get_integer_keyed(PMC *key) { + VTABLE INTVAL get_integer_keyed(PMC *key) :no_wb { return STATICSELF.get_integer_keyed_int(VTABLE_get_integer(INTERP, key)); } @@ -502,7 +514,7 @@ Get integer value of current position plus idx. */ - VTABLE INTVAL get_integer_keyed_int(INTVAL idx) { + VTABLE INTVAL get_integer_keyed_int(INTVAL idx) :no_wb { INTVAL pos; GET_ATTR_pos(INTERP, SELF, pos); @@ -519,7 +531,7 @@ Get integer value of current position plus idx. */ - VTABLE FLOATVAL get_number_keyed(PMC *key) { + VTABLE FLOATVAL get_number_keyed(PMC *key) :no_wb { return STATICSELF.get_number_keyed_int(VTABLE_get_integer(INTERP, key)); } @@ -533,7 +545,7 @@ Get number value of current position plus idx. */ - VTABLE FLOATVAL get_number_keyed_int(INTVAL idx) { + VTABLE FLOATVAL get_number_keyed_int(INTVAL idx) :no_wb { INTVAL pos; GET_ATTR_pos(INTERP, SELF, pos); @@ -552,7 +564,7 @@ Get number value of current position plus idx. */ - VTABLE STRING *get_string_keyed(PMC *key) { + VTABLE STRING *get_string_keyed(PMC *key) :no_wb { return STATICSELF.get_string_keyed_int(VTABLE_get_integer(INTERP, key)); } @@ -566,7 +578,7 @@ Get string value of current position plus idx. */ - VTABLE STRING *get_string_keyed_int(INTVAL idx) { + VTABLE STRING *get_string_keyed_int(INTVAL idx) :no_wb { INTVAL pos; GET_ATTR_pos(INTERP, SELF, pos); @@ -585,7 +597,7 @@ Returns whether an element for C<*key> exists in the array. */ - VTABLE INTVAL exists_keyed(PMC *key) { + VTABLE INTVAL exists_keyed(PMC *key) :no_wb { return STATICSELF.exists_keyed_int(VTABLE_get_integer(INTERP, key)); } @@ -606,6 +618,7 @@ Returns whether an element for C exists in the aggregate. GET_ATTR_pos(INTERP, SELF, pos); GET_ATTR_reverse(INTERP, SELF, reverse); GET_ATTR_array(INTERP, SELF, array); + PARROT_GC_WRITE_BARRIER(INTERP, SELF); /* Cheat! */ final_pos = pos + idx - reverse; @@ -621,7 +634,7 @@ Returns whether an element for C exists in the aggregate. */ - VTABLE INTVAL defined_keyed(PMC *key) { + VTABLE INTVAL defined_keyed(PMC *key) :no_wb { return STATICSELF.defined_keyed_int(VTABLE_get_integer(INTERP, key)); } @@ -642,6 +655,7 @@ Returns the result of calling C on the aggregate. GET_ATTR_pos(INTERP, SELF, pos); GET_ATTR_reverse(INTERP, SELF, reverse); GET_ATTR_array(INTERP, SELF, array); + PARROT_GC_WRITE_BARRIER(INTERP, SELF); /* Cheat! */ final_pos = pos + idx - reverse; diff --git a/src/pmc/capture.pmc b/src/pmc/capture.pmc index 01ed8dd548..d2949450d4 100644 --- a/src/pmc/capture.pmc +++ b/src/pmc/capture.pmc @@ -94,28 +94,28 @@ Sets a value in the array component of the Capture. */ - VTABLE void set_number_keyed_int(INTVAL key, FLOATVAL value) { + VTABLE void set_number_keyed_int(INTVAL key, FLOATVAL value) :manual_wb { PMC *array; CAPTURE_array_CREATE(INTERP, SELF, array); VTABLE_set_number_keyed_int(INTERP, array, key, value); } - VTABLE void set_integer_keyed_int(INTVAL key, INTVAL value) { + VTABLE void set_integer_keyed_int(INTVAL key, INTVAL value) :manual_wb { PMC *array; CAPTURE_array_CREATE(INTERP, SELF, array); VTABLE_set_integer_keyed_int(INTERP, array, key, value); } - VTABLE void set_pmc_keyed_int(INTVAL key, PMC *value) { + VTABLE void set_pmc_keyed_int(INTVAL key, PMC *value) :manual_wb { PMC *array; CAPTURE_array_CREATE(INTERP, SELF, array); VTABLE_set_pmc_keyed_int(INTERP, array, key, value); } - VTABLE void set_string_keyed_int(INTVAL key, STRING *value) { + VTABLE void set_string_keyed_int(INTVAL key, STRING *value) :manual_wb { PMC *array; CAPTURE_array_CREATE(INTERP, SELF, array); @@ -142,6 +142,7 @@ Retrieves a value in the array component of the Capture. PMC *array; GET_ATTR_array(INTERP, SELF, array); + PARROT_GC_WRITE_BARRIER(INTERP, SELF); if (!array) return 0.0; @@ -153,6 +154,7 @@ Retrieves a value in the array component of the Capture. PMC *array; GET_ATTR_array(INTERP, SELF, array); + PARROT_GC_WRITE_BARRIER(INTERP, SELF); if (!array) return 0; @@ -164,6 +166,7 @@ Retrieves a value in the array component of the Capture. PMC *array; GET_ATTR_array(INTERP, SELF, array); + PARROT_GC_WRITE_BARRIER(INTERP, SELF); if (!array) return PMCNULL; @@ -175,6 +178,7 @@ Retrieves a value in the array component of the Capture. PMC *array; GET_ATTR_array(INTERP, SELF, array); + PARROT_GC_WRITE_BARRIER(INTERP, SELF); if (!array) return CONST_STRING(INTERP, ""); @@ -208,35 +212,35 @@ Unshift a value onto the array component of the Capture. */ - VTABLE void push_float(FLOATVAL value) { + VTABLE void push_float(FLOATVAL value) :manual_wb { PMC *array; CAPTURE_array_CREATE(INTERP, SELF, array); VTABLE_push_float(INTERP, array, value); } - VTABLE void push_integer(INTVAL value) { + VTABLE void push_integer(INTVAL value) :manual_wb { PMC *array; CAPTURE_array_CREATE(INTERP, SELF, array); VTABLE_push_integer(INTERP, array, value); } - VTABLE void push_pmc(PMC *value) { + VTABLE void push_pmc(PMC *value) :manual_wb { PMC *array; CAPTURE_array_CREATE(INTERP, SELF, array); VTABLE_push_pmc(INTERP, array, value); } - VTABLE void push_string(STRING *value) { + VTABLE void push_string(STRING *value) :manual_wb { PMC *array; CAPTURE_array_CREATE(INTERP, SELF, array); VTABLE_push_string(INTERP, array, value); } - VTABLE void unshift_float(FLOATVAL value) { + VTABLE void unshift_float(FLOATVAL value) :manual_wb { PMC *array; CAPTURE_array_CREATE(INTERP, SELF, array); @@ -250,14 +254,14 @@ Unshift a value onto the array component of the Capture. VTABLE_unshift_integer(INTERP, array, value); } - VTABLE void unshift_pmc(PMC *value) { + VTABLE void unshift_pmc(PMC *value) :manual_wb { PMC *array; CAPTURE_array_CREATE(INTERP, SELF, array); VTABLE_unshift_pmc(INTERP, array, value); } - VTABLE void unshift_string(STRING *value) { + VTABLE void unshift_string(STRING *value) :manual_wb { PMC *array; CAPTURE_array_CREATE(INTERP, SELF, array); @@ -290,56 +294,56 @@ Shift a value from the array component of the Capture. */ - VTABLE FLOATVAL pop_float() { + VTABLE FLOATVAL pop_float() :manual_wb { PMC *array; CAPTURE_array_CREATE(INTERP, SELF, array); return VTABLE_pop_float(INTERP, array); } - VTABLE INTVAL pop_integer() { + VTABLE INTVAL pop_integer() :manual_wb { PMC *array; CAPTURE_array_CREATE(INTERP, SELF, array); return VTABLE_pop_integer(INTERP, array); } - VTABLE PMC *pop_pmc() { + VTABLE PMC *pop_pmc() :manual_wb { PMC *array; CAPTURE_array_CREATE(INTERP, SELF, array); return VTABLE_pop_pmc(INTERP, array); } - VTABLE STRING *pop_string() { + VTABLE STRING *pop_string() :manual_wb { PMC *array; CAPTURE_array_CREATE(INTERP, SELF, array); return VTABLE_pop_string(INTERP, array); } - VTABLE FLOATVAL shift_float() { + VTABLE FLOATVAL shift_float() :manual_wb { PMC *array; CAPTURE_array_CREATE(INTERP, SELF, array); return VTABLE_shift_float(INTERP, array); } - VTABLE INTVAL shift_integer() { + VTABLE INTVAL shift_integer() :manual_wb { PMC *array; CAPTURE_array_CREATE(INTERP, SELF, array); return VTABLE_shift_integer(INTERP, array); } - VTABLE PMC *shift_pmc() { + VTABLE PMC *shift_pmc() :manual_wb { PMC *array; CAPTURE_array_CREATE(INTERP, SELF, array); return VTABLE_shift_pmc(INTERP, array); } - VTABLE STRING *shift_string() { + VTABLE STRING *shift_string() :manual_wb { PMC *array; CAPTURE_array_CREATE(INTERP, SELF, array); @@ -368,7 +372,7 @@ Delete the element corresponding to C in the array component. */ - VTABLE INTVAL elements() { + VTABLE INTVAL elements() :no_wb { PMC *array; GET_ATTR_array(INTERP, SELF, array); @@ -379,7 +383,7 @@ Delete the element corresponding to C in the array component. return VTABLE_elements(INTERP, array); } - VTABLE INTVAL defined_keyed_int(INTVAL key) { + VTABLE INTVAL defined_keyed_int(INTVAL key) :no_wb { PMC *array; GET_ATTR_array(INTERP, SELF, array); @@ -390,7 +394,7 @@ Delete the element corresponding to C in the array component. return VTABLE_defined_keyed_int(INTERP, array, key); } - VTABLE INTVAL exists_keyed_int(INTVAL key) { + VTABLE INTVAL exists_keyed_int(INTVAL key) :no_wb { PMC *array; GET_ATTR_array(INTERP, SELF, array); @@ -426,28 +430,28 @@ Sets a value in the hash component of the Capture. */ - VTABLE void set_number_keyed(PMC *key, FLOATVAL value) { + VTABLE void set_number_keyed(PMC *key, FLOATVAL value) :manual_wb { PMC *hash; CAPTURE_hash_CREATE(INTERP, SELF, hash); VTABLE_set_number_keyed(INTERP, hash, key, value); } - VTABLE void set_integer_keyed(PMC *key, INTVAL value) { + VTABLE void set_integer_keyed(PMC *key, INTVAL value) :manual_wb { PMC *hash; CAPTURE_hash_CREATE(INTERP, SELF, hash); VTABLE_set_integer_keyed(INTERP, hash, key, value); } - VTABLE void set_pmc_keyed(PMC *key, PMC *value) { + VTABLE void set_pmc_keyed(PMC *key, PMC *value) :manual_wb { PMC *hash; CAPTURE_hash_CREATE(INTERP, SELF, hash); VTABLE_set_pmc_keyed(INTERP, hash, key, value); } - VTABLE void set_string_keyed(PMC *key, STRING *value) { + VTABLE void set_string_keyed(PMC *key, STRING *value) :manual_wb { PMC *hash; CAPTURE_hash_CREATE(INTERP, SELF, hash); @@ -470,7 +474,7 @@ Retrieves a value from the hash component of the Capture. */ - VTABLE FLOATVAL get_number_keyed(PMC *key) { + VTABLE FLOATVAL get_number_keyed(PMC *key) :no_wb { PMC *hash; GET_ATTR_hash(INTERP, SELF, hash); @@ -481,7 +485,7 @@ Retrieves a value from the hash component of the Capture. return VTABLE_get_number_keyed(INTERP, hash, key); } - VTABLE INTVAL get_integer_keyed(PMC *key) { + VTABLE INTVAL get_integer_keyed(PMC *key) :no_wb { PMC *hash; GET_ATTR_hash(INTERP, SELF, hash); @@ -492,7 +496,7 @@ Retrieves a value from the hash component of the Capture. return VTABLE_get_integer_keyed(INTERP, hash, key); } - VTABLE PMC *get_pmc_keyed(PMC *key) { + VTABLE PMC *get_pmc_keyed(PMC *key) :no_wb { PMC *hash; GET_ATTR_hash(INTERP, SELF, hash); @@ -503,7 +507,7 @@ Retrieves a value from the hash component of the Capture. return VTABLE_get_pmc_keyed(INTERP, hash, key); } - VTABLE STRING *get_string_keyed(PMC *key) { + VTABLE STRING *get_string_keyed(PMC *key) :no_wb { PMC *hash; GET_ATTR_hash(INTERP, SELF, hash); @@ -530,28 +534,28 @@ Sets a value in the hash component of the Capture. */ - VTABLE void set_number_keyed_str(STRING *key, FLOATVAL value) { + VTABLE void set_number_keyed_str(STRING *key, FLOATVAL value) :manual_wb { PMC *hash; CAPTURE_hash_CREATE(INTERP, SELF, hash); VTABLE_set_number_keyed_str(INTERP, hash, key, value); } - VTABLE void set_integer_keyed_str(STRING *key, INTVAL value) { + VTABLE void set_integer_keyed_str(STRING *key, INTVAL value) :manual_wb { PMC *hash; CAPTURE_hash_CREATE(INTERP, SELF, hash); VTABLE_set_integer_keyed_str(INTERP, hash, key, value); } - VTABLE void set_pmc_keyed_str(STRING *key, PMC *value) { + VTABLE void set_pmc_keyed_str(STRING *key, PMC *value) :manual_wb { PMC *hash; CAPTURE_hash_CREATE(INTERP, SELF, hash); VTABLE_set_pmc_keyed_str(INTERP, hash, key, value); } - VTABLE void set_string_keyed_str(STRING *key, STRING *value) { + VTABLE void set_string_keyed_str(STRING *key, STRING *value) :manual_wb { PMC *hash; CAPTURE_hash_CREATE(INTERP, SELF, hash); @@ -574,7 +578,7 @@ Retrieves a value in the hash component of the Capture. */ - VTABLE FLOATVAL get_number_keyed_str(STRING *key) { + VTABLE FLOATVAL get_number_keyed_str(STRING *key) :no_wb { PMC *hash; GET_ATTR_hash(INTERP, SELF, hash); @@ -585,7 +589,7 @@ Retrieves a value in the hash component of the Capture. return VTABLE_get_number_keyed_str(INTERP, hash, key); } - VTABLE INTVAL get_integer_keyed_str(STRING *key) { + VTABLE INTVAL get_integer_keyed_str(STRING *key) :no_wb { PMC *hash; GET_ATTR_hash(INTERP, SELF, hash); @@ -596,7 +600,7 @@ Retrieves a value in the hash component of the Capture. return VTABLE_get_integer_keyed_str(INTERP, hash, key); } - VTABLE PMC *get_pmc_keyed_str(STRING *key) { + VTABLE PMC *get_pmc_keyed_str(STRING *key) :no_wb { PMC *hash; GET_ATTR_hash(INTERP, SELF, hash); @@ -607,7 +611,7 @@ Retrieves a value in the hash component of the Capture. return VTABLE_get_pmc_keyed_str(INTERP, hash, key); } - VTABLE STRING *get_string_keyed_str(STRING *key) { + VTABLE STRING *get_string_keyed_str(STRING *key) :no_wb { PMC *hash; GET_ATTR_hash(INTERP, SELF, hash); @@ -635,7 +639,7 @@ Delete the element corresponding to C in the hash component. */ - VTABLE INTVAL defined_keyed(PMC *key) { + VTABLE INTVAL defined_keyed(PMC *key) :no_wb { PMC *hash; GET_ATTR_hash(INTERP, SELF, hash); @@ -646,7 +650,7 @@ Delete the element corresponding to C in the hash component. return VTABLE_defined_keyed(INTERP, hash, key); } - VTABLE INTVAL exists_keyed(PMC *key) { + VTABLE INTVAL exists_keyed(PMC *key) :no_wb { PMC *hash; GET_ATTR_hash(INTERP, SELF, hash); @@ -684,7 +688,7 @@ Delete the element corresponding to C in the hash component. */ - VTABLE INTVAL defined_keyed_str(STRING *key) { + VTABLE INTVAL defined_keyed_str(STRING *key) :no_wb { PMC *hash; GET_ATTR_hash(INTERP, SELF, hash); @@ -694,7 +698,7 @@ Delete the element corresponding to C in the hash component. return VTABLE_defined_keyed_str(INTERP, hash, key); } - VTABLE INTVAL exists_keyed_str(STRING *key) { + VTABLE INTVAL exists_keyed_str(STRING *key) :no_wb { PMC *hash; GET_ATTR_hash(INTERP, SELF, hash);