Permalink
Browse files

Merge branch 'master' into dyncall-callbacks

  • Loading branch information...
2 parents 0897370 + 7dbd85b commit fc4115b2d18799bc0576363ec16ad932154ac08b @arnsholt arnsholt committed Jul 23, 2012
View
@@ -1 +1 @@
-2012.06.1
+2012.07
View
@@ -15,6 +15,10 @@ immediately prior to the Rakudo release.
=item 1.
+*Warning: Since 2012.07, this first step should only be done if the current
+revision is not a Parrot release. So this step may or may not apply,
+depending.*
+
Edit NQP's F<tools/build/PARROT_REVISION> file to contain the latest tag
of the Parrot repository corresponding to Parrot's monthly release. For
Instance, running C<git tag> on an up-to-date Parrot repository will
@@ -31,23 +35,21 @@ In this example the latest release of Parrot is 3.9.0, so the string
RELEASE_3_9_0 should be placed in F<tools/build/PARROT_REVISION>
Once F<tools/build/PARROT_REVISION> has been set to the Parrot release,
-it must not be changed until after the Rakudo release. In other words,
-we want each monthly release of Rakudo to be able to be built using the
-immediately prior release of Parrot.
+it must not be changed until after the Rakudo release.
=item 2.
Change the C<VERSION> file in nqp:
$ echo '2012.12' > VERSION
- $ git commit -m 'bump VERSION to 2012' VERSION
+ $ git commit -m 'bump VERSION to 2012.12' VERSION
$ git push
=item 3.
Tag NQP by its release month ("YYYY.MM")
- $ git tag -a -m"tag release YYYY.MM" YYYY.MM # e.g., 2011.10
+ $ git tag -a -m"tag release YYYY.MM" YYYY.MM # e.g., 2012.12
$ git push --tags
=item 4.
@@ -56,10 +58,17 @@ Update F<tools/build/NQP_REVISION> in your Rakudo repository to contain
the tag you just set on NQP.
$ cd ~/git/rakudo
- $ echo "2011.10" > tools/build/NQP_REVISION
+ $ echo "2012.12" > tools/build/NQP_REVISION
=item 5.
+Cut a release tarball (needed for the Rakudo Star release).
+
+ $ git clean -xdf
+ $ git archive --format=tar 2012.12 | gzip -9 > ~/nqp-2012.12.tar.gz
+
+=item 6.
+
Continue with the Rakudo release since that's currently the only reason
to have an NQP release.
View
@@ -12,8 +12,8 @@
static REPROps *this_repr;
/* Some functions we have to get references to. */
-static PMC * (* wrap_object_func) (PARROT_INTERP, void *obj);
-static PMC * (* create_stable_func) (PARROT_INTERP, REPROps *REPR, PMC *HOW);
+static wrap_object_t wrap_object_func;
+static create_stable_t create_stable_func;
/* Gets size and type information to put it into the REPR data. */
static void fill_repr_data(PARROT_INTERP, STable *st) {
@@ -130,7 +130,7 @@ static void initialize(PARROT_INTERP, STable *st, void *data) {
if (repr_data->elem_kind == CARRAY_ELEM_KIND_NUMERIC)
body->child_objs = NULL;
else
- body->child_objs = mem_sys_allocate_zeroed(4*sizeof(PMC *));
+ body->child_objs = (PMC **) mem_sys_allocate_zeroed(4*sizeof(PMC *));
body->allocated = 4;
body->elems = 0;
}
@@ -190,6 +190,7 @@ static storage_spec get_storage_spec(PARROT_INTERP, STable *st) {
spec.inlineable = STORAGE_SPEC_REFERENCE;
spec.boxed_primitive = STORAGE_SPEC_BP_NONE;
spec.can_box = 0;
+ spec.bits = sizeof(void *) * 8;
return spec;
}
@@ -211,7 +212,7 @@ static void expand(PARROT_INTERP, CArrayREPRData *repr_data, CArrayBody *body, I
|| repr_data->elem_kind == CARRAY_ELEM_KIND_CSTRUCT
|| repr_data->elem_kind == CARRAY_ELEM_KIND_STRING);
if (is_complex)
- body->child_objs = mem_sys_realloc_zeroed(body->child_objs, next_size * sizeof(PMC *), body->allocated * sizeof(PMC *));
+ body->child_objs = (PMC **) mem_sys_realloc_zeroed(body->child_objs, next_size * sizeof(PMC *), body->allocated * sizeof(PMC *));
body->allocated = next_size;
}
static void * at_pos_ref(PARROT_INTERP, STable *st, void *data, INTVAL index) {
@@ -230,6 +231,7 @@ static void * at_pos_ref(PARROT_INTERP, STable *st, void *data, INTVAL index) {
static PMC * make_object(PARROT_INTERP, STable *st, void *data) {
CArrayREPRData *repr_data = (CArrayREPRData *)st->REPR_data;
CArrayBody *body = (CArrayBody *)data;
+ PMC *retval;
switch (repr_data->elem_kind) {
case CARRAY_ELEM_KIND_STRING:
@@ -240,15 +242,24 @@ static PMC * make_object(PARROT_INTERP, STable *st, void *data) {
REPR(obj)->initialize(interp, STABLE(obj), OBJECT_BODY(obj));
REPR(obj)->box_funcs->set_str(interp, STABLE(obj), OBJECT_BODY(obj), str);
PARROT_GC_WRITE_BARRIER(interp, obj);
- return obj;
+ retval = obj;
+ break;
}
case CARRAY_ELEM_KIND_CARRAY:
- return make_carray_result(interp, repr_data->elem_type, data);
+ retval = make_carray_result(interp, repr_data->elem_type, data);
+ break;
case CARRAY_ELEM_KIND_CPOINTER:
- return make_cpointer_result(interp, repr_data->elem_type, data);
+ retval = make_cpointer_result(interp, repr_data->elem_type, data);
+ break;
case CARRAY_ELEM_KIND_CSTRUCT:
- return make_cstruct_result(interp, repr_data->elem_type, data);
+ retval = make_cstruct_result(interp, repr_data->elem_type, data);
+ break;
+ default:
+ Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_INVALID_OPERATION,
+ "Fatal error: unknown CArray elem_kind (%d) in make_object", repr_data->elem_kind);
}
+
+ return retval;
}
static PMC * at_pos_boxed(PARROT_INTERP, STable *st, void *data, INTVAL index) {
CArrayREPRData *repr_data = (CArrayREPRData *)st->REPR_data;
@@ -367,6 +378,9 @@ static void bind_pos_boxed(PARROT_INTERP, STable *st, void *data, INTVAL index,
case CARRAY_ELEM_KIND_CPOINTER:
cptr = ((CPointerBody *) OBJECT_BODY(obj))->ptr;
break;
+ default:
+ Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_INVALID_OPERATION,
+ "Fatal error: unknown CArray elem_kind (%d) in bind_pos_boxed", repr_data->elem_kind);
}
}
else {
@@ -418,16 +432,17 @@ static void serialize_repr_data(PARROT_INTERP, STable *st, SerializationWriter *
/* Deserializes the REPR data. */
static void deserialize_repr_data(PARROT_INTERP, STable *st, SerializationReader *reader) {
- CArrayREPRData *repr_data = st->REPR_data = (CArrayREPRData *) mem_sys_allocate_zeroed(sizeof(CArrayREPRData));
+ CArrayREPRData *repr_data = (CArrayREPRData *) mem_sys_allocate_zeroed(sizeof(CArrayREPRData));
+ st->REPR_data = (CArrayREPRData *) repr_data;
repr_data->elem_size = reader->read_int(interp, reader);
repr_data->elem_type = reader->read_ref(interp, reader);
repr_data->elem_kind = reader->read_int(interp, reader);
}
/* Initializes the CArray representation. */
REPROps * CArray_initialize(PARROT_INTERP,
- PMC * (* wrap_object_func_ptr) (PARROT_INTERP, void *obj),
- PMC * (* create_stable_func_ptr) (PARROT_INTERP, REPROps *REPR, PMC *HOW)) {
+ wrap_object_t wrap_object_func_ptr,
+ create_stable_t create_stable_func_ptr) {
/* Stash away functions passed wrapping functions. */
wrap_object_func = wrap_object_func_ptr;
create_stable_func = create_stable_func_ptr;
@@ -8,8 +8,8 @@
static REPROps *this_repr;
/* Some functions we have to get references to. */
-static PMC * (* wrap_object_func) (PARROT_INTERP, void *obj);
-static PMC * (* create_stable_func) (PARROT_INTERP, REPROps *REPR, PMC *HOW);
+static wrap_object_t wrap_object_func;
+static create_stable_t create_stable_func;
/* Creates a new type object of this representation, and associates it with
* the given HOW. */
@@ -63,13 +63,14 @@ static storage_spec get_storage_spec(PARROT_INTERP, STable *st) {
spec.inlineable = STORAGE_SPEC_REFERENCE;
spec.boxed_primitive = STORAGE_SPEC_BP_NONE;
spec.can_box = 0;
+ spec.bits = sizeof(void *) * 8;
return spec;
}
/* Initializes the CPointer representation. */
REPROps * CPointer_initialize(PARROT_INTERP,
- PMC * (* wrap_object_func_ptr) (PARROT_INTERP, void *obj),
- PMC * (* create_stable_func_ptr) (PARROT_INTERP, REPROps *REPR, PMC *HOW)) {
+ wrap_object_t wrap_object_func_ptr,
+ create_stable_t create_stable_func_ptr) {
/* Stash away functions passed wrapping functions. */
wrap_object_func = wrap_object_func_ptr;
create_stable_func = create_stable_func_ptr;
View
@@ -8,14 +8,14 @@
static REPROps *this_repr;
/* Some functions we have to get references to. */
-static PMC * (* wrap_object_func) (PARROT_INTERP, void *obj);
-static PMC * (* create_stable_func) (PARROT_INTERP, REPROps *REPR, PMC *HOW);
+static wrap_object_t wrap_object_func;
+static create_stable_t create_stable_func;
static void set_str(PARROT_INTERP, STable *st, void *data, STRING *value) {
CStrBody *body = (CStrBody *) data;
PMC *old_ctx, *cappy, *meth, *enc_pmc;
STRING *enc;
- void *encoding;
+ STR_VTABLE *encoding;
if(body->cstr)
mem_sys_free(body->cstr);
@@ -99,12 +99,13 @@ static storage_spec get_storage_spec(PARROT_INTERP, STable *st) {
spec.inlineable = STORAGE_SPEC_REFERENCE;
spec.boxed_primitive = STORAGE_SPEC_BP_STR;
spec.can_box = 0;
+ spec.bits = sizeof(void *) * 8;;
return spec;
}
REPROps *CStr_initialize(PARROT_INTERP,
- PMC * (* wrap_object_func_ptr) (PARROT_INTERP, void *obj),
- PMC * (* create_stable_func_ptr) (PARROT_INTERP, REPROps *REPR, PMC *HOW)) {
+ wrap_object_t wrap_object_func_ptr,
+ create_stable_t create_stable_func_ptr) {
/* Stash away functions passed wrapping functions. */
wrap_object_func = wrap_object_func_ptr;
create_stable_func = create_stable_func_ptr;
View
@@ -11,8 +11,8 @@
static REPROps *this_repr;
/* Some functions we have to get references to. */
-static PMC * (* wrap_object_func) (PARROT_INTERP, void *obj);
-static PMC * (* create_stable_func) (PARROT_INTERP, REPROps *REPR, PMC *HOW);
+static wrap_object_t wrap_object_func;
+static create_stable_t create_stable_func;
/* How do we go from type-object to a hash value? For now, we make an integer
* that is the address of the STable struct, which not being subject to GC will
@@ -366,7 +366,7 @@ static PMC * allocate(PARROT_INTERP, STable *st) {
/* Allocate child obj array. */
if(repr_data->num_child_objs > 0) {
size_t bytes = repr_data->num_child_objs*sizeof(PMC *);
- obj->body.child_objs = mem_sys_allocate(bytes);
+ obj->body.child_objs = (PMC **) mem_sys_allocate(bytes);
memset(obj->body.child_objs, 0, bytes);
}
@@ -627,6 +627,7 @@ static storage_spec get_storage_spec(PARROT_INTERP, STable *st) {
spec.inlineable = STORAGE_SPEC_REFERENCE;
spec.boxed_primitive = STORAGE_SPEC_BP_NONE;
spec.can_box = 0;
+ spec.bits = sizeof(void *) * 8;
return spec;
}
@@ -644,8 +645,8 @@ static void deserialize_repr_data(PARROT_INTERP, STable *st, SerializationReader
/* Initializes the CStruct representation. */
REPROps * CStruct_initialize(PARROT_INTERP,
- PMC * (* wrap_object_func_ptr) (PARROT_INTERP, void *obj),
- PMC * (* create_stable_func_ptr) (PARROT_INTERP, REPROps *REPR, PMC *HOW)) {
+ wrap_object_t wrap_object_func_ptr,
+ create_stable_t create_stable_func_ptr) {
/* Stash away functions passed wrapping functions. */
wrap_object_func = wrap_object_func_ptr;
create_stable_func = create_stable_func_ptr;
@@ -8,8 +8,8 @@
static REPROps *this_repr;
/* Some functions we have to get references to. */
-static PMC * (* wrap_object_func) (PARROT_INTERP, void *obj);
-static PMC * (* create_stable_func) (PARROT_INTERP, REPROps *REPR, PMC *HOW);
+static wrap_object_t wrap_object_func;
+static create_stable_t create_stable_func;
/* Creates a new type object of this representation, and associates it with
* the given HOW. */
@@ -51,7 +51,7 @@ static void copy_to(PARROT_INTERP, STable *st, void *src, void *dest) {
/* Need a fresh handle for resource management purposes. */
if (src_body->lib_name) {
- dest_body->lib_name = mem_sys_allocate(strlen(src_body->lib_name) + 1);
+ dest_body->lib_name = (char *) mem_sys_allocate(strlen(src_body->lib_name) + 1);
strcpy(dest_body->lib_name, src_body->lib_name);
dest_body->lib_handle = dlLoadLibrary(dest_body->lib_name);
}
@@ -61,7 +61,7 @@ static void copy_to(PARROT_INTERP, STable *st, void *src, void *dest) {
dest_body->convention = src_body->convention;
dest_body->num_args = src_body->num_args;
if (src_body->arg_types) {
- dest_body->arg_types = mem_sys_allocate(sizeof(INTVAL) * (src_body->num_args ? src_body->num_args : 1));
+ dest_body->arg_types = (INTVAL *) mem_sys_allocate(sizeof(INTVAL) * (src_body->num_args ? src_body->num_args : 1));
memcpy(dest_body->arg_types, src_body->arg_types, src_body->num_args * sizeof(INTVAL));
}
dest_body->ret_type = src_body->ret_type;
@@ -106,6 +106,7 @@ static storage_spec get_storage_spec(PARROT_INTERP, STable *st) {
spec.inlineable = STORAGE_SPEC_INLINED;
spec.bits = sizeof(NativeCallBody) * 8;
spec.boxed_primitive = STORAGE_SPEC_BP_NONE;
+ spec.can_box = 0;
return spec;
}
@@ -119,8 +120,8 @@ static void deserialize(PARROT_INTERP, STable *st, void *data, SerializationRead
/* Initializes the NativeCall representation. */
REPROps * NativeCall_initialize(PARROT_INTERP,
- PMC * (* wrap_object_func_ptr) (PARROT_INTERP, void *obj),
- PMC * (* create_stable_func_ptr) (PARROT_INTERP, REPROps *REPR, PMC *HOW)) {
+ wrap_object_t wrap_object_func_ptr,
+ create_stable_t create_stable_func_ptr) {
/* Stash away functions passed wrapping functions. */
wrap_object_func = wrap_object_func_ptr;
create_stable_func = create_stable_func_ptr;
@@ -11,8 +11,8 @@
static REPROps *this_repr;
/* Some functions we have to get references to. */
-static PMC * (* wrap_object_func) (PARROT_INTERP, void *obj);
-static PMC * (* create_stable_func) (PARROT_INTERP, REPROps *REPR, PMC *HOW);
+static wrap_object_t wrap_object_func;
+static create_stable_t create_stable_func;
/* Creates a new type object of this representation, and associates it with
* the given HOW. */
@@ -150,7 +150,7 @@ static void serialize(PARROT_INTERP, STable *st, void *data, SerializationWriter
int len;
char *buf;
mp_radix_size(i, 10, &len);
- buf = mem_sys_allocate(len);
+ buf = (char *) mem_sys_allocate(len);
mp_toradix_n(i, buf, 10, len);
/* len - 1 because buf is \0-terminated */
writer->write_str(interp, writer, Parrot_str_new(interp, buf, len - 1));
@@ -167,8 +167,8 @@ static void deserialize(PARROT_INTERP, STable *st, void *data, SerializationRead
/* Initializes the P6bigint representation. */
REPROps * P6bigint_initialize(PARROT_INTERP,
- PMC * (* wrap_object_func_ptr) (PARROT_INTERP, void *obj),
- PMC * (* create_stable_func_ptr) (PARROT_INTERP, REPROps *REPR, PMC *HOW)) {
+ wrap_object_t wrap_object_func_ptr,
+ create_stable_t create_stable_func_ptr) {
/* Stash away functions passed wrapping functions. */
wrap_object_func = wrap_object_func_ptr;
create_stable_func = create_stable_func_ptr;
@@ -378,7 +378,9 @@ PMC * create_stable(PARROT_INTERP, REPROps *REPR, PMC *HOW);
PMC * decontainerize(PARROT_INTERP, PMC *var);
/* Dynamic representation registration. */
-typedef INTVAL (* rf) (PARROT_INTERP, STRING *name, REPROps * (*reg) (PARROT_INTERP, void *, void *));
+typedef PMC * (*wrap_object_t)(PARROT_INTERP, void *obj);
+typedef PMC * (*create_stable_t)(PARROT_INTERP, REPROps *REPR, PMC *HOW);
+typedef INTVAL (* rf) (PARROT_INTERP, STRING *name, REPROps * (*reg) (PARROT_INTERP, wrap_object_t, create_stable_t));
#define REGISTER_DYNAMIC_REPR(interp, name, reg_func) \
((rf) \
VTABLE_get_pointer(interp, \
Oops, something went wrong.

0 comments on commit fc4115b

Please sign in to comment.