[svn:parrot] r46322 - in branches/codestring: . config/auto/zlib config/gen/makefiles examples/shootout examples/tools include/parrot ports/fedora/2.3.0 ports/suse/2.2.0 src src/dynpmc src/interp src/pmc src/runcore src/string t/src tools/dev
coke at svn.parrot.org
coke at svn.parrot.org
Thu May 6 00:31:11 UTC 2010
Author: coke
Date: Thu May 6 00:31:08 2010
New Revision: 46322
URL: https://trac.parrot.org/parrot/changeset/46322
Log:
merge latest changes from trunk
Modified:
branches/codestring/ (props changed)
branches/codestring/config/auto/zlib/ (props changed)
branches/codestring/config/gen/makefiles/root.in
branches/codestring/examples/shootout/revcomp.pir
branches/codestring/examples/tools/pbc_checker.cpp
branches/codestring/include/parrot/packfile.h
branches/codestring/include/parrot/runcore_trace.h (props changed)
branches/codestring/include/parrot/string_funcs.h
branches/codestring/ports/fedora/2.3.0/ (props changed)
branches/codestring/ports/suse/2.2.0/ (props changed)
branches/codestring/src/dynpmc/dynlexpad.pmc
branches/codestring/src/dynpmc/file.pmc
branches/codestring/src/dynpmc/foo.pmc
branches/codestring/src/dynpmc/os.pmc
branches/codestring/src/dynpmc/pccmethod_test.pmc
branches/codestring/src/dynpmc/subproxy.pmc
branches/codestring/src/embed.c
branches/codestring/src/interp/inter_create.c (props changed)
branches/codestring/src/oo.c
branches/codestring/src/packfile.c
branches/codestring/src/pmc/addrregistry.pmc
branches/codestring/src/pmc/arrayiterator.pmc
branches/codestring/src/pmc/bigint.pmc
branches/codestring/src/pmc/bignum.pmc
branches/codestring/src/pmc/callcontext.pmc
branches/codestring/src/pmc/complex.pmc
branches/codestring/src/pmc/continuation.pmc
branches/codestring/src/pmc/coroutine.pmc
branches/codestring/src/pmc/default.pmc
branches/codestring/src/pmc/env.pmc
branches/codestring/src/pmc/eval.pmc
branches/codestring/src/pmc/eventhandler.pmc
branches/codestring/src/pmc/exception.pmc
branches/codestring/src/pmc/exceptionhandler.pmc
branches/codestring/src/pmc/exporter.pmc
branches/codestring/src/pmc/filehandle.pmc
branches/codestring/src/pmc/fixedbooleanarray.pmc
branches/codestring/src/pmc/fixedfloatarray.pmc
branches/codestring/src/pmc/fixedintegerarray.pmc
branches/codestring/src/pmc/fixedpmcarray.pmc
branches/codestring/src/pmc/fixedstringarray.pmc
branches/codestring/src/pmc/handle.pmc
branches/codestring/src/pmc/hash.pmc
branches/codestring/src/pmc/imageio.pmc
branches/codestring/src/pmc/imageiosize.pmc
branches/codestring/src/pmc/integer.pmc
branches/codestring/src/pmc/key.pmc
branches/codestring/src/pmc/lexinfo.pmc
branches/codestring/src/pmc/managedstruct.pmc
branches/codestring/src/pmc/multisub.pmc
branches/codestring/src/pmc/namespace.pmc
branches/codestring/src/pmc/null.pmc
branches/codestring/src/pmc/object.pmc
branches/codestring/src/pmc/opcode.pmc
branches/codestring/src/pmc/oplib.pmc
branches/codestring/src/pmc/packfile.pmc
branches/codestring/src/pmc/packfileannotation.pmc
branches/codestring/src/pmc/packfileannotations.pmc
branches/codestring/src/pmc/packfileconstanttable.pmc
branches/codestring/src/pmc/packfiledirectory.pmc
branches/codestring/src/pmc/packfilefixupentry.pmc
branches/codestring/src/pmc/packfilefixuptable.pmc
branches/codestring/src/pmc/packfilerawsegment.pmc
branches/codestring/src/pmc/packfilesegment.pmc
branches/codestring/src/pmc/parrotinterpreter.pmc
branches/codestring/src/pmc/parrotthread.pmc
branches/codestring/src/pmc/pmcproxy.pmc
branches/codestring/src/pmc/resizablebooleanarray.pmc
branches/codestring/src/pmc/resizablefloatarray.pmc
branches/codestring/src/pmc/resizableintegerarray.pmc
branches/codestring/src/pmc/resizablestringarray.pmc
branches/codestring/src/pmc/role.pmc
branches/codestring/src/pmc/scheduler.pmc
branches/codestring/src/pmc/schedulermessage.pmc
branches/codestring/src/pmc/socket.pmc
branches/codestring/src/pmc/string.pmc
branches/codestring/src/pmc/stringhandle.pmc
branches/codestring/src/pmc/sub.pmc
branches/codestring/src/pmc/task.pmc
branches/codestring/src/pmc/timer.pmc
branches/codestring/src/pmc/undef.pmc
branches/codestring/src/pmc/unmanagedstruct.pmc
branches/codestring/src/runcore/cores.c (props changed)
branches/codestring/src/runcore/trace.c (props changed)
branches/codestring/src/string/api.c
branches/codestring/t/src/embed.t (contents, props changed)
branches/codestring/tools/dev/mk_gitignore.pl (props changed)
Modified: branches/codestring/config/gen/makefiles/root.in
==============================================================================
--- branches/codestring/config/gen/makefiles/root.in Wed May 5 23:52:59 2010 (r46321)
+++ branches/codestring/config/gen/makefiles/root.in Thu May 6 00:31:08 2010 (r46322)
@@ -664,6 +664,7 @@
src/spf_vtable.str \
src/string/api.str \
src/sub.str \
+ src/embed.str \
\
$(CLASS_STR_FILES)
Modified: branches/codestring/examples/shootout/revcomp.pir
==============================================================================
--- branches/codestring/examples/shootout/revcomp.pir Wed May 5 23:52:59 2010 (r46321)
+++ branches/codestring/examples/shootout/revcomp.pir Thu May 6 00:31:08 2010 (r46322)
@@ -67,11 +67,25 @@
.sub print_revcomp
.param string line
.local int i, linelen, ch
+ .local string revline
linelen = length line
$P0 = new 'String'
- $P0.'reverse'(line)
-
+# $P0.'reverse'(line)
+# reverse is no longer available so
+ i = linelen
+ revline = ''
+rev_loop:
+ i -= 1
+ $S0 = substr line, i, 1
+ revline .= $S0
+ if i > 0 goto rev_loop
+#
+ $P0 = revline
+#
+ # line was reversed in-place so we need
+ line = revline
+#
.const 'Sub' tr_00 = 'tr_00_init'
$P0.'trans'(line, tr_00)
Modified: branches/codestring/examples/tools/pbc_checker.cpp
==============================================================================
--- branches/codestring/examples/tools/pbc_checker.cpp Wed May 5 23:52:59 2010 (r46321)
+++ branches/codestring/examples/tools/pbc_checker.cpp Thu May 6 00:31:08 2010 (r46322)
@@ -320,7 +320,8 @@
opcode read_opcode(ifstream &pbcfile);
private:
unsigned int opcode_size;
- unsigned int pbc_version;
+ unsigned int pbc_major;
+ unsigned int pbc_minor;
unsigned char byte_order;
unsigned char fp_encoding;
@@ -387,7 +388,8 @@
cerr << "*** Warning: opcode size too big for this program ***\n";
this->opcode_size = opcode_size;
- this->pbc_version = ((unsigned int) pbc_major) * 8 + pbc_minor;
+ this->pbc_major = pbc_major;
+ this->pbc_minor = pbc_minor;
this->byte_order = byte_order;
this->fp_encoding = fp_encoding;
if (byte_order != ByteOrderLE && byte_order != ByteOrderBE)
@@ -431,9 +433,13 @@
opcode size = read_opcode(pbcfile);
cout << "Directory segment size: " << size << '\n';
- pbcfile.ignore(16 - opcode_size);
- if (pbc_version <= 0x0325 && opcode_size == 8)
- pbcfile.ignore(16);
+ // Must be zero:
+ opcode in_type = read_opcode(pbcfile);
+ opcode in_id = read_opcode(pbcfile);
+ opcode op_size = read_opcode(pbcfile);
+ cout << "Internal type: " << in_type << '\n';
+ cout << "Internal id: " << in_id << '\n';
+ cout << "Op table size: " << op_size << '\n';
opcode entries = read_opcode(pbcfile);
cout << "Directory entries: " << entries << '\n';
@@ -464,7 +470,9 @@
" (0x" << hex << type << dec << ")\n";
// Set file read position to segment's start
- pbcfile.seekg(entry.getOffset() * opcode_size);
+ size_t start = entry.getOffset() * opcode_size;
+ cout << "Start: 0x" << hex << setw(6) << start << dec << '\n';
+ pbcfile.seekg(start);
switch(type)
{
@@ -715,26 +723,50 @@
void PbcFile::dump_constant_string(ifstream &pbcfile)
{
- opcode flags = read_opcode(pbcfile);
- cout << "Flags: 0x" << hex << flags << dec;
- opcode charset = read_opcode(pbcfile);
+ opcode flags;
+ opcode charset;
+ if (pbc_major > 5 && pbc_minor > 11) {
+ opcode flags_charset = read_opcode(pbcfile);
+ flags = flags_charset & 0xFF;
+ charset = flags_charset >> 8;
+ }
+ else {
+ flags = read_opcode(pbcfile);
+ charset = read_opcode(pbcfile);
+ }
+
+ cout << "Flags: 0x" << hex << setw(6) << flags << dec;
cout << " Charset: " << charset;
+ // Encoding not saved, see TT #468
//opcode encoding = read_opcode(pbcfile);
//cout << " Encoding: "<< encoding;
opcode length = read_opcode(pbcfile);
cout << " Length: "<< length;
+
+ // Don't dump very long strings at full length.
+ opcode full = length;
+ length = std::min(length, (opcode)512);
+
cout << " \'";
for (opcode i= 0; i < length; ++i) {
unsigned char c = pbcfile.get();
+ if (! pbcfile)
+ throw ReadError("string constant");
if (c >= 32 && c < 128)
cout << c;
else
cout << "\\x" << hex << setw(2) << setfill('0') <<
(unsigned int) c << dec;
}
- cout << "'\n";
+ cout << '\'';
+ if (full > length) {
+ cout << "(...)";
+ pbcfile.ignore(full - length);
+ }
+ cout << '\n';
+
for (unsigned int i= length; i % opcode_size; ++i) {
pbcfile.ignore(1);
}
Modified: branches/codestring/include/parrot/packfile.h
==============================================================================
--- branches/codestring/include/parrot/packfile.h Wed May 5 23:52:59 2010 (r46321)
+++ branches/codestring/include/parrot/packfile.h Thu May 6 00:31:08 2010 (r46322)
@@ -301,11 +301,11 @@
typedef struct PackFile_Annotations {
PackFile_Segment base;
opcode_t num_keys;
- PackFile_Annotations_Key **keys;
+ PackFile_Annotations_Key *keys;
opcode_t num_groups;
- PackFile_Annotations_Group **groups;
+ PackFile_Annotations_Group *groups;
opcode_t num_entries;
- PackFile_Annotations_Entry **entries;
+ PackFile_Annotations_Entry *entries;
PackFile_ByteCode *code;
} PackFile_Annotations;
Modified: branches/codestring/include/parrot/string_funcs.h
==============================================================================
--- branches/codestring/include/parrot/string_funcs.h Wed May 5 23:52:59 2010 (r46321)
+++ branches/codestring/include/parrot/string_funcs.h Thu May 6 00:31:08 2010 (r46322)
@@ -102,8 +102,8 @@
PARROT_EXPORT
PARROT_CANNOT_RETURN_NULL
STRING * Parrot_str_concat(PARROT_INTERP,
- ARGIN_NULLOK(STRING *a),
- ARGIN_NULLOK(STRING *b))
+ ARGIN_NULLOK(const STRING *a),
+ ARGIN_NULLOK(const STRING *b))
__attribute__nonnull__(1);
PARROT_EXPORT
Modified: branches/codestring/src/dynpmc/dynlexpad.pmc
==============================================================================
--- branches/codestring/src/dynpmc/dynlexpad.pmc Wed May 5 23:52:59 2010 (r46321)
+++ branches/codestring/src/dynpmc/dynlexpad.pmc Thu May 6 00:31:08 2010 (r46322)
@@ -24,7 +24,7 @@
ATTR PMC *init; /* the PMC used to initialize this DynLexPad */
VTABLE void init() {
- Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_INVALID_OPERATION,
+ Parrot_ex_throw_from_c_args(INTERP, NULL, EXCEPTION_INVALID_OPERATION,
"don't create me like this");
}
@@ -44,8 +44,8 @@
Parrot_DynLexPad_attributes *attrs =
(Parrot_DynLexPad_attributes *) PMC_data(SELF);
- if (VTABLE_elements(interp, lexinfo)) {
- attrs->init = Parrot_pmc_new_init(interp, enum_class_LexPad, lexinfo);
+ if (VTABLE_elements(INTERP, lexinfo)) {
+ attrs->init = Parrot_pmc_new_init(INTERP, enum_class_LexPad, lexinfo);
}
else
attrs->init = NULL;
@@ -68,7 +68,7 @@
VTABLE void set_pointer(void* ctx) {
PMC *std_pad = PARROT_DYNLEXPAD(SELF)->init;
if (std_pad)
- VTABLE_set_pointer(interp, std_pad, ctx);
+ VTABLE_set_pointer(INTERP, std_pad, ctx);
}
/*
@@ -81,7 +81,7 @@
*/
VTABLE INTVAL elements() {
- return parrot_hash_size(interp, PARROT_DYNLEXPAD(SELF)->hash);
+ return parrot_hash_size(INTERP, PARROT_DYNLEXPAD(SELF)->hash);
}
/*
@@ -97,17 +97,17 @@
*/
VTABLE INTVAL exists_keyed(PMC* name) {
- STRING *s = VTABLE_get_string(interp, name);
+ STRING *s = VTABLE_get_string(INTERP, name);
return SELF.exists_keyed_str(s);
}
VTABLE INTVAL exists_keyed_str(STRING* name) {
PMC *std_pad;
- if (parrot_hash_exists(interp, PARROT_DYNLEXPAD(SELF)->hash, name))
+ if (parrot_hash_exists(INTERP, PARROT_DYNLEXPAD(SELF)->hash, name))
return 1;
std_pad = PARROT_DYNLEXPAD(SELF)->init;
if (std_pad)
- return VTABLE_exists_keyed_str(interp, std_pad, name);
+ return VTABLE_exists_keyed_str(INTERP, std_pad, name);
return 0;
}
@@ -124,14 +124,14 @@
*/
VTABLE PMC* get_pmc_keyed_str(STRING* name) {
- HashBucket *b = parrot_hash_get_bucket(interp,
+ HashBucket *b = parrot_hash_get_bucket(INTERP,
PARROT_DYNLEXPAD(SELF)->hash, name);
if (!b) {
PMC *std_pad = PARROT_DYNLEXPAD(SELF)->init;
if (std_pad)
- return VTABLE_get_pmc_keyed_str(interp, std_pad, name);
+ return VTABLE_get_pmc_keyed_str(INTERP, std_pad, name);
return PMCNULL;
}
@@ -140,7 +140,7 @@
}
VTABLE PMC* get_pmc_keyed(PMC* name) {
- STRING *s = VTABLE_get_string(interp, name);
+ STRING *s = VTABLE_get_string(INTERP, name);
return SELF.get_pmc_keyed_str(s);
}
@@ -159,17 +159,17 @@
*/
VTABLE void set_pmc_keyed(PMC* name, PMC* value) {
- STRING *s = VTABLE_get_string(interp, name);
+ STRING *s = VTABLE_get_string(INTERP, name);
SELF.set_pmc_keyed_str(s, value);
}
VTABLE void set_pmc_keyed_str(STRING* name, PMC* value) {
PMC *std_pad = PARROT_DYNLEXPAD(SELF)->init;
- if (std_pad && VTABLE_exists_keyed_str(interp, std_pad, name))
- VTABLE_set_pmc_keyed_str(interp, std_pad, name, value);
+ if (std_pad && VTABLE_exists_keyed_str(INTERP, std_pad, name))
+ VTABLE_set_pmc_keyed_str(INTERP, std_pad, name, value);
- parrot_hash_put(interp, PARROT_DYNLEXPAD(SELF)->hash, name, value);
+ parrot_hash_put(INTERP, PARROT_DYNLEXPAD(SELF)->hash, name, value);
}
/*
@@ -184,7 +184,7 @@
VTABLE void destroy() {
if (PARROT_DYNLEXPAD(SELF)->hash) {
- parrot_hash_destroy(interp, PARROT_DYNLEXPAD(SELF)->hash);
+ parrot_hash_destroy(INTERP, PARROT_DYNLEXPAD(SELF)->hash);
PARROT_DYNLEXPAD(SELF)->hash = NULL;
}
}
@@ -202,7 +202,7 @@
PMC *std_pad = PARROT_DYNLEXPAD(SELF)->init;
Parrot_gc_mark_PMC_alive(INTERP, std_pad);
if (PARROT_DYNLEXPAD(SELF)->hash)
- parrot_mark_hash(interp, PARROT_DYNLEXPAD(SELF)->hash);
+ parrot_mark_hash(INTERP, PARROT_DYNLEXPAD(SELF)->hash);
}
Modified: branches/codestring/src/dynpmc/file.pmc
==============================================================================
--- branches/codestring/src/dynpmc/file.pmc Wed May 5 23:52:59 2010 (r46321)
+++ branches/codestring/src/dynpmc/file.pmc Thu May 6 00:31:08 2010 (r46322)
@@ -67,7 +67,7 @@
METHOD exists(STRING *path) {
struct stat info;
- char * const cpath = Parrot_str_to_cstring(interp, path);
+ char * const cpath = Parrot_str_to_cstring(INTERP, path);
#ifdef WIN32
const int error = stat(cpath, &info);
#else
@@ -93,7 +93,7 @@
METHOD is_dir(STRING *path) {
struct stat info;
- char * const cpath = Parrot_str_to_cstring(interp, path);
+ char * const cpath = Parrot_str_to_cstring(INTERP, path);
#ifdef WIN32
const int error = stat(cpath, &info);
#else
@@ -103,7 +103,7 @@
if (error) {
const char * const errmsg = strerror(errno);
- Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_EXTERNAL_ERROR,
+ Parrot_ex_throw_from_c_args(INTERP, NULL, EXCEPTION_EXTERNAL_ERROR,
errmsg);
}
@@ -125,7 +125,7 @@
METHOD is_file(STRING *path) {
struct stat info;
- char * const cpath = Parrot_str_to_cstring(interp, path);
+ char * const cpath = Parrot_str_to_cstring(INTERP, path);
#ifdef WIN32
int error = stat(cpath, &info);
#else
@@ -135,7 +135,7 @@
if (error) {
const char * const errmsg = strerror(errno);
- Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_EXTERNAL_ERROR,
+ Parrot_ex_throw_from_c_args(INTERP, NULL, EXCEPTION_EXTERNAL_ERROR,
errmsg);
}
@@ -162,14 +162,14 @@
#else
struct stat info;
- char * const cpath = Parrot_str_to_cstring(interp, path);
+ char * const cpath = Parrot_str_to_cstring(INTERP, path);
const int error = lstat(cpath, &info);
Parrot_str_free_cstring(cpath);
if (error) {
const char * const errmsg = strerror(errno);
- Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_EXTERNAL_ERROR,
+ Parrot_ex_throw_from_c_args(INTERP, NULL, EXCEPTION_EXTERNAL_ERROR,
errmsg);
}
@@ -199,13 +199,13 @@
METHOD copy(STRING *from, STRING *to) {
#define CHUNK_SIZE 1024
- char * const cfrom = Parrot_str_to_cstring(interp, from);
+ char * const cfrom = Parrot_str_to_cstring(INTERP, from);
FILE * const source = fopen(cfrom, "rb");
Parrot_str_free_cstring(cfrom);
if (source) {
- char * const cto = Parrot_str_to_cstring(interp, to);
+ char * const cto = Parrot_str_to_cstring(INTERP, to);
FILE * const target = fopen(cto, "w+b");
Parrot_str_free_cstring(cto);
@@ -218,7 +218,7 @@
if (bytes_read) {
const size_t bytes_written = fwrite(buf, 1, bytes_read, target);
if (bytes_read != bytes_written) {
- Parrot_ex_throw_from_c_args(interp, NULL,
+ Parrot_ex_throw_from_c_args(INTERP, NULL,
EXCEPTION_EXTERNAL_ERROR, "Error writing file");
break;
}
@@ -228,14 +228,14 @@
}
else {
const char * const errmsg = strerror(errno);
- Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_EXTERNAL_ERROR,
+ Parrot_ex_throw_from_c_args(INTERP, NULL, EXCEPTION_EXTERNAL_ERROR,
errmsg);
}
fclose(source);
}
else {
const char * const errmsg = strerror(errno);
- Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_EXTERNAL_ERROR,
+ Parrot_ex_throw_from_c_args(INTERP, NULL, EXCEPTION_EXTERNAL_ERROR,
errmsg);
}
#undef CHUNK_SIZE
@@ -252,8 +252,8 @@
*/
METHOD rename(STRING *from, STRING *to) {
- char * const cfrom = Parrot_str_to_cstring(interp, from);
- char * const cto = Parrot_str_to_cstring(interp, to);
+ char * const cfrom = Parrot_str_to_cstring(INTERP, from);
+ char * const cto = Parrot_str_to_cstring(INTERP, to);
const int error = rename(cfrom, cto);
Parrot_str_free_cstring(cfrom);
@@ -261,7 +261,7 @@
if (error) {
const char * const errmsg = strerror(errno);
- Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_EXTERNAL_ERROR,
+ Parrot_ex_throw_from_c_args(INTERP, NULL, EXCEPTION_EXTERNAL_ERROR,
errmsg);
}
}
Modified: branches/codestring/src/dynpmc/foo.pmc
==============================================================================
--- branches/codestring/src/dynpmc/foo.pmc Wed May 5 23:52:59 2010 (r46321)
+++ branches/codestring/src/dynpmc/foo.pmc Thu May 6 00:31:08 2010 (r46322)
@@ -16,15 +16,15 @@
MULTI PMC* subtract(Integer value, PMC *dest) {
if (!dest)
- dest = Parrot_pmc_new(interp, SELF->vtable->base_type);
- VTABLE_set_integer_native(interp, dest, 144);
+ dest = Parrot_pmc_new(INTERP, SELF->vtable->base_type);
+ VTABLE_set_integer_native(INTERP, dest, 144);
return dest;
}
MULTI PMC* subtract(DEFAULT value, PMC *dest) {
if (!dest)
- dest = Parrot_pmc_new(interp, SELF->vtable->base_type);
- VTABLE_set_integer_native(interp, dest, 244);
+ dest = Parrot_pmc_new(INTERP, SELF->vtable->base_type);
+ VTABLE_set_integer_native(INTERP, dest, 244);
return dest;
}
}
Modified: branches/codestring/src/dynpmc/os.pmc
==============================================================================
--- branches/codestring/src/dynpmc/os.pmc Wed May 5 23:52:59 2010 (r46321)
+++ branches/codestring/src/dynpmc/os.pmc Thu May 6 00:31:08 2010 (r46322)
@@ -506,13 +506,13 @@
HANDLE hFind = INVALID_HANDLE_VALUE;
/* Add \* to the directory name and start search. */
- STRING *last_char = Parrot_str_substr(interp, path,
- Parrot_str_length(interp, path) - 1, 1, NULL, 0);
- int trailing_slash = Parrot_str_equal(interp, last_char, string_from_literal(interp, "\\"))
+ STRING *last_char = Parrot_str_substr(INTERP, path,
+ Parrot_str_length(INTERP, path) - 1, 1, NULL, 0);
+ int trailing_slash = Parrot_str_equal(INTERP, last_char, string_from_literal(INTERP, "\\"))
||
- Parrot_str_equal(interp, last_char, string_from_literal(interp, "/"));
- cpath = Parrot_str_to_cstring(interp, Parrot_str_concat(interp,
- path, string_from_literal(interp, trailing_slash ? "*" : "\\*"), 0));
+ Parrot_str_equal(INTERP, last_char, string_from_literal(INTERP, "/"));
+ cpath = Parrot_str_to_cstring(INTERP, Parrot_str_concat(INTERP,
+ path, string_from_literal(INTERP, trailing_slash ? "*" : "\\*"), 0));
hFind = FindFirstFile(cpath, &file_find_data);
Parrot_str_free_cstring(cpath);
if (hFind == INVALID_HANDLE_VALUE)
Modified: branches/codestring/src/dynpmc/pccmethod_test.pmc
==============================================================================
--- branches/codestring/src/dynpmc/pccmethod_test.pmc Wed May 5 23:52:59 2010 (r46321)
+++ branches/codestring/src/dynpmc/pccmethod_test.pmc Thu May 6 00:31:08 2010 (r46322)
@@ -20,32 +20,32 @@
METHOD test_method()
{
UNUSED(SELF);
- Parrot_io_printf(interp, "test_method\n");
+ Parrot_io_printf(INTERP, "test_method\n");
}
METHOD test_method0(int a1)
{
UNUSED(SELF);
- Parrot_io_printf(interp, "test_method0\n");
- Parrot_io_printf(interp, "%d\n", a1);
+ Parrot_io_printf(INTERP, "test_method0\n");
+ Parrot_io_printf(INTERP, "%d\n", a1);
}
METHOD test_method1(int a1, int a2, int a3, int a4, int a5, int a6)
{
UNUSED(SELF);
- Parrot_io_printf(interp, "test_method1\n");
- Parrot_io_printf(interp, "%d,%d,%d,%d,%d,%d\n", a1, a2, a3, a4, a5, a6);
+ Parrot_io_printf(INTERP, "test_method1\n");
+ Parrot_io_printf(INTERP, "%d,%d,%d,%d,%d,%d\n", a1, a2, a3, a4, a5, a6);
}
METHOD test_method2(int a1 :optional, int a1o :opt_flag,
PMC *slurpy_pos :slurpy)
{
- STRING *kevin = CONST_STRING(interp, "KEVIN");
+ STRING *kevin = CONST_STRING(INTERP, "KEVIN");
UNUSED(SELF);
- Parrot_io_printf(interp, "test_method2\n");
- Parrot_io_printf(interp, "%d, %d, %Ss %Ss\n", a1, a1o,
- VTABLE_name(interp, slurpy_pos),
- VTABLE_get_repr(interp, slurpy_pos));
+ Parrot_io_printf(INTERP, "test_method2\n");
+ Parrot_io_printf(INTERP, "%d, %d, %Ss %Ss\n", a1, a1o,
+ VTABLE_name(INTERP, slurpy_pos),
+ VTABLE_get_repr(INTERP, slurpy_pos));
RETURN(int 1000, STRING *kevin);
}
@@ -53,8 +53,8 @@
METHOD test_method3(PMC *a1 :named("a1name"), PMC *a2 :named("a2name"))
{
UNUSED(SELF);
- Parrot_io_printf(interp, "test_method3\n");
- Parrot_io_printf(interp, "%Ps, %Ps\n", a1, a2);
+ Parrot_io_printf(INTERP, "test_method3\n");
+ Parrot_io_printf(INTERP, "%Ps, %Ps\n", a1, a2);
}
METHOD test_method4(int george :optional, int g_f :opt_flag,
@@ -65,7 +65,7 @@
UNUSED(g_f);
UNUSED(slurpy_pos);
UNUSED(slurpy_named);
- Parrot_io_printf(interp, "test_method4\n");
+ Parrot_io_printf(INTERP, "test_method4\n");
}
}
Modified: branches/codestring/src/dynpmc/subproxy.pmc
==============================================================================
--- branches/codestring/src/dynpmc/subproxy.pmc Wed May 5 23:52:59 2010 (r46321)
+++ branches/codestring/src/dynpmc/subproxy.pmc Thu May 6 00:31:08 2010 (r46322)
@@ -34,22 +34,22 @@
Parrot_Sub_attributes *rsub, *my_sub;
if (!key)
- Parrot_ex_throw_from_c_args(interp, NULL, 1, "SubProxy: no key");
+ Parrot_ex_throw_from_c_args(INTERP, NULL, 1, "SubProxy: no key");
- file = VTABLE_get_string(interp, key);
+ file = VTABLE_get_string(INTERP, key);
if (!file)
- Parrot_ex_throw_from_c_args(interp, NULL, 1, "SubProxy: no file");
+ Parrot_ex_throw_from_c_args(INTERP, NULL, 1, "SubProxy: no file");
- sub_pmc = key_next(interp, key);
+ sub_pmc = key_next(INTERP, key);
if (!sub_pmc)
- Parrot_ex_throw_from_c_args(interp, NULL, 1, "SubProxy: no sub");
+ Parrot_ex_throw_from_c_args(INTERP, NULL, 1, "SubProxy: no sub");
- Parrot_load_bytecode(interp, file);
- rsub_pmc = VTABLE_get_pmc_keyed(interp,
- interp->root_namespace, sub_pmc);
+ Parrot_load_bytecode(INTERP, file);
+ rsub_pmc = VTABLE_get_pmc_keyed(INTERP,
+ INTERP->root_namespace, sub_pmc);
- if (!VTABLE_defined(interp, rsub_pmc))
- Parrot_ex_throw_from_c_args(interp, NULL, 1,
+ if (!VTABLE_defined(INTERP, rsub_pmc))
+ Parrot_ex_throw_from_c_args(INTERP, NULL, 1,
"SubProxy: sub not found");
PObj_get_FLAGS(SELF) &= ~PObj_private0_FLAG;
Modified: branches/codestring/src/embed.c
==============================================================================
--- branches/codestring/src/embed.c Wed May 5 23:52:59 2010 (r46321)
+++ branches/codestring/src/embed.c Thu May 6 00:31:08 2010 (r46322)
@@ -27,6 +27,8 @@
#include "../compilers/imcc/imc.h"
+#include "embed.str"
+
/* HEADERIZER HFILE: none */ /* The visible types are different than what we use in here */
/* HEADERIZER BEGIN: static */
@@ -1093,18 +1095,17 @@
if (!interp->initial_pf) {
/* SIDE EFFECT: PackFile_new_dummy sets interp->initial_pf */
- interp->initial_pf = PackFile_new_dummy(interp,
- Parrot_str_new_constant(interp, "compile_string"));
+ interp->initial_pf = PackFile_new_dummy(interp, CONST_STRING(interp, "compile_string"));
/* Assumption: there is no valid reason to fail to create it.
* If the assumption changes, replace the assertion with a
* runtime check */
PARROT_ASSERT(interp->initial_pf);
}
- if (Parrot_str_compare(interp, Parrot_str_new(interp, "PIR", 3), type) == 0)
+ if (Parrot_str_compare(interp, CONST_STRING(interp, "PIR"), type) == 0)
return IMCC_compile_pir_s(interp, code, error);
- if (Parrot_str_compare(interp, Parrot_str_new(interp, "PASM", 4), type) == 0)
+ if (Parrot_str_compare(interp, CONST_STRING(interp, "PASM"), type) == 0)
return IMCC_compile_pasm_s(interp, code, error);
*error = Parrot_str_new(interp, "Invalid interpreter type", 0);
Modified: branches/codestring/src/oo.c
==============================================================================
--- branches/codestring/src/oo.c Wed May 5 23:52:59 2010 (r46321)
+++ branches/codestring/src/oo.c Thu May 6 00:31:08 2010 (r46322)
@@ -433,10 +433,9 @@
ARGIN(PMC *classobj), ARGIN(STRING *name))
{
ASSERT_ARGS(Parrot_oo_find_vtable_override_for_class)
- Parrot_Class_attributes *class_info;
+ const Parrot_Class_attributes * const class_info = PARROT_CLASS(classobj);;
PARROT_ASSERT(PObj_is_class_TEST(classobj));
- class_info = PARROT_CLASS(classobj);
return VTABLE_get_pmc_keyed_str(interp, class_info->vtable_overrides, name);
}
@@ -802,8 +801,8 @@
invalidate_all_caches(PARROT_INTERP)
{
ASSERT_ARGS(invalidate_all_caches)
- UINTVAL i;
- for (i = 1; i < (UINTVAL)interp->n_vtable_max; ++i)
+ int i;
+ for (i = 1; i < interp->n_vtable_max; ++i)
invalidate_type_caches(interp, i);
}
Modified: branches/codestring/src/packfile.c
==============================================================================
--- branches/codestring/src/packfile.c Wed May 5 23:52:59 2010 (r46321)
+++ branches/codestring/src/packfile.c Thu May 6 00:31:08 2010 (r46322)
@@ -4122,26 +4122,16 @@
INTVAL i;
/* Free any keys. */
- if (self->keys) {
- for (i = 0; i < self->num_keys; ++i)
- mem_gc_free(interp, self->keys[i]);
-
+ if (self->keys)
mem_gc_free(interp, self->keys);
- }
/* Free any groups. */
- if (self->groups) {
- for (i = 0; i < self->num_groups; ++i)
- mem_gc_free(interp, self->groups[i]);
+ if (self->groups)
mem_gc_free(interp, self->groups);
- }
/* Free any entries. */
- if (self->entries) {
- for (i = 0; i < self->num_entries; ++i)
- mem_gc_free(interp, self->entries[i]);
+ if (self->entries)
mem_gc_free(interp, self->entries);
- }
}
@@ -4195,7 +4185,7 @@
*cursor++ = self->num_keys;
for (i = 0; i < self->num_keys; ++i) {
- const PackFile_Annotations_Key * const key = self->keys[i];
+ const PackFile_Annotations_Key * const key = self->keys + i;
*cursor++ = key->name;
*cursor++ = key->type;
}
@@ -4204,7 +4194,7 @@
*cursor++ = self->num_groups;
for (i = 0; i < self->num_groups; ++i) {
- const PackFile_Annotations_Group * const group = self->groups[i];
+ const PackFile_Annotations_Group * const group = self->groups + i;
*cursor++ = group->bytecode_offset;
*cursor++ = group->entries_offset;
}
@@ -4213,7 +4203,7 @@
*cursor++ = self->num_entries;
for (i = 0; i < self->num_entries; ++i) {
- const PackFile_Annotations_Entry * const entry = self->entries[i];
+ const PackFile_Annotations_Entry * const entry = self->entries + i;
*cursor++ = entry->bytecode_offset;
*cursor++ = entry->key;
*cursor++ = entry->value;
@@ -4255,11 +4245,10 @@
self->num_keys));
self->keys = mem_gc_allocate_n_zeroed_typed(interp,
- self->num_keys, PackFile_Annotations_Key *);
+ self->num_keys, PackFile_Annotations_Key);
for (i = 0; i < self->num_keys; ++i) {
- PackFile_Annotations_Key * const key = self->keys[i] =
- mem_gc_allocate_zeroed_typed(interp, PackFile_Annotations_Key);
+ PackFile_Annotations_Key * const key = self->keys + i;
key->name = PF_fetch_opcode(seg->pf, &cursor);
key->type = PF_fetch_opcode(seg->pf, &cursor);
TRACE_PRINTF_VAL(("PackFile_Annotations_unpack: key[%d]/%d name=%s type=%d\n",
@@ -4269,12 +4258,10 @@
/* Unpack groups. */
self->num_groups = PF_fetch_opcode(seg->pf, &cursor);
self->groups = mem_gc_allocate_n_zeroed_typed(interp,
- self->num_groups, PackFile_Annotations_Group *);
+ self->num_groups, PackFile_Annotations_Group);
for (i = 0; i < self->num_groups; ++i) {
- PackFile_Annotations_Group * const group =
- self->groups[i] = mem_gc_allocate_zeroed_typed(interp,
- PackFile_Annotations_Group);
+ PackFile_Annotations_Group * const group = self->groups + i;
group->bytecode_offset = PF_fetch_opcode(seg->pf, &cursor);
group->entries_offset = PF_fetch_opcode(seg->pf, &cursor);
TRACE_PRINTF_VAL((
@@ -4286,11 +4273,9 @@
/* Unpack entries. */
self->num_entries = PF_fetch_opcode(seg->pf, &cursor);
self->entries = mem_gc_allocate_n_zeroed_typed(interp,
- self->num_entries, PackFile_Annotations_Entry *);
+ self->num_entries, PackFile_Annotations_Entry);
for (i = 0; i < self->num_entries; ++i) {
- PackFile_Annotations_Entry * const entry =
- self->entries[i] = mem_gc_allocate_zeroed_typed(interp,
- PackFile_Annotations_Entry);
+ PackFile_Annotations_Entry * const entry = self->entries + i;
entry->bytecode_offset = PF_fetch_opcode(seg->pf, &cursor);
entry->key = PF_fetch_opcode(seg->pf, &cursor);
entry->value = PF_fetch_opcode(seg->pf, &cursor);
@@ -4338,7 +4323,7 @@
/* Dump keys. */
Parrot_io_printf(interp, "\n keys => [\n");
for (i = 0; i < self->num_keys; ++i) {
- const PackFile_Annotations_Key * const key = self->keys[i];
+ const PackFile_Annotations_Key * const key = self->keys + i;
Parrot_io_printf(interp, " #%d\n [\n", i);
Parrot_io_printf(interp, " NAME => %Ss\n",
PF_CONST(self->code, key->name)->u.string);
@@ -4355,7 +4340,7 @@
/* Dump groups. */
Parrot_io_printf(interp, "\n groups => [\n");
for (i = 0; i < self->num_groups; ++i) {
- const PackFile_Annotations_Group * const group = self->groups[i];
+ const PackFile_Annotations_Group * const group = self->groups + i;
Parrot_io_printf(interp, " #%d\n [\n", i);
Parrot_io_printf(interp, " BYTECODE_OFFSET => %d\n",
group->bytecode_offset);
@@ -4370,7 +4355,7 @@
Parrot_io_printf(interp, "\n entries => [\n");
for (i = 0; i < self->num_entries; ++i) {
- const PackFile_Annotations_Entry * const entry = self->entries[i];
+ const PackFile_Annotations_Entry * const entry = self->entries + i;
Parrot_io_printf(interp, " #%d\n [\n", i);
Parrot_io_printf(interp, " BYTECODE_OFFSET => %d\n",
entry->bytecode_offset);
@@ -4408,14 +4393,13 @@
/* Allocate extra space for the group in the groups array. */
if (self->groups)
self->groups = mem_gc_realloc_n_typed_zeroed(interp, self->groups,
- 1 + self->num_groups, self->num_groups, PackFile_Annotations_Group *);
+ 1 + self->num_groups, self->num_groups, PackFile_Annotations_Group);
else
self->groups = mem_gc_allocate_n_typed(interp,
- 1 + self->num_groups, PackFile_Annotations_Group *);
+ 1 + self->num_groups, PackFile_Annotations_Group);
/* Store details. */
- group = self->groups[self->num_groups] =
- mem_gc_allocate_zeroed_typed(interp, PackFile_Annotations_Group);
+ group = self->groups + self->num_groups;
group->bytecode_offset = offset;
group->entries_offset = self->num_entries;
@@ -4452,7 +4436,7 @@
INTVAL i;
for (i = 0; i < self->num_keys; ++i) {
- STRING * const test_key = PF_CONST(self->code, self->keys[i]->name)->u.string;
+ STRING * const test_key = PF_CONST(self->code, self->keys[i].name)->u.string;
if (Parrot_str_equal(interp, test_key, key_name)) {
key_id = i;
break;
@@ -4463,22 +4447,21 @@
/* We do have it. Add key entry. */
if (self->keys)
self->keys = mem_gc_realloc_n_typed_zeroed(interp, self->keys,
- 1 + self->num_keys, self->num_keys, PackFile_Annotations_Key *);
+ 1 + self->num_keys, self->num_keys, PackFile_Annotations_Key);
else
self->keys = mem_gc_allocate_n_typed(interp,
- 1 + self->num_keys, PackFile_Annotations_Key *);
+ 1 + self->num_keys, PackFile_Annotations_Key);
key_id = self->num_keys;
- self->keys[key_id] = mem_gc_allocate_typed(interp, PackFile_Annotations_Key);
++self->num_keys;
/* Populate it. */
- self->keys[key_id]->name = key;
- self->keys[key_id]->type = type;
+ self->keys[key_id].name = key;
+ self->keys[key_id].type = type;
}
else {
/* Ensure key types are compatible. */
- if (self->keys[key_id]->type != type)
+ if (self->keys[key_id].type != type)
Parrot_ex_throw_from_c_args(interp, NULL,
EXCEPTION_INVALID_OPERATION,
"Annotations with different types of value used for key '%S'\n",
@@ -4488,16 +4471,14 @@
/* Add annotations entry. */
if (self->entries)
self->entries = mem_gc_realloc_n_typed(interp, self->entries,
- 1 + self->num_entries, PackFile_Annotations_Entry *);
+ 1 + self->num_entries, PackFile_Annotations_Entry);
else
self->entries = mem_gc_allocate_n_typed(interp,
- 1 + self->num_entries, PackFile_Annotations_Entry *);
+ 1 + self->num_entries, PackFile_Annotations_Entry);
- self->entries[self->num_entries] =
- mem_gc_allocate_typed(interp, PackFile_Annotations_Entry);
- self->entries[self->num_entries]->bytecode_offset = offset;
- self->entries[self->num_entries]->key = key_id;
- self->entries[self->num_entries]->value = value;
+ self->entries[self->num_entries].bytecode_offset = offset;
+ self->entries[self->num_entries].key = key_id;
+ self->entries[self->num_entries].value = value;
++self->num_entries;
}
@@ -4572,7 +4553,7 @@
if (!STRING_IS_NULL(key)) {
for (i = 0; i < self->num_keys; ++i) {
- STRING * const test_key = PF_CONST(self->code, self->keys[i]->name)->u.string;
+ STRING * const test_key = PF_CONST(self->code, self->keys[i].name)->u.string;
if (Parrot_str_equal(interp, test_key, key)) {
key_id = i;
break;
@@ -4585,10 +4566,10 @@
/* Use groups to find search start point. */
for (i = 0; i < self->num_groups; ++i)
- if (offset < self->groups[i]->bytecode_offset)
+ if (offset < self->groups[i].bytecode_offset)
break;
else
- start_entry = self->groups[i]->entries_offset;
+ start_entry = self->groups[i].entries_offset;
if (key_id == -1) {
/* Look through entries, storing what we find by key and tracking those
@@ -4599,11 +4580,11 @@
self->num_keys, opcode_t);
for (i = start_entry; i < self->num_entries; ++i) {
- if (self->entries[i]->bytecode_offset >= offset)
+ if (self->entries[i].bytecode_offset >= offset)
break;
- latest_values[self->entries[i]->key] = self->entries[i]->value;
- have_values[self->entries[i]->key] = 1;
+ latest_values[self->entries[i].key] = self->entries[i].value;
+ have_values[self->entries[i].key] = 1;
}
/* Create hash of values we have. */
@@ -4611,9 +4592,9 @@
for (i = 0; i < self->num_keys; ++i) {
if (have_values[i]) {
- STRING * const key_name = PF_CONST(self->code, self->keys[i]->name)->u.string;
+ STRING * const key_name = PF_CONST(self->code, self->keys[i].name)->u.string;
VTABLE_set_pmc_keyed_str(interp, result, key_name,
- make_annotation_value_pmc(interp, self, self->keys[i]->type,
+ make_annotation_value_pmc(interp, self, self->keys[i].type,
latest_values[i]));
}
}
@@ -4627,11 +4608,11 @@
opcode_t found_value = 0;
for (i = start_entry; i < self->num_entries; ++i) {
- if (self->entries[i]->bytecode_offset >= offset)
+ if (self->entries[i].bytecode_offset >= offset)
break;
- if (self->entries[i]->key == key_id) {
- latest_value = self->entries[i]->value;
+ if (self->entries[i].key == key_id) {
+ latest_value = self->entries[i].value;
found_value = 1;
}
}
@@ -4641,7 +4622,7 @@
result = PMCNULL;
else
result = make_annotation_value_pmc(interp, self,
- self->keys[key_id]->type, latest_value);
+ self->keys[key_id].type, latest_value);
}
return result;
Modified: branches/codestring/src/pmc/addrregistry.pmc
==============================================================================
--- branches/codestring/src/pmc/addrregistry.pmc Wed May 5 23:52:59 2010 (r46321)
+++ branches/codestring/src/pmc/addrregistry.pmc Thu May 6 00:31:08 2010 (r46322)
@@ -77,7 +77,7 @@
Hash *hash;
const void *value;
- GET_ATTR_hash(interp, SELF, hash);
+ GET_ATTR_hash(INTERP, SELF, hash);
value = parrot_hash_get(INTERP, hash, key);
if (value)
@@ -89,7 +89,7 @@
VTABLE INTVAL elements() {
const Hash *hash;
- GET_ATTR_hash(interp, SELF, hash);
+ GET_ATTR_hash(INTERP, SELF, hash);
return parrot_hash_size(INTERP, hash);
}
@@ -97,7 +97,7 @@
VTABLE INTVAL get_bool() {
const Hash *hash;
- GET_ATTR_hash(interp, SELF, hash);
+ GET_ATTR_hash(INTERP, SELF, hash);
return parrot_hash_size(INTERP, hash) != 0;
}
@@ -128,7 +128,7 @@
Hash *hash;
UNUSED(value);
- GET_ATTR_hash(interp, SELF, hash);
+ GET_ATTR_hash(INTERP, SELF, hash);
oldval = parrot_hash_get(INTERP, hash, key);
@@ -140,7 +140,7 @@
VTABLE void set_integer_keyed(PMC *key, INTVAL value) {
Hash *hash;
- GET_ATTR_hash(interp, SELF, hash);
+ GET_ATTR_hash(INTERP, SELF, hash);
parrot_hash_put(INTERP, hash, key, (void *)value);
}
@@ -148,7 +148,7 @@
Hash *hash;
void *value;
- GET_ATTR_hash(interp, SELF, hash);
+ GET_ATTR_hash(INTERP, SELF, hash);
value = parrot_hash_get(INTERP, hash, key);
/* these casts look bad, but they avoid type punning warnings with -O */
Modified: branches/codestring/src/pmc/arrayiterator.pmc
==============================================================================
--- branches/codestring/src/pmc/arrayiterator.pmc Wed May 5 23:52:59 2010 (r46321)
+++ branches/codestring/src/pmc/arrayiterator.pmc Thu May 6 00:31:08 2010 (r46322)
@@ -90,7 +90,7 @@
VTABLE void init_pmc(PMC *array) {
- SET_ATTR_array(interp, SELF, array);
+ SET_ATTR_array(INTERP, SELF, array);
PObj_custom_mark_SET(SELF);
@@ -128,14 +128,14 @@
PMC *array;
PMC *clone;
- GET_ATTR_array(interp, SELF, array);
- GET_ATTR_pos(interp, SELF, pos);
- GET_ATTR_reverse(interp, SELF, reverse);
+ GET_ATTR_array(INTERP, SELF, array);
+ GET_ATTR_pos(INTERP, SELF, pos);
+ GET_ATTR_reverse(INTERP, SELF, reverse);
clone = Parrot_pmc_new_init(INTERP, enum_class_ArrayIterator, array);
- SET_ATTR_pos(interp, clone, pos);
- SET_ATTR_reverse(interp, clone, reverse);
+ SET_ATTR_pos(INTERP, clone, pos);
+ SET_ATTR_reverse(INTERP, clone, reverse);
return clone;
}
@@ -167,15 +167,15 @@
VTABLE INTVAL elements() {
INTVAL reverse, pos, length;
- GET_ATTR_reverse(interp, SELF, reverse);
+ GET_ATTR_reverse(INTERP, SELF, reverse);
if (reverse) {
- GET_ATTR_pos(interp, SELF, pos);
+ GET_ATTR_pos(INTERP, SELF, pos);
return pos;
}
else {
- GET_ATTR_length(interp, SELF, length);
- GET_ATTR_pos(interp, SELF, pos);
+ GET_ATTR_length(INTERP, SELF, length);
+ GET_ATTR_pos(INTERP, SELF, pos);
return length - pos;
}
}
@@ -201,18 +201,18 @@
PMC *array;
if (value == ITERATE_FROM_START) {
- GET_ATTR_array(interp, SELF, array);
- SET_ATTR_reverse(interp, SELF, 0);
- SET_ATTR_pos(interp, SELF, 0);
- SET_ATTR_length(interp, SELF, VTABLE_elements(INTERP, array));
+ GET_ATTR_array(INTERP, SELF, array);
+ SET_ATTR_reverse(INTERP, SELF, 0);
+ SET_ATTR_pos(INTERP, SELF, 0);
+ SET_ATTR_length(INTERP, SELF, VTABLE_elements(INTERP, array));
}
else if (value == ITERATE_FROM_END) {
INTVAL element;
- GET_ATTR_array(interp, SELF, array);
+ GET_ATTR_array(INTERP, SELF, array);
element = VTABLE_elements(INTERP, array);
- SET_ATTR_reverse(interp, SELF, 1);
- SET_ATTR_length(interp, SELF, element);
- SET_ATTR_pos(interp, SELF, element);
+ SET_ATTR_reverse(INTERP, SELF, 1);
+ SET_ATTR_length(INTERP, SELF, element);
+ SET_ATTR_pos(INTERP, SELF, element);
}
else
Parrot_ex_throw_from_c_args(INTERP, NULL, EXCEPTION_INVALID_OPERATION,
Modified: branches/codestring/src/pmc/bigint.pmc
==============================================================================
--- branches/codestring/src/pmc/bigint.pmc Wed May 5 23:52:59 2010 (r46321)
+++ branches/codestring/src/pmc/bigint.pmc Thu May 6 00:31:08 2010 (r46322)
@@ -1183,7 +1183,7 @@
MULTI PMC *add(Integer value, PMC *dest) {
dest = Parrot_pmc_new(INTERP, VTABLE_type(INTERP, SELF));
- bigint_add_bigint_int(INTERP, SELF, VTABLE_get_integer(interp, value), dest);
+ bigint_add_bigint_int(INTERP, SELF, VTABLE_get_integer(INTERP, value), dest);
return dest;
}
@@ -1192,7 +1192,7 @@
Parrot_ex_throw_from_c_args(INTERP, NULL,
EXCEPTION_INTERNAL_NOT_IMPLEMENTED,
"BigInt: no multiple dispatch variant 'add' for %Ss",
- VTABLE_name(interp, value));
+ VTABLE_name(INTERP, value));
}
VTABLE PMC *add_int(INTVAL value, PMC *dest) {
@@ -1207,14 +1207,14 @@
}
MULTI void i_add(Integer value) {
- bigint_add_bigint_int(INTERP, SELF, VTABLE_get_integer(interp, value), SELF);
+ bigint_add_bigint_int(INTERP, SELF, VTABLE_get_integer(INTERP, value), SELF);
}
MULTI void i_add(DEFAULT value) {
Parrot_ex_throw_from_c_args(INTERP, NULL,
EXCEPTION_INTERNAL_NOT_IMPLEMENTED,
"BigInt: no multiple dispatch variant 'i_add' for %Ss",
- VTABLE_name(interp, value));
+ VTABLE_name(INTERP, value));
}
VTABLE void i_add_int(INTVAL value) {
@@ -1239,7 +1239,7 @@
MULTI PMC *subtract(Integer value, PMC *dest) {
dest = Parrot_pmc_new(INTERP, VTABLE_type(INTERP, SELF));
- bigint_sub_bigint_int(INTERP, SELF, VTABLE_get_integer(interp, value), dest);
+ bigint_sub_bigint_int(INTERP, SELF, VTABLE_get_integer(INTERP, value), dest);
return dest;
}
@@ -1248,7 +1248,7 @@
Parrot_ex_throw_from_c_args(INTERP, NULL,
EXCEPTION_INTERNAL_NOT_IMPLEMENTED,
"BigInt: no multiple dispatch variant 'subtract' for %Ss",
- VTABLE_name(interp, value));
+ VTABLE_name(INTERP, value));
}
VTABLE PMC *subtract_int(INTVAL value, PMC *dest) {
@@ -1263,14 +1263,14 @@
}
MULTI void i_subtract(Integer value) {
- bigint_sub_bigint_int(INTERP, SELF, VTABLE_get_integer(interp, value), SELF);
+ bigint_sub_bigint_int(INTERP, SELF, VTABLE_get_integer(INTERP, value), SELF);
}
MULTI void i_subtract(DEFAULT value) {
Parrot_ex_throw_from_c_args(INTERP, NULL,
EXCEPTION_INTERNAL_NOT_IMPLEMENTED,
"BigInt: no multiple dispatch variant 'i_subtract' for %Ss",
- VTABLE_name(interp, value));
+ VTABLE_name(INTERP, value));
}
VTABLE void i_subtract_int(INTVAL value) {
@@ -1295,7 +1295,7 @@
MULTI PMC *multiply(Integer value, PMC *dest) {
dest = Parrot_pmc_new(INTERP, VTABLE_type(INTERP, SELF));
- bigint_mul_bigint_int(INTERP, SELF, VTABLE_get_integer(interp, value), dest);
+ bigint_mul_bigint_int(INTERP, SELF, VTABLE_get_integer(INTERP, value), dest);
return dest;
}
@@ -1304,7 +1304,7 @@
Parrot_ex_throw_from_c_args(INTERP, NULL,
EXCEPTION_INTERNAL_NOT_IMPLEMENTED,
"BigInt: no multiple dispatch variant 'multiply' for %Ss",
- VTABLE_name(interp, value));
+ VTABLE_name(INTERP, value));
}
VTABLE PMC *multiply_int(INTVAL value, PMC *dest) {
@@ -1318,13 +1318,13 @@
bigint_mul_bigint(INTERP, SELF, value, SELF);
}
MULTI void i_multiply(Integer value) {
- bigint_mul_bigint_int(INTERP, SELF, VTABLE_get_integer(interp, value), SELF);
+ bigint_mul_bigint_int(INTERP, SELF, VTABLE_get_integer(INTERP, value), SELF);
}
MULTI void i_multiply(DEFAULT value) {
Parrot_ex_throw_from_c_args(INTERP, NULL,
EXCEPTION_INTERNAL_NOT_IMPLEMENTED,
"BigInt: no multiple dispatch variant 'i_multiply' for %Ss",
- VTABLE_name(interp, value));
+ VTABLE_name(INTERP, value));
}
VTABLE void i_multiply_int(INTVAL value) {
@@ -1358,7 +1358,7 @@
MULTI PMC *divide(Integer value, PMC *dest) {
dest = Parrot_pmc_new(INTERP, VTABLE_type(INTERP, SELF));
- bigint_div_bigint_int(INTERP, SELF, VTABLE_get_integer(interp, value), dest);
+ bigint_div_bigint_int(INTERP, SELF, VTABLE_get_integer(INTERP, value), dest);
return dest;
}
@@ -1367,7 +1367,7 @@
Parrot_ex_throw_from_c_args(INTERP, NULL,
EXCEPTION_INTERNAL_NOT_IMPLEMENTED,
"BigInt: no multiple dispatch variant 'divide' for %Ss",
- VTABLE_name(interp, value));
+ VTABLE_name(INTERP, value));
}
VTABLE PMC *divide_int(INTVAL value, PMC *dest) {
@@ -1381,13 +1381,13 @@
bigint_div_bigint(INTERP, SELF, value, SELF);
}
MULTI void i_divide(Integer value) {
- bigint_div_bigint_int(INTERP, SELF, VTABLE_get_integer(interp, value), SELF);
+ bigint_div_bigint_int(INTERP, SELF, VTABLE_get_integer(INTERP, value), SELF);
}
MULTI void i_divide(DEFAULT value) {
Parrot_ex_throw_from_c_args(INTERP, NULL,
EXCEPTION_INTERNAL_NOT_IMPLEMENTED,
"BigInt: no multiple dispatch variant 'i_divide' for %Ss",
- VTABLE_name(interp, value));
+ VTABLE_name(INTERP, value));
}
VTABLE void i_divide_int(INTVAL value) {
@@ -1404,7 +1404,7 @@
MULTI PMC *floor_divide(Integer value, PMC *dest) {
dest = Parrot_pmc_new(INTERP, VTABLE_type(INTERP, SELF));
- bigint_fdiv_bigint_int(INTERP, SELF, VTABLE_get_integer(interp, value), dest);
+ bigint_fdiv_bigint_int(INTERP, SELF, VTABLE_get_integer(INTERP, value), dest);
return dest;
}
@@ -1413,7 +1413,7 @@
Parrot_ex_throw_from_c_args(INTERP, NULL,
EXCEPTION_INTERNAL_NOT_IMPLEMENTED,
"BigInt: no multiple dispatch variant 'floor_divide' for %Ss",
- VTABLE_name(interp, value));
+ VTABLE_name(INTERP, value));
}
VTABLE PMC *floor_divide_int(INTVAL value, PMC *dest) {
@@ -1428,14 +1428,14 @@
}
MULTI void i_floor_divide(Integer value) {
- bigint_fdiv_bigint_int(INTERP, SELF, VTABLE_get_integer(interp, value), SELF);
+ bigint_fdiv_bigint_int(INTERP, SELF, VTABLE_get_integer(INTERP, value), SELF);
}
MULTI void i_floor_divide(DEFAULT value) {
Parrot_ex_throw_from_c_args(INTERP, NULL,
EXCEPTION_INTERNAL_NOT_IMPLEMENTED,
"BigInt: no multiple dispatch variant 'i_floor_divide' for %Ss",
- VTABLE_name(interp, value));
+ VTABLE_name(INTERP, value));
}
VTABLE void i_floor_divide_int(INTVAL value) {
@@ -1452,7 +1452,7 @@
MULTI PMC *modulus(Integer value, PMC *dest) {
dest = Parrot_pmc_new(INTERP, VTABLE_type(INTERP, SELF));
- bigint_mod_bigint_int(INTERP, SELF, VTABLE_get_integer(interp, value), dest);
+ bigint_mod_bigint_int(INTERP, SELF, VTABLE_get_integer(INTERP, value), dest);
return dest;
}
@@ -1461,20 +1461,20 @@
Parrot_ex_throw_from_c_args(INTERP, NULL,
EXCEPTION_INTERNAL_NOT_IMPLEMENTED,
"BigInt: no multiple dispatch variant 'modulus' for %Ss",
- VTABLE_name(interp, value));
+ VTABLE_name(INTERP, value));
}
MULTI void i_modulus(BigInt value) {
bigint_mod_bigint(INTERP, SELF, value, SELF);
}
MULTI void i_modulus(Integer value) {
- bigint_mod_bigint_int(INTERP, SELF, VTABLE_get_integer(interp, value), SELF);
+ bigint_mod_bigint_int(INTERP, SELF, VTABLE_get_integer(INTERP, value), SELF);
}
MULTI void i_modulus(DEFAULT value) {
Parrot_ex_throw_from_c_args(INTERP, NULL,
EXCEPTION_INTERNAL_NOT_IMPLEMENTED,
"BigInt: no multiple dispatch variant 'i_modulus' for %Ss",
- VTABLE_name(interp, value));
+ VTABLE_name(INTERP, value));
}
MULTI INTVAL cmp(BigInt value) {
@@ -1482,14 +1482,14 @@
}
MULTI INTVAL cmp(Integer value) {
- return bigint_cmp_int(INTERP, SELF, VTABLE_get_integer(interp, value));
+ return bigint_cmp_int(INTERP, SELF, VTABLE_get_integer(INTERP, value));
}
MULTI INTVAL cmp(DEFAULT value) {
Parrot_ex_throw_from_c_args(INTERP, NULL,
EXCEPTION_INTERNAL_NOT_IMPLEMENTED,
"BigInt: no multiple dispatch variant 'cmp' for %Ss",
- VTABLE_name(interp, value));
+ VTABLE_name(INTERP, value));
}
MULTI INTVAL is_equal(BigInt value) {
@@ -1497,14 +1497,14 @@
}
MULTI INTVAL is_equal(Integer value) {
- return bigint_cmp_int(INTERP, SELF, VTABLE_get_integer(interp, value)) == 0;
+ return bigint_cmp_int(INTERP, SELF, VTABLE_get_integer(INTERP, value)) == 0;
}
MULTI INTVAL is_equal(DEFAULT value) {
Parrot_ex_throw_from_c_args(INTERP, NULL,
EXCEPTION_INTERNAL_NOT_IMPLEMENTED,
"BigInt: no multiple dispatch variant 'is_equal' for %Ss",
- VTABLE_name(interp, value));
+ VTABLE_name(INTERP, value));
}
/*
Modified: branches/codestring/src/pmc/bignum.pmc
==============================================================================
--- branches/codestring/src/pmc/bignum.pmc Wed May 5 23:52:59 2010 (r46321)
+++ branches/codestring/src/pmc/bignum.pmc Thu May 6 00:31:08 2010 (r46322)
@@ -1442,7 +1442,7 @@
#if PARROT_BIGNUM_CAN_BIGINT
return bignum_get_bigint(INTERP, SELF);
#else
- Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_LIBRARY_ERROR,
+ Parrot_ex_throw_from_c_args(INTERP, NULL, EXCEPTION_LIBRARY_ERROR,
"no bigint support in bignum");
#endif
}
@@ -1488,27 +1488,27 @@
VTABLE STRING *get_string() {
char *s = bignum_get_string(INTERP, SELF, 10);
STRING *ps = Parrot_str_new(INTERP, s, 0);
- mem_gc_free(interp, s);
+ mem_gc_free(INTERP, s);
return ps;
}
VTABLE STRING *get_string_keyed_int(INTVAL base) {
char *s = bignum_get_string(INTERP, SELF, base);
STRING *ps = Parrot_str_new(INTERP, s, 0);
- mem_gc_free(interp, s);
+ mem_gc_free(INTERP, s);
return ps;
}
VTABLE STRING *get_string_keyed_int_int(INTVAL base, INTVAL digits) {
char *s = bignum_get_string_size(INTERP, SELF, base, digits);
STRING *ps = Parrot_str_new(INTERP, s, 0);
- mem_gc_free(interp, s);
+ mem_gc_free(INTERP, s);
return ps;
}
VTABLE STRING *get_repr() {
STRING *s = SELF.get_string();
- return Parrot_str_concat(INTERP, s, Parrot_str_new(interp, "N", 1));
+ return Parrot_str_concat(INTERP, s, Parrot_str_new(INTERP, "N", 1));
}
/*
@@ -1556,7 +1556,7 @@
MULTI PMC *add(Integer value, PMC *dest) {
dest = Parrot_pmc_new(INTERP, SELF->vtable->base_type);
- bignum_add_bignum_int(INTERP, SELF, VTABLE_get_integer(interp, value), dest);
+ bignum_add_bignum_int(INTERP, SELF, VTABLE_get_integer(INTERP, value), dest);
return dest;
}
@@ -1564,7 +1564,7 @@
Parrot_ex_throw_from_c_args(INTERP, NULL,
EXCEPTION_INTERNAL_NOT_IMPLEMENTED,
"BigNum: no multiple dispatch variant 'add' for %Ss",
- VTABLE_name(interp, value));
+ VTABLE_name(INTERP, value));
}
VTABLE PMC *add_int(INTVAL value, PMC *dest) {
@@ -1590,7 +1590,7 @@
Parrot_ex_throw_from_c_args(INTERP, NULL,
EXCEPTION_INTERNAL_NOT_IMPLEMENTED,
"BigNum: no multiple dispatch variant 'i_add' for %Ss",
- VTABLE_name(interp, value));
+ VTABLE_name(INTERP, value));
}
VTABLE void i_add_int(INTVAL value) {
@@ -1619,7 +1619,7 @@
MULTI PMC *subtract(Integer value, PMC *dest) {
dest = Parrot_pmc_new(INTERP, VTABLE_type(INTERP, SELF));
- bignum_sub_bignum_int(INTERP, SELF, VTABLE_get_integer(interp, value), dest);
+ bignum_sub_bignum_int(INTERP, SELF, VTABLE_get_integer(INTERP, value), dest);
return dest;
}
@@ -1627,7 +1627,7 @@
Parrot_ex_throw_from_c_args(INTERP, NULL,
EXCEPTION_INTERNAL_NOT_IMPLEMENTED,
"BigNum: no multiple dispatch variant 'subtract' for %Ss",
- VTABLE_name(interp, value));
+ VTABLE_name(INTERP, value));
}
VTABLE PMC *subtract_int(INTVAL value, PMC *dest) {
@@ -1653,7 +1653,7 @@
Parrot_ex_throw_from_c_args(INTERP, NULL,
EXCEPTION_INTERNAL_NOT_IMPLEMENTED,
"BigNum: no multiple dispatch variant 'i_subtract' for %Ss",
- VTABLE_name(interp, value));
+ VTABLE_name(INTERP, value));
}
VTABLE void i_subtract_int(INTVAL value) {
@@ -1682,7 +1682,7 @@
MULTI PMC *multiply(Integer value, PMC *dest) {
dest = Parrot_pmc_new(INTERP, SELF->vtable->base_type);
- bignum_mul_bignum_int(INTERP, SELF, VTABLE_get_integer(interp, value), dest);
+ bignum_mul_bignum_int(INTERP, SELF, VTABLE_get_integer(INTERP, value), dest);
return dest;
}
@@ -1690,7 +1690,7 @@
Parrot_ex_throw_from_c_args(INTERP, NULL,
EXCEPTION_INTERNAL_NOT_IMPLEMENTED,
"BigNum: no multiple dispatch variant 'multiply' for %Ss",
- VTABLE_name(interp, value));
+ VTABLE_name(INTERP, value));
}
VTABLE PMC *multiply_int(INTVAL value, PMC *dest) {
@@ -1709,14 +1709,14 @@
}
MULTI void i_multiply(Integer value) {
- bignum_mul_bignum_int(INTERP, SELF, VTABLE_get_integer(interp, value), SELF);
+ bignum_mul_bignum_int(INTERP, SELF, VTABLE_get_integer(INTERP, value), SELF);
}
MULTI void i_multiply(DEFAULT value) {
Parrot_ex_throw_from_c_args(INTERP, NULL,
EXCEPTION_INTERNAL_NOT_IMPLEMENTED,
"BigNum: no multiple dispatch variant 'i_multiply' for %Ss",
- VTABLE_name(interp, value));
+ VTABLE_name(INTERP, value));
}
VTABLE void i_multiply_int(INTVAL value) {
@@ -1768,7 +1768,7 @@
MULTI PMC *divide(Integer value, PMC *dest) {
dest = Parrot_pmc_new(INTERP, VTABLE_type(INTERP, SELF));
- bignum_div_bignum_int(INTERP, SELF, VTABLE_get_integer(interp, value), dest);
+ bignum_div_bignum_int(INTERP, SELF, VTABLE_get_integer(INTERP, value), dest);
return dest;
}
@@ -1776,7 +1776,7 @@
Parrot_ex_throw_from_c_args(INTERP, NULL,
EXCEPTION_INTERNAL_NOT_IMPLEMENTED,
"BigNum: no multiple dispatch variant 'divide' for %Ss",
- VTABLE_name(interp, value));
+ VTABLE_name(INTERP, value));
}
VTABLE PMC *divide_int(INTVAL value, PMC *dest) {
@@ -1797,16 +1797,16 @@
bignum_div_bignum(INTERP, SELF, value, SELF);
}
MULTI void i_divide(Integer value) {
- bignum_div_bignum_int(INTERP, SELF, VTABLE_get_integer(interp, value), SELF);
+ bignum_div_bignum_int(INTERP, SELF, VTABLE_get_integer(INTERP, value), SELF);
}
MULTI void i_divide(Float value) {
- bignum_div_bignum_float(INTERP, SELF, VTABLE_get_integer(interp, value), SELF);
+ bignum_div_bignum_float(INTERP, SELF, VTABLE_get_integer(INTERP, value), SELF);
}
MULTI void i_divide(DEFAULT value) {
Parrot_ex_throw_from_c_args(INTERP, NULL,
EXCEPTION_INTERNAL_NOT_IMPLEMENTED,
"BigNum: no multiple dispatch variant 'i_divide' for %Ss",
- VTABLE_name(interp, value));
+ VTABLE_name(INTERP, value));
}
VTABLE void i_divide_int(INTVAL value) {
@@ -1831,7 +1831,7 @@
MULTI PMC *floor_divide(Integer value, PMC *dest) {
dest = Parrot_pmc_new(INTERP, VTABLE_type(INTERP, SELF));
- bignum_fdiv_bignum_int(INTERP, SELF, VTABLE_get_integer(interp, value), dest);
+ bignum_fdiv_bignum_int(INTERP, SELF, VTABLE_get_integer(INTERP, value), dest);
return dest;
}
@@ -1839,7 +1839,7 @@
Parrot_ex_throw_from_c_args(INTERP, NULL,
EXCEPTION_INTERNAL_NOT_IMPLEMENTED,
"BigNum: no multiple dispatch variant 'floor_divide' for %Ss",
- VTABLE_name(interp, value));
+ VTABLE_name(INTERP, value));
}
VTABLE PMC *floor_divide_int(INTVAL value, PMC *dest) {
@@ -1854,14 +1854,14 @@
}
MULTI void i_floor_divide(Integer value) {
- bignum_fdiv_bignum_int(INTERP, SELF, VTABLE_get_integer(interp, value), SELF);
+ bignum_fdiv_bignum_int(INTERP, SELF, VTABLE_get_integer(INTERP, value), SELF);
}
MULTI void i_floor_divide(DEFAULT value) {
Parrot_ex_throw_from_c_args(INTERP, NULL,
EXCEPTION_INTERNAL_NOT_IMPLEMENTED,
"BigNum: no multiple dispatch variant 'i_floor_divide' for %Ss",
- VTABLE_name(interp, value));
+ VTABLE_name(INTERP, value));
}
VTABLE void i_floor_divide_int(INTVAL value) {
@@ -1881,14 +1881,14 @@
}
MULTI INTVAL cmp(Integer value) {
- return bignum_cmp_int(INTERP, SELF, VTABLE_get_integer(interp, value));
+ return bignum_cmp_int(INTERP, SELF, VTABLE_get_integer(INTERP, value));
}
MULTI INTVAL cmp(DEFAULT value) {
Parrot_ex_throw_from_c_args(INTERP, NULL,
EXCEPTION_INTERNAL_NOT_IMPLEMENTED,
"BigNum: no multiple dispatch variant 'cmp' for %Ss",
- VTABLE_name(interp, value));
+ VTABLE_name(INTERP, value));
}
/*
@@ -1904,14 +1904,14 @@
}
MULTI INTVAL is_equal(Integer value) {
- return bignum_cmp_int(INTERP, SELF, VTABLE_get_integer(interp, value)) == 0;
+ return bignum_cmp_int(INTERP, SELF, VTABLE_get_integer(INTERP, value)) == 0;
}
MULTI INTVAL is_equal(DEFAULT value) {
Parrot_ex_throw_from_c_args(INTERP, NULL,
EXCEPTION_INTERNAL_NOT_IMPLEMENTED,
"BigNum: no multiple dispatch variant 'is_equal' for %Ss",
- VTABLE_name(interp, value));
+ VTABLE_name(INTERP, value));
}
/*
Modified: branches/codestring/src/pmc/callcontext.pmc
==============================================================================
--- branches/codestring/src/pmc/callcontext.pmc Wed May 5 23:52:59 2010 (r46321)
+++ branches/codestring/src/pmc/callcontext.pmc Thu May 6 00:31:08 2010 (r46322)
@@ -539,13 +539,13 @@
PMC * const p = bp_ps.regs_p[-1L-(i)];
/* Original code from CTX_REG_PMC */
if (p)
- Parrot_gc_mark_PMC_alive(interp, p);
+ Parrot_gc_mark_PMC_alive(INTERP, p);
}
for (i = 0; i < n_regs_used[REGNO_STR]; ++i) {
STRING * const s = bp_ps.regs_s[i];
if (s)
- Parrot_gc_mark_STRING_alive(interp, s);
+ Parrot_gc_mark_STRING_alive(INTERP, s);
}
}
@@ -589,7 +589,7 @@
}
parrot_hash_destroy(INTERP, hash);
- SET_ATTR_hash(interp, SELF, NULL);
+ SET_ATTR_hash(INTERP, SELF, NULL);
}
}
@@ -736,7 +736,7 @@
GET_ATTR_positionals(INTERP, SELF, c);
GET_ATTR_num_positionals(INTERP, SELF, num_positionals);
- type_tuple = Parrot_pmc_new_init_int(interp,
+ type_tuple = Parrot_pmc_new_init_int(INTERP,
enum_class_FixedIntegerArray, num_positionals);
for (i = 0; i < num_positionals; ++i) {
@@ -749,15 +749,15 @@
case PMCCELL:
type = PMC_IS_NULL(c[i].u.p)
? (INTVAL) enum_type_PMC
- : VTABLE_type(interp, c[i].u.p);
+ : VTABLE_type(INTERP, c[i].u.p);
break;
default:
- Parrot_ex_throw_from_c_args(interp, NULL,
+ Parrot_ex_throw_from_c_args(INTERP, NULL,
EXCEPTION_INVALID_OPERATION,
"Multiple Dispatch: invalid argument type!");
}
- VTABLE_set_integer_keyed_int(interp, type_tuple, i, type);
+ VTABLE_set_integer_keyed_int(INTERP, type_tuple, i, type);
}
SET_ATTR_type_tuple(INTERP, SELF, type_tuple);
@@ -931,7 +931,7 @@
INTVAL num_pos, allocated_positionals;
GET_ATTR_num_positionals(INTERP, SELF, num_pos);
- GET_ATTR_allocated_positionals(interp, SELF, allocated_positionals);
+ GET_ATTR_allocated_positionals(INTERP, SELF, allocated_positionals);
if (num_pos + 1 > allocated_positionals)
ensure_positionals_storage(INTERP, SELF, num_pos + 1);
@@ -973,7 +973,7 @@
INTVAL num_pos, allocated_positionals;
GET_ATTR_num_positionals(INTERP, SELF, num_pos);
- GET_ATTR_allocated_positionals(interp, SELF, allocated_positionals);
+ GET_ATTR_allocated_positionals(INTERP, SELF, allocated_positionals);
if (num_pos + 1 > allocated_positionals)
ensure_positionals_storage(INTERP, SELF, num_pos + 1);
@@ -991,7 +991,7 @@
VTABLE void unshift_pmc(PMC *value) {
Pcc_cell *cells;
- INTVAL size = STATICSELF.elements();
+ const INTVAL size = STATICSELF.elements();
INTVAL i;
ensure_positionals_storage(INTERP, SELF, size + 1);
@@ -1012,7 +1012,7 @@
INTVAL i;
if (size < 1)
- Parrot_ex_throw_from_c_args(interp, NULL,
+ Parrot_ex_throw_from_c_args(INTERP, NULL,
EXCEPTION_INVALID_OPERATION,
"Cannot shift PMC from empty CallContext");
@@ -1033,7 +1033,7 @@
INTVAL i;
if (size < 1)
- Parrot_ex_throw_from_c_args(interp, NULL,
+ Parrot_ex_throw_from_c_args(INTERP, NULL,
EXCEPTION_INVALID_OPERATION,
"Cannot shift PMC from empty CallContext");
@@ -1460,48 +1460,48 @@
*/
METHOD backtrace(PMC *resume :optional, INTVAL has_resume :opt_flag) {
- PMC *result = Parrot_pmc_new(interp, enum_class_ResizablePMCArray);
+ PMC *result = Parrot_pmc_new(INTERP, enum_class_ResizablePMCArray);
PMC *cur_ctx = SELF;
Parrot_Continuation_attributes * const cont = has_resume ? PMC_cont(resume) : NULL;
/* Get starting context, then loop over them. */
while (cur_ctx) {
- PMC * const frame = Parrot_pmc_new(interp, enum_class_Hash);
+ PMC * const frame = Parrot_pmc_new(INTERP, enum_class_Hash);
PMC *annotations = NULL;
Parrot_Sub_attributes *sub;
/* Get sub and put it in the hash. */
- PMC *sub_pmc = Parrot_pcc_get_sub(interp, cur_ctx);
+ PMC *sub_pmc = Parrot_pcc_get_sub(INTERP, cur_ctx);
if (!sub_pmc)
sub_pmc = PMCNULL;
- VTABLE_set_pmc_keyed_str(interp, frame, CONST_STRING(interp, "sub"), sub_pmc);
+ VTABLE_set_pmc_keyed_str(INTERP, frame, CONST_STRING(INTERP, "sub"), sub_pmc);
/* Look up any annotations and put them in the hash. */
if (!PMC_IS_NULL(sub_pmc)) {
- PMC_get_sub(interp, sub_pmc, sub);
+ PMC_get_sub(INTERP, sub_pmc, sub);
if (sub->seg->annotations) {
PackFile_ByteCode *seg = sub->seg;
opcode_t *pc = cont && cur_ctx == cont->to_ctx
? cont->address
- : Parrot_pcc_get_pc(interp, cur_ctx);
+ : Parrot_pcc_get_pc(INTERP, cur_ctx);
- annotations = PackFile_Annotations_lookup(interp,
+ annotations = PackFile_Annotations_lookup(INTERP,
seg->annotations, pc - seg->base.data,
NULL);
}
}
if (!annotations)
- annotations = Parrot_pmc_new(interp, enum_class_Hash);
+ annotations = Parrot_pmc_new(INTERP, enum_class_Hash);
- VTABLE_set_pmc_keyed_str(interp, frame, CONST_STRING(interp, "annotations"), annotations);
+ VTABLE_set_pmc_keyed_str(INTERP, frame, CONST_STRING(INTERP, "annotations"), annotations);
/* Push frame and go to next caller. */
- VTABLE_push_pmc(interp, result, frame);
- cur_ctx = Parrot_pcc_get_caller_ctx(interp, cur_ctx);
+ VTABLE_push_pmc(INTERP, result, frame);
+ cur_ctx = Parrot_pcc_get_caller_ctx(INTERP, cur_ctx);
}
RETURN(PMC *result);
Modified: branches/codestring/src/pmc/complex.pmc
==============================================================================
--- branches/codestring/src/pmc/complex.pmc Wed May 5 23:52:59 2010 (r46321)
+++ branches/codestring/src/pmc/complex.pmc Thu May 6 00:31:08 2010 (r46322)
@@ -309,31 +309,31 @@
}
VTABLE void init_pmc(PMC *initializer) {
- const INTVAL arg_type = VTABLE_type(interp, initializer);
+ const INTVAL arg_type = VTABLE_type(INTERP, initializer);
SELF.init();
switch (arg_type) {
case enum_class_String:
- SELF.set_string_native(VTABLE_get_string(interp, initializer));
+ SELF.set_string_native(VTABLE_get_string(INTERP, initializer));
break;
case enum_class_FixedFloatArray:
case enum_class_ResizableFloatArray:
case enum_class_FixedIntegerArray:
case enum_class_ResizableIntegerArray:
- if (VTABLE_get_integer(interp, initializer) == 2) {
- const FLOATVAL re = VTABLE_get_number_keyed_int(interp, initializer, 0);
- const FLOATVAL im = VTABLE_get_number_keyed_int(interp, initializer, 1);
+ if (VTABLE_get_integer(INTERP, initializer) == 2) {
+ const FLOATVAL re = VTABLE_get_number_keyed_int(INTERP, initializer, 0);
+ const FLOATVAL im = VTABLE_get_number_keyed_int(INTERP, initializer, 1);
SET_ATTR_re(INTERP, SELF, re);
SET_ATTR_im(INTERP, SELF, im);
break;
}
/* else let it fall to default */
default:
- if (VTABLE_isa(interp, initializer, CONST_STRING(interp, "String"))) {
- STRING * const s = VTABLE_get_string(interp, initializer);
+ if (VTABLE_isa(INTERP, initializer, CONST_STRING(INTERP, "String"))) {
+ STRING * const s = VTABLE_get_string(INTERP, initializer);
SELF.set_string_native(s);
}
else {
- Parrot_ex_throw_from_c_args(interp, NULL,
+ Parrot_ex_throw_from_c_args(INTERP, NULL,
EXCEPTION_INVALID_OPERATION,
"Invalid Complex initializer");
}
@@ -480,14 +480,14 @@
GET_ATTR_im(INTERP, SELF, value);
}
else
- Parrot_ex_throw_from_c_args(interp, NULL,
+ Parrot_ex_throw_from_c_args(INTERP, NULL,
EXCEPTION_INVALID_OPERATION, "Complex: key is neither 'real' or 'imag'");
return value;
}
VTABLE PMC *get_pmc_keyed(PMC *key) {
- if (VTABLE_isa(interp, key, CONST_STRING(interp, "Integer"))) {
- const INTVAL i = VTABLE_get_integer(interp, key);
+ if (VTABLE_isa(INTERP, key, CONST_STRING(INTERP, "Integer"))) {
+ const INTVAL i = VTABLE_get_integer(INTERP, key);
return SELF.get_pmc_keyed_int(i);
}
else {
@@ -547,7 +547,7 @@
GET_ATTR_im(INTERP, SELF, f);
break;
default:
- Parrot_ex_throw_from_c_args(interp, NULL,
+ Parrot_ex_throw_from_c_args(INTERP, NULL,
EXCEPTION_INVALID_OPERATION, "Complex: key must be 0 or 1");
}
return f;
@@ -562,7 +562,7 @@
SET_ATTR_im(INTERP, SELF, v);
break;
default:
- Parrot_ex_throw_from_c_args(interp, NULL,
+ Parrot_ex_throw_from_c_args(INTERP, NULL,
EXCEPTION_INVALID_OPERATION, "Complex: key must be 0 or 1");
}
}
@@ -648,8 +648,8 @@
}
VTABLE void set_number_keyed(PMC *key, FLOATVAL value) {
- if (VTABLE_isa(interp, key, CONST_STRING(interp, "Integer"))) {
- const INTVAL i = VTABLE_get_integer(interp, key);
+ if (VTABLE_isa(INTERP, key, CONST_STRING(INTERP, "Integer"))) {
+ const INTVAL i = VTABLE_get_integer(INTERP, key);
SELF.set_number_keyed_int(i, value);
}
else {
@@ -666,7 +666,7 @@
SET_ATTR_im(INTERP, SELF, value);
}
else
- Parrot_ex_throw_from_c_args(interp, NULL,
+ Parrot_ex_throw_from_c_args(INTERP, NULL,
EXCEPTION_INVALID_OPERATION, "Complex: key is neither 'real' or 'imag'");
}
@@ -1861,12 +1861,12 @@
PMC *log;
PMC *dest = Parrot_pmc_new(INTERP, VTABLE_type(INTERP, SELF));
- Parrot_pcc_invoke_method_from_c_args(interp, SELF, CONST_STRING(interp, "ln"),
+ Parrot_pcc_invoke_method_from_c_args(INTERP, SELF, CONST_STRING(INTERP, "ln"),
"->P", &log);
l = VTABLE_multiply(INTERP, log, value, l);
- Parrot_pcc_invoke_method_from_c_args(interp, l, CONST_STRING(interp, "exp"),
+ Parrot_pcc_invoke_method_from_c_args(INTERP, l, CONST_STRING(INTERP, "exp"),
"->P", &dest);
RETURN(PMC *dest);
}
Modified: branches/codestring/src/pmc/continuation.pmc
==============================================================================
--- branches/codestring/src/pmc/continuation.pmc Wed May 5 23:52:59 2010 (r46321)
+++ branches/codestring/src/pmc/continuation.pmc Thu May 6 00:31:08 2010 (r46322)
@@ -1,5 +1,5 @@
/*
-Copyright (C) 2001-2008, Parrot Foundation.
+Copyright (C) 2001-2010, Parrot Foundation.
$Id$
=head1 NAME
@@ -57,6 +57,7 @@
ATTR PMC *from_ctx; /* sub, this cont is returning from */
ATTR int runloop_id; /* id of the creating runloop. */
ATTR int invoked; /* flag when a handler has been invoked. */
+
/*
=item C<void init()>
@@ -80,7 +81,19 @@
PObj_custom_mark_SET(SELF);
}
- /*if they pass in a PMC to initialize with*/
+
+/*
+
+=item C<void init_pmc(PMC *continuation)>
+
+Initializes the continuation with values from the provided continuation.
+
+=cut
+
+*/
+
+
+ /* if they pass in a PMC to initialize with */
VTABLE void init_pmc(PMC *values) {
PMC *to_ctx;
opcode_t *address;
@@ -103,7 +116,6 @@
}
-
/*
=item C<void mark()>
@@ -131,6 +143,7 @@
Parrot_gc_mark_PMC_alive(INTERP, tmp);
}
+
/*
=item C<PMC *clone()>
@@ -146,25 +159,27 @@
return Parrot_pmc_new_init(INTERP, SELF->vtable->base_type, SELF);
}
+
/*
=item C<PMC *set_pmc()>
-Assign context.
+Assigns context.
=cut
*/
VTABLE void set_pmc(PMC *src) {
- STRUCT_COPY((Parrot_Continuation_attributes *)PMC_data(SELF),
- (Parrot_Continuation_attributes *)PMC_data(src));
+ STRUCT_COPY(PMC_data_typed(SELF, Parrot_Continuation_attributes *),
+ PMC_data_typed(src, Parrot_Continuation_attributes *));
}
+
/*
=item C<void set_pointer(void *value)>
-Sets the pointer to the return instruction. Also captures the descriptor
-address for any returned values.
+Sets the pointer to the given return instruction and captures the runloop id
+for any returned values.
=cut
@@ -175,6 +190,7 @@
SET_ATTR_runloop_id(INTERP, SELF, INTERP->current_runloop_id);
}
+
/*
=item C<void *get_pointer()>
@@ -189,10 +205,10 @@
opcode_t *address;
GET_ATTR_address(INTERP, SELF, address);
-
return address;
}
+
/*
=item C<INTVAL defined()>
@@ -209,18 +225,18 @@
opcode_t *address;
GET_ATTR_address(INTERP, SELF, address);
-
return address != NULL;
}
+
VTABLE INTVAL get_bool() {
opcode_t *address;
GET_ATTR_address(INTERP, SELF, address);
-
return address != NULL;
}
+
/*
=item C<opcode_t *invoke(void *next)>
@@ -247,9 +263,8 @@
Parrot_continuation_check(INTERP, SELF);
Parrot_continuation_rewind_environment(INTERP, SELF);
- if (!PMC_IS_NULL(from_obj)) {
+ if (!PMC_IS_NULL(from_obj))
Parrot_pcc_set_signature(INTERP, CURRENT_CONTEXT(INTERP), from_obj);
- }
/* switch segment */
if (INTERP->code != seg)
@@ -258,11 +273,12 @@
return pc;
}
+
/*
=item C<STRING *get_string()>
-Experimental: return caller info as a STRING.
+Experimental: returns caller info as a STRING.
=cut
@@ -272,15 +288,15 @@
PMC *to_ctx;
GET_ATTR_to_ctx(INTERP, SELF, to_ctx);
-
return Parrot_Context_infostr(INTERP, to_ctx);
}
+
/*
=item C<PMC *caller()>
-Experimental: return caller PMC or PMCNULL if none.
+Experimental: return callers PMC or PMCNULL if none.
=cut
@@ -305,11 +321,13 @@
RETURN(PMC *caller);
}
+
+
/*
=item C<PMC *continuation()>
-Experimental: return continuation PMC of this Continuation or PMCNULL if none.
+Experimental: returns continuation PMC of this Continuation or PMCNULL if none.
=cut
@@ -333,10 +351,6 @@
=back
-=head1 HISTORY
-
-Initial revision by sean 2002/08/04.
-
=cut
*/
Modified: branches/codestring/src/pmc/coroutine.pmc
==============================================================================
--- branches/codestring/src/pmc/coroutine.pmc Wed May 5 23:52:59 2010 (r46321)
+++ branches/codestring/src/pmc/coroutine.pmc Thu May 6 00:31:08 2010 (r46322)
@@ -152,8 +152,8 @@
opcode_t *dest;
PackFile_ByteCode *wanted_seg;
opcode_t * const next_op = (opcode_t *)next;
- PMC * const signature = Parrot_pcc_get_signature(interp,
- CURRENT_CONTEXT(interp));
+ PMC * const signature = Parrot_pcc_get_signature(INTERP,
+ CURRENT_CONTEXT(INTERP));
if (Interp_trace_TEST(INTERP, PARROT_TRACE_SUB_CALL_FLAG))
print_sub_name(INTERP, SELF);
@@ -170,8 +170,8 @@
PMC *ccont = INTERP->current_cont;
if (ccont == NEED_CONTINUATION) {
- ccont = pmc_new(interp, enum_class_Continuation);
- VTABLE_set_pointer(interp, ccont, next_op);
+ ccont = pmc_new(INTERP, enum_class_Continuation);
+ VTABLE_set_pointer(INTERP, ccont, next_op);
}
if (PObj_get_FLAGS(ccont) & SUB_FLAG_TAILCALL)
@@ -282,7 +282,7 @@
CURRENT_CONTEXT(INTERP) = to_ctx;
}
- Parrot_pcc_set_signature(interp, CURRENT_CONTEXT(interp), signature);
+ Parrot_pcc_set_signature(INTERP, CURRENT_CONTEXT(INTERP), signature);
/* toggle address */
GET_ATTR_address(INTERP, SELF, dest);
Modified: branches/codestring/src/pmc/default.pmc
==============================================================================
--- branches/codestring/src/pmc/default.pmc Wed May 5 23:52:59 2010 (r46321)
+++ branches/codestring/src/pmc/default.pmc Thu May 6 00:31:08 2010 (r46322)
@@ -356,9 +356,9 @@
if (PMC_IS_NULL(initializer))
SELF.init();
else
- Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_ILL_INHERIT,
+ Parrot_ex_throw_from_c_args(INTERP, NULL, EXCEPTION_ILL_INHERIT,
"init_pmc() not implemented in class '%Ss'",
- caller(interp, SELF));
+ caller(INTERP, SELF));
}
/*
@@ -391,7 +391,7 @@
/* Ensure no looping, as Parrot_pmc_new calls the instantiate vtable entry for
* classes. */
if (PObj_is_class_TEST(SELF))
- Parrot_ex_throw_from_c_args(interp, NULL, 1,
+ Parrot_ex_throw_from_c_args(INTERP, NULL, 1,
"All high-level classes should override instantiate");
if (!PMC_IS_NULL(init))
@@ -427,7 +427,7 @@
VTABLE PMC *getprop(STRING *key) {
if (PMC_IS_NULL(PMC_metadata(SELF)))
- return check_get_std_props(interp, SELF, key);
+ return check_get_std_props(INTERP, SELF, key);
else
return VTABLE_get_pmc_keyed_str(INTERP, PMC_metadata(SELF), key);
}
@@ -688,7 +688,7 @@
*/
VTABLE void morph(PMC* type) {
- Parrot_pmc_reuse(INTERP, SELF, VTABLE_get_integer(interp, type), 0);
+ Parrot_pmc_reuse(INTERP, SELF, VTABLE_get_integer(INTERP, type), 0);
}
/*
@@ -782,7 +782,7 @@
VTABLE INTVAL is_equal(PMC *value) {
INTVAL retval;
- Parrot_mmd_multi_dispatch_from_c_args(interp,
+ Parrot_mmd_multi_dispatch_from_c_args(INTERP,
"is_equal", "PP->I", SELF, value, &retval);
return retval;
@@ -800,7 +800,7 @@
VTABLE INTVAL is_equal_num(PMC *value) {
INTVAL retval;
- Parrot_mmd_multi_dispatch_from_c_args(interp,
+ Parrot_mmd_multi_dispatch_from_c_args(INTERP,
"is_equal_num", "PP->I", SELF, value, &retval);
return retval;
@@ -818,7 +818,7 @@
VTABLE INTVAL is_equal_string(PMC *value) {
INTVAL retval;
- Parrot_mmd_multi_dispatch_from_c_args(interp,
+ Parrot_mmd_multi_dispatch_from_c_args(INTERP,
"is_equal_string", "PP->I", SELF, value, &retval);
return retval;
@@ -952,10 +952,10 @@
if (PMC_IS_NULL(lookup))
return 0;
- pmc_name = VTABLE_get_string(interp, lookup);
+ pmc_name = VTABLE_get_string(INTERP, lookup);
if (!isa_hash)
- return Parrot_str_equal(interp, SELF->vtable->whoami, pmc_name);
+ return Parrot_str_equal(INTERP, SELF->vtable->whoami, pmc_name);
return parrot_hash_exists(INTERP, isa_hash, (void *)pmc_name);
}
@@ -975,7 +975,7 @@
VTABLE INTVAL isa(STRING *_class) {
const Hash * const isa_hash = SELF->vtable->isa_hash;
if (!isa_hash)
- return Parrot_str_equal(interp, SELF->vtable->whoami, _class);
+ return Parrot_str_equal(INTERP, SELF->vtable->whoami, _class);
return parrot_hash_exists(INTERP, isa_hash, (void *)_class);
}
@@ -991,16 +991,16 @@
*/
VTABLE PMC *inspect_str(STRING *name) {
- if (Parrot_str_equal(interp, name, CONST_STRING(interp, "flags"))) {
- PMC *found = Parrot_pmc_new_init_int(interp, enum_class_Integer,
+ if (Parrot_str_equal(INTERP, name, CONST_STRING(INTERP, "flags"))) {
+ PMC *found = Parrot_pmc_new_init_int(INTERP, enum_class_Integer,
(INTVAL)PObj_get_FLAGS(SELF));
return found;
}
- else if (Parrot_str_equal(interp, name, CONST_STRING(interp, "mro"))) {
- return VTABLE_clone(interp, SELF->vtable->mro);
+ else if (Parrot_str_equal(INTERP, name, CONST_STRING(INTERP, "mro"))) {
+ return VTABLE_clone(INTERP, SELF->vtable->mro);
}
else
- Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_INVALID_OPERATION,
+ Parrot_ex_throw_from_c_args(INTERP, NULL, EXCEPTION_INVALID_OPERATION,
"Unknown introspection value '%S'", name);
}
@@ -1015,11 +1015,11 @@
*/
VTABLE PMC *inspect() {
- PMC * const metadata = Parrot_pmc_new(interp, enum_class_Hash);
- STRING * const flags_str = CONST_STRING(interp, "flags");
+ PMC * const metadata = Parrot_pmc_new(INTERP, enum_class_Hash);
+ STRING * const flags_str = CONST_STRING(INTERP, "flags");
- VTABLE_set_pmc_keyed_str(interp, metadata, flags_str,
- VTABLE_inspect_str(interp, SELF, flags_str));
+ VTABLE_set_pmc_keyed_str(INTERP, metadata, flags_str,
+ VTABLE_inspect_str(INTERP, SELF, flags_str));
return metadata;
}
@@ -1034,15 +1034,15 @@
*/
VTABLE PMC *get_class() {
- PMC * const ns = VTABLE_get_namespace(interp, SELF);
+ PMC * const ns = VTABLE_get_namespace(INTERP, SELF);
PMC *_class = PMCNULL;
if (!PMC_IS_NULL(ns))
- _class = VTABLE_get_class(interp, ns);
+ _class = VTABLE_get_class(INTERP, ns);
if (PMC_IS_NULL(_class)) {
- const INTVAL type = VTABLE_type(interp, SELF);
- return Parrot_pmc_new_init_int(interp, enum_class_PMCProxy, type);
+ const INTVAL type = VTABLE_type(INTERP, SELF);
+ return Parrot_pmc_new_init_int(INTERP, enum_class_PMCProxy, type);
}
return _class;
@@ -1087,10 +1087,10 @@
VTABLE void add_parent(PMC *parent) {
UNUSED(parent)
if (!PObj_is_class_TEST(SELF))
- Parrot_ex_throw_from_c_args(interp, NULL, 1,
+ Parrot_ex_throw_from_c_args(INTERP, NULL, 1,
"Only classes can be subclassed");
- Parrot_ex_throw_from_c_args(interp, NULL, 1,
+ Parrot_ex_throw_from_c_args(INTERP, NULL, 1,
"All classes should override add_parent");
}
@@ -1118,7 +1118,7 @@
*/
VTABLE PMC* clone() {
- return Parrot_thaw(interp, Parrot_freeze(interp, SELF));
+ return Parrot_thaw(INTERP, Parrot_freeze(INTERP, SELF));
}
/*
@@ -1178,7 +1178,7 @@
VTABLE PMC *add(PMC *value, PMC *dest) {
PMC *result = PMCNULL;
- Parrot_mmd_multi_dispatch_from_c_args(interp,
+ Parrot_mmd_multi_dispatch_from_c_args(INTERP,
"add", "PPP->P", SELF, value, dest, &result);
return result;
}
@@ -1195,7 +1195,7 @@
VTABLE PMC *add_int(INTVAL value, PMC *dest) {
PMC *result = PMCNULL;
- Parrot_mmd_multi_dispatch_from_c_args(interp,
+ Parrot_mmd_multi_dispatch_from_c_args(INTERP,
"add_int", "PIP->P", SELF, value, dest, &result);
return result;
}
@@ -1229,7 +1229,7 @@
*/
VTABLE void i_add(PMC *value) {
- Parrot_mmd_multi_dispatch_from_c_args(interp,
+ Parrot_mmd_multi_dispatch_from_c_args(INTERP,
"i_add", "PP", SELF, value);
}
@@ -1244,7 +1244,7 @@
*/
VTABLE void i_add_int(INTVAL value) {
- Parrot_mmd_multi_dispatch_from_c_args(interp,
+ Parrot_mmd_multi_dispatch_from_c_args(INTERP,
"i_add_int", "PI", SELF, value);
}
@@ -1259,7 +1259,7 @@
*/
VTABLE void i_add_float(FLOATVAL value) {
- Parrot_mmd_multi_dispatch_from_c_args(interp,
+ Parrot_mmd_multi_dispatch_from_c_args(INTERP,
"i_add_float", "PN", SELF, value);
}
@@ -1275,7 +1275,7 @@
VTABLE PMC *subtract(PMC *value, PMC *dest) {
PMC *result = PMCNULL;
- Parrot_mmd_multi_dispatch_from_c_args(interp,
+ Parrot_mmd_multi_dispatch_from_c_args(INTERP,
"subtract", "PPP->P", SELF, value, dest, &result);
return result;
}
@@ -1292,7 +1292,7 @@
VTABLE PMC *subtract_int(INTVAL value, PMC *dest) {
PMC *result = PMCNULL;
- Parrot_mmd_multi_dispatch_from_c_args(interp,
+ Parrot_mmd_multi_dispatch_from_c_args(INTERP,
"subtract_int", "PIP->P", SELF, value, dest, &result);
return result;
}
@@ -1309,7 +1309,7 @@
VTABLE PMC *subtract_float(FLOATVAL value, PMC *dest) {
PMC *result = PMCNULL;
- Parrot_mmd_multi_dispatch_from_c_args(interp,
+ Parrot_mmd_multi_dispatch_from_c_args(INTERP,
"subtract_float", "PNP->P", SELF, value, dest, &result);
return result;
}
@@ -1325,7 +1325,7 @@
*/
VTABLE void i_subtract(PMC *value) {
- Parrot_mmd_multi_dispatch_from_c_args(interp,
+ Parrot_mmd_multi_dispatch_from_c_args(INTERP,
"i_subtract", "PP", SELF, value);
}
@@ -1340,7 +1340,7 @@
*/
VTABLE void i_subtract_int(INTVAL value) {
- Parrot_mmd_multi_dispatch_from_c_args(interp,
+ Parrot_mmd_multi_dispatch_from_c_args(INTERP,
"i_subtract_int", "PI", SELF, value);
}
@@ -1355,7 +1355,7 @@
*/
VTABLE void i_subtract_float(FLOATVAL value) {
- Parrot_mmd_multi_dispatch_from_c_args(interp,
+ Parrot_mmd_multi_dispatch_from_c_args(INTERP,
"i_subtract_float", "PN", SELF, value);
}
@@ -1371,7 +1371,7 @@
VTABLE PMC *multiply(PMC *value, PMC *dest) {
PMC *result = PMCNULL;
- Parrot_mmd_multi_dispatch_from_c_args(interp,
+ Parrot_mmd_multi_dispatch_from_c_args(INTERP,
"multiply", "PPP->P", SELF, value, dest, &result);
return result;
}
@@ -1388,7 +1388,7 @@
VTABLE PMC *multiply_int(INTVAL value, PMC *dest) {
PMC *result = PMCNULL;
- Parrot_mmd_multi_dispatch_from_c_args(interp,
+ Parrot_mmd_multi_dispatch_from_c_args(INTERP,
"multiply_int", "PIP->P", SELF, value, dest, &result);
return result;
}
@@ -1405,7 +1405,7 @@
VTABLE PMC *multiply_float(FLOATVAL value, PMC *dest) {
PMC *result = PMCNULL;
- Parrot_mmd_multi_dispatch_from_c_args(interp,
+ Parrot_mmd_multi_dispatch_from_c_args(INTERP,
"multiply_float", "PNP->P", SELF, value, dest, &result);
return result;
}
@@ -1421,7 +1421,7 @@
*/
VTABLE void i_multiply(PMC *value) {
- Parrot_mmd_multi_dispatch_from_c_args(interp,
+ Parrot_mmd_multi_dispatch_from_c_args(INTERP,
"i_multiply", "PP", SELF, value);
}
@@ -1436,7 +1436,7 @@
*/
VTABLE void i_multiply_int(INTVAL value) {
- Parrot_mmd_multi_dispatch_from_c_args(interp,
+ Parrot_mmd_multi_dispatch_from_c_args(INTERP,
"i_multiply_int", "PI", SELF, value);
}
@@ -1451,7 +1451,7 @@
*/
VTABLE void i_multiply_float(FLOATVAL value) {
- Parrot_mmd_multi_dispatch_from_c_args(interp,
+ Parrot_mmd_multi_dispatch_from_c_args(INTERP,
"i_multiply_float", "PN", SELF, value);
}
@@ -1467,7 +1467,7 @@
VTABLE PMC *divide(PMC *value, PMC *dest) {
PMC *result = PMCNULL;
- Parrot_mmd_multi_dispatch_from_c_args(interp,
+ Parrot_mmd_multi_dispatch_from_c_args(INTERP,
"divide", "PPP->P", SELF, value, dest, &result);
return result;
}
@@ -1484,7 +1484,7 @@
VTABLE PMC *divide_int(INTVAL value, PMC *dest) {
PMC *result = PMCNULL;
- Parrot_mmd_multi_dispatch_from_c_args(interp,
+ Parrot_mmd_multi_dispatch_from_c_args(INTERP,
"divide_int", "PIP->P", SELF, value, dest, &result);
return result;
}
@@ -1501,7 +1501,7 @@
VTABLE PMC *divide_float(FLOATVAL value, PMC *dest) {
PMC *result = PMCNULL;
- Parrot_mmd_multi_dispatch_from_c_args(interp,
+ Parrot_mmd_multi_dispatch_from_c_args(INTERP,
"divide_float", "PNP->P", SELF, value, dest, &result);
return result;
}
@@ -1517,7 +1517,7 @@
*/
VTABLE void i_divide(PMC *value) {
- Parrot_mmd_multi_dispatch_from_c_args(interp,
+ Parrot_mmd_multi_dispatch_from_c_args(INTERP,
"i_divide", "PP", SELF, value);
}
@@ -1532,7 +1532,7 @@
*/
VTABLE void i_divide_int(INTVAL value) {
- Parrot_mmd_multi_dispatch_from_c_args(interp,
+ Parrot_mmd_multi_dispatch_from_c_args(INTERP,
"i_divide_int", "PI", SELF, value);
}
@@ -1547,7 +1547,7 @@
*/
VTABLE void i_divide_float(FLOATVAL value) {
- Parrot_mmd_multi_dispatch_from_c_args(interp,
+ Parrot_mmd_multi_dispatch_from_c_args(INTERP,
"i_divide_float", "PN", SELF, value);
}
@@ -1563,7 +1563,7 @@
VTABLE PMC *floor_divide(PMC *value, PMC *dest) {
PMC *result = PMCNULL;
- Parrot_mmd_multi_dispatch_from_c_args(interp,
+ Parrot_mmd_multi_dispatch_from_c_args(INTERP,
"floor_divide", "PPP->P", SELF, value, dest, &result);
return result;
}
@@ -1580,7 +1580,7 @@
VTABLE PMC *floor_divide_int(INTVAL value, PMC *dest) {
PMC *result = PMCNULL;
- Parrot_mmd_multi_dispatch_from_c_args(interp,
+ Parrot_mmd_multi_dispatch_from_c_args(INTERP,
"floor_divide_int", "PIP->P", SELF, value, dest, &result);
return result;
}
@@ -1597,7 +1597,7 @@
VTABLE PMC *floor_divide_float(FLOATVAL value, PMC *dest) {
PMC *result = PMCNULL;
- Parrot_mmd_multi_dispatch_from_c_args(interp,
+ Parrot_mmd_multi_dispatch_from_c_args(INTERP,
"floor_divide_float", "PNP->P", SELF, value, dest, &result);
return result;
}
@@ -1613,7 +1613,7 @@
*/
VTABLE void i_floor_divide(PMC *value) {
- Parrot_mmd_multi_dispatch_from_c_args(interp,
+ Parrot_mmd_multi_dispatch_from_c_args(INTERP,
"i_floor_divide", "PP", SELF, value);
}
@@ -1628,7 +1628,7 @@
*/
VTABLE void i_floor_divide_int(INTVAL value) {
- Parrot_mmd_multi_dispatch_from_c_args(interp,
+ Parrot_mmd_multi_dispatch_from_c_args(INTERP,
"i_floor_divide_int", "PI", SELF, value);
}
@@ -1643,7 +1643,7 @@
*/
VTABLE void i_floor_divide_float(FLOATVAL value) {
- Parrot_mmd_multi_dispatch_from_c_args(interp,
+ Parrot_mmd_multi_dispatch_from_c_args(INTERP,
"i_floor_divide_float", "PN", SELF, value);
}
@@ -1659,7 +1659,7 @@
VTABLE PMC *modulus(PMC *value, PMC *dest) {
PMC *result = PMCNULL;
- Parrot_mmd_multi_dispatch_from_c_args(interp,
+ Parrot_mmd_multi_dispatch_from_c_args(INTERP,
"modulus", "PPP->P", SELF, value, dest, &result);
return result;
}
@@ -1676,7 +1676,7 @@
VTABLE PMC *modulus_int(INTVAL value, PMC *dest) {
PMC *result = PMCNULL;
- Parrot_mmd_multi_dispatch_from_c_args(interp,
+ Parrot_mmd_multi_dispatch_from_c_args(INTERP,
"modulus_int", "PIP->P", SELF, value, dest, &result);
return result;
}
@@ -1693,7 +1693,7 @@
VTABLE PMC *modulus_float(FLOATVAL value, PMC *dest) {
PMC *result = PMCNULL;
- Parrot_mmd_multi_dispatch_from_c_args(interp,
+ Parrot_mmd_multi_dispatch_from_c_args(INTERP,
"modulus_float", "PNP->P", SELF, value, dest, &result);
return result;
}
@@ -1709,7 +1709,7 @@
*/
VTABLE void i_modulus(PMC *value) {
- Parrot_mmd_multi_dispatch_from_c_args(interp,
+ Parrot_mmd_multi_dispatch_from_c_args(INTERP,
"i_modulus", "PP", SELF, value);
}
@@ -1724,7 +1724,7 @@
*/
VTABLE void i_modulus_int(INTVAL value) {
- Parrot_mmd_multi_dispatch_from_c_args(interp,
+ Parrot_mmd_multi_dispatch_from_c_args(INTERP,
"i_modulus_int", "PI", SELF, value);
}
@@ -1739,7 +1739,7 @@
*/
VTABLE void i_modulus_float(FLOATVAL value) {
- Parrot_mmd_multi_dispatch_from_c_args(interp,
+ Parrot_mmd_multi_dispatch_from_c_args(INTERP,
"i_modulus_float", "PN", SELF, value);
}
@@ -1761,7 +1761,7 @@
if (SELF == value)
return 0;
- Parrot_mmd_multi_dispatch_from_c_args(interp,
+ Parrot_mmd_multi_dispatch_from_c_args(INTERP,
"cmp", "PP->I", SELF, value, &retval);
return retval;
@@ -1779,7 +1779,7 @@
VTABLE INTVAL cmp_num(PMC *value) {
INTVAL retval;
- Parrot_mmd_multi_dispatch_from_c_args(interp,
+ Parrot_mmd_multi_dispatch_from_c_args(INTERP,
"cmp_num", "PP->I", SELF, value, &retval);
return retval;
@@ -1797,7 +1797,7 @@
VTABLE INTVAL cmp_string(PMC *value) {
INTVAL retval;
- Parrot_mmd_multi_dispatch_from_c_args(interp,
+ Parrot_mmd_multi_dispatch_from_c_args(INTERP,
"cmp_string", "PP->I", SELF, value, &retval);
return retval;
@@ -1821,7 +1821,7 @@
if (SELF == value)
return NULL;
- Parrot_mmd_multi_dispatch_from_c_args(interp,
+ Parrot_mmd_multi_dispatch_from_c_args(INTERP,
"cmp_pmc", "PP->P", SELF, value, &retval);
return retval;
@@ -1838,7 +1838,7 @@
VTABLE PMC *logical_or(PMC *value, PMC *dest) {
PMC *result = PMCNULL;
- Parrot_mmd_multi_dispatch_from_c_args(interp,
+ Parrot_mmd_multi_dispatch_from_c_args(INTERP,
"logical_or", "PPP->P", SELF, value, dest, &result);
return result;
}
@@ -1855,7 +1855,7 @@
VTABLE PMC *logical_and(PMC *value, PMC *dest) {
PMC *result = PMCNULL;
- Parrot_mmd_multi_dispatch_from_c_args(interp,
+ Parrot_mmd_multi_dispatch_from_c_args(INTERP,
"logical_and", "PPP->P", SELF, value, dest, &result);
return result;
}
@@ -1872,7 +1872,7 @@
VTABLE PMC *logical_xor(PMC *value, PMC *dest) {
PMC *result = PMCNULL;
- Parrot_mmd_multi_dispatch_from_c_args(interp,
+ Parrot_mmd_multi_dispatch_from_c_args(INTERP,
"logical_xor", "PPP->P", SELF, value, dest, &result);
return result;
}
@@ -1889,7 +1889,7 @@
VTABLE PMC *concatenate(PMC *value, PMC *dest) {
PMC *result = PMCNULL;
- Parrot_mmd_multi_dispatch_from_c_args(interp,
+ Parrot_mmd_multi_dispatch_from_c_args(INTERP,
"concatenate", "PPP->P", SELF, value, dest, &result);
return result;
}
@@ -1906,7 +1906,7 @@
VTABLE PMC *concatenate_str(STRING *value, PMC *dest) {
PMC *result = PMCNULL;
- Parrot_mmd_multi_dispatch_from_c_args(interp,
+ Parrot_mmd_multi_dispatch_from_c_args(INTERP,
"concatenate_str", "PSP->P", SELF, value, dest, &result);
return result;
}
@@ -1922,7 +1922,7 @@
*/
VTABLE void i_concatenate(PMC *value) {
- Parrot_mmd_multi_dispatch_from_c_args(interp,
+ Parrot_mmd_multi_dispatch_from_c_args(INTERP,
"i_concatenate", "PP", SELF, value);
}
@@ -1937,7 +1937,7 @@
*/
VTABLE void i_concatenate_str(STRING *value) {
- Parrot_mmd_multi_dispatch_from_c_args(interp,
+ Parrot_mmd_multi_dispatch_from_c_args(INTERP,
"i_concatenate_str", "PS", SELF, value);
}
@@ -1953,7 +1953,7 @@
VTABLE PMC *repeat(PMC *value, PMC *dest) {
PMC *result = PMCNULL;
- Parrot_mmd_multi_dispatch_from_c_args(interp,
+ Parrot_mmd_multi_dispatch_from_c_args(INTERP,
"repeat", "PPP->P", SELF, value, dest, &result);
return result;
}
@@ -1970,7 +1970,7 @@
VTABLE PMC *repeat_int(INTVAL value, PMC *dest) {
PMC *result = PMCNULL;
- Parrot_mmd_multi_dispatch_from_c_args(interp,
+ Parrot_mmd_multi_dispatch_from_c_args(INTERP,
"repeat_int", "PIP->P", SELF, value, dest, &result);
return result;
}
@@ -1986,7 +1986,7 @@
*/
VTABLE void i_repeat(PMC *value) {
- Parrot_mmd_multi_dispatch_from_c_args(interp,
+ Parrot_mmd_multi_dispatch_from_c_args(INTERP,
"i_repeat", "PP", SELF, value);
}
@@ -2001,7 +2001,7 @@
*/
VTABLE void i_repeat_int(INTVAL value) {
- Parrot_mmd_multi_dispatch_from_c_args(interp,
+ Parrot_mmd_multi_dispatch_from_c_args(INTERP,
"i_repeat_int", "PI", SELF, value);
}
}
Modified: branches/codestring/src/pmc/env.pmc
==============================================================================
--- branches/codestring/src/pmc/env.pmc Wed May 5 23:52:59 2010 (r46321)
+++ branches/codestring/src/pmc/env.pmc Thu May 6 00:31:08 2010 (r46322)
@@ -154,15 +154,15 @@
VTABLE STRING *get_string_keyed_str(STRING *key) {
if (!STRING_IS_EMPTY(key)) {
- const char * const val = Parrot_getenv(interp, key);
+ const char * const val = Parrot_getenv(INTERP, key);
if (val) {
- STRING * const retval = Parrot_str_new(interp, val, 0);
+ STRING * const retval = Parrot_str_new(INTERP, val, 0);
return retval;
}
}
- return string_from_literal(interp, "");
+ return string_from_literal(INTERP, "");
}
VTABLE STRING *get_string_keyed(PMC *key) {
@@ -183,12 +183,12 @@
VTABLE STRING *get_string_keyed_int(INTVAL pos) {
if (pos < 0 || pos >= SELF.elements()) {
- return string_from_literal(interp, "");
+ return string_from_literal(INTERP, "");
}
else {
const char * const envp = environ[pos];
const char * const p = strchr(envp, '=');
- return Parrot_str_new(interp, envp, (UINTVAL)(p - envp));
+ return Parrot_str_new(INTERP, envp, (UINTVAL)(p - envp));
}
}
@@ -274,7 +274,7 @@
STRING * const keyname = VTABLE_get_string(INTERP, pmckey);
if (!STRING_IS_EMPTY(keyname)) {
- const char * const val = Parrot_getenv(interp, keyname);
+ const char * const val = Parrot_getenv(INTERP, keyname);
if (val != NULL) {
return 1;
Modified: branches/codestring/src/pmc/eval.pmc
==============================================================================
--- branches/codestring/src/pmc/eval.pmc Wed May 5 23:52:59 2010 (r46321)
+++ branches/codestring/src/pmc/eval.pmc Thu May 6 00:31:08 2010 (r46322)
@@ -224,8 +224,8 @@
}
/* XXX Quick and dirty fix for TT #995 */
- if ((struct PackFile *)cur_cs == interp->initial_pf
- || cur_cs == interp->code) {
+ if ((struct PackFile *)cur_cs == INTERP->initial_pf
+ || cur_cs == INTERP->code) {
SUPER();
return;
}
@@ -404,7 +404,7 @@
/*
* TT #1292 this isn't ok - it seems that the packfile
- * gets attached to interp->code and is
+ * gets attached to INTERP->code and is
* destroyed again during interpreter destruction
*/
/* PackFile_destroy(INTERP, pf); */
@@ -416,7 +416,7 @@
PackFile_ByteCode *seg;
PackFile_FixupTable *ft;
- PMC_get_sub(interp, SELF, sub);
+ PMC_get_sub(INTERP, SELF, sub);
seg = sub->seg;
if (!seg)
Modified: branches/codestring/src/pmc/eventhandler.pmc
==============================================================================
--- branches/codestring/src/pmc/eventhandler.pmc Wed May 5 23:52:59 2010 (r46321)
+++ branches/codestring/src/pmc/eventhandler.pmc Thu May 6 00:31:08 2010 (r46322)
@@ -217,7 +217,7 @@
Parrot_EventHandler_attributes * const e = PARROT_EVENTHANDLER(SELF);
PMC *value = PMCNULL;
- if (Parrot_str_equal(interp, name, CONST_STRING(interp, "code"))) {
+ if (Parrot_str_equal(INTERP, name, CONST_STRING(INTERP, "code"))) {
value = e->code;
}
@@ -274,15 +274,15 @@
METHOD can_handle(PMC *event) {
if (event->vtable->base_type == enum_class_Task) {
- PMC * const type = VTABLE_get_attr_str(interp, event, CONST_STRING(interp, "type"));
- STRING * const type_str = VTABLE_get_string(interp, type);
+ PMC * const type = VTABLE_get_attr_str(INTERP, event, CONST_STRING(INTERP, "type"));
+ STRING * const type_str = VTABLE_get_string(INTERP, type);
- if (Parrot_str_equal(interp, type_str, CONST_STRING(interp, "event"))) {
+ if (Parrot_str_equal(INTERP, type_str, CONST_STRING(INTERP, "event"))) {
Parrot_EventHandler_attributes * const handler_struct = PARROT_EVENTHANDLER(SELF);
- PMC * const subtype = VTABLE_get_attr_str(interp, event, CONST_STRING(interp, "subtype"));
- STRING * const subtype_str = VTABLE_get_string(interp, subtype);
+ PMC * const subtype = VTABLE_get_attr_str(INTERP, event, CONST_STRING(INTERP, "subtype"));
+ STRING * const subtype_str = VTABLE_get_string(INTERP, subtype);
- if (Parrot_str_equal(interp, subtype_str, handler_struct->type)) {
+ if (Parrot_str_equal(INTERP, subtype_str, handler_struct->type)) {
RETURN(INTVAL 1);
}
}
Modified: branches/codestring/src/pmc/exception.pmc
==============================================================================
--- branches/codestring/src/pmc/exception.pmc Wed May 5 23:52:59 2010 (r46321)
+++ branches/codestring/src/pmc/exception.pmc Thu May 6 00:31:08 2010 (r46322)
@@ -113,17 +113,17 @@
INTVAL severity_val;
STRING *message_val;
- const INTVAL ishash = VTABLE_isa(interp, values, CONST_STRING(interp, 'Hash'));
+ const INTVAL ishash = VTABLE_isa(INTERP, values, CONST_STRING(INTERP, 'Hash'));
if (ishash) {
- STRING * const severity = CONST_STRING(interp, "severity");
- STRING * const message = CONST_STRING(interp, "message");
- severity_val = VTABLE_get_integer_keyed_str(interp, values, severity);
- message_val = VTABLE_get_string_keyed_str(interp, values, message);
+ STRING * const severity = CONST_STRING(INTERP, "severity");
+ STRING * const message = CONST_STRING(INTERP, "message");
+ severity_val = VTABLE_get_integer_keyed_str(INTERP, values, severity);
+ message_val = VTABLE_get_string_keyed_str(INTERP, values, message);
}
else {
severity_val = EXCEPT_error;
- message_val = VTABLE_get_string(interp, values);
+ message_val = VTABLE_get_string(INTERP, values);
}
/* Set flags for custom GC mark. */
@@ -153,13 +153,13 @@
VTABLE void mark() {
Parrot_Exception_attributes * const core_struct = PARROT_EXCEPTION(SELF);
- Parrot_gc_mark_STRING_alive(interp, core_struct->message);
- Parrot_gc_mark_PMC_alive(interp, core_struct->payload);
- Parrot_gc_mark_PMC_alive(interp, core_struct->resume);
- Parrot_gc_mark_PMC_alive(interp, core_struct->backtrace);
- Parrot_gc_mark_PMC_alive(interp, core_struct->handler_iter);
- Parrot_gc_mark_PMC_alive(interp, core_struct->handler_ctx);
- Parrot_gc_mark_PMC_alive(interp, core_struct->thrower);
+ Parrot_gc_mark_STRING_alive(INTERP, core_struct->message);
+ Parrot_gc_mark_PMC_alive(INTERP, core_struct->payload);
+ Parrot_gc_mark_PMC_alive(INTERP, core_struct->resume);
+ Parrot_gc_mark_PMC_alive(INTERP, core_struct->backtrace);
+ Parrot_gc_mark_PMC_alive(INTERP, core_struct->handler_iter);
+ Parrot_gc_mark_PMC_alive(INTERP, core_struct->handler_ctx);
+ Parrot_gc_mark_PMC_alive(INTERP, core_struct->thrower);
}
/*
@@ -188,9 +188,9 @@
VTABLE STRING *get_string() {
STRING *message;
- GET_ATTR_message(interp, SELF, message);
+ GET_ATTR_message(INTERP, SELF, message);
if (STRING_IS_NULL(message))
- message = CONST_STRING(interp, "");
+ message = CONST_STRING(INTERP, "");
return message;
}
@@ -229,7 +229,7 @@
}
else {
/* If unknown attribute name, throw an exception. */
- Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_ATTRIB_NOT_FOUND,
+ Parrot_ex_throw_from_c_args(INTERP, NULL, EXCEPTION_ATTRIB_NOT_FOUND,
"No such string attribute '%S'", name);
}
@@ -251,20 +251,20 @@
INTVAL result = 0;
if (Parrot_str_equal(INTERP, name, CONST_STRING(INTERP, "type"))) {
- GET_ATTR_type(interp, SELF, result);
+ GET_ATTR_type(INTERP, SELF, result);
}
else if (Parrot_str_equal(INTERP, name, CONST_STRING(INTERP, "severity"))) {
- GET_ATTR_severity(interp, SELF, result);
+ GET_ATTR_severity(INTERP, SELF, result);
}
else if (Parrot_str_equal(INTERP, name, CONST_STRING(INTERP, "exit_code"))) {
- GET_ATTR_exit_code(interp, SELF, result);
+ GET_ATTR_exit_code(INTERP, SELF, result);
}
else if (Parrot_str_equal(INTERP, name, CONST_STRING(INTERP, "handled"))) {
- GET_ATTR_handled(interp, SELF, result);
+ GET_ATTR_handled(INTERP, SELF, result);
}
else {
/* If unknown attribute name, throw an exception. */
- Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_ATTRIB_NOT_FOUND,
+ Parrot_ex_throw_from_c_args(INTERP, NULL, EXCEPTION_ATTRIB_NOT_FOUND,
"No such integer attribute '%S'", name);
}
@@ -285,20 +285,20 @@
INTVAL result = 0;
if (Parrot_str_equal(INTERP, key, CONST_STRING(INTERP, "type"))) {
- GET_ATTR_type(interp, SELF, result);
+ GET_ATTR_type(INTERP, SELF, result);
}
else if (Parrot_str_equal(INTERP, key, CONST_STRING(INTERP, "severity"))) {
- GET_ATTR_severity(interp, SELF, result);
+ GET_ATTR_severity(INTERP, SELF, result);
}
else if (Parrot_str_equal(INTERP, key, CONST_STRING(INTERP, "exit_code"))) {
- GET_ATTR_exit_code(interp, SELF, result);
+ GET_ATTR_exit_code(INTERP, SELF, result);
}
else if (Parrot_str_equal(INTERP, key, CONST_STRING(INTERP, "handled"))) {
- GET_ATTR_handled(interp, SELF, result);
+ GET_ATTR_handled(INTERP, SELF, result);
}
else {
/* If unknown attribute name, throw an exception. */
- Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_ATTRIB_NOT_FOUND,
+ Parrot_ex_throw_from_c_args(INTERP, NULL, EXCEPTION_ATTRIB_NOT_FOUND,
"No such integer attribute '%S'", key);
}
@@ -332,7 +332,7 @@
*/
VTABLE void set_string_native(STRING *value) {
- SET_ATTR_message(interp, SELF, value);
+ SET_ATTR_message(INTERP, SELF, value);
}
@@ -347,7 +347,7 @@
*/
VTABLE void set_integer_native(INTVAL value) {
- SET_ATTR_id(interp, SELF, value);
+ SET_ATTR_id(INTERP, SELF, value);
}
/*
@@ -361,7 +361,7 @@
*/
VTABLE void set_number_native(FLOATVAL value) {
- SET_ATTR_birthtime(interp, SELF, value);
+ SET_ATTR_birthtime(INTERP, SELF, value);
}
@@ -383,7 +383,7 @@
}
else {
/* If unknown attribute name, throw an exception. */
- Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_ATTRIB_NOT_FOUND,
+ Parrot_ex_throw_from_c_args(INTERP, NULL, EXCEPTION_ATTRIB_NOT_FOUND,
"No such string attribute '%S'", name);
}
}
@@ -402,20 +402,20 @@
STRING * const name = VTABLE_get_string(INTERP, key);
if (Parrot_str_equal(INTERP, name, CONST_STRING(INTERP, "type"))) {
- SET_ATTR_type(interp, SELF, value);
+ SET_ATTR_type(INTERP, SELF, value);
}
else if (Parrot_str_equal(INTERP, name, CONST_STRING(INTERP, "severity"))) {
- SET_ATTR_severity(interp, SELF, value);
+ SET_ATTR_severity(INTERP, SELF, value);
}
else if (Parrot_str_equal(INTERP, name, CONST_STRING(INTERP, "exit_code"))) {
- SET_ATTR_exit_code(interp, SELF, value);
+ SET_ATTR_exit_code(INTERP, SELF, value);
}
else if (Parrot_str_equal(INTERP, name, CONST_STRING(INTERP, "handled"))) {
- SET_ATTR_handled(interp, SELF, value);
+ SET_ATTR_handled(INTERP, SELF, value);
}
else {
/* If unknown attribute name, throw an exception. */
- Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_ATTRIB_NOT_FOUND,
+ Parrot_ex_throw_from_c_args(INTERP, NULL, EXCEPTION_ATTRIB_NOT_FOUND,
"No such integer attribute '%S'", name);
}
}
@@ -432,20 +432,20 @@
VTABLE void set_integer_keyed_str(STRING *key, INTVAL value) {
if (Parrot_str_equal(INTERP, key, CONST_STRING(INTERP, "type"))) {
- SET_ATTR_type(interp, SELF, value);
+ SET_ATTR_type(INTERP, SELF, value);
}
else if (Parrot_str_equal(INTERP, key, CONST_STRING(INTERP, "severity"))) {
- SET_ATTR_severity(interp, SELF, value);
+ SET_ATTR_severity(INTERP, SELF, value);
}
else if (Parrot_str_equal(INTERP, key, CONST_STRING(INTERP, "exit_code"))) {
- SET_ATTR_exit_code(interp, SELF, value);
+ SET_ATTR_exit_code(INTERP, SELF, value);
}
else if (Parrot_str_equal(INTERP, key, CONST_STRING(INTERP, "handled"))) {
- SET_ATTR_handled(interp, SELF, value);
+ SET_ATTR_handled(INTERP, SELF, value);
}
else {
/* If unknown attribute name, throw an exception. */
- Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_ATTRIB_NOT_FOUND,
+ Parrot_ex_throw_from_c_args(INTERP, NULL, EXCEPTION_ATTRIB_NOT_FOUND,
"No such integer attribute '%S'", key);
}
}
@@ -513,14 +513,14 @@
if (value->vtable->base_type == SELF->vtable->base_type
&& VTABLE_isa(INTERP, value, exception_str)) {
INTVAL self_compare, value_compare;
- GET_ATTR_type(interp, SELF, self_compare);
- GET_ATTR_type(interp, value, value_compare);
+ GET_ATTR_type(INTERP, SELF, self_compare);
+ GET_ATTR_type(INTERP, value, value_compare);
if (self_compare == value_compare) {
- GET_ATTR_severity(interp, SELF, self_compare);
- GET_ATTR_severity(interp, value, value_compare);
+ GET_ATTR_severity(INTERP, SELF, self_compare);
+ GET_ATTR_severity(INTERP, value, value_compare);
if (self_compare == value_compare) {
- GET_ATTR_exit_code(interp, SELF, self_compare);
- GET_ATTR_exit_code(interp, value, value_compare);
+ GET_ATTR_exit_code(INTERP, SELF, self_compare);
+ GET_ATTR_exit_code(INTERP, value, value_compare);
if (self_compare == value_compare)
return 1;
}
@@ -544,44 +544,44 @@
if (Parrot_str_equal(INTERP, name, CONST_STRING(INTERP, "type"))) {
INTVAL type;
- GET_ATTR_type(interp, SELF, type);
- value = Parrot_pmc_new_init_int(interp, enum_class_Integer, type);
+ GET_ATTR_type(INTERP, SELF, type);
+ value = Parrot_pmc_new_init_int(INTERP, enum_class_Integer, type);
}
else if (Parrot_str_equal(INTERP, name, CONST_STRING(INTERP, "severity"))) {
INTVAL severity;
- GET_ATTR_severity(interp, SELF, severity);
- value = Parrot_pmc_new_init_int(interp, enum_class_Integer, severity);
+ GET_ATTR_severity(INTERP, SELF, severity);
+ value = Parrot_pmc_new_init_int(INTERP, enum_class_Integer, severity);
}
else if (Parrot_str_equal(INTERP, name, CONST_STRING(INTERP, "exit_code"))) {
INTVAL exit_code;
- GET_ATTR_exit_code(interp, SELF, exit_code);
- value = Parrot_pmc_new_init_int(interp, enum_class_Integer, exit_code);
+ GET_ATTR_exit_code(INTERP, SELF, exit_code);
+ value = Parrot_pmc_new_init_int(INTERP, enum_class_Integer, exit_code);
}
else if (Parrot_str_equal(INTERP, name, CONST_STRING(INTERP, "handled"))) {
INTVAL handled;
- GET_ATTR_handled(interp, SELF, handled);
- value = Parrot_pmc_new_init_int(interp, enum_class_Integer, handled);
+ GET_ATTR_handled(INTERP, SELF, handled);
+ value = Parrot_pmc_new_init_int(INTERP, enum_class_Integer, handled);
}
else if (Parrot_str_equal(INTERP, name, CONST_STRING(INTERP, "message"))) {
STRING *message = SELF.get_string();
- value = Parrot_pmc_new(interp, enum_class_String);
- VTABLE_set_string_native(interp, value, message);
+ value = Parrot_pmc_new(INTERP, enum_class_String);
+ VTABLE_set_string_native(INTERP, value, message);
}
else if (Parrot_str_equal(INTERP, name, CONST_STRING(INTERP, "payload"))) {
- GET_ATTR_payload(interp, SELF, value);
+ GET_ATTR_payload(INTERP, SELF, value);
}
else if (Parrot_str_equal(INTERP, name, CONST_STRING(INTERP, "resume"))) {
- GET_ATTR_resume(interp, SELF, value);
+ GET_ATTR_resume(INTERP, SELF, value);
}
else if (Parrot_str_equal(INTERP, name, CONST_STRING(INTERP, "backtrace"))) {
- GET_ATTR_backtrace(interp, SELF, value);
+ GET_ATTR_backtrace(INTERP, SELF, value);
}
else if (Parrot_str_equal(INTERP, name, CONST_STRING(INTERP, "handler_iter"))) {
- GET_ATTR_handler_iter(interp, SELF, value);
+ GET_ATTR_handler_iter(INTERP, SELF, value);
}
else {
/* If unknown attribute name, throw an exception. */
- Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_ATTRIB_NOT_FOUND,
+ Parrot_ex_throw_from_c_args(INTERP, NULL, EXCEPTION_ATTRIB_NOT_FOUND,
"No such attribute '%S'", name);
}
@@ -600,49 +600,49 @@
VTABLE void set_attr_str(STRING *name, PMC *value) {
if (Parrot_str_equal(INTERP, name, CONST_STRING(INTERP, "type"))) {
- const INTVAL type = VTABLE_get_integer(interp, value);
- SET_ATTR_type(interp, SELF, type);
+ const INTVAL type = VTABLE_get_integer(INTERP, value);
+ SET_ATTR_type(INTERP, SELF, type);
}
else if (Parrot_str_equal(INTERP, name, CONST_STRING(INTERP, "severity"))) {
- const INTVAL severity = VTABLE_get_integer(interp, value);
- SET_ATTR_severity(interp, SELF, severity);
+ const INTVAL severity = VTABLE_get_integer(INTERP, value);
+ SET_ATTR_severity(INTERP, SELF, severity);
}
else if (Parrot_str_equal(INTERP, name, CONST_STRING(INTERP, "exit_code"))) {
- const INTVAL exit_code = VTABLE_get_integer(interp, value);
- SET_ATTR_exit_code(interp, SELF, exit_code);
+ const INTVAL exit_code = VTABLE_get_integer(INTERP, value);
+ SET_ATTR_exit_code(INTERP, SELF, exit_code);
}
else if (Parrot_str_equal(INTERP, name, CONST_STRING(INTERP, "handled"))) {
- const INTVAL handled = VTABLE_get_integer(interp, value);
- SET_ATTR_handled(interp, SELF, handled);
+ const INTVAL handled = VTABLE_get_integer(INTERP, value);
+ SET_ATTR_handled(INTERP, SELF, handled);
}
else if (Parrot_str_equal(INTERP, name, CONST_STRING(INTERP, "message"))) {
- STRING * const message = VTABLE_get_string(interp, value);
+ STRING * const message = VTABLE_get_string(INTERP, value);
SELF.set_string_native(message);
}
else if (Parrot_str_equal(INTERP, name, CONST_STRING(INTERP, "payload"))) {
- SET_ATTR_payload(interp, SELF, value);
+ SET_ATTR_payload(INTERP, SELF, value);
}
else if (Parrot_str_equal(INTERP, name, CONST_STRING(INTERP, "resume"))) {
- SET_ATTR_resume(interp, SELF, value);
+ SET_ATTR_resume(INTERP, SELF, value);
}
else if (Parrot_str_equal(INTERP, name, CONST_STRING(INTERP, "backtrace"))) {
- SET_ATTR_backtrace(interp, SELF, value);
+ SET_ATTR_backtrace(INTERP, SELF, value);
}
else if (Parrot_str_equal(INTERP, name, CONST_STRING(INTERP, "handler_iter"))) {
- SET_ATTR_handler_iter(interp, SELF, value);
+ SET_ATTR_handler_iter(INTERP, SELF, value);
}
else if (Parrot_str_equal(INTERP, name, CONST_STRING(INTERP, "thrower"))) {
/* Ensure it's a ret cont, and extract the from_ctx.
* XXX TT #596 - when we have Context PMCs, just take and set that. */
- if (!PMC_IS_NULL(value) && VTABLE_isa(interp, value, CONST_STRING(interp, "Continuation"))) {
+ if (!PMC_IS_NULL(value) && VTABLE_isa(INTERP, value, CONST_STRING(INTERP, "Continuation"))) {
PMC * const ctx = PMC_cont(value)->from_ctx;
if (!PMC_IS_NULL(ctx))
- SET_ATTR_thrower(interp, SELF, ctx);
+ SET_ATTR_thrower(INTERP, SELF, ctx);
}
}
else {
/* If unknown attribute name, throw an exception. */
- Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_ATTRIB_NOT_FOUND,
+ Parrot_ex_throw_from_c_args(INTERP, NULL, EXCEPTION_ATTRIB_NOT_FOUND,
"No such attribute '%S'", name);
}
@@ -698,18 +698,18 @@
PMC *result = PMCNULL;
/* Get resume continuation, to find location we failed at. */
- GET_ATTR_resume(interp, SELF, resume);
+ GET_ATTR_resume(INTERP, SELF, resume);
if (!PMC_IS_NULL(resume)) {
const Parrot_Continuation_attributes * const cont = PARROT_CONTINUATION(resume);
if (cont->seg != NULL && cont->seg->annotations != NULL)
- result = PackFile_Annotations_lookup(interp, cont->seg->annotations,
+ result = PackFile_Annotations_lookup(INTERP, cont->seg->annotations,
cont->address - cont->seg->base.data, name);
}
/* If we didn't have a key specified and we found no annotations to
* return, should return an empty hash. */
if (!have_name && PMC_IS_NULL(result))
- result = Parrot_pmc_new(interp, enum_class_Hash);
+ result = Parrot_pmc_new(INTERP, enum_class_Hash);
RETURN(PMC *result);
}
@@ -735,17 +735,17 @@
PMC *resume;
/* Get starting context, then loop over them. */
- GET_ATTR_resume(interp, SELF, resume);
+ GET_ATTR_resume(INTERP, SELF, resume);
if (!PMC_IS_NULL(resume)) {
/* We have a resume continuation, so we can get the address from that. */
const Parrot_Continuation_attributes * const cont = PARROT_CONTINUATION(resume);
- Parrot_pcc_invoke_method_from_c_args(INTERP, cont->to_ctx, CONST_STRING(interp, "backtrace"), "P->P", resume, &result);
+ Parrot_pcc_invoke_method_from_c_args(INTERP, cont->to_ctx, CONST_STRING(INTERP, "backtrace"), "P->P", resume, &result);
}
else {
PMC *cur_ctx;
/* No return continuation. Assuming we're being called */
- GET_ATTR_thrower(interp, SELF, cur_ctx);
- Parrot_pcc_invoke_method_from_c_args(INTERP, CURRENT_CONTEXT(INTERP), CONST_STRING(interp, "backtrace"), "->P", &result);
+ GET_ATTR_thrower(INTERP, SELF, cur_ctx);
+ Parrot_pcc_invoke_method_from_c_args(INTERP, CURRENT_CONTEXT(INTERP), CONST_STRING(INTERP, "backtrace"), "->P", &result);
}
RETURN(PMC *result);
Modified: branches/codestring/src/pmc/exceptionhandler.pmc
==============================================================================
--- branches/codestring/src/pmc/exceptionhandler.pmc Wed May 5 23:52:59 2010 (r46321)
+++ branches/codestring/src/pmc/exceptionhandler.pmc Thu May 6 00:31:08 2010 (r46322)
@@ -72,8 +72,8 @@
VTABLE void mark() {
Parrot_ExceptionHandler_attributes * const attrs =
PARROT_EXCEPTIONHANDLER(SELF);
- Parrot_gc_mark_PMC_alive(interp, attrs->handled_types);
- Parrot_gc_mark_PMC_alive(interp, attrs->handled_types_except);
+ Parrot_gc_mark_PMC_alive(INTERP, attrs->handled_types);
+ Parrot_gc_mark_PMC_alive(INTERP, attrs->handled_types_except);
SUPER();
}
@@ -125,8 +125,8 @@
VTABLE opcode_t *invoke(void *next) {
opcode_t * const pc = PARROT_CONTINUATION(SELF)->address;
- Parrot_continuation_check(interp, SELF);
- Parrot_continuation_rewind_environment(interp, SELF);
+ Parrot_continuation_check(INTERP, SELF);
+ Parrot_continuation_rewind_environment(INTERP, SELF);
/* switch code segment if needed */
if (INTERP->code != PARROT_CONTINUATION(SELF)->seg)
@@ -159,10 +159,10 @@
*/
METHOD can_handle(PMC *exception) {
- STRING * const sev = CONST_STRING(interp, "severity");
- STRING * const ex_str = CONST_STRING(interp, "Exception");
+ STRING * const sev = CONST_STRING(INTERP, "severity");
+ STRING * const ex_str = CONST_STRING(INTERP, "Exception");
- INTVAL severity = VTABLE_get_integer_keyed_str(interp, exception, sev);
+ INTVAL severity = VTABLE_get_integer_keyed_str(INTERP, exception, sev);
if (exception->vtable->base_type == enum_class_Exception
|| VTABLE_isa(INTERP, exception, ex_str)) {
@@ -181,12 +181,12 @@
RETURN(INTVAL 0);
}
if (! PMC_IS_NULL(handled_types)) {
- const INTVAL elems = VTABLE_elements(interp, handled_types);
- const INTVAL type = VTABLE_get_integer_keyed_str(interp, exception, CONST_STRING(interp, "type"));
+ const INTVAL elems = VTABLE_elements(INTERP, handled_types);
+ const INTVAL type = VTABLE_get_integer_keyed_str(INTERP, exception, CONST_STRING(INTERP, "type"));
INTVAL i;
for (i = 0; i < elems; ++i) {
- INTVAL handled_type = VTABLE_get_integer_keyed_int(interp,
+ INTVAL handled_type = VTABLE_get_integer_keyed_int(INTERP,
handled_types, i);
if (handled_type == type)
RETURN(INTVAL 1);
@@ -195,12 +195,12 @@
RETURN(INTVAL 0);
}
if (handled_types_except != PMCNULL) {
- const INTVAL elems = VTABLE_elements(interp, handled_types_except);
- const INTVAL type = VTABLE_get_integer_keyed_str(interp, exception, CONST_STRING(interp, "type"));
+ const INTVAL elems = VTABLE_elements(INTERP, handled_types_except);
+ const INTVAL type = VTABLE_get_integer_keyed_str(INTERP, exception, CONST_STRING(INTERP, "type"));
INTVAL i;
for (i = 0; i < elems; ++i) {
- const INTVAL handled_type = VTABLE_get_integer_keyed_int(interp,
+ const INTVAL handled_type = VTABLE_get_integer_keyed_int(INTERP,
handled_types_except, i);
if (handled_type == type)
RETURN(INTVAL 0);
@@ -276,7 +276,7 @@
Parrot_ExceptionHandler_attributes * const attrs =
PARROT_EXCEPTIONHANDLER(SELF);
attrs->handled_types =
- VTABLE_elements(interp, types) > 0
+ VTABLE_elements(INTERP, types) > 0
? types
: PMCNULL;
}
@@ -295,7 +295,7 @@
Parrot_ExceptionHandler_attributes * const attrs =
PARROT_EXCEPTIONHANDLER(SELF);
attrs->handled_types_except =
- VTABLE_elements(interp, types) > 0
+ VTABLE_elements(INTERP, types) > 0
? types
: PMCNULL;
}
Modified: branches/codestring/src/pmc/exporter.pmc
==============================================================================
--- branches/codestring/src/pmc/exporter.pmc Wed May 5 23:52:59 2010 (r46321)
+++ branches/codestring/src/pmc/exporter.pmc Thu May 6 00:31:08 2010 (r46322)
@@ -139,9 +139,9 @@
GET_ATTR_ns_dest(INTERP, SELF, ns_dest);
GET_ATTR_globals(INTERP, SELF, globals);
- Parrot_gc_mark_PMC_alive(interp, ns_src);
- Parrot_gc_mark_PMC_alive(interp, ns_dest);
- Parrot_gc_mark_PMC_alive(interp, globals);
+ Parrot_gc_mark_PMC_alive(INTERP, ns_src);
+ Parrot_gc_mark_PMC_alive(INTERP, ns_dest);
+ Parrot_gc_mark_PMC_alive(INTERP, globals);
}
@@ -167,14 +167,14 @@
METHOD source(PMC *src :optional, int got_src :opt_flag) {
if (got_src) {
if (src->vtable->base_type != enum_class_NameSpace)
- Parrot_ex_throw_from_c_args(interp, NULL, 0,
+ Parrot_ex_throw_from_c_args(INTERP, NULL, 0,
"source must be a NameSpace PMC");
- SET_ATTR_ns_src(interp, SELF, src);
+ SET_ATTR_ns_src(INTERP, SELF, src);
}
else {
PMC *tmp_ns_src;
- GET_ATTR_ns_src(interp, SELF, tmp_ns_src);
+ GET_ATTR_ns_src(INTERP, SELF, tmp_ns_src);
RETURN(PMC *tmp_ns_src);
}
}
@@ -197,14 +197,14 @@
if (got_dest) {
if (dest->vtable->base_type != enum_class_NameSpace)
- Parrot_ex_throw_from_c_args(interp, NULL, 0,
+ Parrot_ex_throw_from_c_args(INTERP, NULL, 0,
"destination must be a NameSpace PMC");
- SET_ATTR_ns_dest(interp, SELF, dest);
+ SET_ATTR_ns_dest(INTERP, SELF, dest);
}
else {
PMC *tmp_ns_dest;
- GET_ATTR_ns_dest(interp, SELF, tmp_ns_dest);
+ GET_ATTR_ns_dest(INTERP, SELF, tmp_ns_dest);
RETURN(PMC *tmp_ns_dest);
}
}
@@ -229,54 +229,54 @@
*/
METHOD globals(PMC *glb :optional, int got_glb :opt_flag) {
- STRING * const s_str = CONST_STRING(interp, "String");
- STRING * const s_arr = CONST_STRING(interp, "array");
- STRING * const s_hash = CONST_STRING(interp, "hash");
- STRING * const s_space = CONST_STRING(interp, " ");
+ STRING * const s_str = CONST_STRING(INTERP, "String");
+ STRING * const s_arr = CONST_STRING(INTERP, "array");
+ STRING * const s_hash = CONST_STRING(INTERP, "hash");
+ STRING * const s_space = CONST_STRING(INTERP, " ");
if (got_glb) {
- STRING * const s_empty = CONST_STRING(interp, "");
- PMC *temp_globals = Parrot_pmc_new(interp, enum_class_Hash);
+ STRING * const s_empty = CONST_STRING(INTERP, "");
+ PMC *temp_globals = Parrot_pmc_new(INTERP, enum_class_Hash);
if (PMC_IS_NULL(glb)) {
temp_globals = PMCNULL;
}
- else if (VTABLE_isa(interp, glb, s_str) || (VTABLE_does(interp, glb, s_arr))) {
+ else if (VTABLE_isa(INTERP, glb, s_str) || (VTABLE_does(INTERP, glb, s_arr))) {
PMC *glb_array;
INTVAL n, i;
- if (VTABLE_isa(interp, glb, s_str))
- glb_array = Parrot_str_split(interp, s_space,
- VTABLE_get_string(interp, glb));
+ if (VTABLE_isa(INTERP, glb, s_str))
+ glb_array = Parrot_str_split(INTERP, s_space,
+ VTABLE_get_string(INTERP, glb));
else
glb_array = glb;
- n = VTABLE_elements(interp, glb_array);
+ n = VTABLE_elements(INTERP, glb_array);
if (n == 0)
temp_globals = PMCNULL;
for (i = 0; i < n; ++i) {
- STRING * const item = VTABLE_get_string_keyed_int(interp, glb_array, i);
- VTABLE_set_string_keyed_str(interp, temp_globals, item, s_empty);
+ STRING * const item = VTABLE_get_string_keyed_int(INTERP, glb_array, i);
+ VTABLE_set_string_keyed_str(INTERP, temp_globals, item, s_empty);
}
}
- else if (VTABLE_does(interp, glb, s_hash)) {
- if (VTABLE_elements(interp, glb) == 0)
+ else if (VTABLE_does(INTERP, glb, s_hash)) {
+ if (VTABLE_elements(INTERP, glb) == 0)
temp_globals = PMCNULL;
else
temp_globals = glb;
}
else {
- Parrot_ex_throw_from_c_args(interp, NULL, 0,
+ Parrot_ex_throw_from_c_args(INTERP, NULL, 0,
"Invalid type %d in globals()", glb->vtable->base_type);
}
- SET_ATTR_globals(interp, SELF, temp_globals);
+ SET_ATTR_globals(INTERP, SELF, temp_globals);
}
else {
PMC *tmp_globals;
- GET_ATTR_globals(interp, SELF, tmp_globals);
+ GET_ATTR_globals(INTERP, SELF, tmp_globals);
if (PMC_IS_NULL(tmp_globals)) {
RETURN(PMC *PMCNULL);
}
@@ -314,26 +314,26 @@
PMC *ns_src, *ns_dest, *ns_globals;
if (got_src)
- PCCINVOKE(interp, SELF, "source", PMC *src);
+ PCCINVOKE(INTERP, SELF, "source", PMC *src);
if (got_dest)
- PCCINVOKE(interp, SELF, "destination", PMC *dest);
+ PCCINVOKE(INTERP, SELF, "destination", PMC *dest);
if (got_globals)
- PCCINVOKE(interp, SELF, "globals", PMC *globals);
+ PCCINVOKE(INTERP, SELF, "globals", PMC *globals);
- GET_ATTR_ns_src(interp, SELF, ns_src);
+ GET_ATTR_ns_src(INTERP, SELF, ns_src);
if (PMC_IS_NULL(ns_src))
- Parrot_ex_throw_from_c_args(interp, NULL, 0, "source namespace not set");
+ Parrot_ex_throw_from_c_args(INTERP, NULL, 0, "source namespace not set");
- GET_ATTR_ns_dest(interp, SELF, ns_dest);
+ GET_ATTR_ns_dest(INTERP, SELF, ns_dest);
if (PMC_IS_NULL(ns_dest))
- Parrot_ex_throw_from_c_args(interp, NULL, 0,
+ Parrot_ex_throw_from_c_args(INTERP, NULL, 0,
"destination namespace not set");
- GET_ATTR_globals(interp, SELF, ns_globals);
+ GET_ATTR_globals(INTERP, SELF, ns_globals);
- PCCINVOKE(interp, ns_src, "export_to", PMC *ns_dest, PMC *ns_globals);
+ PCCINVOKE(INTERP, ns_src, "export_to", PMC *ns_dest, PMC *ns_globals);
}
Modified: branches/codestring/src/pmc/filehandle.pmc
==============================================================================
--- branches/codestring/src/pmc/filehandle.pmc Wed May 5 23:52:59 2010 (r46321)
+++ branches/codestring/src/pmc/filehandle.pmc Thu May 6 00:31:08 2010 (r46322)
@@ -106,7 +106,7 @@
VTABLE PMC *clone() {
Parrot_FileHandle_attributes * const old_struct
= PARROT_FILEHANDLE(SELF);
- PMC * const copy = Parrot_io_new_pmc(interp, old_struct->flags);
+ PMC * const copy = Parrot_io_new_pmc(INTERP, old_struct->flags);
Parrot_FileHandle_attributes * const data_struct
= PARROT_FILEHANDLE(copy);
@@ -130,9 +130,9 @@
Parrot_FileHandle_attributes * const data_struct
= PARROT_FILEHANDLE(SELF);
- Parrot_gc_mark_STRING_alive(interp, data_struct->mode);
- Parrot_gc_mark_STRING_alive(interp, data_struct->filename);
- Parrot_gc_mark_STRING_alive(interp, data_struct->encoding);
+ Parrot_gc_mark_STRING_alive(INTERP, data_struct->mode);
+ Parrot_gc_mark_STRING_alive(INTERP, data_struct->filename);
+ Parrot_gc_mark_STRING_alive(INTERP, data_struct->encoding);
}
@@ -249,7 +249,7 @@
STRING *open_filename, *open_mode;
if (!Parrot_io_is_closed_filehandle(INTERP, SELF))
- Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_PIO_ERROR,
+ Parrot_ex_throw_from_c_args(INTERP, NULL, EXCEPTION_PIO_ERROR,
"Cannot reopen already open filehandle");
if (got_mode && !STRING_IS_NULL(mode))
@@ -263,7 +263,7 @@
GET_ATTR_mode(INTERP, SELF, open_mode);
if (STRING_IS_NULL(open_filename))
- Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_PIO_ERROR,
+ Parrot_ex_throw_from_c_args(INTERP, NULL, EXCEPTION_PIO_ERROR,
"Cannot open filehandle, no filename");
if (STRING_IS_NULL(open_mode)) {
@@ -317,7 +317,7 @@
*/
METHOD is_closed() {
- const INTVAL status = Parrot_io_is_closed(interp, SELF);
+ const INTVAL status = Parrot_io_is_closed(INTERP, SELF);
RETURN(INTVAL status);
}
@@ -447,7 +447,7 @@
GET_ATTR_encoding(INTERP, SELF, encoding);
if (!Parrot_io_is_closed_filehandle(INTERP, SELF))
- Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_PIO_ERROR,
+ Parrot_ex_throw_from_c_args(INTERP, NULL, EXCEPTION_PIO_ERROR,
"Cannot readall on a new file from an already open filehandle");
filehandle = Parrot_io_open(INTERP, PMCNULL, name, NULL);
@@ -459,27 +459,23 @@
result = Parrot_io_reads(INTERP, filehandle, size);
Parrot_io_close(INTERP, filehandle);
- RETURN(STRING *result);
}
else {
/* slurp open file */
if (Parrot_io_is_closed_filehandle(INTERP, SELF))
- Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_PIO_ERROR,
+ Parrot_ex_throw_from_c_args(INTERP, NULL, EXCEPTION_PIO_ERROR,
"Cannot readall without a file name or open filehandle");
- result = Parrot_str_new_noinit(INTERP, enum_stringrep_one, 0);
-
/* Do line buffering on the filehandle */
if (!(PARROT_FILEHANDLE(SELF)->flags & PIO_F_LINEBUF))
Parrot_io_setlinebuf(INTERP, SELF);
+ result = STRINGNULL;
do {
STRING * const part = Parrot_io_reads(INTERP, SELF, 0);
- result = Parrot_str_concat(INTERP, result, part);
-
- if (Parrot_io_eof(INTERP, SELF))
- break;
- } while (1);
+ result = STRING_IS_NULL(result) ? part :
+ Parrot_str_concat(INTERP, result, part);
+ } while (!Parrot_io_eof(INTERP, SELF));
}
RETURN(STRING *result);
@@ -514,7 +510,7 @@
METHOD print(PMC *to_print) {
STRING * const string_to_print = VTABLE_get_string(INTERP, to_print);
- Parrot_io_putps(interp, SELF, string_to_print);
+ Parrot_io_putps(INTERP, SELF, string_to_print);
}
Modified: branches/codestring/src/pmc/fixedbooleanarray.pmc
==============================================================================
--- branches/codestring/src/pmc/fixedbooleanarray.pmc Wed May 5 23:52:59 2010 (r46321)
+++ branches/codestring/src/pmc/fixedbooleanarray.pmc Thu May 6 00:31:08 2010 (r46322)
@@ -87,7 +87,7 @@
const size_t size_in_bytes = get_size_in_bytes(size);
if (size < 0)
- Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_OUT_OF_BOUNDS,
+ Parrot_ex_throw_from_c_args(INTERP, NULL, EXCEPTION_OUT_OF_BOUNDS,
_("FixedBooleanArray: Cannot set array size to a negative number (%d)"), size);
SET_ATTR_size(INTERP, SELF, size);
@@ -585,7 +585,7 @@
STRING * const s = VTABLE_shift_string(INTERP, info);
unsigned char * const bit_array = (unsigned char *)Parrot_str_to_cstring(INTERP, s);
- const UINTVAL threshold = Parrot_str_byte_length(interp, s) * BITS_PER_CHAR;
+ const UINTVAL threshold = Parrot_str_byte_length(INTERP, s) * BITS_PER_CHAR;
SET_ATTR_size(INTERP, SELF, size);
SET_ATTR_resize_threshold(INTERP, SELF, threshold);
Modified: branches/codestring/src/pmc/fixedfloatarray.pmc
==============================================================================
--- branches/codestring/src/pmc/fixedfloatarray.pmc Wed May 5 23:52:59 2010 (r46321)
+++ branches/codestring/src/pmc/fixedfloatarray.pmc Thu May 6 00:31:08 2010 (r46322)
@@ -62,7 +62,7 @@
VTABLE void init_int(INTVAL size) {
if (size < 0)
- Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_OUT_OF_BOUNDS,
+ Parrot_ex_throw_from_c_args(INTERP, NULL, EXCEPTION_OUT_OF_BOUNDS,
_("FixedFloatArray: Cannot set array size to a negative number (%d)"), size);
SET_ATTR_size(INTERP, SELF, size);
SET_ATTR_float_array(INTERP, SELF, mem_gc_allocate_n_typed(INTERP, size, FLOATVAL));
Modified: branches/codestring/src/pmc/fixedintegerarray.pmc
==============================================================================
--- branches/codestring/src/pmc/fixedintegerarray.pmc Wed May 5 23:52:59 2010 (r46321)
+++ branches/codestring/src/pmc/fixedintegerarray.pmc Thu May 6 00:31:08 2010 (r46322)
@@ -59,7 +59,7 @@
VTABLE void init_int(INTVAL size) {
if (size < 0)
- Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_OUT_OF_BOUNDS,
+ Parrot_ex_throw_from_c_args(INTERP, NULL, EXCEPTION_OUT_OF_BOUNDS,
_("FixedIntegerArray: Cannot set array size to a negative number (%d)"), size);
SET_ATTR_size(INTERP, SELF, size);
SET_ATTR_int_array(INTERP, SELF, mem_gc_allocate_n_typed(INTERP, size, INTVAL));
@@ -191,7 +191,7 @@
GET_ATTR_size(INTERP, SELF, size);
if (key < 0 || key >= size)
- Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_OUT_OF_BOUNDS,
+ Parrot_ex_throw_from_c_args(INTERP, NULL, EXCEPTION_OUT_OF_BOUNDS,
"FixedIntegerArray: index out of bounds!");
GET_ATTR_int_array(INTERP, SELF, int_array);
@@ -381,7 +381,7 @@
GET_ATTR_size(INTERP, SELF, size);
if (key < 0 || key >= size)
- Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_OUT_OF_BOUNDS,
+ Parrot_ex_throw_from_c_args(INTERP, NULL, EXCEPTION_OUT_OF_BOUNDS,
"FixedIntegerArray: index out of bounds!");
GET_ATTR_int_array(INTERP, SELF, int_array);
@@ -503,7 +503,7 @@
if (n > 1) {
GET_ATTR_int_array(INTERP, SELF, int_array);
- Parrot_quicksort(interp, (void**)int_array, n, cmp_func);
+ Parrot_quicksort(INTERP, (void**)int_array, n, cmp_func);
}
}
Modified: branches/codestring/src/pmc/fixedpmcarray.pmc
==============================================================================
--- branches/codestring/src/pmc/fixedpmcarray.pmc Wed May 5 23:52:59 2010 (r46321)
+++ branches/codestring/src/pmc/fixedpmcarray.pmc Thu May 6 00:31:08 2010 (r46322)
@@ -51,11 +51,11 @@
if (n > 1) {
/* XXX Workaround for TT #218 */
if (PObj_is_object_TEST(SELF)) {
- PMC *parent = SELF.get_attr_str(CONST_STRING(interp, "proxy"));
- Parrot_pcc_invoke_method_from_c_args(interp, parent, CONST_STRING(interp, "sort"), "P->", cmp_func);
+ PMC *parent = SELF.get_attr_str(CONST_STRING(INTERP, "proxy"));
+ Parrot_pcc_invoke_method_from_c_args(INTERP, parent, CONST_STRING(INTERP, "sort"), "P->", cmp_func);
}
else
- Parrot_quicksort(interp, (void **)PMC_array(SELF), n, cmp_func);
+ Parrot_quicksort(INTERP, (void **)PMC_array(SELF), n, cmp_func);
}
RETURN(PMC *SELF);
}
@@ -308,7 +308,7 @@
PMC * const retval = SELF.get_pmc_keyed_int(key);
if (PMC_IS_NULL(retval))
- return CONST_STRING(interp, "");
+ return CONST_STRING(INTERP, "");
return VTABLE_get_string(INTERP, retval);
}
@@ -416,7 +416,7 @@
if (SELF == value)
return;
- if (!VTABLE_does(interp, value, CONST_STRING(interp, "array")))
+ if (!VTABLE_does(INTERP, value, CONST_STRING(INTERP, "array")))
Parrot_ex_throw_from_c_args(INTERP, NULL, EXCEPTION_OUT_OF_BOUNDS,
_("Can't set self from this type"));
@@ -637,7 +637,7 @@
|| item2->vtable->base_type == enum_class_Null)
return 0;
- if (!VTABLE_is_equal(interp, item1, item2))
+ if (!VTABLE_is_equal(INTERP, item1, item2))
return 0;
}
@@ -791,7 +791,7 @@
return;
for (i = PMC_size(SELF) - 1; i >= 0; --i)
- Parrot_gc_mark_PMC_alive(interp, data[i]);
+ Parrot_gc_mark_PMC_alive(INTERP, data[i]);
}
Modified: branches/codestring/src/pmc/fixedstringarray.pmc
==============================================================================
--- branches/codestring/src/pmc/fixedstringarray.pmc Wed May 5 23:52:59 2010 (r46321)
+++ branches/codestring/src/pmc/fixedstringarray.pmc Thu May 6 00:31:08 2010 (r46322)
@@ -59,7 +59,7 @@
VTABLE void init_int(INTVAL size) {
if (size < 0)
- Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_OUT_OF_BOUNDS,
+ Parrot_ex_throw_from_c_args(INTERP, NULL, EXCEPTION_OUT_OF_BOUNDS,
_("FixedStringArray: Cannot set array size to a negative number (%d)"), size);
SET_ATTR_size(INTERP, SELF, size);
SET_ATTR_str_array(INTERP, SELF, mem_gc_allocate_n_zeroed_typed(INTERP, size, STRING *));
@@ -234,7 +234,7 @@
VTABLE INTVAL get_integer_keyed_int(INTVAL key) {
STRING * const element = SELF.get_string_keyed_int(key);
- return Parrot_str_to_int(interp, element);
+ return Parrot_str_to_int(INTERP, element);
}
/*
@@ -266,7 +266,7 @@
VTABLE FLOATVAL get_number_keyed_int(INTVAL key) {
STRING * const element = SELF.get_string_keyed_int(key);
- return Parrot_str_to_num(interp, element);
+ return Parrot_str_to_num(INTERP, element);
}
/*
@@ -395,7 +395,7 @@
*/
VTABLE void set_integer_keyed_int(INTVAL key, INTVAL value) {
- STRING *val = Parrot_str_from_int(interp, value);
+ STRING *val = Parrot_str_from_int(INTERP, value);
SELF.set_string_keyed_int(key, val);
}
@@ -426,7 +426,7 @@
*/
VTABLE void set_number_keyed_int(INTVAL key, FLOATVAL value) {
- STRING *val = Parrot_str_from_num(interp, value);
+ STRING *val = Parrot_str_from_num(INTERP, value);
SELF.set_string_keyed_int(key, val);
}
@@ -582,7 +582,7 @@
if (item1 == NULL || item2 == NULL)
return 0;
- if (!Parrot_str_equal(interp, item1, item2))
+ if (!Parrot_str_equal(INTERP, item1, item2))
return 0;
}
Modified: branches/codestring/src/pmc/handle.pmc
==============================================================================
--- branches/codestring/src/pmc/handle.pmc Wed May 5 23:52:59 2010 (r46321)
+++ branches/codestring/src/pmc/handle.pmc Thu May 6 00:31:08 2010 (r46322)
@@ -34,12 +34,12 @@
ATTR PIOHANDLE os_handle; /* Low level OS descriptor */
VTABLE void init() {
- Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_INVALID_OPERATION,
+ Parrot_ex_throw_from_c_args(INTERP, NULL, EXCEPTION_INVALID_OPERATION,
"Handle cannot be instantiated directly.");
}
VTABLE void init_pmc(PMC * init) {
- Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_INVALID_OPERATION,
+ Parrot_ex_throw_from_c_args(INTERP, NULL, EXCEPTION_INVALID_OPERATION,
"Handle cannot be instantiated directly.");
}
}
Modified: branches/codestring/src/pmc/hash.pmc
==============================================================================
--- branches/codestring/src/pmc/hash.pmc Wed May 5 23:52:59 2010 (r46321)
+++ branches/codestring/src/pmc/hash.pmc Thu May 6 00:31:08 2010 (r46322)
@@ -96,7 +96,7 @@
}
VTABLE void destroy() {
- Hash * const hash = (Hash *)STATICSELF.get_pointer();
+ Hash * const hash = (Hash *)SELF.get_pointer();
if (hash)
parrot_hash_destroy(INTERP, hash);
}
@@ -111,7 +111,7 @@
*/
VTABLE void mark() {
- Hash * const hash = (Hash *)STATICSELF.get_pointer();
+ Hash * const hash = (Hash *)SELF.get_pointer();
if (hash != NULL)
parrot_mark_hash(INTERP, hash);
}
@@ -129,7 +129,7 @@
VTABLE PMC *clone() {
PMC * const dest = Parrot_pmc_new(INTERP, SELF->vtable->base_type);
- parrot_hash_clone(INTERP, (Hash *)STATICSELF.get_pointer(),
+ parrot_hash_clone(INTERP, (Hash *)SELF.get_pointer(),
(Hash *)VTABLE_get_pointer(INTERP, dest));
return dest;
@@ -146,7 +146,7 @@
*/
VTABLE void set_pointer(void *ptr) {
- Hash * const old_hash = (Hash *)STATICSELF.get_pointer();
+ Hash * const old_hash = (Hash *)SELF.get_pointer();
Hash * const new_hash = (Hash *)ptr;
PARROT_HASH(SELF)->hash = new_hash;
@@ -179,21 +179,21 @@
: enum_type_PMC;
if (type == Hash_key_type_STRING)
- new_hash = parrot_create_hash(interp,
+ new_hash = parrot_create_hash(INTERP,
entry_type,
Hash_key_type_STRING,
STRING_compare,
(hash_hash_key_fn)key_hash_STRING);
else if (type == Hash_key_type_int)
/* new_int_hash set BOTH keys and values to INTVAL */
- new_hash = parrot_create_hash(interp,
+ new_hash = parrot_create_hash(INTERP,
entry_type,
Hash_key_type_int,
int_compare,
key_hash_int);
else if (type == Hash_key_type_PMC)
/* new_int_hash set BOTH keys and values to INTVAL */
- new_hash = parrot_create_hash(interp,
+ new_hash = parrot_create_hash(INTERP,
entry_type,
Hash_key_type_PMC,
(hash_comp_fn)PMC_compare,
@@ -226,7 +226,7 @@
*/
METHOD get_key_type() {
- const INTVAL ret = ((Hash *)STATICSELF.get_pointer())->key_type;
+ const INTVAL ret = ((Hash *)SELF.get_pointer())->key_type;
RETURN(INTVAL ret);
}
@@ -242,7 +242,7 @@
=cut
*/
METHOD set_value_type(INTVAL type) {
- Hash *old_hash = (Hash *)STATICSELF.get_pointer();
+ Hash *old_hash = (Hash *)SELF.get_pointer();
Hash *new_hash;
/*
@@ -257,14 +257,14 @@
case enum_type_INTVAL:
case enum_type_STRING:
case enum_type_PMC:
- new_hash = parrot_create_hash(interp,
+ new_hash = parrot_create_hash(INTERP,
(PARROT_DATA_TYPE)type,
old_hash ? old_hash->key_type : Hash_key_type_STRING,
old_hash ? old_hash->compare : STRING_compare,
old_hash ? old_hash->hash_val : (hash_hash_key_fn)key_hash_STRING);
break;
default:
- Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_UNIMPLEMENTED,
+ Parrot_ex_throw_from_c_args(INTERP, NULL, EXCEPTION_UNIMPLEMENTED,
"Hash: unsupported entry_type %d", type);
}
@@ -276,7 +276,7 @@
}
METHOD get_value_type() {
- INTVAL ret = ((Hash *)STATICSELF.get_pointer())->entry_type;
+ INTVAL ret = ((Hash *)SELF.get_pointer())->entry_type;
RETURN(INTVAL ret);
}
@@ -306,7 +306,7 @@
*/
VTABLE INTVAL get_integer() {
- return parrot_hash_size(INTERP, (Hash *)STATICSELF.get_pointer());
+ return parrot_hash_size(INTERP, (Hash *)SELF.get_pointer());
}
VTABLE FLOATVAL get_number() {
@@ -389,7 +389,7 @@
*/
VTABLE INTVAL get_integer_keyed_str(STRING *key) {
- const Hash * const hash = (Hash*)STATICSELF.get_pointer();
+ const Hash * const hash = (Hash*)SELF.get_pointer();
HashBucket * const b = parrot_hash_get_bucket(INTERP, hash,
hash_key_from_string(INTERP, hash, key));
@@ -400,7 +400,7 @@
}
VTABLE INTVAL get_integer_keyed_int(INTVAL key) {
- const Hash * const hash = (Hash*)STATICSELF.get_pointer();
+ const Hash * const hash = (Hash*)SELF.get_pointer();
HashBucket * const b = parrot_hash_get_bucket(INTERP, hash,
hash_key_from_int(INTERP, hash, key));
@@ -421,7 +421,7 @@
/* Handling Keys */
VTABLE INTVAL get_integer_keyed(PMC *key) {
- const Hash * const hash = (Hash *)STATICSELF.get_pointer();
+ const Hash * const hash = (Hash *)SELF.get_pointer();
HashBucket * const b = parrot_hash_get_bucket(INTERP, hash,
hash_key_from_pmc(INTERP, hash, key));
PMC *valpmc;
@@ -450,7 +450,7 @@
*/
VTABLE void set_integer_keyed(PMC *key, INTVAL value) {
- Hash * const hash = (Hash *)STATICSELF.get_pointer();
+ Hash * const hash = (Hash *)SELF.get_pointer();
void * const keystr = hash_key_from_pmc(INTERP, hash, key);
PMC * const nextkey = key_next(INTERP, key);
PMC *box;
@@ -476,7 +476,7 @@
}
VTABLE void set_integer_keyed_int(INTVAL key, INTVAL value) {
- Hash * const hash = (Hash *)STATICSELF.get_pointer();
+ Hash * const hash = (Hash *)SELF.get_pointer();
parrot_hash_put(INTERP, hash, hash_key_from_int(INTERP, hash, key),
hash_value_from_int(INTERP, hash, value));
}
@@ -490,7 +490,7 @@
*/
VTABLE void set_integer_keyed_str(STRING *key, INTVAL value) {
- Hash * const hash = (Hash *)STATICSELF.get_pointer();
+ Hash * const hash = (Hash *)SELF.get_pointer();
parrot_hash_put(INTERP, hash, hash_key_from_string(INTERP, hash, key),
hash_value_from_int(INTERP, hash, value));
}
@@ -507,7 +507,7 @@
*/
VTABLE FLOATVAL get_number_keyed_str(STRING *key) {
- const Hash * const hash = (Hash *)STATICSELF.get_pointer();
+ const Hash * const hash = (Hash *)SELF.get_pointer();
HashBucket * const b = parrot_hash_get_bucket(INTERP, hash,
hash_key_from_string(INTERP, hash, key));
@@ -518,7 +518,7 @@
}
VTABLE FLOATVAL get_number_keyed_int(INTVAL key) {
- const Hash * const hash = (Hash *)STATICSELF.get_pointer();
+ const Hash * const hash = (Hash *)SELF.get_pointer();
HashBucket * const b = parrot_hash_get_bucket(INTERP, hash,
hash_key_from_int(INTERP, hash, key));
@@ -541,7 +541,7 @@
VTABLE FLOATVAL get_number_keyed(PMC *key) {
PMC *nextkey;
PMC *valpmc;
- const Hash * const hash = (Hash *)STATICSELF.get_pointer();
+ const Hash * const hash = (Hash *)SELF.get_pointer();
void * const keystr = hash_key_from_pmc(INTERP, hash, key);
HashBucket * const b = parrot_hash_get_bucket(INTERP, hash, keystr);
@@ -569,7 +569,7 @@
*/
VTABLE STRING *get_string_keyed_str(STRING *key) {
- const Hash * const hash = (Hash*)STATICSELF.get_pointer();
+ const Hash * const hash = (Hash*)SELF.get_pointer();
HashBucket * const b =
parrot_hash_get_bucket(INTERP, hash, hash_key_from_string(INTERP, hash, key));
@@ -580,7 +580,7 @@
}
VTABLE STRING *get_string_keyed_int(INTVAL key) {
- const Hash * const hash = (Hash*)STATICSELF.get_pointer();
+ const Hash * const hash = (Hash*)SELF.get_pointer();
HashBucket * const b =
parrot_hash_get_bucket(INTERP, hash, hash_key_from_int(INTERP, hash, key));
@@ -601,7 +601,7 @@
*/
VTABLE STRING *get_string_keyed(PMC *key) {
- const Hash * const hash = (Hash *)STATICSELF.get_pointer();
+ const Hash * const hash = (Hash *)SELF.get_pointer();
HashBucket * const b = parrot_hash_get_bucket(INTERP, hash,
hash_key_from_pmc(INTERP, hash, key));
PMC *valpmc;
@@ -630,7 +630,7 @@
*/
VTABLE void set_string_keyed(PMC *key, STRING *value) {
- Hash * const hash = (Hash *)STATICSELF.get_pointer();
+ Hash * const hash = (Hash *)SELF.get_pointer();
void * const keystr = hash_key_from_pmc(INTERP, hash, key);
PMC * const nextkey = key_next(INTERP, key);
PMC *box;
@@ -664,14 +664,14 @@
*/
VTABLE void set_string_keyed_str(STRING *key, STRING *value) {
- Hash * const hash = (Hash *)STATICSELF.get_pointer();
+ Hash * const hash = (Hash *)SELF.get_pointer();
parrot_hash_put(INTERP, hash,
hash_key_from_string(INTERP, hash, key),
hash_value_from_string(INTERP, hash, value));
}
VTABLE void set_string_keyed_int(INTVAL key, STRING *value) {
- Hash * const hash = (Hash *)STATICSELF.get_pointer();
+ Hash * const hash = (Hash *)SELF.get_pointer();
parrot_hash_put(INTERP, hash,
hash_key_from_int(INTERP, hash, key),
hash_value_from_string(INTERP, hash, value));
@@ -695,11 +695,11 @@
const Hash *hash;
HashBucket *b = NULL;
- GET_ATTR_hash(interp, SELF, hash);
+ GET_ATTR_hash(INTERP, SELF, hash);
/* special case the most key type, for speed */
if (hash->key_type == Hash_key_type_STRING)
- b = parrot_hash_get_bucket(interp, hash, key);
+ b = parrot_hash_get_bucket(INTERP, hash, key);
else
b = parrot_hash_get_bucket(INTERP, hash,
hash_key_from_string(INTERP, hash, key));
@@ -715,7 +715,7 @@
}
VTABLE PMC *get_pmc_keyed_int(INTVAL key) {
- const Hash * const hash = (Hash *)STATICSELF.get_pointer();
+ const Hash * const hash = (Hash *)SELF.get_pointer();
HashBucket * const b = parrot_hash_get_bucket(INTERP, hash,
hash_key_from_int(INTERP, hash, key));
@@ -727,7 +727,7 @@
/* Compound Key */
VTABLE PMC *get_pmc_keyed(PMC *key) {
- const Hash * const hash = (Hash *)STATICSELF.get_pointer();
+ const Hash * const hash = (Hash *)SELF.get_pointer();
HashBucket * const b = parrot_hash_get_bucket(INTERP, hash,
hash_key_from_pmc(INTERP, hash, key));
PMC *valpmc;
@@ -756,7 +756,7 @@
*/
VTABLE void set_number_keyed(PMC *key, FLOATVAL value) {
- Hash * const hash = (Hash *)STATICSELF.get_pointer();
+ Hash * const hash = (Hash *)SELF.get_pointer();
void * const keystr = hash_key_from_pmc(INTERP, hash, key);
PMC * const nextkey = key_next(INTERP, key);
PMC *box = PMCNULL;
@@ -769,7 +769,7 @@
return;
}
- b = parrot_hash_get_bucket(INTERP, (Hash *)STATICSELF.get_pointer(), keystr);
+ b = parrot_hash_get_bucket(INTERP, (Hash *)SELF.get_pointer(), keystr);
if (b)
box = hash_value_to_pmc(INTERP, hash, b->value);
@@ -793,7 +793,7 @@
VTABLE void set_number_keyed_str(STRING *key, FLOATVAL value) {
PMC * const val = get_number_pmc(INTERP, value);
- parrot_hash_put(INTERP, (Hash *)STATICSELF.get_pointer(), key, val);
+ parrot_hash_put(INTERP, (Hash *)SELF.get_pointer(), key, val);
}
/*
@@ -805,7 +805,7 @@
*/
VTABLE void set_pmc_keyed(PMC *key, PMC *value) {
- Hash * const hash = (Hash *)STATICSELF.get_pointer();
+ Hash * const hash = (Hash *)SELF.get_pointer();
void * const keystr = hash_key_from_pmc(INTERP, hash, key);
PMC * const nextkey = key_next(INTERP, key);
PMC *box;
@@ -841,7 +841,7 @@
*/
VTABLE void set_pmc_keyed_str(STRING *key, PMC *value) {
- Hash * const hash = (Hash *)STATICSELF.get_pointer();
+ Hash * const hash = (Hash *)SELF.get_pointer();
parrot_hash_put(INTERP, hash, hash_key_from_string(INTERP, hash, key),
hash_value_from_pmc(INTERP, hash, value));
}
@@ -855,7 +855,7 @@
*/
VTABLE INTVAL exists_keyed_str(STRING *key) {
- Hash * const hash = (Hash *)STATICSELF.get_pointer();
+ Hash * const hash = (Hash *)SELF.get_pointer();
HashBucket * const b = parrot_hash_get_bucket(INTERP, hash,
hash_key_from_string(INTERP, hash, key));
return b != NULL;
@@ -872,7 +872,7 @@
*/
VTABLE INTVAL exists_keyed(PMC *key) {
- Hash * const h = (Hash *)STATICSELF.get_pointer();
+ Hash * const h = (Hash *)SELF.get_pointer();
void * const sx = hash_key_from_pmc(INTERP, h, key);
HashBucket * const b = parrot_hash_get_bucket(INTERP, h, sx);
@@ -898,7 +898,7 @@
*/
VTABLE INTVAL defined_keyed_str(STRING *key) {
- const Hash * const hash = (Hash *)STATICSELF.get_pointer();
+ const Hash * const hash = (Hash *)SELF.get_pointer();
HashBucket * const b = parrot_hash_get_bucket(INTERP, hash,
hash_key_from_string(INTERP, hash, key));
@@ -920,7 +920,7 @@
*/
VTABLE INTVAL defined_keyed(PMC *key) {
- Hash * const h = (Hash *)STATICSELF.get_pointer();
+ Hash * const h = (Hash *)SELF.get_pointer();
void * const sx = hash_key_from_pmc(INTERP, h, key);
HashBucket * const b = parrot_hash_get_bucket(INTERP, h, sx);
@@ -946,7 +946,7 @@
*/
VTABLE void delete_keyed_str(STRING *key) {
- Hash * const hash = (Hash *)STATICSELF.get_pointer();
+ Hash * const hash = (Hash *)SELF.get_pointer();
parrot_hash_delete(INTERP, hash, hash_key_from_string(INTERP, hash, key));
}
@@ -961,7 +961,7 @@
*/
VTABLE void delete_keyed(PMC *key) {
- Hash * const h = (Hash *)STATICSELF.get_pointer();
+ Hash * const h = (Hash *)SELF.get_pointer();
void * const sx = hash_key_from_pmc(INTERP, h, key);
HashBucket * const b = parrot_hash_get_bucket(INTERP, h, sx);
@@ -988,7 +988,7 @@
*/
VTABLE INTVAL get_bool() {
- return parrot_hash_size(INTERP, (Hash *)STATICSELF.get_pointer()) != 0;
+ return parrot_hash_size(INTERP, (Hash *)SELF.get_pointer()) != 0;
}
/*
@@ -1002,7 +1002,7 @@
*/
VTABLE INTVAL elements() {
- return parrot_hash_size(INTERP, (Hash *)STATICSELF.get_pointer());
+ return parrot_hash_size(INTERP, (Hash *)SELF.get_pointer());
}
/*
@@ -1031,7 +1031,7 @@
VTABLE INTVAL is_same(PMC *other) {
return (INTVAL)(other->vtable == SELF->vtable &&
- VTABLE_get_pointer(INTERP, other) == STATICSELF.get_pointer());
+ VTABLE_get_pointer(INTERP, other) == SELF.get_pointer());
}
/*
@@ -1109,7 +1109,7 @@
*/
VTABLE void visit(PMC *info) {
- parrot_hash_visit(INTERP, (Hash *)STATICSELF.get_pointer(), info);
+ parrot_hash_visit(INTERP, (Hash *)SELF.get_pointer(), info);
SUPER(info);
}
@@ -1124,7 +1124,7 @@
*/
VTABLE void freeze(PMC *info) {
- Hash * const hash = (Hash *)STATICSELF.get_pointer();;
+ Hash * const hash = (Hash *)SELF.get_pointer();;
SUPER(info);
VTABLE_push_integer(INTERP, info, VTABLE_elements(INTERP, SELF));
@@ -1169,7 +1169,7 @@
cmp_fn = (hash_comp_fn)PMC_compare;
break;
default:
- Parrot_ex_throw_from_c_args(interp, NULL, 1,
+ Parrot_ex_throw_from_c_args(INTERP, NULL, 1,
"unimplemented key type");
break;
}
@@ -1178,7 +1178,7 @@
(Hash_key_type)k_type, cmp_fn, key_fn));
}
- hash = (Hash *)STATICSELF.get_pointer();
+ hash = (Hash *)SELF.get_pointer();
PARROT_ASSERT((INTVAL)hash->key_type == k_type);
PARROT_ASSERT(hash->entry_type == v_type);
Modified: branches/codestring/src/pmc/imageio.pmc
==============================================================================
--- branches/codestring/src/pmc/imageio.pmc Wed May 5 23:52:59 2010 (r46321)
+++ branches/codestring/src/pmc/imageio.pmc Thu May 6 00:31:08 2010 (r46322)
@@ -212,7 +212,7 @@
}
#ifndef DISABLE_GC_DEBUG
- Parrot_gc_compact_memory_pool(INTERP);
+ Parrot_gc_compact_memory_pool(interp);
#endif
}
@@ -500,7 +500,7 @@
VTABLE void push_integer(INTVAL v) {
const size_t len = PF_size_integer() * sizeof (opcode_t);
- ensure_buffer_size(interp, SELF, len);
+ ensure_buffer_size(INTERP, SELF, len);
SET_VISIT_CURSOR(SELF, (char *)PF_store_integer(GET_VISIT_CURSOR(SELF), v));
}
@@ -518,7 +518,7 @@
VTABLE void push_float(FLOATVAL v)
{
size_t len = PF_size_number() * sizeof (opcode_t);
- ensure_buffer_size(interp, SELF, len);
+ ensure_buffer_size(INTERP, SELF, len);
SET_VISIT_CURSOR(SELF, (char *)PF_store_number(GET_VISIT_CURSOR(SELF), &v));
}
@@ -542,11 +542,11 @@
PackFile_Constant *constant = table->constants[i];
if (constant->type == PFC_STRING) {
STRING * const sc = constant->u.string;
- if (Parrot_str_equal(interp, v, sc)
- && Parrot_charset_number_of_str(interp, v)
- == Parrot_charset_number_of_str(interp, sc)
- && Parrot_encoding_number_of_str(interp, v)
- == Parrot_encoding_number_of_str(interp, sc))
+ if (Parrot_str_equal(INTERP, v, sc)
+ && Parrot_charset_number_of_str(INTERP, v)
+ == Parrot_charset_number_of_str(INTERP, sc)
+ && Parrot_encoding_number_of_str(INTERP, v)
+ == Parrot_encoding_number_of_str(INTERP, sc))
{
STATICSELF.push_integer(i);
return;
@@ -653,7 +653,7 @@
{
opcode_t *pos = GET_VISIT_CURSOR(SELF);
- STRING *s = PF_fetch_string(interp, PARROT_IMAGEIO(SELF)->pf,
+ STRING *s = PF_fetch_string(INTERP, PARROT_IMAGEIO(SELF)->pf,
(const opcode_t **)&pos);
SET_VISIT_CURSOR(SELF, (char *)pos);
BYTECODE_SHIFT_OK(SELF);
@@ -708,13 +708,13 @@
PARROT_IMAGEIO(SELF)->input_length = image->strlen;
PARROT_IMAGEIO(SELF)->pf->options |= PFOPT_PMC_FREEZE_ONLY;
- unpacked_length = PackFile_unpack(interp, PARROT_IMAGEIO(SELF)->pf,
+ unpacked_length = PackFile_unpack(INTERP, PARROT_IMAGEIO(SELF)->pf,
GET_VISIT_CURSOR(SELF), PARROT_IMAGEIO(SELF)->input_length);
if (unpacked_length)
INC_VISIT_CURSOR(SELF, header_length);
else
- Parrot_ex_throw_from_c_args(interp, NULL,
+ Parrot_ex_throw_from_c_args(INTERP, NULL,
EXCEPTION_INVALID_STRING_REPRESENTATION,
"PackFile header failed during unpack");
Modified: branches/codestring/src/pmc/imageiosize.pmc
==============================================================================
--- branches/codestring/src/pmc/imageiosize.pmc Wed May 5 23:52:59 2010 (r46321)
+++ branches/codestring/src/pmc/imageiosize.pmc Thu May 6 00:31:08 2010 (r46322)
@@ -117,7 +117,7 @@
PARROT_IMAGEIOSIZE(SELF)->todo = Parrot_pmc_new(INTERP, enum_class_ResizablePMCArray);
PARROT_IMAGEIOSIZE(SELF)->pf = PackFile_new(INTERP, 0);
PARROT_IMAGEIOSIZE(SELF)->pf_ct =
- (PackFile_ConstTable *)VTABLE_get_pointer(interp, pf_ct);
+ (PackFile_ConstTable *)VTABLE_get_pointer(INTERP, pf_ct);
PARROT_IMAGEIOSIZE(SELF)->size = 0;
PARROT_IMAGEIOSIZE(SELF)->seen = Parrot_pmc_new(INTERP, enum_class_Hash);
@@ -253,11 +253,11 @@
PackFile_Constant *constant = table->constants[i];
if (constant->type == PFC_STRING) {
STRING * const sc = constant->u.string;
- if (Parrot_str_equal(interp, v, sc)
- && Parrot_charset_number_of_str(interp, v)
- == Parrot_charset_number_of_str(interp, sc)
- && Parrot_encoding_number_of_str(interp, v)
- == Parrot_encoding_number_of_str(interp, sc)) {
+ if (Parrot_str_equal(INTERP, v, sc)
+ && Parrot_charset_number_of_str(INTERP, v)
+ == Parrot_charset_number_of_str(INTERP, sc)
+ && Parrot_encoding_number_of_str(INTERP, v)
+ == Parrot_encoding_number_of_str(INTERP, sc)) {
STATICSELF.push_integer(i);
return;
}
Modified: branches/codestring/src/pmc/integer.pmc
==============================================================================
--- branches/codestring/src/pmc/integer.pmc Wed May 5 23:52:59 2010 (r46321)
+++ branches/codestring/src/pmc/integer.pmc Thu May 6 00:31:08 2010 (r46322)
@@ -300,7 +300,7 @@
const INTVAL c = a + b;
if ((c^a) >= 0 || (c^b) >= 0) {
- dest = Parrot_pmc_new(INTERP, VTABLE_type(interp, SELF));
+ dest = Parrot_pmc_new(INTERP, VTABLE_type(INTERP, SELF));
/* need this for e.g. Undef PMC */
VTABLE_set_integer_native(INTERP, dest, c);
@@ -308,10 +308,10 @@
}
else {
PMC * temp;
- maybe_throw_overflow_error(interp);
- temp = Parrot_pmc_new(interp, enum_class_BigInt);
- VTABLE_set_integer_native(interp, temp, a);
- return VTABLE_add(interp, temp, value, dest);
+ maybe_throw_overflow_error(INTERP);
+ temp = Parrot_pmc_new(INTERP, enum_class_BigInt);
+ VTABLE_set_integer_native(INTERP, temp, a);
+ return VTABLE_add(INTERP, temp, value, dest);
}
}
@@ -331,15 +331,15 @@
MULTI PMC *add(BigInt value, PMC *dest) {
PMC *temp;
- maybe_throw_overflow_error(interp);
- temp = Parrot_pmc_new(interp, enum_class_BigInt);
- VTABLE_set_integer_native(interp, temp, SELF.get_integer());
- return VTABLE_add(interp, temp, value, dest);
+ maybe_throw_overflow_error(INTERP);
+ temp = Parrot_pmc_new(INTERP, enum_class_BigInt);
+ VTABLE_set_integer_native(INTERP, temp, SELF.get_integer());
+ return VTABLE_add(INTERP, temp, value, dest);
}
MULTI PMC *add(DEFAULT value, PMC *dest) {
- dest = Parrot_pmc_new(INTERP, VTABLE_type(interp, value));
+ dest = Parrot_pmc_new(INTERP, VTABLE_type(INTERP, value));
VTABLE_set_number_native(INTERP, dest,
SELF.get_integer() + VTABLE_get_number(INTERP, value));
@@ -359,10 +359,10 @@
}
else {
PMC *temp;
- maybe_throw_overflow_error(interp);
- temp = Parrot_pmc_new(interp, enum_class_BigInt);
- VTABLE_set_integer_native(interp, temp, a);
- return VTABLE_add_int(interp, temp, b, dest);
+ maybe_throw_overflow_error(INTERP);
+ temp = Parrot_pmc_new(INTERP, enum_class_BigInt);
+ VTABLE_set_integer_native(INTERP, temp, a);
+ return VTABLE_add_int(INTERP, temp, b, dest);
}
}
@@ -409,9 +409,9 @@
if ((c^a) >= 0 || (c^b) >= 0)
VTABLE_set_integer_native(INTERP, SELF, c);
else {
- maybe_throw_overflow_error(interp);
- SELF = upgrade_self_to_bignum(interp, SELF);
- VTABLE_i_add_int(interp, SELF, b);
+ maybe_throw_overflow_error(INTERP);
+ SELF = upgrade_self_to_bignum(INTERP, SELF);
+ VTABLE_i_add_int(INTERP, SELF, b);
}
}
@@ -449,10 +449,10 @@
}
else {
PMC *temp;
- maybe_throw_overflow_error(interp);
- temp = Parrot_pmc_new(interp, enum_class_BigInt);
- VTABLE_set_integer_native(interp, temp, a);
- return VTABLE_subtract(interp, temp, value, dest);
+ maybe_throw_overflow_error(INTERP);
+ temp = Parrot_pmc_new(INTERP, enum_class_BigInt);
+ VTABLE_set_integer_native(INTERP, temp, a);
+ return VTABLE_subtract(INTERP, temp, value, dest);
}
}
@@ -472,10 +472,10 @@
MULTI PMC *subtract(BigInt value, PMC *dest) {
PMC *temp;
- maybe_throw_overflow_error(interp);
- temp = Parrot_pmc_new(interp, enum_class_BigInt);
- VTABLE_set_integer_native(interp, temp, SELF.get_integer());
- return VTABLE_subtract(interp, temp, value, dest);
+ maybe_throw_overflow_error(INTERP);
+ temp = Parrot_pmc_new(INTERP, enum_class_BigInt);
+ VTABLE_set_integer_native(INTERP, temp, SELF.get_integer());
+ return VTABLE_subtract(INTERP, temp, value, dest);
}
@@ -510,10 +510,10 @@
}
else {
PMC *temp;
- maybe_throw_overflow_error(interp);
- temp = Parrot_pmc_new(interp, enum_class_BigInt);
- VTABLE_set_integer_native(interp, temp, a);
- return VTABLE_subtract_int(interp, temp, b, dest);
+ maybe_throw_overflow_error(INTERP);
+ temp = Parrot_pmc_new(INTERP, enum_class_BigInt);
+ VTABLE_set_integer_native(INTERP, temp, a);
+ return VTABLE_subtract_int(INTERP, temp, b, dest);
}
}
@@ -540,9 +540,9 @@
if ((c^a) >= 0 || (c^~b) >= 0)
VTABLE_set_integer_native(INTERP, SELF, c);
else {
- maybe_throw_overflow_error(interp);
- SELF = upgrade_self_to_bignum(interp, SELF);
- VTABLE_i_subtract(interp, SELF, value);
+ maybe_throw_overflow_error(INTERP);
+ SELF = upgrade_self_to_bignum(INTERP, SELF);
+ VTABLE_i_subtract(INTERP, SELF, value);
}
}
@@ -603,7 +603,7 @@
const double cf = (double)a * (double)b;
if ((double) c == cf) {
- dest = Parrot_pmc_new(INTERP, VTABLE_type(interp, SELF));
+ dest = Parrot_pmc_new(INTERP, VTABLE_type(INTERP, SELF));
VTABLE_set_integer_native(INTERP, dest, c);
return dest;
@@ -611,8 +611,8 @@
else {
PMC *temp;
maybe_throw_overflow_error(INTERP);
- temp = Parrot_pmc_new(interp, enum_class_BigInt);
- VTABLE_set_integer_native(interp, temp, a);
+ temp = Parrot_pmc_new(INTERP, enum_class_BigInt);
+ VTABLE_set_integer_native(INTERP, temp, a);
return VTABLE_multiply(INTERP, temp, value, dest);
}
}
@@ -656,8 +656,8 @@
else {
PMC *temp;
maybe_throw_overflow_error(INTERP);
- temp = Parrot_pmc_new(interp, enum_class_BigInt);
- VTABLE_set_integer_native(interp, temp, a);
+ temp = Parrot_pmc_new(INTERP, enum_class_BigInt);
+ VTABLE_set_integer_native(INTERP, temp, a);
return VTABLE_multiply_int(INTERP, temp, b, dest);
}
}
@@ -682,7 +682,7 @@
MULTI void i_multiply(BigInt value) {
- interp->vtables[enum_class_BigInt]->multiply_int(INTERP, value, SELF.get_integer(), SELF);
+ INTERP->vtables[enum_class_BigInt]->multiply_int(INTERP, value, SELF.get_integer(), SELF);
}
@@ -743,8 +743,8 @@
MULTI PMC *divide(BigInt value, PMC *dest) {
PMC *temp;
maybe_throw_overflow_error(INTERP);
- temp = Parrot_pmc_new(interp, enum_class_BigInt);
- VTABLE_set_integer_native(interp, temp, SELF.get_integer());
+ temp = Parrot_pmc_new(INTERP, enum_class_BigInt);
+ VTABLE_set_integer_native(INTERP, temp, SELF.get_integer());
return VTABLE_divide(INTERP, temp, value, dest);
}
@@ -804,8 +804,8 @@
MULTI PMC *floor_divide(BigInt value, PMC *dest) {
PMC *temp;
maybe_throw_overflow_error(INTERP);
- temp = Parrot_pmc_new(interp, enum_class_BigInt);
- VTABLE_set_integer_native(interp, temp, SELF.get_integer());
+ temp = Parrot_pmc_new(INTERP, enum_class_BigInt);
+ VTABLE_set_integer_native(INTERP, temp, SELF.get_integer());
return VTABLE_floor_divide(INTERP, temp, value, dest);
}
@@ -926,8 +926,8 @@
MULTI PMC *modulus(BigInt value, PMC *dest) {
PMC *temp;
maybe_throw_overflow_error(INTERP);
- temp = Parrot_pmc_new(interp, enum_class_BigInt);
- VTABLE_set_integer_native(interp, temp, SELF.get_integer());
+ temp = Parrot_pmc_new(INTERP, enum_class_BigInt);
+ VTABLE_set_integer_native(INTERP, temp, SELF.get_integer());
return VTABLE_modulus(INTERP, temp, value, dest);
}
@@ -1029,7 +1029,7 @@
case enum_class_BigInt:
temp = Parrot_pmc_new(INTERP, enum_class_BigInt);
VTABLE_set_integer_native(INTERP, temp, SELF.get_integer());
- Parrot_mmd_multi_dispatch_from_c_args(interp,
+ Parrot_mmd_multi_dispatch_from_c_args(INTERP,
"is_equal", "PP->I", temp, value, &retval);
return retval;
break;
@@ -1066,7 +1066,7 @@
MULTI INTVAL cmp(Float value) {
INTVAL iv;
- GET_ATTR_iv(interp, SELF, iv);
+ GET_ATTR_iv(INTERP, SELF, iv);
{
const FLOATVAL diff = (FLOATVAL)iv - VTABLE_get_number(INTERP, value);
@@ -1078,7 +1078,7 @@
MULTI INTVAL cmp(DEFAULT value) {
/* int or undef */
INTVAL selfint;
- GET_ATTR_iv(interp, SELF, selfint);
+ GET_ATTR_iv(INTERP, SELF, selfint);
{
const INTVAL valueint = VTABLE_get_integer(INTERP, value);
return selfint > valueint ? 1 : selfint < valueint ? -1 : 0;
@@ -1134,16 +1134,16 @@
VTABLE void increment() {
INTVAL a, c;
- GET_ATTR_iv(interp, SELF, a);
+ GET_ATTR_iv(INTERP, SELF, a);
c = a + 1;
/* did not overflow */
if ((c^a) >= 0 || (c^1) >= 0)
- SET_ATTR_iv(interp, SELF, c);
+ SET_ATTR_iv(INTERP, SELF, c);
else {
- Parrot_pmc_reuse(interp, SELF, enum_class_BigInt, 0);
- VTABLE_set_integer_native(interp, SELF, a);
- VTABLE_increment(interp, SELF);
+ Parrot_pmc_reuse(INTERP, SELF, enum_class_BigInt, 0);
+ VTABLE_set_integer_native(INTERP, SELF, a);
+ VTABLE_increment(INTERP, SELF);
}
}
@@ -1163,11 +1163,11 @@
const INTVAL c = a - 1;
if ((c^a) >= 0 || (c^~1) >= 0)
- VTABLE_set_integer_native(interp, SELF, c);
+ VTABLE_set_integer_native(INTERP, SELF, c);
else {
Parrot_pmc_reuse(INTERP, SELF, enum_class_BigInt, 0);
- VTABLE_set_integer_native(interp, SELF, a);
- VTABLE_decrement(interp, SELF);
+ VTABLE_set_integer_native(INTERP, SELF, a);
+ VTABLE_decrement(INTERP, SELF);
}
}
@@ -1218,10 +1218,10 @@
STRING *result;
if ((base < 2) || (base > 36))
- Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_OUT_OF_BOUNDS,
+ Parrot_ex_throw_from_c_args(INTERP, NULL, EXCEPTION_OUT_OF_BOUNDS,
"get_as_base: base out of bounds");
- result = Parrot_str_from_int_base(interp, buf,
+ result = Parrot_str_from_int_base(INTERP, buf,
(HUGEINTVAL)VTABLE_get_integer(INTERP, SELF),
(unsigned int)base);
Modified: branches/codestring/src/pmc/key.pmc
==============================================================================
--- branches/codestring/src/pmc/key.pmc Wed May 5 23:52:59 2010 (r46321)
+++ branches/codestring/src/pmc/key.pmc Thu May 6 00:31:08 2010 (r46322)
@@ -238,7 +238,7 @@
void push_pmc(PMC *value) {
if (value->vtable->base_type != enum_class_Key)
- Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_INVALID_OPERATION,
+ Parrot_ex_throw_from_c_args(INTERP, NULL, EXCEPTION_INVALID_OPERATION,
"Can only push another Key onto a Key PMC.");
key_append(INTERP, SELF, value);
Modified: branches/codestring/src/pmc/lexinfo.pmc
==============================================================================
--- branches/codestring/src/pmc/lexinfo.pmc Wed May 5 23:52:59 2010 (r46321)
+++ branches/codestring/src/pmc/lexinfo.pmc Thu May 6 00:31:08 2010 (r46322)
@@ -51,7 +51,7 @@
void class_init() {
/* there is no pmclass const_pmc flag yet */
- interp->vtables[entry]->flags |= VTABLE_IS_CONST_PMC_FLAG;
+ INTERP->vtables[entry]->flags |= VTABLE_IS_CONST_PMC_FLAG;
}
@@ -96,8 +96,8 @@
*/
VTABLE PMC *inspect_str(STRING *what) {
- if (Parrot_str_equal(interp, what, CONST_STRING(interp, "symbols"))) {
- PMC * const result = Parrot_pmc_new(interp, enum_class_ResizableStringArray);
+ if (Parrot_str_equal(INTERP, what, CONST_STRING(INTERP, "symbols"))) {
+ PMC * const result = Parrot_pmc_new(INTERP, enum_class_ResizableStringArray);
const Hash *hash = (Hash *)SELF.get_pointer();
const UINTVAL entries = hash->entries;
@@ -108,12 +108,12 @@
HashBucket *bucket = hash->bi[i];
while (bucket) {
if (++found > entries)
- Parrot_ex_throw_from_c_args(interp, NULL, 1,
+ Parrot_ex_throw_from_c_args(INTERP, NULL, 1,
"Detected corruption at LexInfo hash %p entries %d",
hash, (int)entries);
PARROT_ASSERT(bucket->key);
- VTABLE_push_string(interp, result, (STRING *)bucket->key);
+ VTABLE_push_string(INTERP, result, (STRING *)bucket->key);
bucket = bucket->next;
}
@@ -122,7 +122,7 @@
return result;
}
else
- Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_INVALID_OPERATION,
+ Parrot_ex_throw_from_c_args(INTERP, NULL, EXCEPTION_INVALID_OPERATION,
"Unknown introspection value '%S'", what);
}
Modified: branches/codestring/src/pmc/managedstruct.pmc
==============================================================================
--- branches/codestring/src/pmc/managedstruct.pmc Wed May 5 23:52:59 2010 (r46321)
+++ branches/codestring/src/pmc/managedstruct.pmc Thu May 6 00:31:08 2010 (r46322)
@@ -148,9 +148,9 @@
PMC *dest;
if (clone_func) {
void *clone_data = PARROT_MANAGEDSTRUCT(SELF)->custom_clone_priv;
- return clone_func(interp, SELF, clone_data);
+ return clone_func(INTERP, SELF, clone_data);
}
- dest = Parrot_pmc_new_init(interp, SELF->vtable->base_type,
+ dest = Parrot_pmc_new_init(INTERP, SELF->vtable->base_type,
PARROT_MANAGEDSTRUCT(SELF)->init);
if (PARROT_MANAGEDSTRUCT(SELF)->ptr)
Modified: branches/codestring/src/pmc/multisub.pmc
==============================================================================
--- branches/codestring/src/pmc/multisub.pmc Wed May 5 23:52:59 2010 (r46321)
+++ branches/codestring/src/pmc/multisub.pmc Thu May 6 00:31:08 2010 (r46322)
@@ -34,49 +34,49 @@
}
VTABLE void push_pmc(PMC *value) {
- STRING * const _sub = CONST_STRING(interp, "Sub");
- STRING * const _nci = CONST_STRING(interp, "NCI");
+ STRING * const _sub = CONST_STRING(INTERP, "Sub");
+ STRING * const _nci = CONST_STRING(INTERP, "NCI");
- if (!VTABLE_isa(interp, value, _sub)
- && !VTABLE_isa(interp, value, _nci))
- Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_INVALID_OPERATION,
+ if (!VTABLE_isa(INTERP, value, _sub)
+ && !VTABLE_isa(INTERP, value, _nci))
+ Parrot_ex_throw_from_c_args(INTERP, NULL, EXCEPTION_INVALID_OPERATION,
"attempt to push non Sub PMC");
SUPER(value);
}
VTABLE void set_pmc_keyed_int(INTVAL key, PMC *value) {
- STRING * const _sub = CONST_STRING(interp, "Sub");
- if (!VTABLE_isa(interp, value, _sub))
- Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_INVALID_OPERATION,
+ STRING * const _sub = CONST_STRING(INTERP, "Sub");
+ if (!VTABLE_isa(INTERP, value, _sub))
+ Parrot_ex_throw_from_c_args(INTERP, NULL, EXCEPTION_INVALID_OPERATION,
"attempt to set non Sub PMC");
SUPER(key, value);
}
VTABLE void set_integer_keyed_int(INTVAL key, INTVAL value) {
- Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_INVALID_OPERATION,
+ Parrot_ex_throw_from_c_args(INTERP, NULL, EXCEPTION_INVALID_OPERATION,
"attempt to set non Sub PMC");
}
VTABLE void set_string_keyed_int(INTVAL key, STRING *value) {
- Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_INVALID_OPERATION,
+ Parrot_ex_throw_from_c_args(INTERP, NULL, EXCEPTION_INVALID_OPERATION,
"attempt to set non Sub PMC");
}
VTABLE void set_number_keyed_int(INTVAL key, FLOATVAL value) {
- Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_INVALID_OPERATION,
+ Parrot_ex_throw_from_c_args(INTERP, NULL, EXCEPTION_INVALID_OPERATION,
"attempt to set non Sub PMC");
}
VTABLE opcode_t *invoke(void *next) {
- PMC * const sig_obj = CONTEXT(interp)->current_sig;
- PMC * const func = Parrot_mmd_sort_manhattan_by_sig_pmc(interp,
+ PMC * const sig_obj = CONTEXT(INTERP)->current_sig;
+ PMC * const func = Parrot_mmd_sort_manhattan_by_sig_pmc(INTERP,
SELF, sig_obj);
if (PMC_IS_NULL(func))
Parrot_ex_throw_from_c_args(INTERP, NULL, 1,
"No applicable candidates found to dispatch to for '%Ss'",
- VTABLE_get_string(interp, SELF));
+ VTABLE_get_string(INTERP, SELF));
return VTABLE_invoke(INTERP, func, next);
}
@@ -86,26 +86,26 @@
ResizablePMCArray's VTABLEs of the same names. Hopefully we
don't need anything beyond that. */
VTABLE PMC *get_pmc_keyed(PMC *key) {
- PMC * const sig_obj = CONTEXT(interp)->current_sig;
- PMC * const sub = Parrot_mmd_sort_manhattan_by_sig_pmc(interp,
+ PMC * const sig_obj = CONTEXT(INTERP)->current_sig;
+ PMC * const sub = Parrot_mmd_sort_manhattan_by_sig_pmc(INTERP,
SELF, sig_obj);
if (PMC_IS_NULL(sub))
Parrot_ex_throw_from_c_args(INTERP, NULL, 1,
"No applicable candidates found to dispatch to for '%Ss'",
- VTABLE_get_string(interp, SELF));
+ VTABLE_get_string(INTERP, SELF));
return SUPER(key);
}
VTABLE PMC *get_pmc_keyed_str(STRING *s) {
- PMC * const sig_obj = CONTEXT(interp)->current_sig;
- PMC * const sub = Parrot_mmd_sort_manhattan_by_sig_pmc(interp,
+ PMC * const sig_obj = CONTEXT(INTERP)->current_sig;
+ PMC * const sub = Parrot_mmd_sort_manhattan_by_sig_pmc(INTERP,
SELF, sig_obj);
if (PMC_IS_NULL(sub))
Parrot_ex_throw_from_c_args(INTERP, NULL, 1,
"No applicable candidates found to dispatch to for '%Ss'",
- VTABLE_get_string(interp, SELF));
+ VTABLE_get_string(INTERP, SELF));
return SUPER(s);
}
@@ -115,8 +115,8 @@
to this input argument list and return an iterator over that list. */
METHOD get_iter(PMC *args) {
- STRING * const _array = CONST_STRING(interp, "Array");
- STRING * const _string = CONST_STRING(interp, "String");
+ STRING * const _array = CONST_STRING(INTERP, "Array");
+ STRING * const _string = CONST_STRING(INTERP, "String");
if (VTABLE_isa(INTERP, args, _array)){
/* TODO: What goes here? */
@@ -126,7 +126,7 @@
/* TODO: What goes here? */
}
else
- Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_INVALID_OPERATION,
+ Parrot_ex_throw_from_c_args(INTERP, NULL, EXCEPTION_INVALID_OPERATION,
"attempt to call get_iter method with invalid arg type.\n");
}
}
Modified: branches/codestring/src/pmc/namespace.pmc
==============================================================================
--- branches/codestring/src/pmc/namespace.pmc Wed May 5 23:52:59 2010 (r46321)
+++ branches/codestring/src/pmc/namespace.pmc Thu May 6 00:31:08 2010 (r46322)
@@ -319,13 +319,13 @@
Parrot_NameSpace_attributes * const nsinfo = PARROT_NAMESPACE(SELF);
if (nsinfo->hash)
- parrot_mark_hash(interp, nsinfo->hash);
+ parrot_mark_hash(INTERP, nsinfo->hash);
- Parrot_gc_mark_PMC_alive(interp, nsinfo->parent);
- Parrot_gc_mark_PMC_alive(interp, nsinfo->_class);
- Parrot_gc_mark_PMC_alive(interp, nsinfo->vtable);
- Parrot_gc_mark_PMC_alive(interp, nsinfo->methods);
- Parrot_gc_mark_STRING_alive(interp, nsinfo->name);
+ Parrot_gc_mark_PMC_alive(INTERP, nsinfo->parent);
+ Parrot_gc_mark_PMC_alive(INTERP, nsinfo->_class);
+ Parrot_gc_mark_PMC_alive(INTERP, nsinfo->vtable);
+ Parrot_gc_mark_PMC_alive(INTERP, nsinfo->methods);
+ Parrot_gc_mark_STRING_alive(INTERP, nsinfo->name);
}
/*
@@ -385,14 +385,14 @@
PMC * const old = (PMC *)parrot_hash_get(INTERP, (Hash *)SELF.get_pointer(), key);
/* If it's a sub... */
- if (maybe_add_sub_to_namespace(interp, SELF, key, value))
+ if (maybe_add_sub_to_namespace(INTERP, SELF, key, value))
return;
/* If it's an NCI method */
- add_nci_to_namespace(interp, SELF, key, value);
+ add_nci_to_namespace(INTERP, SELF, key, value);
/* If it's a multi-sub and the first in this NS... */
- add_multi_to_namespace(interp, SELF, key, value);
+ add_multi_to_namespace(INTERP, SELF, key, value);
if (!old)
SUPER(key, value);
@@ -465,10 +465,10 @@
}
if (key->vtable->base_type == enum_class_ResizableStringArray) {
- const INTVAL elements = VTABLE_elements(interp, key);
+ const INTVAL elements = VTABLE_elements(INTERP, key);
INTVAL i;
for (i = 0; i < elements; ++i) {
- STRING * const part = VTABLE_get_string_keyed_int(interp, key, i);
+ STRING * const part = VTABLE_get_string_keyed_int(INTERP, key, i);
if ((i + 1) >= elements) { /* Last entry in the array */
Parrot_set_global(INTERP, ns, part, value);
@@ -554,7 +554,7 @@
if (PMC_IS_NULL(vtable))
return PMCNULL;
- return VTABLE_get_pmc_keyed_int(interp, vtable, key);
+ return VTABLE_get_pmc_keyed_int(INTERP, vtable, key);
}
/*
@@ -612,10 +612,10 @@
}
}
case enum_class_ResizableStringArray: {
- const INTVAL elements = VTABLE_elements(interp, key);
+ const INTVAL elements = VTABLE_elements(INTERP, key);
INTVAL i;
for (i = 0; i < elements; ++i) {
- STRING * const part = VTABLE_get_string_keyed_int(interp, key, i);
+ STRING * const part = VTABLE_get_string_keyed_int(INTERP, key, i);
/* Last entry in the array */
if ((i + 1) >= elements)
@@ -685,17 +685,17 @@
const Parrot_NameSpace_attributes * const nsinfo = PARROT_NAMESPACE(SELF);
PMC *found;
- if (Parrot_str_equal(interp, what, CONST_STRING(interp, "methods"))) {
+ if (Parrot_str_equal(INTERP, what, CONST_STRING(INTERP, "methods"))) {
found = nsinfo->methods;
}
- else if (Parrot_str_equal(interp, what, CONST_STRING(interp, "vtable_overrides"))) {
+ else if (Parrot_str_equal(INTERP, what, CONST_STRING(INTERP, "vtable_overrides"))) {
found = nsinfo->vtable;
}
- else if (Parrot_str_equal(interp, what, CONST_STRING(interp, "class"))) {
+ else if (Parrot_str_equal(INTERP, what, CONST_STRING(INTERP, "class"))) {
found = nsinfo->_class;
}
else
- Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_INVALID_OPERATION,
+ Parrot_ex_throw_from_c_args(INTERP, NULL, EXCEPTION_INVALID_OPERATION,
"Unknown introspection value '%S'", what);
/* return found value */
@@ -1015,75 +1015,75 @@
*/
METHOD export_to(PMC *dest, PMC *what) {
- STRING * const s_hash = CONST_STRING(interp, "hash");
- STRING * const s_array = CONST_STRING(interp, "array");
+ STRING * const s_hash = CONST_STRING(INTERP, "hash");
+ STRING * const s_array = CONST_STRING(INTERP, "array");
if (PMC_IS_NULL(dest))
- Parrot_ex_throw_from_c_args(interp, NULL, 0,
+ Parrot_ex_throw_from_c_args(INTERP, NULL, 0,
"destination namespace not specified");
- if (PMC_IS_NULL(what) || !VTABLE_elements(interp, what))
- Parrot_ex_throw_from_c_args(interp, NULL, 0,
+ if (PMC_IS_NULL(what) || !VTABLE_elements(INTERP, what))
+ Parrot_ex_throw_from_c_args(INTERP, NULL, 0,
"exporting default object set not yet implemented");
/* if "what" does "hash", we extract string key/value pairs,
* lookup the object with the name specified in the key,
* and export it with the name specified as value. */
if (VTABLE_does(INTERP, what, s_hash)) {
- PMC * const iter = VTABLE_get_iter(interp, what);
- const INTVAL n = VTABLE_elements(interp, what);
+ PMC * const iter = VTABLE_get_iter(INTERP, what);
+ const INTVAL n = VTABLE_elements(INTERP, what);
INTVAL i;
for (i = 0; i < n; ++i) {
STRING *dest_name;
PMC *object;
- STRING * const src_name = VTABLE_shift_string(interp, iter);
+ STRING * const src_name = VTABLE_shift_string(INTERP, iter);
if (STRING_IS_NULL(src_name) || STRING_IS_EMPTY(src_name))
- Parrot_ex_throw_from_c_args(interp, NULL, 0,
+ Parrot_ex_throw_from_c_args(INTERP, NULL, 0,
"source object name not specified");
- if (PMC_IS_NULL(VTABLE_get_pmc_keyed_str(interp, what, src_name))) {
+ if (PMC_IS_NULL(VTABLE_get_pmc_keyed_str(INTERP, what, src_name))) {
dest_name = src_name;
}
else {
- dest_name = VTABLE_get_string_keyed_str(interp, what, src_name);
+ dest_name = VTABLE_get_string_keyed_str(INTERP, what, src_name);
if (STRING_IS_NULL(dest_name) || STRING_IS_EMPTY(dest_name))
dest_name = src_name;
}
- object = VTABLE_get_pmc_keyed_str(interp, SELF, src_name);
+ object = VTABLE_get_pmc_keyed_str(INTERP, SELF, src_name);
if (PMC_IS_NULL(object))
- Parrot_ex_throw_from_c_args(interp, NULL, 0,
+ Parrot_ex_throw_from_c_args(INTERP, NULL, 0,
"object '%Ss' not found in current namespace", src_name);
- VTABLE_set_pmc_keyed_str(interp, dest, dest_name, object);
+ VTABLE_set_pmc_keyed_str(INTERP, dest, dest_name, object);
}
}
else if (VTABLE_does(INTERP, what, s_array)) {
- const INTVAL n = VTABLE_elements(interp, what);
+ const INTVAL n = VTABLE_elements(INTERP, what);
INTVAL i;
for (i = 0; i < n; ++i) {
PMC *object;
- STRING * const name = VTABLE_get_string_keyed_int(interp, what, i);
+ STRING * const name = VTABLE_get_string_keyed_int(INTERP, what, i);
if (STRING_IS_NULL(name) || STRING_IS_EMPTY(name))
- Parrot_ex_throw_from_c_args(interp, NULL, 0,
+ Parrot_ex_throw_from_c_args(INTERP, NULL, 0,
"object name not specified");
- object = VTABLE_get_pmc_keyed_str(interp, SELF, name);
+ object = VTABLE_get_pmc_keyed_str(INTERP, SELF, name);
if (PMC_IS_NULL(object))
- Parrot_ex_throw_from_c_args(interp, NULL, 0,
+ Parrot_ex_throw_from_c_args(INTERP, NULL, 0,
"object '%Ss' not found in current namespace", name);
- VTABLE_set_pmc_keyed_str(interp, dest, name, object);
+ VTABLE_set_pmc_keyed_str(INTERP, dest, name, object);
}
}
else
- Parrot_ex_throw_from_c_args(interp, NULL, 0,
+ Parrot_ex_throw_from_c_args(INTERP, NULL, 0,
"can't handle argument of type %s", what->vtable->base_type);
}
Modified: branches/codestring/src/pmc/null.pmc
==============================================================================
--- branches/codestring/src/pmc/null.pmc Wed May 5 23:52:59 2010 (r46321)
+++ branches/codestring/src/pmc/null.pmc Thu May 6 00:31:08 2010 (r46322)
@@ -55,21 +55,21 @@
*/
VTABLE void init() {
- UNUSED(interp)
+ UNUSED(INTERP)
}
VTABLE void *get_pointer() {
- UNUSED(interp)
+ UNUSED(INTERP)
return PMCNULL;
}
VTABLE void set_pointer(void *p) {
- UNUSED(interp)
+ UNUSED(INTERP)
PMCNULL = (PMC *)p;
}
VTABLE INTVAL does(STRING *what) {
- UNUSED(interp)
+ UNUSED(INTERP)
UNUSED(what)
/* XXX maybe a hack to get TGE running again */
return 0;
@@ -99,7 +99,7 @@
*/
VTABLE PMC *find_method(STRING *method_name) {
- Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_NULL_REG_ACCESS,
+ Parrot_ex_throw_from_c_args(INTERP, NULL, EXCEPTION_NULL_REG_ACCESS,
"Null PMC access in find_method('%Ss')",
method_name);
}
Modified: branches/codestring/src/pmc/object.pmc
==============================================================================
--- branches/codestring/src/pmc/object.pmc Wed May 5 23:52:59 2010 (r46321)
+++ branches/codestring/src/pmc/object.pmc Thu May 6 00:31:08 2010 (r46322)
@@ -218,7 +218,7 @@
*/
VTABLE void init() {
- Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_INVALID_OPERATION,
+ Parrot_ex_throw_from_c_args(INTERP, NULL, EXCEPTION_INVALID_OPERATION,
"Object must be created by a class.");
}
@@ -234,7 +234,7 @@
*/
VTABLE void init_pmc(PMC *worreva) {
- Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_INVALID_OPERATION,
+ Parrot_ex_throw_from_c_args(INTERP, NULL, EXCEPTION_INVALID_OPERATION,
"Object must be created by a class.");
}
@@ -261,20 +261,20 @@
*/
VTABLE STRING *name() {
- PMC * const _class = VTABLE_get_class(interp, SELF);
- STRING * const name = CONST_STRING(interp, "name");
+ PMC * const _class = VTABLE_get_class(INTERP, SELF);
+ STRING * const name = CONST_STRING(INTERP, "name");
/* If there's a vtable override for 'name' run that instead. */
- PMC * const method = Parrot_oo_find_vtable_override(interp, _class, name);
+ PMC * const method = Parrot_oo_find_vtable_override(INTERP, _class, name);
if (!PMC_IS_NULL(method)) {
STRING *result = NULL;
- Parrot_pcc_invoke_sub_from_c_args(interp, method, "Pi->S",
+ Parrot_pcc_invoke_sub_from_c_args(INTERP, method, "Pi->S",
SELF, &result);
return result;
}
else
- return VTABLE_get_string(interp, _class);
+ return VTABLE_get_string(INTERP, _class);
}
/*
@@ -290,8 +290,8 @@
if (PARROT_OBJECT(SELF)) {
Parrot_Object_attributes * const obj = PARROT_OBJECT(SELF);
- Parrot_gc_mark_PMC_alive(interp, obj->_class);
- Parrot_gc_mark_PMC_alive(interp, obj->attrib_store);
+ Parrot_gc_mark_PMC_alive(INTERP, obj->_class);
+ Parrot_gc_mark_PMC_alive(INTERP, obj->attrib_store);
}
}
@@ -307,29 +307,29 @@
*/
VTABLE PMC *get_attr_str(STRING *name) {
Parrot_Object_attributes * const obj = PARROT_OBJECT(SELF);
- STRING * const get_attr = CONST_STRING(interp, "get_attr_str");
+ STRING * const get_attr = CONST_STRING(INTERP, "get_attr_str");
INTVAL index;
/* If there's a vtable override for 'get_attr_str' run that first. */
- PMC * const method = Parrot_oo_find_vtable_override(interp,
- VTABLE_get_class(interp, SELF), get_attr);
+ PMC * const method = Parrot_oo_find_vtable_override(INTERP,
+ VTABLE_get_class(INTERP, SELF), get_attr);
if (!PMC_IS_NULL(method)) {
PMC *result = PMCNULL;
- Parrot_pcc_invoke_sub_from_c_args(interp, method, "PiS->P",
+ Parrot_pcc_invoke_sub_from_c_args(INTERP, method, "PiS->P",
SELF, name, &result);
return result;
}
/* Look up the index. */
- index = get_attrib_index(interp, obj->_class, name);
+ index = get_attrib_index(INTERP, obj->_class, name);
/* If lookup failed, exception. */
if (index == -1)
- Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_ATTRIB_NOT_FOUND,
+ Parrot_ex_throw_from_c_args(INTERP, NULL, EXCEPTION_ATTRIB_NOT_FOUND,
"No such attribute '%S'", name);
- return VTABLE_get_pmc_keyed_int(interp, obj->attrib_store, index);
+ return VTABLE_get_pmc_keyed_int(INTERP, obj->attrib_store, index);
}
/*
@@ -346,15 +346,15 @@
Parrot_Object_attributes * const obj = PARROT_OBJECT(SELF);
/* Look up the index. */
- const INTVAL index = get_attrib_index_keyed(interp, obj->_class, key, name);
+ const INTVAL index = get_attrib_index_keyed(INTERP, obj->_class, key, name);
/* If lookup failed, exception. */
if (index == -1)
- Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_ATTRIB_NOT_FOUND,
+ Parrot_ex_throw_from_c_args(INTERP, NULL, EXCEPTION_ATTRIB_NOT_FOUND,
"No such attribute '%S' in class '%S'", name,
- VTABLE_get_string(interp, key));
+ VTABLE_get_string(INTERP, key));
- return VTABLE_get_pmc_keyed_int(interp, obj->attrib_store, index);
+ return VTABLE_get_pmc_keyed_int(INTERP, obj->attrib_store, index);
}
/*
@@ -369,26 +369,26 @@
*/
VTABLE void set_attr_str(STRING *name, PMC *value) {
Parrot_Object_attributes * const obj = PARROT_OBJECT(SELF);
- STRING * const vtable_meth_name = CONST_STRING(interp, "set_attr_str");
+ STRING * const vtable_meth_name = CONST_STRING(INTERP, "set_attr_str");
INTVAL index;
/* If there's a vtable override for 'set_attr_str' run that first. */
- PMC * const method = Parrot_oo_find_vtable_override(interp,
- VTABLE_get_class(interp, SELF), vtable_meth_name);
+ PMC * const method = Parrot_oo_find_vtable_override(INTERP,
+ VTABLE_get_class(INTERP, SELF), vtable_meth_name);
if (!PMC_IS_NULL(method)) {
- Parrot_pcc_invoke_sub_from_c_args(interp, method, "PiSP->",
+ Parrot_pcc_invoke_sub_from_c_args(INTERP, method, "PiSP->",
SELF, name, value);
return;
}
- index = get_attrib_index(interp, obj->_class, name);
+ index = get_attrib_index(INTERP, obj->_class, name);
/* If lookup failed, exception. */
if (index == -1)
- Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_ATTRIB_NOT_FOUND,
+ Parrot_ex_throw_from_c_args(INTERP, NULL, EXCEPTION_ATTRIB_NOT_FOUND,
"No such attribute '%S'", name);
- VTABLE_set_pmc_keyed_int(interp, obj->attrib_store, index, value);
+ VTABLE_set_pmc_keyed_int(INTERP, obj->attrib_store, index, value);
}
/*
@@ -403,15 +403,15 @@
*/
VTABLE void set_attr_keyed(PMC *key, STRING *name, PMC *value) {
Parrot_Object_attributes * const obj = PARROT_OBJECT(SELF);
- const INTVAL index = get_attrib_index_keyed(interp, obj->_class, key, name);
+ const INTVAL index = get_attrib_index_keyed(INTERP, obj->_class, key, name);
/* If lookup failed, exception. */
if (index == -1)
- Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_ATTRIB_NOT_FOUND,
+ Parrot_ex_throw_from_c_args(INTERP, NULL, EXCEPTION_ATTRIB_NOT_FOUND,
"No such attribute '%S' in class '%S'", name,
- VTABLE_get_string(interp, key));
+ VTABLE_get_string(INTERP, key));
- VTABLE_set_pmc_keyed_int(interp, obj->attrib_store, index, value);
+ VTABLE_set_pmc_keyed_int(INTERP, obj->attrib_store, index, value);
}
/*
@@ -426,13 +426,13 @@
VTABLE PMC *find_method(STRING *name) {
Parrot_Object_attributes * const obj = PARROT_OBJECT(SELF);
Parrot_Class_attributes * const _class = PARROT_CLASS(obj->_class);
- PMC *method = find_cached(interp, obj->_class, name);
+ PMC *method = find_cached(INTERP, obj->_class, name);
if (!PMC_IS_NULL(method))
return method;
else {
- STRING * const find_method = CONST_STRING(interp, "find_method");
- const int num_classes = VTABLE_elements(interp,
+ STRING * const find_method = CONST_STRING(INTERP, "find_method");
+ const int num_classes = VTABLE_elements(INTERP,
_class->all_parents);
const int all_in_universe =
@@ -442,7 +442,7 @@
for (i = 0; i < num_classes; i++) {
/* Get the class. */
PMC * const cur_class =
- VTABLE_get_pmc_keyed_int(interp, _class->all_parents, i);
+ VTABLE_get_pmc_keyed_int(INTERP, _class->all_parents, i);
const Parrot_Class_attributes * const class_info =
PARROT_CLASS(cur_class);
@@ -450,12 +450,12 @@
/* If there's a vtable override for 'find_method' in the
* current class, run that first. */
- method = Parrot_oo_find_vtable_override_for_class(interp,
+ method = Parrot_oo_find_vtable_override_for_class(INTERP,
cur_class, find_method);
if (!PMC_IS_NULL(method)) {
PMC *result = PMCNULL;
- Parrot_pcc_invoke_sub_from_c_args(interp, method,
+ Parrot_pcc_invoke_sub_from_c_args(INTERP, method,
"PiS->P", SELF, name, &result);
/* break out to the CACHE IF FOUND code */
@@ -465,8 +465,8 @@
/* If it's from this universe or the class doesn't inherit from
* anything outside of it... */
- if (all_in_universe || VTABLE_isa(interp, cur_class, CONST_STRING(interp, "Class"))) {
- method = VTABLE_get_pmc_keyed_str(interp,
+ if (all_in_universe || VTABLE_isa(INTERP, cur_class, CONST_STRING(INTERP, "Class"))) {
+ method = VTABLE_get_pmc_keyed_str(INTERP,
class_info->methods, name);
/* Found it! */
@@ -480,7 +480,7 @@
}
if (!PMC_IS_NULL(method))
- cache_method(interp, obj->_class, name, method);
+ cache_method(INTERP, obj->_class, name, method);
return method;
}
@@ -498,36 +498,36 @@
VTABLE INTVAL get_integer() {
Parrot_Object_attributes * const obj = PARROT_OBJECT(SELF);
Parrot_Class_attributes * const _class = PARROT_CLASS(obj->_class);
- STRING * const meth_name = CONST_STRING(interp, "get_integer");
+ STRING * const meth_name = CONST_STRING(INTERP, "get_integer");
/* Walk and search for the vtable. */
- const int num_classes = VTABLE_elements(interp, _class->all_parents);
+ const int num_classes = VTABLE_elements(INTERP, _class->all_parents);
int i;
for (i = 0; i < num_classes; i++) {
/* Get the class. */
- PMC * const cur_class = VTABLE_get_pmc_keyed_int(interp, _class->all_parents, i);
+ PMC * const cur_class = VTABLE_get_pmc_keyed_int(INTERP, _class->all_parents, i);
- PMC * const meth = Parrot_oo_find_vtable_override_for_class(interp,
+ PMC * const meth = Parrot_oo_find_vtable_override_for_class(INTERP,
cur_class, meth_name);
if (!PMC_IS_NULL(meth)) {
INTVAL result;
- Parrot_pcc_invoke_sub_from_c_args(interp, meth, "Pi->I", SELF, &result);
+ Parrot_pcc_invoke_sub_from_c_args(INTERP, meth, "Pi->I", SELF, &result);
return result;
}
/* method name is get_integer */
if (cur_class->vtable->base_type == enum_class_PMCProxy) {
/* Get the PMC instance and call the vtable function on that. */
- STRING * const proxy = CONST_STRING(interp, "proxy");
- PMC * const del_object = VTABLE_get_attr_str(interp, SELF, proxy);
+ STRING * const proxy = CONST_STRING(INTERP, "proxy");
+ PMC * const del_object = VTABLE_get_attr_str(INTERP, SELF, proxy);
if (!PMC_IS_NULL(del_object)) {
- return (INTVAL)VTABLE_get_integer(interp, del_object);
+ return (INTVAL)VTABLE_get_integer(INTERP, del_object);
}
}
}
- return interp->vtables[enum_class_default]->get_integer(interp, SELF);
+ return INTERP->vtables[enum_class_default]->get_integer(INTERP, SELF);
}
/*
@@ -541,14 +541,14 @@
*/
VTABLE PMC *get_class() {
PMC * const classobj = PARROT_OBJECT(SELF)->_class;
- STRING * const get_class = CONST_STRING(interp, "get_class");
+ STRING * const get_class = CONST_STRING(INTERP, "get_class");
/* If there's a vtable override for 'get_class' run that instead. */
- PMC * const method = Parrot_oo_find_vtable_override(interp,
+ PMC * const method = Parrot_oo_find_vtable_override(INTERP,
classobj, get_class);
if (!PMC_IS_NULL(method)) {
PMC *result;
- Parrot_pcc_invoke_sub_from_c_args(interp, method, "Pi->P",
+ Parrot_pcc_invoke_sub_from_c_args(INTERP, method, "Pi->P",
SELF, &result);
return result;
}
@@ -567,20 +567,20 @@
*/
VTABLE PMC *get_namespace() {
- PMC * const classobj = VTABLE_get_class(interp, SELF);
- STRING * const get_namespace = CONST_STRING(interp, "get_namespace");
+ PMC * const classobj = VTABLE_get_class(INTERP, SELF);
+ STRING * const get_namespace = CONST_STRING(INTERP, "get_namespace");
/* If there's a vtable override for 'get_namespace' run that instead. */
- PMC * const method = Parrot_oo_find_vtable_override(interp,
+ PMC * const method = Parrot_oo_find_vtable_override(INTERP,
classobj, get_namespace);
if (!PMC_IS_NULL(method)) {
PMC *result;
- Parrot_pcc_invoke_sub_from_c_args(interp, method, "Pi->P",
+ Parrot_pcc_invoke_sub_from_c_args(INTERP, method, "Pi->P",
SELF, &result);
return result;
}
else
- return VTABLE_inspect_str(interp, classobj, CONST_STRING(interp, "namespace"));
+ return VTABLE_inspect_str(INTERP, classobj, CONST_STRING(INTERP, "namespace"));
}
@@ -596,7 +596,7 @@
*/
VTABLE INTVAL can(STRING *method_name) {
/* Just use find_method and see it if finds anything. */
- const PMC * const method = VTABLE_find_method(interp, SELF, method_name);
+ const PMC * const method = VTABLE_find_method(INTERP, SELF, method_name);
return !PMC_IS_NULL(method);
}
@@ -618,7 +618,7 @@
return 1;
/* Dispatch isa to the object's class */
- return VTABLE_isa_pmc(interp, VTABLE_get_class(interp, SELF), lookup);
+ return VTABLE_isa_pmc(INTERP, VTABLE_get_class(INTERP, SELF), lookup);
}
/*
@@ -637,8 +637,8 @@
if (SUPER(classname))
return 1;
- _class = VTABLE_get_class(interp, SELF);
- return VTABLE_isa(interp, _class, classname);
+ _class = VTABLE_get_class(INTERP, SELF);
+ return VTABLE_isa(INTERP, _class, classname);
}
/*
@@ -656,15 +656,15 @@
if (!role_name)
return 0;
else {
- PMC * const classobj = VTABLE_get_class(interp, SELF);
- STRING * const meth_name = CONST_STRING(interp, "does");
+ PMC * const classobj = VTABLE_get_class(INTERP, SELF);
+ STRING * const meth_name = CONST_STRING(INTERP, "does");
- PMC * const method = Parrot_oo_find_vtable_override(interp,
+ PMC * const method = Parrot_oo_find_vtable_override(INTERP,
classobj, meth_name);
if (!PMC_IS_NULL(method)) {
INTVAL result;
- Parrot_pcc_invoke_sub_from_c_args(interp, method,
+ Parrot_pcc_invoke_sub_from_c_args(INTERP, method,
"PiS->I", SELF, role_name, &result);
if (result)
return 1;
@@ -675,7 +675,7 @@
return 1;
/* Dispatch to the object's class */
- return VTABLE_does(interp, VTABLE_get_class(interp, SELF), role_name);
+ return VTABLE_does(INTERP, VTABLE_get_class(INTERP, SELF), role_name);
}
/*
@@ -696,7 +696,7 @@
return 1;
/* Dispatch to the object's class */
- return VTABLE_does_pmc(interp, VTABLE_get_class(interp, SELF), role);
+ return VTABLE_does_pmc(INTERP, VTABLE_get_class(INTERP, SELF), role);
}
/*
@@ -714,40 +714,40 @@
Parrot_Class_attributes * const _class = PARROT_CLASS(obj->_class);
/* Walk and search for the vtable. */
- const int num_classes = VTABLE_elements(interp, _class->all_parents);
+ const int num_classes = VTABLE_elements(INTERP, _class->all_parents);
int i;
for (i = 0; i < num_classes; i++) {
/* Get the class. */
- STRING * const meth_name = CONST_STRING(interp, "invoke");
- STRING * const proxy = CONST_STRING(interp, "proxy");
+ STRING * const meth_name = CONST_STRING(INTERP, "invoke");
+ STRING * const proxy = CONST_STRING(INTERP, "proxy");
PMC * const cur_class =
- VTABLE_get_pmc_keyed_int(interp, _class->all_parents, i);
+ VTABLE_get_pmc_keyed_int(INTERP, _class->all_parents, i);
PMC * const meth =
- Parrot_oo_find_vtable_override_for_class(interp, cur_class,
+ Parrot_oo_find_vtable_override_for_class(INTERP, cur_class,
meth_name);
if (!PMC_IS_NULL(meth)) {
/* Experimental code. See DEPRECATED.pod */
- PMC *call_sig = Parrot_pcc_get_signature(interp, CURRENT_CONTEXT(interp));
- if ((VTABLE_elements(interp, call_sig) == 0 ||
- VTABLE_get_pmc_keyed_int(interp, call_sig, 0) != SELF))
- VTABLE_unshift_pmc(interp, call_sig, SELF);
+ PMC *call_sig = Parrot_pcc_get_signature(INTERP, CURRENT_CONTEXT(INTERP));
+ if ((VTABLE_elements(INTERP, call_sig) == 0 ||
+ VTABLE_get_pmc_keyed_int(INTERP, call_sig, 0) != SELF))
+ VTABLE_unshift_pmc(INTERP, call_sig, SELF);
- return VTABLE_invoke(interp, meth, next);
+ return VTABLE_invoke(INTERP, meth, next);
}
if (cur_class->vtable->base_type == enum_class_PMCProxy) {
/* Get the PMC instance and call the vtable function on that. */
PMC * const del_object =
- VTABLE_get_attr_keyed(interp, SELF, cur_class, proxy);
+ VTABLE_get_attr_keyed(INTERP, SELF, cur_class, proxy);
if (!PMC_IS_NULL(del_object))
- return VTABLE_invoke(interp, del_object, next);
+ return VTABLE_invoke(INTERP, del_object, next);
}
}
- return (opcode_t *)interp->vtables[enum_class_default]->invoke(interp, SELF, next);
+ return (opcode_t *)INTERP->vtables[enum_class_default]->invoke(INTERP, SELF, next);
}
/*
@@ -761,8 +761,8 @@
*/
VTABLE INTVAL type() {
- PMC * const _class = VTABLE_get_class(interp, SELF);
- return VTABLE_type(interp, _class);
+ PMC * const _class = VTABLE_get_class(INTERP, SELF);
+ return VTABLE_type(INTERP, _class);
}
/*
@@ -779,16 +779,16 @@
Parrot_Object_attributes * const obj = PARROT_OBJECT(SELF);
/* If we have a custom override, invoke it.
* If not, use the oo function. */
- STRING * const meth_name = CONST_STRING(interp, "clone");
+ STRING * const meth_name = CONST_STRING(INTERP, "clone");
PMC * const meth =
- Parrot_oo_find_vtable_override(interp, obj->_class, meth_name);
+ Parrot_oo_find_vtable_override(INTERP, obj->_class, meth_name);
PMC *result;
if (!PMC_IS_NULL(meth)) {
- Parrot_pcc_invoke_sub_from_c_args(interp, meth, "Pi->P", SELF, &result);
+ Parrot_pcc_invoke_sub_from_c_args(INTERP, meth, "Pi->P", SELF, &result);
}
else {
- result = Parrot_oo_clone_object(interp, SELF, NULL);
+ result = Parrot_oo_clone_object(INTERP, SELF, NULL);
}
return result;
@@ -874,7 +874,7 @@
/* make sure metadata doesn't go away unexpectedly */
if (PMC_metadata(SELF))
- PMC_metadata(SELF) = pt_shared_fixup(interp, PMC_metadata(SELF));
+ PMC_metadata(SELF) = pt_shared_fixup(INTERP, PMC_metadata(SELF));
PARROT_ASSERT(master->vtables[type_num]->pmc_class);
/* don't want the referenced class disappearing on us */
@@ -885,7 +885,7 @@
ret = SELF;
/* Setting the '_ro' property switches to the read-only vtable */
_true = Parrot_pmc_new_init_int(INTERP, enum_class_Integer, 1);
- VTABLE_setprop(INTERP, ret, CONST_STRING(interp, "_ro"), _true);
+ VTABLE_setprop(INTERP, ret, CONST_STRING(INTERP, "_ro"), _true);
SELF->vtable->pmc_class = master->vtables[type_num]->pmc_class;
PObj_is_PMC_shared_SET(ret);
@@ -919,14 +919,14 @@
*/
VTABLE void morph(PMC* type) {
- PMC * const classobj = VTABLE_get_class(interp, SELF);
- STRING * const meth_name = CONST_STRING(interp, "morph");
+ PMC * const classobj = VTABLE_get_class(INTERP, SELF);
+ STRING * const meth_name = CONST_STRING(INTERP, "morph");
/* If there's a vtable override for 'morph' run that instead. */
- PMC * const method = Parrot_oo_find_vtable_override(interp,
+ PMC * const method = Parrot_oo_find_vtable_override(INTERP,
classobj, meth_name);
if (!PMC_IS_NULL(method))
- Parrot_pcc_invoke_sub_from_c_args(interp, method, "PiP->",
+ Parrot_pcc_invoke_sub_from_c_args(INTERP, method, "PiP->",
SELF, type);
else
SUPER(type);
Modified: branches/codestring/src/pmc/opcode.pmc
==============================================================================
--- branches/codestring/src/pmc/opcode.pmc Wed May 5 23:52:59 2010 (r46321)
+++ branches/codestring/src/pmc/opcode.pmc Thu May 6 00:31:08 2010 (r46322)
@@ -26,7 +26,7 @@
ATTR STRING *full_name_cache;
VTABLE void init() {
- Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_INVALID_OPERATION,
+ Parrot_ex_throw_from_c_args(INTERP, NULL, EXCEPTION_INVALID_OPERATION,
"Opcode must be created from OpLib.");
}
@@ -39,7 +39,7 @@
VTABLE void set_pointer(void *i) {
Parrot_Opcode_attributes * const attrs = PARROT_OPCODE(SELF);
if (attrs->info)
- Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_INVALID_OPERATION,
+ Parrot_ex_throw_from_c_args(INTERP, NULL, EXCEPTION_INVALID_OPERATION,
"Opcode has already been initialized");
attrs->info = (op_info_t *)i;
}
@@ -65,7 +65,7 @@
const INTVAL opcount = INTERP->op_lib->op_count;
Parrot_Opcode_attributes * const attrs = PARROT_OPCODE(SELF);
if (attrs->info)
- Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_INVALID_OPERATION,
+ Parrot_ex_throw_from_c_args(INTERP, NULL, EXCEPTION_INVALID_OPERATION,
"Opcode has already been initialized");
if (value >= opcount || value < 0)
Parrot_ex_throw_from_c_args(INTERP, NULL, EXCEPTION_OUT_OF_BOUNDS,
Modified: branches/codestring/src/pmc/oplib.pmc
==============================================================================
--- branches/codestring/src/pmc/oplib.pmc Wed May 5 23:52:59 2010 (r46321)
+++ branches/codestring/src/pmc/oplib.pmc Thu May 6 00:31:08 2010 (r46322)
@@ -89,11 +89,11 @@
}
VTABLE PMC* get_pmc_keyed_int(INTVAL value) {
- if ((UINTVAL)value > interp->op_lib->op_count)
+ if ((UINTVAL)value > INTERP->op_lib->op_count)
Parrot_ex_throw_from_c_args(INTERP, NULL, EXCEPTION_OUT_OF_BOUNDS,
"OpLib: Opcode index %d out of bounds", value);
else {
- const char * const name = interp->op_info_table[value].full_name;
+ const char * const name = INTERP->op_info_table[value].full_name;
STRING * const newstr = Parrot_str_new(INTERP, name, 0);
return VTABLE_get_pmc_keyed_str(INTERP, SELF, newstr);
}
Modified: branches/codestring/src/pmc/packfile.pmc
==============================================================================
--- branches/codestring/src/pmc/packfile.pmc Wed May 5 23:52:59 2010 (r46321)
+++ branches/codestring/src/pmc/packfile.pmc Thu May 6 00:31:08 2010 (r46322)
@@ -96,9 +96,9 @@
attrs->directory = Parrot_pmc_new(INTERP, enum_class_PackfileDirectory);
/* Create dummy PackFile and copy default attributes to self */
- pf = PackFile_new(interp, 0);
- copy_packfile_header(interp, SELF, pf);
- PackFile_destroy(interp, pf);
+ pf = PackFile_new(INTERP, 0);
+ copy_packfile_header(INTERP, SELF, pf);
+ PackFile_destroy(INTERP, pf);
PObj_custom_mark_SET(SELF);
}
@@ -134,12 +134,12 @@
VTABLE STRING *get_string() {
Parrot_Packfile_attributes * const attrs = PARROT_PACKFILE(SELF);
PackFile * const pf =
- (PackFile*)VTABLE_get_pointer(interp, attrs->directory);
+ (PackFile*)VTABLE_get_pointer(INTERP, attrs->directory);
STRING *str;
/* Calculate required memory */
- const opcode_t length = PackFile_pack_size(interp, pf) * sizeof (opcode_t);
+ const opcode_t length = PackFile_pack_size(INTERP, pf) * sizeof (opcode_t);
opcode_t * const ptr = (opcode_t*)Parrot_gc_allocate_memory_chunk(INTERP, length);
/* Copy related attributes to header */
@@ -149,13 +149,13 @@
pf->header->uuid_type = attrs->uuid_type;
/* And pack it! */
- PackFile_pack(interp, pf, ptr);
+ PackFile_pack(INTERP, pf, ptr);
- str = Parrot_str_new_init(interp, (const char*)ptr, length,
+ str = Parrot_str_new_init(INTERP, (const char*)ptr, length,
PARROT_FIXED_8_ENCODING, PARROT_BINARY_CHARSET, 0);
Parrot_gc_free_memory_chunk(INTERP, ptr);
- PackFile_destroy(interp, pf);
+ PackFile_destroy(INTERP, pf);
return str;
}
@@ -173,29 +173,29 @@
VTABLE void set_string_native(STRING *str) {
Parrot_Packfile_attributes * const attrs = PARROT_PACKFILE(SELF);
- PackFile * const pf = PackFile_new(interp, 0);
+ PackFile * const pf = PackFile_new(INTERP, 0);
const opcode_t * const ptr =
- (const opcode_t *)Parrot_str_cstring(interp, str);
+ (const opcode_t *)Parrot_str_cstring(INTERP, str);
- const int length = Parrot_str_byte_length(interp, str);
+ const int length = Parrot_str_byte_length(INTERP, str);
- if (!PackFile_unpack(interp, pf, ptr, length)) {
- PackFile_destroy(interp, pf);
- Parrot_ex_throw_from_c_args(interp, NULL,
+ if (!PackFile_unpack(INTERP, pf, ptr, length)) {
+ PackFile_destroy(INTERP, pf);
+ Parrot_ex_throw_from_c_args(INTERP, NULL,
EXCEPTION_MALFORMED_PACKFILE, "Can't unpack packfile.");
}
/* Disable GC during copy data into internal structures. */
- Parrot_block_GC_mark(interp);
+ Parrot_block_GC_mark(INTERP);
/* Copy values from PackFile header to own attributes */
- copy_packfile_header(interp, SELF, pf);
+ copy_packfile_header(INTERP, SELF, pf);
- VTABLE_set_pointer(interp, attrs->directory, &pf->directory);
+ VTABLE_set_pointer(INTERP, attrs->directory, &pf->directory);
- Parrot_unblock_GC_mark(interp);
+ Parrot_unblock_GC_mark(INTERP);
- PackFile_destroy(interp, pf);
+ PackFile_destroy(INTERP, pf);
}
@@ -235,28 +235,28 @@
VTABLE INTVAL get_integer_keyed_str(STRING *key) {
Parrot_Packfile_attributes * const attrs = PARROT_PACKFILE(SELF);
- if (!Parrot_str_compare(interp, key, CONST_STRING(interp, "wordsize")))
+ if (!Parrot_str_compare(INTERP, key, CONST_STRING(INTERP, "wordsize")))
return attrs->wordsize;
- if (!Parrot_str_compare(interp, key, CONST_STRING(interp, "byteorder")))
+ if (!Parrot_str_compare(INTERP, key, CONST_STRING(INTERP, "byteorder")))
return attrs->byteorder;
- if (!Parrot_str_compare(interp, key, CONST_STRING(interp, "fptype")))
+ if (!Parrot_str_compare(INTERP, key, CONST_STRING(INTERP, "fptype")))
return attrs->fptype;
- if (!Parrot_str_compare(interp, key, CONST_STRING(interp, "version_major")))
+ if (!Parrot_str_compare(INTERP, key, CONST_STRING(INTERP, "version_major")))
return attrs->version_major;
- if (!Parrot_str_compare(interp, key, CONST_STRING(interp, "version_minor")))
+ if (!Parrot_str_compare(INTERP, key, CONST_STRING(INTERP, "version_minor")))
return attrs->version_minor;
- if (!Parrot_str_compare(interp, key, CONST_STRING(interp, "version_patch")))
+ if (!Parrot_str_compare(INTERP, key, CONST_STRING(INTERP, "version_patch")))
return attrs->version_patch;
- if (!Parrot_str_compare(interp, key, CONST_STRING(interp, "bytecode_major")))
+ if (!Parrot_str_compare(INTERP, key, CONST_STRING(INTERP, "bytecode_major")))
return attrs->bytecode_major;
- if (!Parrot_str_compare(interp, key, CONST_STRING(interp, "bytecode_minor")))
+ if (!Parrot_str_compare(INTERP, key, CONST_STRING(INTERP, "bytecode_minor")))
return attrs->bytecode_minor;
- if (!Parrot_str_compare(interp, key, CONST_STRING(interp, "uuid_type")))
+ if (!Parrot_str_compare(INTERP, key, CONST_STRING(INTERP, "uuid_type")))
return attrs->uuid_type;
- Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_KEY_NOT_FOUND,
+ Parrot_ex_throw_from_c_args(INTERP, NULL, EXCEPTION_KEY_NOT_FOUND,
"Packfile: No such integer key \"%s\"",
- Parrot_str_cstring(interp, key));
+ Parrot_str_cstring(INTERP, key));
}
/*
@@ -275,12 +275,12 @@
*/
VTABLE STRING *get_string_keyed_str(STRING *key) {
- if (!Parrot_str_compare(interp, key, CONST_STRING(interp, "uuid")))
+ if (!Parrot_str_compare(INTERP, key, CONST_STRING(INTERP, "uuid")))
return PARROT_PACKFILE(SELF)->uuid;
- Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_KEY_NOT_FOUND,
+ Parrot_ex_throw_from_c_args(INTERP, NULL, EXCEPTION_KEY_NOT_FOUND,
"Packfile: No such string key \"%s\"",
- Parrot_str_cstring(interp, key));
+ Parrot_str_cstring(INTERP, key));
}
@@ -338,25 +338,25 @@
*/
VTABLE void set_integer_keyed_str(STRING *key, INTVAL value) {
Parrot_Packfile_attributes * const attrs = PARROT_PACKFILE(SELF);
- if (!Parrot_str_compare(interp, key, CONST_STRING(interp, "version_major"))) {
+ if (!Parrot_str_compare(INTERP, key, CONST_STRING(INTERP, "version_major"))) {
attrs->version_major = value;
return;
}
- if (!Parrot_str_compare(interp, key, CONST_STRING(interp, "version_minor"))) {
+ if (!Parrot_str_compare(INTERP, key, CONST_STRING(INTERP, "version_minor"))) {
attrs->version_minor = value;
return;
}
- if (!Parrot_str_compare(interp, key, CONST_STRING(interp, "version_patch"))) {
+ if (!Parrot_str_compare(INTERP, key, CONST_STRING(INTERP, "version_patch"))) {
attrs->version_patch = value;
return;
}
- if (!Parrot_str_compare(interp, key, CONST_STRING(interp, "uuid_type"))) {
+ if (!Parrot_str_compare(INTERP, key, CONST_STRING(INTERP, "uuid_type"))) {
attrs->uuid_type = value;
return;
}
- Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_KEY_NOT_FOUND,
+ Parrot_ex_throw_from_c_args(INTERP, NULL, EXCEPTION_KEY_NOT_FOUND,
"Packfile: No such integer key \"%s\"",
- Parrot_str_cstring(interp, key));
+ Parrot_str_cstring(INTERP, key));
}
@@ -393,14 +393,14 @@
*/
VTABLE void set_string_keyed_str(STRING *key, STRING *value) {
- if (!Parrot_str_compare(interp, key, CONST_STRING(interp, "uuid"))) {
+ if (!Parrot_str_compare(INTERP, key, CONST_STRING(INTERP, "uuid"))) {
PARROT_PACKFILE(SELF)->uuid = value;
return;
}
- Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_KEY_NOT_FOUND,
+ Parrot_ex_throw_from_c_args(INTERP, NULL, EXCEPTION_KEY_NOT_FOUND,
"Packfile: No such string key \"%s\"",
- Parrot_str_cstring(interp, key));
+ Parrot_str_cstring(INTERP, key));
}
/*
Modified: branches/codestring/src/pmc/packfileannotation.pmc
==============================================================================
--- branches/codestring/src/pmc/packfileannotation.pmc Wed May 5 23:52:59 2010 (r46321)
+++ branches/codestring/src/pmc/packfileannotation.pmc Thu May 6 00:31:08 2010 (r46322)
@@ -64,8 +64,8 @@
Parrot_PackfileAnnotation_attributes * const attrs =
PARROT_PACKFILEANNOTATION(SELF);
- Parrot_gc_mark_STRING_alive(interp, attrs->name);
- Parrot_gc_mark_STRING_alive(interp, attrs->str_value);
+ Parrot_gc_mark_STRING_alive(INTERP, attrs->name);
+ Parrot_gc_mark_STRING_alive(INTERP, attrs->str_value);
}
@@ -139,7 +139,7 @@
VTABLE INTVAL get_integer() {
Parrot_PackfileAnnotation_attributes * const attrs = PARROT_PACKFILEANNOTATION(SELF);
if (attrs->value_type != PF_ANNOTATION_KEY_TYPE_INT)
- Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_INVALID_OPERATION,
+ Parrot_ex_throw_from_c_args(INTERP, NULL, EXCEPTION_INVALID_OPERATION,
"Trying to fetch wrong type of value from annotation");
return attrs->int_value;
}
@@ -172,7 +172,7 @@
VTABLE STRING * get_string() {
Parrot_PackfileAnnotation_attributes * const attrs = PARROT_PACKFILEANNOTATION(SELF);
if (attrs->value_type != PF_ANNOTATION_KEY_TYPE_STR)
- Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_INVALID_OPERATION,
+ Parrot_ex_throw_from_c_args(INTERP, NULL, EXCEPTION_INVALID_OPERATION,
"Trying to fetch wrong type of value from annotation");
return attrs->str_value;
}
@@ -205,7 +205,7 @@
VTABLE FLOATVAL get_number() {
Parrot_PackfileAnnotation_attributes * const attrs = PARROT_PACKFILEANNOTATION(SELF);
if (attrs->value_type != PF_ANNOTATION_KEY_TYPE_NUM)
- Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_INVALID_OPERATION,
+ Parrot_ex_throw_from_c_args(INTERP, NULL, EXCEPTION_INVALID_OPERATION,
"Trying to fetch wrong type of value from annotation");
return attrs->num_value;
}
Modified: branches/codestring/src/pmc/packfileannotations.pmc
==============================================================================
--- branches/codestring/src/pmc/packfileannotations.pmc Wed May 5 23:52:59 2010 (r46321)
+++ branches/codestring/src/pmc/packfileannotations.pmc Thu May 6 00:31:08 2010 (r46322)
@@ -53,7 +53,7 @@
Parrot_PackfileAnnotations_attributes * attrs =
PMC_data_typed(SELF, Parrot_PackfileAnnotations_attributes*);
- attrs->annotations = Parrot_pmc_new(interp, enum_class_ResizablePMCArray);
+ attrs->annotations = Parrot_pmc_new(INTERP, enum_class_ResizablePMCArray);
/*
Don't initialize C<const_table>. It will be set to NULL bu auto_attrs
handling. And should be set to proper PMC in set_directory.
@@ -76,8 +76,8 @@
Parrot_PackfileAnnotations_attributes * attrs =
PARROT_PACKFILEANNOTATIONS(SELF);
- Parrot_gc_mark_PMC_alive(interp, attrs->const_table);
- Parrot_gc_mark_PMC_alive(interp, attrs->annotations);
+ Parrot_gc_mark_PMC_alive(INTERP, attrs->const_table);
+ Parrot_gc_mark_PMC_alive(INTERP, attrs->annotations);
SUPER();
}
@@ -93,7 +93,7 @@
*/
VTABLE INTVAL elements() {
- return VTABLE_elements(interp,
+ return VTABLE_elements(INTERP,
PARROT_PACKFILEANNOTATIONS(SELF)->annotations);
}
@@ -108,7 +108,7 @@
*/
VTABLE PMC *get_pmc_keyed_int(INTVAL index) {
- return VTABLE_get_pmc_keyed_int(interp,
+ return VTABLE_get_pmc_keyed_int(INTERP,
PARROT_PACKFILEANNOTATIONS(SELF)->annotations, index);
}
@@ -145,22 +145,22 @@
INTVAL dummy;
/* TODO: add checks desribed above */
- VTABLE_set_pmc_keyed_int(interp, attrs->annotations, index, annotation);
+ VTABLE_set_pmc_keyed_int(INTERP, attrs->annotations, index, annotation);
/* Add required constants */
- Parrot_mmd_multi_dispatch_from_c_args(interp,
+ Parrot_mmd_multi_dispatch_from_c_args(INTERP,
"get_or_create_constant", "PS->I", attrs->const_table,
entity_attrs->name, &dummy);
switch (entity_attrs->value_type) {
case PF_ANNOTATION_KEY_TYPE_STR:
- Parrot_mmd_multi_dispatch_from_c_args(interp,
+ Parrot_mmd_multi_dispatch_from_c_args(INTERP,
"get_or_create_constant", "PS->I", attrs->const_table,
entity_attrs->str_value, &dummy);
break;
case PF_ANNOTATION_KEY_TYPE_NUM:
- Parrot_mmd_multi_dispatch_from_c_args(interp,
+ Parrot_mmd_multi_dispatch_from_c_args(INTERP,
"get_or_create_constant", "PN->I", attrs->const_table,
entity_attrs->num_value, &dummy);
break;
@@ -190,12 +190,12 @@
STRING *name;
PMC *segment;
- PMC *iter = VTABLE_get_iter(interp, directory);
- while (VTABLE_get_bool(interp, iter)) {
- name = VTABLE_shift_string(interp, iter);
- segment = VTABLE_get_pmc_keyed_str(interp, directory, name);
- if (VTABLE_isa(interp, segment,
- Parrot_str_new_constant(interp, "PackfileConstantTable"))) {
+ PMC *iter = VTABLE_get_iter(INTERP, directory);
+ while (VTABLE_get_bool(INTERP, iter)) {
+ name = VTABLE_shift_string(INTERP, iter);
+ segment = VTABLE_get_pmc_keyed_str(INTERP, directory, name);
+ if (VTABLE_isa(INTERP, segment,
+ Parrot_str_new_constant(INTERP, "PackfileConstantTable"))) {
attrs->const_table = segment;
break;
}
@@ -220,39 +220,39 @@
Parrot_PackfileAnnotation_attributes *annotation_attrs;
/* Copy annotations to own array */
- VTABLE_set_integer_native(interp, attrs->annotations, a->num_entries);
+ VTABLE_set_integer_native(INTERP, attrs->annotations, a->num_entries);
for (i = 0; i < a->num_entries; ++i) {
- PackFile_Annotations_Entry *entry = a->entries[i];
- PackFile_Annotations_Key *key = a->keys[entry->key];
- annotation = Parrot_pmc_new(interp, enum_class_PackfileAnnotation);
+ PackFile_Annotations_Entry *entry = a->entries + i;
+ PackFile_Annotations_Key *key = a->keys + entry->key;
+ annotation = Parrot_pmc_new(INTERP, enum_class_PackfileAnnotation);
/* Poke directly to annotation attributes. */
annotation_attrs = PARROT_PACKFILEANNOTATION(annotation);
annotation_attrs->offset = entry->bytecode_offset;
if (! attrs->const_table)
- Parrot_ex_throw_from_c_args(interp, NULL,
+ Parrot_ex_throw_from_c_args(INTERP, NULL,
EXCEPTION_MALFORMED_PACKFILE, "No constant table");
- annotation_attrs->name = VTABLE_get_string_keyed_int(interp,
+ annotation_attrs->name = VTABLE_get_string_keyed_int(INTERP,
attrs->const_table, key->name);
switch (key->type) {
case PF_ANNOTATION_KEY_TYPE_INT:
- VTABLE_set_integer_native(interp, annotation, entry->value);
+ VTABLE_set_integer_native(INTERP, annotation, entry->value);
break;
case PF_ANNOTATION_KEY_TYPE_STR:
- VTABLE_set_string_native(interp, annotation,
- VTABLE_get_string_keyed_int(interp, attrs->const_table, entry->value));
+ VTABLE_set_string_native(INTERP, annotation,
+ VTABLE_get_string_keyed_int(INTERP, attrs->const_table, entry->value));
break;
case PF_ANNOTATION_KEY_TYPE_NUM:
- VTABLE_set_number_native(interp, annotation,
- VTABLE_get_number_keyed_int(interp, attrs->const_table, entry->value));
+ VTABLE_set_number_native(INTERP, annotation,
+ VTABLE_get_number_keyed_int(INTERP, attrs->const_table, entry->value));
break;
default:
- Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_MALFORMED_PACKFILE,
+ Parrot_ex_throw_from_c_args(INTERP, NULL, EXCEPTION_MALFORMED_PACKFILE,
"Unknown value type %d in Packfile Annotation", key->type);
}
- VTABLE_set_pmc_keyed_int(interp, attrs->annotations, i, annotation);
+ VTABLE_set_pmc_keyed_int(INTERP, attrs->annotations, i, annotation);
}
}
@@ -297,89 +297,86 @@
...
]
*/
- keys = Parrot_pmc_new(interp, enum_class_Hash);
- names = Parrot_pmc_new(interp, enum_class_ResizableIntegerArray);
- types = Parrot_pmc_new(interp, enum_class_ResizableIntegerArray);
+ keys = Parrot_pmc_new(INTERP, enum_class_Hash);
+ names = Parrot_pmc_new(INTERP, enum_class_ResizableIntegerArray);
+ types = Parrot_pmc_new(INTERP, enum_class_ResizableIntegerArray);
last_key_id = -1;
/* Iterate over stored annotations and create Key if required. */
- num = VTABLE_elements(interp, attrs->annotations);
+ num = VTABLE_elements(INTERP, attrs->annotations);
res->num_entries = num;
- res->entries = mem_gc_allocate_n_typed(INTERP, num, PackFile_Annotations_Entry*);
+ res->entries = mem_gc_allocate_n_typed(INTERP, num, PackFile_Annotations_Entry);
for (i = 0; i < num; ++i) {
- PMC * const entity = VTABLE_get_pmc_keyed_int(interp, attrs->annotations, i);
+ PMC * const entity = VTABLE_get_pmc_keyed_int(INTERP, attrs->annotations, i);
const Parrot_PackfileAnnotation_attributes * const entity_attrs =
PARROT_PACKFILEANNOTATION(entity);
/* Handle creating of Key */
- PMC * key_array = VTABLE_get_pmc_keyed_str(interp, keys, entity_attrs->name);
+ PMC * key_array = VTABLE_get_pmc_keyed_str(INTERP, keys, entity_attrs->name);
if (PMC_IS_NULL(key_array)) {
/* Never see this name before. Create new FIA and add to keys. */
- key_array = Parrot_pmc_new_init_int(interp, enum_class_FixedIntegerArray, 3);
- VTABLE_set_integer_keyed_int(interp, key_array, 0, -1);
- VTABLE_set_integer_keyed_int(interp, key_array, 1, -1);
- VTABLE_set_integer_keyed_int(interp, key_array, 2, -1);
+ key_array = Parrot_pmc_new_init_int(INTERP, enum_class_FixedIntegerArray, 3);
+ VTABLE_set_integer_keyed_int(INTERP, key_array, 0, -1);
+ VTABLE_set_integer_keyed_int(INTERP, key_array, 1, -1);
+ VTABLE_set_integer_keyed_int(INTERP, key_array, 2, -1);
- VTABLE_set_pmc_keyed_str(interp, keys, entity_attrs->name, key_array);
+ VTABLE_set_pmc_keyed_str(INTERP, keys, entity_attrs->name, key_array);
}
/* PackfileAnnotation.value_type exactly the same as key.type */
- key_id = VTABLE_get_integer_keyed_int(interp, key_array, entity_attrs->value_type);
+ key_id = VTABLE_get_integer_keyed_int(INTERP, key_array, entity_attrs->value_type);
/* If key_id is -1 it means we have to create new key. */
if (key_id == -1) {
key_id = ++last_key_id;
- VTABLE_set_integer_keyed_int(interp, key_array, entity_attrs->value_type, key_id);
+ VTABLE_set_integer_keyed_int(INTERP, key_array, entity_attrs->value_type, key_id);
/* Store type */
- VTABLE_set_integer_keyed_int(interp, types, key_id, entity_attrs->value_type);
+ VTABLE_set_integer_keyed_int(INTERP, types, key_id, entity_attrs->value_type);
/* Store constant for name. */
- Parrot_mmd_multi_dispatch_from_c_args(interp, "get_or_create_constant",
+ Parrot_mmd_multi_dispatch_from_c_args(INTERP, "get_or_create_constant",
"PS->I", attrs->const_table, entity_attrs->name, &name_id);
- VTABLE_set_integer_keyed_int(interp, names, key_id, name_id);
+ VTABLE_set_integer_keyed_int(INTERP, names, key_id, name_id);
}
/* At this point we have create (if nesassary) key and name constant. */
/* Start storing real entity */
- res->entries[i] = mem_gc_allocate_zeroed_typed(INTERP,
- PackFile_Annotations_Entry);
- res->entries[i]->bytecode_offset = entity_attrs->offset;
- res->entries[i]->key = key_id;
+ res->entries[i].bytecode_offset = entity_attrs->offset;
+ res->entries[i].key = key_id;
/* Handle value */
switch (entity_attrs->value_type) {
case PF_ANNOTATION_KEY_TYPE_INT:
- res->entries[i]->value = entity_attrs->int_value;
+ res->entries[i].value = entity_attrs->int_value;
break;
case PF_ANNOTATION_KEY_TYPE_STR:
- Parrot_mmd_multi_dispatch_from_c_args(interp, "get_or_create_constant",
+ Parrot_mmd_multi_dispatch_from_c_args(INTERP, "get_or_create_constant",
"PS->I", attrs->const_table, entity_attrs->str_value,
- &res->entries[i]->value);
+ &res->entries[i].value);
break;
case PF_ANNOTATION_KEY_TYPE_NUM:
- Parrot_mmd_multi_dispatch_from_c_args(interp, "get_or_create_constant",
+ Parrot_mmd_multi_dispatch_from_c_args(INTERP, "get_or_create_constant",
"PN->I", attrs->const_table, entity_attrs->num_value,
- &res->entries[i]->value);
+ &res->entries[i].value);
break;
default:
- Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_MALFORMED_PACKFILE,
+ Parrot_ex_throw_from_c_args(INTERP, NULL, EXCEPTION_MALFORMED_PACKFILE,
"Unknown value type in PackfileAnnotation");
}
}
/* Time to pack keys */
- num = VTABLE_elements(interp, types);
+ num = VTABLE_elements(INTERP, types);
res->num_keys = num;
res->keys = mem_gc_allocate_n_zeroed_typed(INTERP, num,
- PackFile_Annotations_Key*);
+ PackFile_Annotations_Key);
for (i = 0; i < num; ++i) {
- res->keys[i] = mem_gc_allocate_typed(INTERP, PackFile_Annotations_Key);
- res->keys[i]->name = VTABLE_get_integer_keyed_int(interp, names, i);
- res->keys[i]->type = VTABLE_get_integer_keyed_int(interp, types, i);
+ res->keys[i].name = VTABLE_get_integer_keyed_int(INTERP, names, i);
+ res->keys[i].type = VTABLE_get_integer_keyed_int(INTERP, types, i);
}
return res;
Modified: branches/codestring/src/pmc/packfileconstanttable.pmc
==============================================================================
--- branches/codestring/src/pmc/packfileconstanttable.pmc Wed May 5 23:52:59 2010 (r46321)
+++ branches/codestring/src/pmc/packfileconstanttable.pmc Thu May 6 00:31:08 2010 (r46322)
@@ -49,8 +49,8 @@
Parrot_PackfileConstantTable_attributes * const attrs =
PMC_data_typed(SELF, Parrot_PackfileConstantTable_attributes*);
- attrs->constants = Parrot_pmc_new(interp, enum_class_ResizablePMCArray);
- attrs->types = Parrot_pmc_new(interp, enum_class_ResizableIntegerArray);
+ attrs->constants = Parrot_pmc_new(INTERP, enum_class_ResizablePMCArray);
+ attrs->types = Parrot_pmc_new(INTERP, enum_class_ResizableIntegerArray);
PObj_custom_mark_SET(SELF);
PMC_data(SELF) = attrs;
@@ -70,8 +70,8 @@
Parrot_PackfileConstantTable_attributes * const attrs =
PARROT_PACKFILECONSTANTTABLE(SELF);
- Parrot_gc_mark_PMC_alive(interp, attrs->constants);
- Parrot_gc_mark_PMC_alive(interp, attrs->types);
+ Parrot_gc_mark_PMC_alive(INTERP, attrs->constants);
+ Parrot_gc_mark_PMC_alive(INTERP, attrs->types);
SUPER();
}
@@ -96,8 +96,8 @@
opcode_t i;
/* Preallocate required amount of memory */
- VTABLE_set_integer_native(interp, attrs->constants, table->const_count);
- VTABLE_set_integer_native(interp, attrs->types, table->const_count);
+ VTABLE_set_integer_native(INTERP, attrs->constants, table->const_count);
+ VTABLE_set_integer_native(INTERP, attrs->types, table->const_count);
for (i = 0; i < table->const_count; ++i) {
val = table->constants[i];
@@ -116,7 +116,7 @@
SELF.set_pmc_keyed_int(i, val->u.key);
break;
default:
- Parrot_ex_throw_from_c_args(interp, NULL,
+ Parrot_ex_throw_from_c_args(INTERP, NULL,
EXCEPTION_MALFORMED_PACKFILE,
"Unknown PackFile constant type: %d", val->type);
}
@@ -139,31 +139,31 @@
pftable->base.type = PF_CONST_SEG;
/* Copy all constanst with respect of type */
- pftable->const_count = VTABLE_get_integer(interp, attrs->constants);
+ pftable->const_count = VTABLE_get_integer(INTERP, attrs->constants);
pftable->constants = mem_gc_allocate_n_typed(INTERP,
pftable->const_count, PackFile_Constant*);
for (i = 0; i < pftable->const_count; ++i) {
- PackFile_Constant * const value = PackFile_Constant_new(interp);
- value->type = VTABLE_get_integer_keyed_int(interp, attrs->types, i);
+ PackFile_Constant * const value = PackFile_Constant_new(INTERP);
+ value->type = VTABLE_get_integer_keyed_int(INTERP, attrs->types, i);
switch (value->type) {
case PFC_NONE:
break;
case PFC_NUMBER:
- value->u.number = VTABLE_get_number_keyed_int(interp,
+ value->u.number = VTABLE_get_number_keyed_int(INTERP,
attrs->constants, i);
break;
case PFC_STRING:
- value->u.string = VTABLE_get_string_keyed_int(interp,
+ value->u.string = VTABLE_get_string_keyed_int(INTERP,
attrs->constants, i);
break;
case PFC_KEY:
case PFC_PMC:
- value->u.key = VTABLE_get_pmc_keyed_int(interp,
+ value->u.key = VTABLE_get_pmc_keyed_int(INTERP,
attrs->constants, i);
break;
default:
- Parrot_ex_throw_from_c_args(interp, NULL,
+ Parrot_ex_throw_from_c_args(INTERP, NULL,
EXCEPTION_MALFORMED_PACKFILE,
"Unknown PackFile constant type: %d", value->type);
}
@@ -184,7 +184,7 @@
*/
VTABLE INTVAL elements() {
- return VTABLE_elements(interp,
+ return VTABLE_elements(INTERP,
PARROT_PACKFILECONSTANTTABLE(SELF)->constants);
}
@@ -200,7 +200,7 @@
*/
VTABLE FLOATVAL get_number_keyed_int(INTVAL index) {
- return VTABLE_get_number_keyed_int(interp,
+ return VTABLE_get_number_keyed_int(INTERP,
PARROT_PACKFILECONSTANTTABLE(SELF)->constants, index);
}
@@ -216,7 +216,7 @@
*/
VTABLE STRING *get_string_keyed_int(INTVAL index) {
- return VTABLE_get_string_keyed_int(interp,
+ return VTABLE_get_string_keyed_int(INTERP,
PARROT_PACKFILECONSTANTTABLE(SELF)->constants, index);
}
@@ -231,7 +231,7 @@
*/
VTABLE PMC *get_pmc_keyed_int(INTVAL index) {
- return VTABLE_get_pmc_keyed_int(interp,
+ return VTABLE_get_pmc_keyed_int(INTERP,
PARROT_PACKFILECONSTANTTABLE(SELF)->constants, index);
}
@@ -249,8 +249,8 @@
Parrot_PackfileConstantTable_attributes * const attrs =
PARROT_PACKFILECONSTANTTABLE(SELF);
- VTABLE_set_number_keyed_int(interp, attrs->constants, index, value);
- VTABLE_set_integer_keyed_int(interp, attrs->types, index, PFC_NUMBER);
+ VTABLE_set_number_keyed_int(INTERP, attrs->constants, index, value);
+ VTABLE_set_integer_keyed_int(INTERP, attrs->types, index, PFC_NUMBER);
}
@@ -268,8 +268,8 @@
Parrot_PackfileConstantTable_attributes * const attrs =
PARROT_PACKFILECONSTANTTABLE(SELF);
- VTABLE_set_string_keyed_int(interp, attrs->constants, index, value);
- VTABLE_set_integer_keyed_int(interp, attrs->types, index, PFC_STRING);
+ VTABLE_set_string_keyed_int(INTERP, attrs->constants, index, value);
+ VTABLE_set_integer_keyed_int(INTERP, attrs->types, index, PFC_STRING);
}
@@ -286,12 +286,12 @@
Parrot_PackfileConstantTable_attributes * const attrs =
PARROT_PACKFILECONSTANTTABLE(SELF);
const opcode_t type =
- VTABLE_isa(interp, value, Parrot_str_new_constant(interp, "Key"))
+ VTABLE_isa(INTERP, value, Parrot_str_new_constant(INTERP, "Key"))
? PFC_KEY
: PFC_PMC;
- VTABLE_set_pmc_keyed_int(interp, attrs->constants, index, value);
- VTABLE_set_integer_keyed_int(interp, attrs->types, index, type);
+ VTABLE_set_pmc_keyed_int(INTERP, attrs->constants, index, value);
+ VTABLE_set_integer_keyed_int(INTERP, attrs->types, index, type);
}
@@ -319,7 +319,7 @@
*/
METHOD get_type(INTVAL index) {
- INTVAL rv = VTABLE_get_integer_keyed_int(interp,
+ INTVAL rv = VTABLE_get_integer_keyed_int(INTERP,
PARROT_PACKFILECONSTANTTABLE(SELF)->types, index);
RETURN(INTVAL rv);
}
@@ -341,7 +341,7 @@
METHOD set_main(INTVAL index) {
PMC *mainsub = SELF.get_pmc_keyed_int(index);
if (mainsub->vtable->base_type != enum_class_Sub)
- Parrot_ex_throw_from_c_args(interp, NULL,
+ Parrot_ex_throw_from_c_args(INTERP, NULL,
EXCEPTION_INVALID_OPERATION,
"Attempt to set main flag in a non Sub");
SUB_FLAG_flag_SET(PF_MAIN, mainsub);
@@ -359,45 +359,45 @@
MULTI INTVAL get_or_create_constant(STRING *value) {
Parrot_PackfileConstantTable_attributes * const attrs =
PARROT_PACKFILECONSTANTTABLE(SELF);
- const INTVAL num = VTABLE_elements(interp, attrs->types);
+ const INTVAL num = VTABLE_elements(INTERP, attrs->types);
INTVAL i;
for (i=0; i < num; ++i) {
- const INTVAL type = VTABLE_get_integer_keyed_int(interp, attrs->types, i);
+ const INTVAL type = VTABLE_get_integer_keyed_int(INTERP, attrs->types, i);
if (type == PFC_STRING) {
- STRING * const str = VTABLE_get_string_keyed_int(interp, attrs->constants, i);
- if (Parrot_str_equal(interp, value, str))
+ STRING * const str = VTABLE_get_string_keyed_int(INTERP, attrs->constants, i);
+ if (Parrot_str_equal(INTERP, value, str))
return i;
}
}
/* Constant not found. Add new one */
- VTABLE_set_string_keyed_int(interp, SELF, i, value);
+ VTABLE_set_string_keyed_int(INTERP, SELF, i, value);
return i;
}
MULTI INTVAL get_or_create_constant(FLOATVAL value) {
Parrot_PackfileConstantTable_attributes * const attrs =
PARROT_PACKFILECONSTANTTABLE(SELF);
- const INTVAL num = VTABLE_elements(interp, attrs->types);
+ const INTVAL num = VTABLE_elements(INTERP, attrs->types);
INTVAL i;
for (i=0; i < num; ++i) {
- const INTVAL type = VTABLE_get_integer_keyed_int(interp, attrs->types, i);
+ const INTVAL type = VTABLE_get_integer_keyed_int(INTERP, attrs->types, i);
if (type == PFC_NUMBER) {
- const FLOATVAL val = VTABLE_get_number_keyed_int(interp, attrs->constants, i);
+ const FLOATVAL val = VTABLE_get_number_keyed_int(INTERP, attrs->constants, i);
if (FLOAT_IS_ZERO(fabs(val - value)))
return i;
}
}
/* Constant not found. Add new one */
- VTABLE_set_number_keyed_int(interp, SELF, i, value);
+ VTABLE_set_number_keyed_int(INTERP, SELF, i, value);
return i;
}
MULTI INTVAL get_or_create_constant(PMC *value) {
Parrot_PackfileConstantTable_attributes * const attrs =
PARROT_PACKFILECONSTANTTABLE(SELF);
- const INTVAL num = VTABLE_elements(interp, attrs->types);
+ const INTVAL num = VTABLE_elements(INTERP, attrs->types);
INTVAL i;
const INTVAL val_type =
value->vtable->base_type == enum_class_Key
@@ -405,15 +405,15 @@
: PFC_PMC;
for (i=0; i < num; ++i) {
- const INTVAL type = VTABLE_get_integer_keyed_int(interp, attrs->types, i);
+ const INTVAL type = VTABLE_get_integer_keyed_int(INTERP, attrs->types, i);
if (type == val_type) {
- PMC * const val = VTABLE_get_pmc_keyed_int(interp, attrs->constants, i);
+ PMC * const val = VTABLE_get_pmc_keyed_int(INTERP, attrs->constants, i);
if (VTABLE_is_equal(INTERP, value, val))
return i;
}
}
/* Constant not found. Add new one */
- VTABLE_set_pmc_keyed_int(interp, SELF, i, value);
+ VTABLE_set_pmc_keyed_int(INTERP, SELF, i, value);
return i;
}
Modified: branches/codestring/src/pmc/packfiledirectory.pmc
==============================================================================
--- branches/codestring/src/pmc/packfiledirectory.pmc Wed May 5 23:52:59 2010 (r46321)
+++ branches/codestring/src/pmc/packfiledirectory.pmc Thu May 6 00:31:08 2010 (r46322)
@@ -46,7 +46,7 @@
Parrot_PackfileDirectory_attributes * attrs =
PMC_data_typed(SELF, Parrot_PackfileDirectory_attributes*);
- attrs->hash = Parrot_pmc_new(interp, enum_class_Hash);
+ attrs->hash = Parrot_pmc_new(INTERP, enum_class_Hash);
PObj_custom_mark_SET(SELF);
}
@@ -65,7 +65,7 @@
Parrot_PackfileDirectory_attributes * attrs =
PARROT_PACKFILEDIRECTORY(SELF);
- Parrot_gc_mark_PMC_alive(interp, attrs->hash);
+ Parrot_gc_mark_PMC_alive(INTERP, attrs->hash);
SUPER();
}
@@ -116,12 +116,12 @@
break;
}
- segment = Parrot_pmc_new(interp, pmc_type);
+ segment = Parrot_pmc_new(INTERP, pmc_type);
name = pfseg->name;
- VTABLE_set_pmc_keyed_str(interp, SELF, name, segment);
+ VTABLE_set_pmc_keyed_str(INTERP, SELF, name, segment);
/* Initialize internal PMC structure */
- VTABLE_set_pointer(interp, segment, pfseg);
+ VTABLE_set_pointer(INTERP, segment, pfseg);
}
}
@@ -139,19 +139,19 @@
VTABLE void *get_pointer() {
Parrot_PackfileDirectory_attributes * attrs =
PARROT_PACKFILEDIRECTORY(SELF);
- PackFile * const pf = PackFile_new(interp, 0); /* dummy PackFile... */
+ PackFile * const pf = PackFile_new(INTERP, 0); /* dummy PackFile... */
PackFile_Directory * const pfdir = &pf->directory;
- PMC * const iter = VTABLE_get_iter(interp, attrs->hash);
+ PMC * const iter = VTABLE_get_iter(INTERP, attrs->hash);
/* Create Segments. Add to Directory with transfering ownership */
- while (VTABLE_get_bool(interp, iter)) {
- STRING * const name = VTABLE_shift_string(interp, iter);
- PMC * const seg = VTABLE_get_pmc_keyed_str(interp, attrs->hash, name);
- PackFile_Segment * const pfseg = (PackFile_Segment *)VTABLE_get_pointer(interp, seg);
+ while (VTABLE_get_bool(INTERP, iter)) {
+ STRING * const name = VTABLE_shift_string(INTERP, iter);
+ PMC * const seg = VTABLE_get_pmc_keyed_str(INTERP, attrs->hash, name);
+ PackFile_Segment * const pfseg = (PackFile_Segment *)VTABLE_get_pointer(INTERP, seg);
pfseg->pf = pf;
pfseg->name = name;
- PackFile_add_segment(interp, pfdir, pfseg);
+ PackFile_add_segment(INTERP, pfdir, pfseg);
}
return pf;
@@ -167,7 +167,7 @@
*/
VTABLE INTVAL elements() {
- return VTABLE_elements(interp, PARROT_PACKFILEDIRECTORY(SELF)->hash);
+ return VTABLE_elements(INTERP, PARROT_PACKFILEDIRECTORY(SELF)->hash);
}
@@ -182,7 +182,7 @@
*/
VTABLE PMC *get_iter() {
- return VTABLE_get_iter(interp, PARROT_PACKFILEDIRECTORY(SELF)->hash);
+ return VTABLE_get_iter(INTERP, PARROT_PACKFILEDIRECTORY(SELF)->hash);
}
/*
@@ -195,7 +195,7 @@
*/
VTABLE PMC *get_pmc_keyed_str(STRING *name) {
- return VTABLE_get_pmc_keyed_str(interp,
+ return VTABLE_get_pmc_keyed_str(INTERP,
PARROT_PACKFILEDIRECTORY(SELF)->hash, name);
}
@@ -210,8 +210,8 @@
*/
VTABLE PMC *get_pmc_keyed(PMC *key) {
- STRING * const s_key = VTABLE_get_string(interp, key);
- return VTABLE_get_pmc_keyed_str(interp,
+ STRING * const s_key = VTABLE_get_string(INTERP, key);
+ return VTABLE_get_pmc_keyed_str(INTERP,
PARROT_PACKFILEDIRECTORY(SELF)->hash, s_key);
}
@@ -229,10 +229,10 @@
*/
VTABLE void set_pmc_keyed_str(STRING *name, PMC *segment) {
- Parrot_pcc_invoke_method_from_c_args(interp, segment,
- Parrot_str_new_constant(interp, "set_directory"),
+ Parrot_pcc_invoke_method_from_c_args(INTERP, segment,
+ Parrot_str_new_constant(INTERP, "set_directory"),
"P->", SELF);
- VTABLE_set_pmc_keyed_str(interp,
+ VTABLE_set_pmc_keyed_str(INTERP,
PARROT_PACKFILEDIRECTORY(SELF)->hash, name, segment);
}
@@ -248,8 +248,8 @@
*/
VTABLE void set_pmc_keyed(PMC *key, PMC *segment) {
- STRING * const s_key = VTABLE_get_string(interp, key);
- VTABLE_set_pmc_keyed_str(interp, SELF, s_key, segment);
+ STRING * const s_key = VTABLE_get_string(INTERP, key);
+ VTABLE_set_pmc_keyed_str(INTERP, SELF, s_key, segment);
}
/*
@@ -263,7 +263,7 @@
*/
VTABLE void delete_keyed(PMC *key) {
- VTABLE_delete_keyed(interp,
+ VTABLE_delete_keyed(INTERP,
PARROT_PACKFILEDIRECTORY(SELF)->hash, key);
}
Modified: branches/codestring/src/pmc/packfilefixupentry.pmc
==============================================================================
--- branches/codestring/src/pmc/packfilefixupentry.pmc Wed May 5 23:52:59 2010 (r46321)
+++ branches/codestring/src/pmc/packfilefixupentry.pmc Thu May 6 00:31:08 2010 (r46322)
@@ -42,7 +42,7 @@
Parrot_PackfileFixupEntry_attributes * attrs =
PMC_data_typed(SELF, Parrot_PackfileFixupEntry_attributes*);
- attrs->name = Parrot_str_new_noinit(interp, enum_stringrep_one, 0);
+ attrs->name = Parrot_str_new_noinit(INTERP, enum_stringrep_one, 0);
PObj_custom_mark_SET(SELF);
}
@@ -61,7 +61,7 @@
Parrot_PackfileFixupEntry_attributes * const attrs =
PARROT_PACKFILEFIXUPENTRY(SELF);
- Parrot_gc_mark_STRING_alive(interp, attrs->name);
+ Parrot_gc_mark_STRING_alive(INTERP, attrs->name);
}
/*
@@ -80,7 +80,7 @@
PackFile_FixupEntry *entry = (PackFile_FixupEntry*)pointer;
attrs->type = entry->type;
- attrs->name = Parrot_str_new_init(interp, entry->name,
+ attrs->name = Parrot_str_new_init(INTERP, entry->name,
strlen(entry->name), PARROT_FIXED_8_ENCODING,
PARROT_BINARY_CHARSET, 0);
attrs->offset = entry->offset;
@@ -102,7 +102,7 @@
mem_gc_allocate_zeroed_typed(INTERP, PackFile_FixupEntry);
entry->type = attrs->type;
- entry->name = strdup(Parrot_str_cstring(interp, attrs->name));
+ entry->name = strdup(Parrot_str_cstring(INTERP, attrs->name));
entry->offset = attrs->offset;
return entry;
}
Modified: branches/codestring/src/pmc/packfilefixuptable.pmc
==============================================================================
--- branches/codestring/src/pmc/packfilefixuptable.pmc Wed May 5 23:52:59 2010 (r46321)
+++ branches/codestring/src/pmc/packfilefixuptable.pmc Thu May 6 00:31:08 2010 (r46322)
@@ -46,7 +46,7 @@
Parrot_PackfileFixupTable_attributes * attrs =
PMC_data_typed(SELF, Parrot_PackfileFixupTable_attributes*);
- attrs->entries = Parrot_pmc_new(interp, enum_class_ResizablePMCArray);
+ attrs->entries = Parrot_pmc_new(INTERP, enum_class_ResizablePMCArray);
PObj_custom_mark_SET(SELF);
}
@@ -65,7 +65,7 @@
Parrot_PackfileFixupTable_attributes * attrs =
PARROT_PACKFILEFIXUPTABLE(SELF);
- Parrot_gc_mark_PMC_alive(interp, attrs->entries);
+ Parrot_gc_mark_PMC_alive(INTERP, attrs->entries);
SUPER();
}
@@ -89,13 +89,13 @@
PackFile_FixupEntry *val;
opcode_t i;
- VTABLE_set_integer_native(interp, attrs->entries, table->fixup_count);
+ VTABLE_set_integer_native(INTERP, attrs->entries, table->fixup_count);
for (i = 0; i < table->fixup_count; ++i) {
val = table->fixups + i;
- entry = Parrot_pmc_new(interp, enum_class_PackfileFixupEntry);
- VTABLE_set_pointer(interp, entry, (void*)val);
- VTABLE_set_pmc_keyed_int(interp, attrs->entries, i, entry);
+ entry = Parrot_pmc_new(INTERP, enum_class_PackfileFixupEntry);
+ VTABLE_set_pointer(INTERP, entry, (void*)val);
+ VTABLE_set_pmc_keyed_int(INTERP, attrs->entries, i, entry);
}
}
@@ -118,14 +118,14 @@
opcode_t i;
pftable->base.type = PF_FIXUP_SEG;
- pftable->fixup_count = VTABLE_elements(interp, attrs->entries);
+ pftable->fixup_count = VTABLE_elements(INTERP, attrs->entries);
pftable->fixups = mem_gc_allocate_n_typed(INTERP,
pftable->fixup_count, PackFile_FixupEntry);
/* Copy all entries */
for (i = 0; i < pftable->fixup_count; ++i) {
- entry = VTABLE_get_pmc_keyed_int(interp, attrs->entries, i);
- val = (PackFile_FixupEntry*)VTABLE_get_pointer(interp, entry);
+ entry = VTABLE_get_pmc_keyed_int(INTERP, attrs->entries, i);
+ val = (PackFile_FixupEntry*)VTABLE_get_pointer(INTERP, entry);
pftable->fixups[i] = *val;
mem_gc_free(INTERP, val);
}
@@ -144,7 +144,7 @@
*/
VTABLE INTVAL elements() {
- return VTABLE_elements(interp,
+ return VTABLE_elements(INTERP,
PARROT_PACKFILEFIXUPTABLE(SELF)->entries);
}
@@ -159,7 +159,7 @@
*/
VTABLE PMC *get_pmc_keyed_int(INTVAL index) {
- return VTABLE_get_pmc_keyed_int(interp,
+ return VTABLE_get_pmc_keyed_int(INTERP,
PARROT_PACKFILEFIXUPTABLE(SELF)->entries, index);
}
@@ -174,7 +174,7 @@
*/
VTABLE void set_pmc_keyed_int(INTVAL index, PMC *value) {
- VTABLE_set_pmc_keyed_int(interp,
+ VTABLE_set_pmc_keyed_int(INTERP,
PARROT_PACKFILEFIXUPTABLE(SELF)->entries, index, value);
}
Modified: branches/codestring/src/pmc/packfilerawsegment.pmc
==============================================================================
--- branches/codestring/src/pmc/packfilerawsegment.pmc Wed May 5 23:52:59 2010 (r46321)
+++ branches/codestring/src/pmc/packfilerawsegment.pmc Thu May 6 00:31:08 2010 (r46322)
@@ -48,7 +48,7 @@
Parrot_PackfileRawSegment_attributes * attrs =
PMC_data_typed(SELF, Parrot_PackfileRawSegment_attributes*);
- attrs->opcodes = Parrot_pmc_new(interp, enum_class_ResizableIntegerArray);
+ attrs->opcodes = Parrot_pmc_new(INTERP, enum_class_ResizableIntegerArray);
attrs->type = PF_BYTEC_SEG;
PObj_custom_mark_SET(SELF);
@@ -68,7 +68,7 @@
Parrot_PackfileRawSegment_attributes * const attrs =
PARROT_PACKFILERAWSEGMENT(SELF);
- Parrot_gc_mark_PMC_alive(interp, attrs->opcodes);
+ Parrot_gc_mark_PMC_alive(INTERP, attrs->opcodes);
SUPER();
}
@@ -98,10 +98,10 @@
size_t i;
/* copy data to own array */
- VTABLE_set_integer_native(interp, opcodes, pfseg->size);
+ VTABLE_set_integer_native(INTERP, opcodes, pfseg->size);
/* Not very efficient... */
for (i = 0; i < pfseg->size; ++i) {
- VTABLE_set_integer_keyed_int(interp, opcodes, i, pfseg->data[i]);
+ VTABLE_set_integer_keyed_int(INTERP, opcodes, i, pfseg->data[i]);
}
}
}
@@ -123,12 +123,12 @@
size_t i;
pfseg->type = attrs->type;
- pfseg->size = VTABLE_get_integer(interp, opcodes);
+ pfseg->size = VTABLE_get_integer(INTERP, opcodes);
pfseg->data = mem_gc_allocate_n_typed(INTERP, pfseg->size, opcode_t);
/* Not very efficient... */
for (i = 0; i < pfseg->size; ++i) {
- pfseg->data[i] = VTABLE_get_integer_keyed_int(interp, opcodes, i);
+ pfseg->data[i] = VTABLE_get_integer_keyed_int(INTERP, opcodes, i);
}
return pfseg;
@@ -143,7 +143,7 @@
*/
VTABLE INTVAL elements() {
- return VTABLE_elements(interp,
+ return VTABLE_elements(INTERP,
PARROT_PACKFILERAWSEGMENT(SELF)->opcodes);
}
@@ -158,7 +158,7 @@
*/
VTABLE INTVAL get_integer_keyed_int(INTVAL key) {
- return VTABLE_get_integer_keyed_int(interp,
+ return VTABLE_get_integer_keyed_int(INTERP,
PARROT_PACKFILERAWSEGMENT(SELF)->opcodes, key);
}
@@ -173,7 +173,7 @@
*/
VTABLE void set_integer_keyed_int(INTVAL key, INTVAL value) {
- VTABLE_set_integer_keyed_int(interp,
+ VTABLE_set_integer_keyed_int(INTERP,
PARROT_PACKFILERAWSEGMENT(SELF)->opcodes, key, value);
}
@@ -187,7 +187,7 @@
*/
VTABLE void push_integer(INTVAL value) {
- VTABLE_push_integer(interp,
+ VTABLE_push_integer(INTERP,
PARROT_PACKFILERAWSEGMENT(SELF)->opcodes, value);
}
Modified: branches/codestring/src/pmc/packfilesegment.pmc
==============================================================================
--- branches/codestring/src/pmc/packfilesegment.pmc Wed May 5 23:52:59 2010 (r46321)
+++ branches/codestring/src/pmc/packfilesegment.pmc Thu May 6 00:31:08 2010 (r46322)
@@ -67,7 +67,7 @@
Parrot_PackfileSegment_attributes * attrs =
PARROT_PACKFILESEGMENT(SELF);
- Parrot_gc_mark_PMC_alive(interp, attrs->directory);
+ Parrot_gc_mark_PMC_alive(INTERP, attrs->directory);
}
/*
@@ -105,7 +105,7 @@
*/
METHOD pack() {
- Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_UNIMPLEMENTED,
+ Parrot_ex_throw_from_c_args(INTERP, NULL, EXCEPTION_UNIMPLEMENTED,
"PackfileSegment.pack() not implemented yet.");
}
@@ -120,7 +120,7 @@
*/
METHOD unpack(STRING *data) {
- Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_UNIMPLEMENTED,
+ Parrot_ex_throw_from_c_args(INTERP, NULL, EXCEPTION_UNIMPLEMENTED,
"PackfileSegment.unpack() not implemented yet.");
}
Modified: branches/codestring/src/pmc/parrotinterpreter.pmc
==============================================================================
--- branches/codestring/src/pmc/parrotinterpreter.pmc Wed May 5 23:52:59 2010 (r46321)
+++ branches/codestring/src/pmc/parrotinterpreter.pmc Thu May 6 00:31:08 2010 (r46322)
@@ -369,14 +369,14 @@
Interp * const new_interp = PMC_interp(SELF);
/* setup code */
- pt_thread_prepare_for_run(new_interp, interp);
+ pt_thread_prepare_for_run(new_interp, INTERP);
/* TODO pass arguments from parent (interp) to child (new_interp) by
* possibly clone of share the arguments r/o args can be passed as is */
/* calculate offset and run */
runops(new_interp, (size_t)((opcode_t *)PMC_sub(SELF) -
- (opcode_t *)interp->code->base.data));
+ (opcode_t *)INTERP->code->base.data));
return (opcode_t *)next;
}
@@ -459,120 +459,120 @@
VTABLE PMC *get_pmc_keyed(PMC *key) {
PMC *nextkey;
STRING *outer = NULL;
- STRING *item = key_string(interp, key);
- STRING *name = CONST_STRING(interp, "globals");
+ STRING *item = key_string(INTERP, key);
+ STRING *name = CONST_STRING(INTERP, "globals");
int level = 0;
PMC *ctx;
- if (Parrot_str_equal(interp, item, name))
- return interp->root_namespace;
+ if (Parrot_str_equal(INTERP, item, name))
+ return INTERP->root_namespace;
- name = CONST_STRING(interp, "outer");
+ name = CONST_STRING(INTERP, "outer");
- if (Parrot_str_equal(interp, item, name)) {
+ if (Parrot_str_equal(INTERP, item, name)) {
outer = item;
nextkey = key_next(INTERP, key);
if (nextkey && (PObj_get_FLAGS(nextkey) & KEY_string_FLAG)) {
key = nextkey;
- item = VTABLE_get_string(interp, key);
+ item = VTABLE_get_string(INTERP, key);
}
}
nextkey = key_next(INTERP, key);
if (nextkey)
- level = VTABLE_get_integer(interp, nextkey);
+ level = VTABLE_get_integer(INTERP, nextkey);
else if (outer)
level = 1;
if (level < 0)
- Parrot_ex_throw_from_c_args(interp, NULL, CONTROL_ERROR,
+ Parrot_ex_throw_from_c_args(INTERP, NULL, CONTROL_ERROR,
"No such caller depth");
- ctx = CURRENT_CONTEXT(interp);
+ ctx = CURRENT_CONTEXT(INTERP);
if (outer) {
for (; level; --level) {
- ctx = Parrot_pcc_get_outer_ctx(interp, ctx);
+ ctx = Parrot_pcc_get_outer_ctx(INTERP, ctx);
if (PMC_IS_NULL(ctx))
- Parrot_ex_throw_from_c_args(interp, NULL,
+ Parrot_ex_throw_from_c_args(INTERP, NULL,
CONTROL_ERROR, "No such outer depth");
}
}
else {
for (; level; --level) {
- PMC * const cont = Parrot_pcc_get_continuation(interp, ctx);
+ PMC * const cont = Parrot_pcc_get_continuation(INTERP, ctx);
if (PMC_IS_NULL(cont) || !PARROT_CONTINUATION(cont)->seg)
- Parrot_ex_throw_from_c_args(interp, NULL,
+ Parrot_ex_throw_from_c_args(INTERP, NULL,
CONTROL_ERROR, "No such caller depth");
ctx = PARROT_CONTINUATION(cont)->to_ctx;
- if (PMC_IS_NULL(Parrot_pcc_get_sub(interp, ctx)))
- Parrot_ex_throw_from_c_args(interp, NULL,
+ if (PMC_IS_NULL(Parrot_pcc_get_sub(INTERP, ctx)))
+ Parrot_ex_throw_from_c_args(INTERP, NULL,
CONTROL_ERROR, "No such caller depth");
}
}
if (item == outer)
- return Parrot_pcc_get_sub(interp, ctx);
+ return Parrot_pcc_get_sub(INTERP, ctx);
- name = CONST_STRING(interp, "context");
+ name = CONST_STRING(INTERP, "context");
- if (Parrot_str_equal(interp, item, name))
+ if (Parrot_str_equal(INTERP, item, name))
return ctx;
- name = CONST_STRING(interp, "sub");
+ name = CONST_STRING(INTERP, "sub");
- if (Parrot_str_equal(interp, item, name))
- return Parrot_pcc_get_sub(interp, ctx);
+ if (Parrot_str_equal(INTERP, item, name))
+ return Parrot_pcc_get_sub(INTERP, ctx);
- name = CONST_STRING(interp, "lexpad");
+ name = CONST_STRING(INTERP, "lexpad");
- if (Parrot_str_equal(interp, item, name))
- return Parrot_pcc_get_lex_pad(interp, ctx);
+ if (Parrot_str_equal(INTERP, item, name))
+ return Parrot_pcc_get_lex_pad(INTERP, ctx);
- name = CONST_STRING(interp, "namespace");
+ name = CONST_STRING(INTERP, "namespace");
- if (Parrot_str_equal(interp, item, name))
- return Parrot_pcc_get_namespace(interp, ctx);
+ if (Parrot_str_equal(INTERP, item, name))
+ return Parrot_pcc_get_namespace(INTERP, ctx);
- name = CONST_STRING(interp, "continuation");
+ name = CONST_STRING(INTERP, "continuation");
- if (Parrot_str_equal(interp, item, name))
- return VTABLE_clone(interp, Parrot_pcc_get_continuation(interp, ctx));
+ if (Parrot_str_equal(INTERP, item, name))
+ return VTABLE_clone(INTERP, Parrot_pcc_get_continuation(INTERP, ctx));
- name = CONST_STRING(interp, "annotations");
+ name = CONST_STRING(INTERP, "annotations");
- if (Parrot_str_equal(interp, item, name)) {
- PMC *sub_pmc = Parrot_pcc_get_sub(interp, ctx);
- if (ctx == CURRENT_CONTEXT(interp)) {
+ if (Parrot_str_equal(INTERP, item, name)) {
+ PMC *sub_pmc = Parrot_pcc_get_sub(INTERP, ctx);
+ if (ctx == CURRENT_CONTEXT(INTERP)) {
/* We can't know the current program counter for the currently
* executing sub, so can't return annotations for that. */
- Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_INVALID_OPERATION,
+ Parrot_ex_throw_from_c_args(INTERP, NULL, EXCEPTION_INVALID_OPERATION,
"Cannot get annotations at depth 0; use annotations op instead.");
}
if (!PMC_IS_NULL(sub_pmc)
&& sub_pmc->vtable->base_type == enum_class_Sub) {
Parrot_Sub_attributes *sub;
PackFile_ByteCode *seg;
- opcode_t *pc = Parrot_pcc_get_pc(interp, ctx);
+ opcode_t *pc = Parrot_pcc_get_pc(INTERP, ctx);
- PMC_get_sub(interp, sub_pmc, sub);
+ PMC_get_sub(INTERP, sub_pmc, sub);
seg = sub->seg;
if (sub->seg->annotations)
- return PackFile_Annotations_lookup(interp, seg->annotations,
+ return PackFile_Annotations_lookup(INTERP, seg->annotations,
pc - seg->base.data, NULL);
}
- return Parrot_pmc_new(interp, enum_class_Hash);
+ return Parrot_pmc_new(INTERP, enum_class_Hash);
}
- Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_ATTRIB_NOT_FOUND,
+ Parrot_ex_throw_from_c_args(INTERP, NULL, EXCEPTION_ATTRIB_NOT_FOUND,
"No such item %Ss", item);
}
@@ -672,14 +672,14 @@
if (!self->thread_data)
return 0;
- return self->thread_data->tid == (UINTVAL) VTABLE_get_integer(interp, value);
+ return self->thread_data->tid == (UINTVAL) VTABLE_get_integer(INTERP, value);
}
MULTI INTVAL is_equal(DEFAULT value) {
Parrot_ex_throw_from_c_args(INTERP, NULL,
EXCEPTION_INTERNAL_NOT_IMPLEMENTED,
"ParrotInterpreter: no multiple dispatch variant 'is_equal' for %Ss",
- VTABLE_name(interp, value));
+ VTABLE_name(INTERP, value));
}
/*
@@ -735,10 +735,10 @@
/* HLL_info */
if (VTABLE_get_integer(INTERP, info) == VISIT_THAW_NORMAL ||
VTABLE_get_integer(INTERP, info) == VISIT_THAW_CONSTANTS) {
- VISIT_PMC(interp, info, PMC_args(SELF));
+ VISIT_PMC(INTERP, info, PMC_args(SELF));
}
else
- VISIT_PMC(interp, info, INTERP->HLL_info);
+ VISIT_PMC(INTERP, info, INTERP->HLL_info);
}
@@ -822,7 +822,7 @@
METHOD hll_map(PMC *core_type, PMC *hll_type) {
const INTVAL core_type_id = VTABLE_type(INTERP, core_type);
const INTVAL hll_type_id = VTABLE_type(INTERP, hll_type);
- const INTVAL hll_id = Parrot_pcc_get_HLL(interp, CURRENT_CONTEXT(interp));
+ const INTVAL hll_id = Parrot_pcc_get_HLL(INTERP, CURRENT_CONTEXT(INTERP));
Parrot_register_HLL_type(INTERP, hll_id, core_type_id, hll_type_id);
}
@@ -843,7 +843,7 @@
*/
METHOD stdhandle(INTVAL fileno, PMC *newhandle :optional) {
- PMC * const handle = Parrot_io_stdhandle(interp, fileno, newhandle);
+ PMC * const handle = Parrot_io_stdhandle(INTERP, fileno, newhandle);
RETURN(PMC *handle);
}
Modified: branches/codestring/src/pmc/parrotthread.pmc
==============================================================================
--- branches/codestring/src/pmc/parrotthread.pmc Wed May 5 23:52:59 2010 (r46321)
+++ branches/codestring/src/pmc/parrotthread.pmc Thu May 6 00:31:08 2010 (r46322)
@@ -45,7 +45,7 @@
*/
VTABLE void init() {
- VTABLE_set_integer_native(interp, SELF, -1);
+ VTABLE_set_integer_native(INTERP, SELF, -1);
}
/*
@@ -59,7 +59,7 @@
*/
VTABLE void init_pmc(PMC *notused) {
- VTABLE_set_integer_native(interp, SELF, -1);
+ VTABLE_set_integer_native(INTERP, SELF, -1);
}
/*
@@ -74,12 +74,12 @@
VTABLE INTVAL get_integer() {
INTVAL ttid;
- GETATTR_ParrotThread_tid(interp, SELF, ttid);
+ GETATTR_ParrotThread_tid(INTERP, SELF, ttid);
return ttid;
}
VTABLE void set_integer_native(INTVAL ttid) {
- SETATTR_ParrotThread_tid(interp, SELF, ttid);
+ SETATTR_ParrotThread_tid(INTERP, SELF, ttid);
}
@@ -95,24 +95,24 @@
METHOD run_clone(PMC *sub, PMC *args :slurpy) {
INTVAL ttid;
if (PMC_IS_NULL(sub)) {
- Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_INVALID_OPERATION,
+ Parrot_ex_throw_from_c_args(INTERP, NULL, EXCEPTION_INVALID_OPERATION,
"Invalid thread sub");
}
- ttid = pt_thread_create_run(interp,
+ ttid = pt_thread_create_run(INTERP,
enum_class_ThreadInterpreter, PARROT_CLONE_DEFAULT, sub, args);
- VTABLE_set_integer_native(interp, SELF, ttid);
+ VTABLE_set_integer_native(INTERP, SELF, ttid);
}
METHOD run(INTVAL clone_flags, PMC *sub, PMC *args :slurpy) {
INTVAL ttid;
if (PMC_IS_NULL(sub)) {
- Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_INVALID_OPERATION,
+ Parrot_ex_throw_from_c_args(INTERP, NULL, EXCEPTION_INVALID_OPERATION,
"Invalid thread sub");
}
- ttid = pt_thread_create_run(interp, enum_class_ThreadInterpreter, clone_flags, sub, args);
- VTABLE_set_integer_native(interp, SELF, ttid);
+ ttid = pt_thread_create_run(INTERP, enum_class_ThreadInterpreter, clone_flags, sub, args);
+ VTABLE_set_integer_native(INTERP, SELF, ttid);
}
/*
@@ -129,7 +129,7 @@
ret = pt_thread_join(INTERP, ttid);
/* invalidate self */
- VTABLE_set_integer_native(interp, SELF, -1);
+ VTABLE_set_integer_native(INTERP, SELF, -1);
RETURN(PMC *ret);
}
Modified: branches/codestring/src/pmc/pmcproxy.pmc
==============================================================================
--- branches/codestring/src/pmc/pmcproxy.pmc Wed May 5 23:52:59 2010 (r46321)
+++ branches/codestring/src/pmc/pmcproxy.pmc Thu May 6 00:31:08 2010 (r46322)
@@ -83,33 +83,33 @@
VTABLE void init() {
Parrot_Class_attributes * const _pmc =
(Parrot_Class_attributes *) PMC_data(SELF);
- PMC * const new_attribute = Parrot_pmc_new(interp, enum_class_Hash);
- STRING * const name = CONST_STRING(interp, "proxy");
+ PMC * const new_attribute = Parrot_pmc_new(INTERP, enum_class_Hash);
+ STRING * const name = CONST_STRING(INTERP, "proxy");
/* Set flag for custom GC mark. */
PObj_custom_mark_SET(SELF);
/* Set up the object. */
_pmc->id = 0;
- _pmc->name = CONST_STRING(interp, "");
+ _pmc->name = CONST_STRING(INTERP, "");
_pmc->_namespace = PMCNULL;
- _pmc->parents = Parrot_pmc_new(interp, enum_class_ResizablePMCArray);
- _pmc->all_parents = Parrot_pmc_new(interp, enum_class_ResizablePMCArray);
- _pmc->roles = Parrot_pmc_new(interp, enum_class_ResizablePMCArray);
- _pmc->methods = Parrot_pmc_new(interp, enum_class_Hash);
- _pmc->vtable_overrides = Parrot_pmc_new(interp, enum_class_Hash);
- _pmc->parent_overrides = Parrot_pmc_new(interp, enum_class_Hash);
- _pmc->attrib_metadata = Parrot_pmc_new(interp, enum_class_Hash);
+ _pmc->parents = Parrot_pmc_new(INTERP, enum_class_ResizablePMCArray);
+ _pmc->all_parents = Parrot_pmc_new(INTERP, enum_class_ResizablePMCArray);
+ _pmc->roles = Parrot_pmc_new(INTERP, enum_class_ResizablePMCArray);
+ _pmc->methods = Parrot_pmc_new(INTERP, enum_class_Hash);
+ _pmc->vtable_overrides = Parrot_pmc_new(INTERP, enum_class_Hash);
+ _pmc->parent_overrides = Parrot_pmc_new(INTERP, enum_class_Hash);
+ _pmc->attrib_metadata = Parrot_pmc_new(INTERP, enum_class_Hash);
_pmc->attrib_index = PMCNULL;
_pmc->attrib_cache = PMCNULL;
- _pmc->resolve_method = Parrot_pmc_new(interp, enum_class_ResizablePMCArray);
+ _pmc->resolve_method = Parrot_pmc_new(INTERP, enum_class_ResizablePMCArray);
/* Set up the attribute storage for the proxy instance */
- VTABLE_set_string_keyed_str(interp, new_attribute, CONST_STRING(interp, "name"), name);
- VTABLE_set_pmc_keyed_str(interp, _pmc->attrib_metadata, name, new_attribute);
+ VTABLE_set_string_keyed_str(INTERP, new_attribute, CONST_STRING(INTERP, "name"), name);
+ VTABLE_set_pmc_keyed_str(INTERP, _pmc->attrib_metadata, name, new_attribute);
/* We put ourself on the all parents list. */
- VTABLE_push_pmc(interp, _pmc->all_parents, SELF);
+ VTABLE_push_pmc(INTERP, _pmc->all_parents, SELF);
/* We are a class. */
PObj_is_class_SET(SELF);
@@ -120,8 +120,8 @@
INTVAL mro_length, i;
/* Ensure that it's a valid type number. */
- if (type_num > interp->n_vtable_max || type_num <= 0)
- Parrot_ex_throw_from_c_args(interp, NULL, 1,
+ if (type_num > INTERP->n_vtable_max || type_num <= 0)
+ Parrot_ex_throw_from_c_args(INTERP, NULL, 1,
"Attempt to create PMC Proxy for invalid type number!");
/* Set up the object. */
@@ -130,36 +130,36 @@
/* Set up number, name and namespace. */
proxy_info = PARROT_CLASS(SELF);
proxy_info->id = type_num;
- proxy_info->name = interp->vtables[type_num]->whoami;
- proxy_info->_namespace = interp->vtables[type_num]->_namespace;
+ proxy_info->name = INTERP->vtables[type_num]->whoami;
+ proxy_info->_namespace = INTERP->vtables[type_num]->_namespace;
/* Build MRO (skip ourself). */
- mro_length = VTABLE_elements(interp, interp->vtables[type_num]->mro);
+ mro_length = VTABLE_elements(INTERP, INTERP->vtables[type_num]->mro);
for (i = 1; i < mro_length; ++i) {
- PMC *pclass = VTABLE_get_pmc_keyed_int(interp, interp->vtables[type_num]->mro, i);
+ PMC *pclass = VTABLE_get_pmc_keyed_int(INTERP, INTERP->vtables[type_num]->mro, i);
PMC *cns = pclass->vtable->_namespace;
STRING *cname = pclass->vtable->whoami;
- if (Parrot_str_not_equal(interp, cname, CONST_STRING(interp, "scalar"))) {
- PMC *pproxy = Parrot_oo_get_class(interp, cns);
- VTABLE_push_pmc(interp, proxy_info->all_parents, pproxy);
+ if (Parrot_str_not_equal(INTERP, cname, CONST_STRING(INTERP, "scalar"))) {
+ PMC *pproxy = Parrot_oo_get_class(INTERP, cns);
+ VTABLE_push_pmc(INTERP, proxy_info->all_parents, pproxy);
}
}
/* PMCs just do single inheritance, so we'll assume that if we have a
* second entry in our MRO, it goes in the parents list. */
- if (VTABLE_elements(interp, proxy_info->all_parents) >= 2)
- VTABLE_push_pmc(interp, proxy_info->parents,
- VTABLE_get_pmc_keyed_int(interp, proxy_info->all_parents, 1));
+ if (VTABLE_elements(INTERP, proxy_info->all_parents) >= 2)
+ VTABLE_push_pmc(INTERP, proxy_info->parents,
+ VTABLE_get_pmc_keyed_int(INTERP, proxy_info->all_parents, 1));
if (!PMC_IS_NULL(proxy_info->_namespace) &&
- PMC_IS_NULL(VTABLE_get_class(interp, proxy_info->_namespace))) {
+ PMC_IS_NULL(VTABLE_get_class(INTERP, proxy_info->_namespace))) {
/* Link the proxy and the namespace, caching the proxy object for
* later retrieval on class lookup. */
- Parrot_pcc_invoke_method_from_c_args(interp, proxy_info->_namespace, CONST_STRING(interp, "set_class"), "P->", SELF);
+ Parrot_pcc_invoke_method_from_c_args(INTERP, proxy_info->_namespace, CONST_STRING(INTERP, "set_class"), "P->", SELF);
/* Extract any methods from the namespace */
- Parrot_oo_extract_methods_from_namespace(interp, SELF,
+ Parrot_oo_extract_methods_from_namespace(INTERP, SELF,
proxy_info->_namespace);
}
@@ -168,7 +168,7 @@
* and terminated by an space,
* the list is '\0' terminated
*/
- const char * attr = interp->vtables[type_num]->attribute_defs;
+ const char * attr = INTERP->vtables[type_num]->attribute_defs;
while (* attr) {
const char * const current = attr + 1;
size_t l;
@@ -176,7 +176,7 @@
while (* attr != ' ') ++attr;
l= attr - current;
if (attrtype != ':') {
- STRING *sattr = Parrot_str_new(interp, current, l);
+ STRING *sattr = Parrot_str_new(INTERP, current, l);
SELF.add_attribute(sattr, NULL);
}
++attr;
@@ -185,7 +185,7 @@
}
VTABLE void init_pmc(PMC *init_data) {
- const INTVAL type_num = VTABLE_get_integer(interp, init_data);
+ const INTVAL type_num = VTABLE_get_integer(INTERP, init_data);
SELF.init_int(type_num);
}
@@ -202,9 +202,9 @@
Parrot_Class_attributes * const _pmc = PARROT_CLASS(SELF);
if (!PMC_IS_NULL(init))
- return Parrot_pmc_new_init(interp, _pmc->id, init);
+ return Parrot_pmc_new_init(INTERP, _pmc->id, init);
- return Parrot_pmc_new(interp, _pmc->id);
+ return Parrot_pmc_new(INTERP, _pmc->id);
}
/*
@@ -229,46 +229,46 @@
if (SUPER(lookup))
return 1;
- classobj = Parrot_oo_get_class(interp, lookup);
+ classobj = Parrot_oo_get_class(INTERP, lookup);
if (PMC_IS_NULL(classobj))
return 0;
- classname = VTABLE_get_string(interp, classobj);
+ classname = VTABLE_get_string(INTERP, classobj);
/* Check if the passed name is the same as the stored short name. */
- if (Parrot_str_equal(interp, classname, _proxy->name))
+ if (Parrot_str_equal(INTERP, classname, _proxy->name))
return 1;
/* Check if the class object is the same as self's class object */
- if (VTABLE_is_same(interp, SELF, classobj))
+ if (VTABLE_is_same(INTERP, SELF, classobj))
return 1;
/* Check if the passed name is the same as the fully qualified name. */
- if (Parrot_str_equal(interp, classname, VTABLE_get_string(interp, SELF)))
+ if (Parrot_str_equal(INTERP, classname, VTABLE_get_string(INTERP, SELF)))
return 1;
/* Look in the isa hash. */
- if (interp->vtables[_proxy->id]) {
- Hash *isa_hash = interp->vtables[_proxy->id]->isa_hash;
+ if (INTERP->vtables[_proxy->id]) {
+ Hash *isa_hash = INTERP->vtables[_proxy->id]->isa_hash;
- if (!isa_hash && Parrot_str_equal(interp,
- interp->vtables[_proxy->id]->whoami, classname))
+ if (!isa_hash && Parrot_str_equal(INTERP,
+ INTERP->vtables[_proxy->id]->whoami, classname))
return 1;
- if (isa_hash && parrot_hash_exists(interp, isa_hash, classname))
+ if (isa_hash && parrot_hash_exists(INTERP, isa_hash, classname))
return 1;
}
/* Iterate over all the parents and check if they respond true
* for 'isa' on the original comparison. */
- num_classes = VTABLE_elements(interp, _proxy->parents);
+ num_classes = VTABLE_elements(INTERP, _proxy->parents);
for (i = 0; i < num_classes; ++i) {
- PMC * const cur_class = VTABLE_get_pmc_keyed_int(interp,
+ PMC * const cur_class = VTABLE_get_pmc_keyed_int(INTERP,
_proxy->parents, i);
- if (VTABLE_isa_pmc(interp, cur_class, lookup))
+ if (VTABLE_isa_pmc(INTERP, cur_class, lookup))
return 1;
}
@@ -287,7 +287,7 @@
VTABLE INTVAL isa(STRING *classname) {
Parrot_Class_attributes * const _proxy = PARROT_CLASS(SELF);
- const STRING * const pmc_proxy = CONST_STRING(interp, "PMCProxy");
+ const STRING * const pmc_proxy = CONST_STRING(INTERP, "PMCProxy");
if (Parrot_str_equal(INTERP, classname, pmc_proxy))
return 1;
@@ -296,15 +296,15 @@
return 1;
/* Look in the isa hash. */
- if (interp->vtables[_proxy->id]) {
- Hash *isa_hash = interp->vtables[_proxy->id]->isa_hash;
+ if (INTERP->vtables[_proxy->id]) {
+ Hash *isa_hash = INTERP->vtables[_proxy->id]->isa_hash;
- if (!isa_hash && Parrot_str_equal(interp,
- interp->vtables[_proxy->id]->whoami, classname)) {
+ if (!isa_hash && Parrot_str_equal(INTERP,
+ INTERP->vtables[_proxy->id]->whoami, classname)) {
return 1;
}
- if (isa_hash && parrot_hash_exists(interp, isa_hash, classname))
+ if (isa_hash && parrot_hash_exists(INTERP, isa_hash, classname))
return 1;
}
@@ -360,21 +360,21 @@
{
/* Create a hash, then use inspect_str to get all of the data to
* fill it up with. */
- STRING * const name_str = CONST_STRING(interp, "name");
- STRING * const ns_str = CONST_STRING(interp, "namespace");
- STRING * const meth_str = CONST_STRING(interp, "methods");
- STRING * const parents_str = CONST_STRING(interp, "parents");
-
- PMC * const metadata = Parrot_pmc_new(interp, enum_class_Hash);
-
- VTABLE_set_pmc_keyed_str(interp, metadata, name_str,
- VTABLE_inspect_str(interp, SELF, name_str));
- VTABLE_set_pmc_keyed_str(interp, metadata, ns_str,
- VTABLE_inspect_str(interp, SELF, ns_str));
- VTABLE_set_pmc_keyed_str(interp, metadata, meth_str,
- VTABLE_inspect_str(interp, SELF, meth_str));
- VTABLE_set_pmc_keyed_str(interp, metadata, parents_str,
- VTABLE_inspect_str(interp, SELF, parents_str));
+ STRING * const name_str = CONST_STRING(INTERP, "name");
+ STRING * const ns_str = CONST_STRING(INTERP, "namespace");
+ STRING * const meth_str = CONST_STRING(INTERP, "methods");
+ STRING * const parents_str = CONST_STRING(INTERP, "parents");
+
+ PMC * const metadata = Parrot_pmc_new(INTERP, enum_class_Hash);
+
+ VTABLE_set_pmc_keyed_str(INTERP, metadata, name_str,
+ VTABLE_inspect_str(INTERP, SELF, name_str));
+ VTABLE_set_pmc_keyed_str(INTERP, metadata, ns_str,
+ VTABLE_inspect_str(INTERP, SELF, ns_str));
+ VTABLE_set_pmc_keyed_str(INTERP, metadata, meth_str,
+ VTABLE_inspect_str(INTERP, SELF, meth_str));
+ VTABLE_set_pmc_keyed_str(INTERP, metadata, parents_str,
+ VTABLE_inspect_str(INTERP, SELF, parents_str));
return metadata;
}
@@ -422,7 +422,7 @@
*/
METHOD new(PMC *args :optional, int got_args :opt_flag) {
- PMC * const obj = VTABLE_instantiate(interp, SELF, args);
+ PMC * const obj = VTABLE_instantiate(INTERP, SELF, args);
UNUSED(got_args);
RETURN(PMC *obj);
}
@@ -438,7 +438,7 @@
*/
METHOD methods() {
- PMC * const ret_methods = VTABLE_inspect_str(interp, SELF, CONST_STRING(interp, "methods"));
+ PMC * const ret_methods = VTABLE_inspect_str(INTERP, SELF, CONST_STRING(INTERP, "methods"));
RETURN(PMC *ret_methods);
}
@@ -453,7 +453,7 @@
*/
METHOD parents() {
- PMC * const ret_parents = VTABLE_inspect_str(interp, SELF, CONST_STRING(interp, "parents"));
+ PMC * const ret_parents = VTABLE_inspect_str(INTERP, SELF, CONST_STRING(INTERP, "parents"));
RETURN(PMC *ret_parents);
}
@@ -472,8 +472,8 @@
/* Just delegate to the appropriate vtable. */
PMC * const found =
got_what
- ? VTABLE_inspect_str(interp, SELF, what)
- : VTABLE_inspect(interp, SELF);
+ ? VTABLE_inspect_str(INTERP, SELF, what)
+ : VTABLE_inspect(INTERP, SELF);
RETURN(PMC *found);
}
Modified: branches/codestring/src/pmc/resizablebooleanarray.pmc
==============================================================================
--- branches/codestring/src/pmc/resizablebooleanarray.pmc Wed May 5 23:52:59 2010 (r46321)
+++ branches/codestring/src/pmc/resizablebooleanarray.pmc Thu May 6 00:31:08 2010 (r46322)
@@ -65,7 +65,7 @@
/* If it's still negative, we have a problem */
if (key < 0)
- Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_OUT_OF_BOUNDS,
+ Parrot_ex_throw_from_c_args(INTERP, NULL, EXCEPTION_OUT_OF_BOUNDS,
"ResizableBooleanArray: index out of bounds!");
}
@@ -99,7 +99,7 @@
/* If it's still negative, we have a problem */
if (key < 0)
- Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_OUT_OF_BOUNDS,
+ Parrot_ex_throw_from_c_args(INTERP, NULL, EXCEPTION_OUT_OF_BOUNDS,
"ResizableBooleanArray: index out of bounds!");
}
@@ -139,7 +139,7 @@
return;
if (size < 0)
- Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_OUT_OF_BOUNDS,
+ Parrot_ex_throw_from_c_args(INTERP, NULL, EXCEPTION_OUT_OF_BOUNDS,
"ResizableBooleanArray: Can't resize!");
/* now set the new size, in bits */
@@ -212,7 +212,7 @@
INTVAL value;
if (SELF.elements() < 1)
- Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_OUT_OF_BOUNDS,
+ Parrot_ex_throw_from_c_args(INTERP, NULL, EXCEPTION_OUT_OF_BOUNDS,
"ResizableBooleanArray: Can't pop from an empty array!");
GET_ATTR_size(INTERP, SELF, tail_pos);
@@ -297,7 +297,7 @@
UINTVAL tail_pos, head_pos;
if (SELF.elements() < 1)
- Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_OUT_OF_BOUNDS,
+ Parrot_ex_throw_from_c_args(INTERP, NULL, EXCEPTION_OUT_OF_BOUNDS,
"ResizableBooleanArray: Can't shift from an empty array!");
/* Get head value */
Modified: branches/codestring/src/pmc/resizablefloatarray.pmc
==============================================================================
--- branches/codestring/src/pmc/resizablefloatarray.pmc Wed May 5 23:52:59 2010 (r46321)
+++ branches/codestring/src/pmc/resizablefloatarray.pmc Thu May 6 00:31:08 2010 (r46322)
@@ -42,7 +42,7 @@
INTVAL size;
if (key < 0)
- Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_OUT_OF_BOUNDS,
+ Parrot_ex_throw_from_c_args(INTERP, NULL, EXCEPTION_OUT_OF_BOUNDS,
"ResizableFloatArray: index out of bounds!");
GET_ATTR_size(INTERP, SELF, size);
@@ -69,7 +69,7 @@
INTVAL size;
if (key < 0)
- Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_OUT_OF_BOUNDS,
+ Parrot_ex_throw_from_c_args(INTERP, NULL, EXCEPTION_OUT_OF_BOUNDS,
"ResizableFloatArray: index out of bounds!");
GET_ATTR_size(INTERP, SELF, size);
@@ -102,7 +102,7 @@
INTVAL resize_threshold;
if (size < 0)
- Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_OUT_OF_BOUNDS,
+ Parrot_ex_throw_from_c_args(INTERP, NULL, EXCEPTION_OUT_OF_BOUNDS,
"ResizableFloatArray: Can't resize to negative value!");
GET_ATTR_float_array(INTERP, SELF, float_array);
@@ -192,7 +192,7 @@
GET_ATTR_size(INTERP, SELF, size);
if (size == 0)
- Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_OUT_OF_BOUNDS,
+ Parrot_ex_throw_from_c_args(INTERP, NULL, EXCEPTION_OUT_OF_BOUNDS,
"ResizableFloatArray: Can't pop from an empty array!");
value = SELF.get_number_keyed_int(size-1);
Modified: branches/codestring/src/pmc/resizableintegerarray.pmc
==============================================================================
--- branches/codestring/src/pmc/resizableintegerarray.pmc Wed May 5 23:52:59 2010 (r46321)
+++ branches/codestring/src/pmc/resizableintegerarray.pmc Thu May 6 00:31:08 2010 (r46322)
@@ -45,7 +45,7 @@
Parrot_ex_throw_from_c_args(INTERP, NULL, EXCEPTION_OUT_OF_BOUNDS,
"ResizableIntegerArray: index out of bounds!");
- GET_ATTR_size(interp, SELF, size);
+ GET_ATTR_size(INTERP, SELF, size);
if (key >= size)
return 0;
@@ -151,17 +151,17 @@
INTVAL nextix;
INTVAL resize_threshold;
- GET_ATTR_size(interp, SELF, nextix);
- GET_ATTR_resize_threshold(interp, SELF, resize_threshold);
+ GET_ATTR_size(INTERP, SELF, nextix);
+ GET_ATTR_resize_threshold(INTERP, SELF, resize_threshold);
/* can't always avoid the resize, but don't duplicate the code */
if ((nextix && (nextix >= resize_threshold)) || !nextix)
SELF.set_integer_native(nextix + 1);
else
- SET_ATTR_size(interp, SELF, nextix + 1);
+ SET_ATTR_size(INTERP, SELF, nextix + 1);
/* fetch the array only after resize check; realloc may move it */
- GET_ATTR_int_array(interp, SELF, int_array);
+ GET_ATTR_int_array(INTERP, SELF, int_array);
int_array[nextix] = value;
}
Modified: branches/codestring/src/pmc/resizablestringarray.pmc
==============================================================================
--- branches/codestring/src/pmc/resizablestringarray.pmc Wed May 5 23:52:59 2010 (r46321)
+++ branches/codestring/src/pmc/resizablestringarray.pmc Thu May 6 00:31:08 2010 (r46322)
@@ -43,7 +43,7 @@
STRING **str_array;
INTVAL size;
- GET_ATTR_size(interp, SELF, size);
+ GET_ATTR_size(INTERP, SELF, size);
if (key < 0) {
if (key < -size)
@@ -59,7 +59,7 @@
GET_ATTR_str_array(INTERP, SELF, str_array);
if (!str_array[key])
- str_array[key] = Parrot_str_new(interp, NULL, 0);
+ str_array[key] = Parrot_str_new(INTERP, NULL, 0);
return str_array[key];
}
@@ -78,7 +78,7 @@
STRING **str_array;
INTVAL size;
- GET_ATTR_size(interp, SELF, size);
+ GET_ATTR_size(INTERP, SELF, size);
if (key < 0) {
if (key < -size)
@@ -108,7 +108,7 @@
VTABLE void push_string(STRING *value) {
INTVAL next_idx;
- GET_ATTR_size(interp, SELF, next_idx);
+ GET_ATTR_size(INTERP, SELF, next_idx);
SELF.set_string_keyed_int(next_idx, value);
}
@@ -125,7 +125,7 @@
VTABLE STRING *pop_string() {
STRING *value;
INTVAL size;
- GET_ATTR_size(interp, SELF, size);
+ GET_ATTR_size(INTERP, SELF, size);
if (size == 0)
Parrot_ex_throw_from_c_args(INTERP, NULL, EXCEPTION_OUT_OF_BOUNDS,
@@ -222,7 +222,7 @@
/* zero out anything that was previously allocated
* if we're growing the array */
INTVAL old_size;
- GET_ATTR_size(interp, SELF, old_size);
+ GET_ATTR_size(INTERP, SELF, old_size);
if (new_size > old_size) {
INTVAL i;
for (i = old_size; i < new_size; ++i)
@@ -270,7 +270,7 @@
VTABLE PMC *clone() {
PMC * const copy = SUPER();
INTVAL size;
- GET_ATTR_size(interp, SELF, size);
+ GET_ATTR_size(INTERP, SELF, size);
/* copy trimmed extra space */
SET_ATTR_resize_threshold(INTERP, copy, size);
return copy;
@@ -289,7 +289,7 @@
VTABLE STRING *shift_string() {
STRING *value;
INTVAL size;
- GET_ATTR_size(interp, SELF, size);
+ GET_ATTR_size(INTERP, SELF, size);
if (size == 0)
Parrot_ex_throw_from_c_args(INTERP, NULL, EXCEPTION_OUT_OF_BOUNDS,
Modified: branches/codestring/src/pmc/role.pmc
==============================================================================
--- branches/codestring/src/pmc/role.pmc Wed May 5 23:52:59 2010 (r46321)
+++ branches/codestring/src/pmc/role.pmc Thu May 6 00:31:08 2010 (r46322)
@@ -248,11 +248,11 @@
PObj_custom_mark_SET(SELF);
/* Set up the object. */
- role->name = CONST_STRING(interp, "");
+ role->name = CONST_STRING(INTERP, "");
role->_namespace = PMCNULL;
- role->roles = Parrot_pmc_new(interp, enum_class_ResizablePMCArray);
- role->methods = Parrot_pmc_new(interp, enum_class_Hash);
- role->attrib_metadata = Parrot_pmc_new(interp, enum_class_Hash);
+ role->roles = Parrot_pmc_new(INTERP, enum_class_ResizablePMCArray);
+ role->methods = Parrot_pmc_new(INTERP, enum_class_Hash);
+ role->attrib_metadata = Parrot_pmc_new(INTERP, enum_class_Hash);
}
VTABLE void init_pmc(PMC *init_data) {
@@ -260,7 +260,7 @@
SELF.init();
/* Initialize the role with the supplied data. */
- init_role_from_hash(interp, SELF, init_data);
+ init_role_from_hash(INTERP, SELF, init_data);
}
/*
@@ -276,11 +276,11 @@
VTABLE void mark() {
Parrot_Role_attributes * const role = PARROT_ROLE(SELF);
- Parrot_gc_mark_STRING_alive(interp, role->name);
- Parrot_gc_mark_PMC_alive(interp, role->_namespace);
- Parrot_gc_mark_PMC_alive(interp, role->roles);
- Parrot_gc_mark_PMC_alive(interp, role->methods);
- Parrot_gc_mark_PMC_alive(interp, role->attrib_metadata);
+ Parrot_gc_mark_STRING_alive(INTERP, role->name);
+ Parrot_gc_mark_PMC_alive(INTERP, role->_namespace);
+ Parrot_gc_mark_PMC_alive(INTERP, role->roles);
+ Parrot_gc_mark_PMC_alive(INTERP, role->methods);
+ Parrot_gc_mark_PMC_alive(INTERP, role->attrib_metadata);
}
/*
@@ -296,16 +296,16 @@
VTABLE void add_attribute(STRING *name, PMC *type) {
Parrot_Role_attributes * const role = PARROT_ROLE(SELF);
- PMC * const new_attribute = Parrot_pmc_new(interp, enum_class_Hash);
+ PMC * const new_attribute = Parrot_pmc_new(INTERP, enum_class_Hash);
/* Set name and type. */
- VTABLE_set_string_keyed_str(interp, new_attribute, CONST_STRING(interp, "name"), name);
+ VTABLE_set_string_keyed_str(INTERP, new_attribute, CONST_STRING(INTERP, "name"), name);
if (!PMC_IS_NULL(type))
- VTABLE_set_pmc_keyed_str(interp, new_attribute, CONST_STRING(interp, "type"), type);
+ VTABLE_set_pmc_keyed_str(INTERP, new_attribute, CONST_STRING(INTERP, "type"), type);
/* Enter the attribute in the attributes array. */
- VTABLE_set_pmc_keyed_str(interp, role->attrib_metadata,
+ VTABLE_set_pmc_keyed_str(INTERP, role->attrib_metadata,
name, new_attribute);
}
@@ -323,15 +323,15 @@
Parrot_Role_attributes * const role = PARROT_ROLE(SELF);
/* If we have already added a method with this name... */
- if (VTABLE_exists_keyed_str(interp, role->methods, name)) {
+ if (VTABLE_exists_keyed_str(INTERP, role->methods, name)) {
/* XXX Need to handle multi methods here. */
- Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_UNIMPLEMENTED,
+ Parrot_ex_throw_from_c_args(INTERP, NULL, EXCEPTION_UNIMPLEMENTED,
"Currently, adding multiple methods of the same name"
" is not supported.");
}
else {
/* Enter it into the table. */
- VTABLE_set_pmc_keyed_str(interp, role->methods, name, sub);
+ VTABLE_set_pmc_keyed_str(INTERP, role->methods, name, sub);
}
}
@@ -346,12 +346,12 @@
*/
VTABLE void remove_method(STRING *name) {
Parrot_Role_attributes * const role = PARROT_ROLE(SELF);
- if (VTABLE_exists_keyed_str(interp, role->methods, name))
- VTABLE_delete_keyed_str(interp, role->methods, name);
+ if (VTABLE_exists_keyed_str(INTERP, role->methods, name))
+ VTABLE_delete_keyed_str(INTERP, role->methods, name);
else
- Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_INVALID_OPERATION,
+ Parrot_ex_throw_from_c_args(INTERP, NULL, EXCEPTION_INVALID_OPERATION,
"No method named '%S' to remove in role '%S'.",
- name, VTABLE_get_string(interp, SELF));
+ name, VTABLE_get_string(INTERP, SELF));
}
/*
@@ -369,7 +369,7 @@
Parrot_Role_attributes * const this_role = PARROT_ROLE(SELF);
/* Do the composition. */
- Parrot_ComposeRole(interp, role, PMCNULL, 0, PMCNULL, 0,
+ Parrot_ComposeRole(INTERP, role, PMCNULL, 0, PMCNULL, 0,
this_role->methods, this_role->roles);
}
@@ -407,25 +407,25 @@
/* What should we return? */
PMC *found;
- if (Parrot_str_equal(interp, what, CONST_STRING(interp, "name"))) {
- found = Parrot_pmc_new(interp, enum_class_String);
- VTABLE_set_string_native(interp, found, role->name);
+ if (Parrot_str_equal(INTERP, what, CONST_STRING(INTERP, "name"))) {
+ found = Parrot_pmc_new(INTERP, enum_class_String);
+ VTABLE_set_string_native(INTERP, found, role->name);
}
- else if (Parrot_str_equal(interp, what, CONST_STRING(interp, "namespace"))) {
+ else if (Parrot_str_equal(INTERP, what, CONST_STRING(INTERP, "namespace"))) {
/* Don't clone the namespace, as it's not part of our state. */
return role->_namespace;
}
- else if (Parrot_str_equal(interp, what, CONST_STRING(interp, "attributes"))) {
+ else if (Parrot_str_equal(INTERP, what, CONST_STRING(INTERP, "attributes"))) {
found = role->attrib_metadata;
}
- else if (Parrot_str_equal(interp, what, CONST_STRING(interp, "methods"))) {
+ else if (Parrot_str_equal(INTERP, what, CONST_STRING(INTERP, "methods"))) {
found = role->methods;
}
- else if (Parrot_str_equal(interp, what, CONST_STRING(interp, "roles"))) {
+ else if (Parrot_str_equal(INTERP, what, CONST_STRING(INTERP, "roles"))) {
found = role->roles;
}
else {
- Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_INVALID_OPERATION,
+ Parrot_ex_throw_from_c_args(INTERP, NULL, EXCEPTION_INVALID_OPERATION,
"Unknown introspection value '%S'", what);
}
@@ -434,16 +434,16 @@
if (found->vtable->base_type == enum_class_Hash) {
/* for Hash return values, create and return a shallow
* clone because the VTABLE_clone does a deep clone */
- PMC * const hash = Parrot_pmc_new(interp, enum_class_Hash);
- PMC * const iter = VTABLE_get_iter(interp, found);
- while (VTABLE_get_bool(interp, iter)) {
- STRING * key = VTABLE_shift_string(interp, iter);
- PMC * value = VTABLE_get_pmc_keyed_str(interp, found, key);
- VTABLE_set_pmc_keyed_str(interp, hash, key, value);
+ PMC * const hash = Parrot_pmc_new(INTERP, enum_class_Hash);
+ PMC * const iter = VTABLE_get_iter(INTERP, found);
+ while (VTABLE_get_bool(INTERP, iter)) {
+ STRING * key = VTABLE_shift_string(INTERP, iter);
+ PMC * value = VTABLE_get_pmc_keyed_str(INTERP, found, key);
+ VTABLE_set_pmc_keyed_str(INTERP, hash, key, value);
}
return hash;
}
- return VTABLE_clone(interp, found);
+ return VTABLE_clone(INTERP, found);
}
@@ -461,28 +461,28 @@
VTABLE PMC *inspect() {
/* Create a hash, then use inspect_str to get all of the data to
* fill it up with. */
- PMC * const metadata = Parrot_pmc_new(interp, enum_class_Hash);
+ PMC * const metadata = Parrot_pmc_new(INTERP, enum_class_Hash);
- STRING * const name = CONST_STRING(interp, "name");
- STRING * const _namespace = CONST_STRING(interp, "namespace");
- STRING * const attributes = CONST_STRING(interp, "attributes");
- STRING * const methods = CONST_STRING(interp, "methods");
- STRING * const roles = CONST_STRING(interp, "roles");
+ STRING * const name = CONST_STRING(INTERP, "name");
+ STRING * const _namespace = CONST_STRING(INTERP, "namespace");
+ STRING * const attributes = CONST_STRING(INTERP, "attributes");
+ STRING * const methods = CONST_STRING(INTERP, "methods");
+ STRING * const roles = CONST_STRING(INTERP, "roles");
- VTABLE_set_pmc_keyed_str(interp, metadata, name,
- VTABLE_inspect_str(interp, SELF, name));
+ VTABLE_set_pmc_keyed_str(INTERP, metadata, name,
+ VTABLE_inspect_str(INTERP, SELF, name));
- VTABLE_set_pmc_keyed_str(interp, metadata, _namespace,
- VTABLE_inspect_str(interp, SELF, _namespace));
+ VTABLE_set_pmc_keyed_str(INTERP, metadata, _namespace,
+ VTABLE_inspect_str(INTERP, SELF, _namespace));
- VTABLE_set_pmc_keyed_str(interp, metadata, attributes,
- VTABLE_inspect_str(interp, SELF, attributes));
+ VTABLE_set_pmc_keyed_str(INTERP, metadata, attributes,
+ VTABLE_inspect_str(INTERP, SELF, attributes));
- VTABLE_set_pmc_keyed_str(interp, metadata, methods,
- VTABLE_inspect_str(interp, SELF, methods));
+ VTABLE_set_pmc_keyed_str(INTERP, metadata, methods,
+ VTABLE_inspect_str(INTERP, SELF, methods));
- VTABLE_set_pmc_keyed_str(interp, metadata, roles,
- VTABLE_inspect_str(interp, SELF, roles));
+ VTABLE_set_pmc_keyed_str(INTERP, metadata, roles,
+ VTABLE_inspect_str(INTERP, SELF, roles));
return metadata;
}
@@ -505,12 +505,12 @@
* to retrieve a fully qualified list of names, then join the list
* with a semicolon.
*/
- PMC * const names = Parrot_ns_get_name(interp, _namespace);
+ PMC * const names = Parrot_ns_get_name(INTERP, _namespace);
if (!PMC_IS_NULL(names)) {
/* remove the HLL namespace name */
VTABLE_shift_string(INTERP, names);
- return Parrot_str_join(interp, CONST_STRING(interp, ";"), names);
+ return Parrot_str_join(INTERP, CONST_STRING(INTERP, ";"), names);
}
}
@@ -532,13 +532,13 @@
Parrot_Role_attributes * const role = PARROT_ROLE(SELF);
INTVAL i, count;
- if (Parrot_str_equal(interp, role->name, role_name))
+ if (Parrot_str_equal(INTERP, role->name, role_name))
return 1;
- count = VTABLE_elements(interp, role->roles);
+ count = VTABLE_elements(INTERP, role->roles);
for (i = 0; i < count; ++i) {
- PMC *cur_role = VTABLE_get_pmc_keyed_int(interp, role->roles, i);
- if (VTABLE_does(interp, cur_role, role_name))
+ PMC *cur_role = VTABLE_get_pmc_keyed_int(INTERP, role->roles, i);
+ if (VTABLE_does(INTERP, cur_role, role_name))
return 1;
}
@@ -562,10 +562,10 @@
if (role == SELF)
return 1;
- count = VTABLE_elements(interp, this_role->roles);
+ count = VTABLE_elements(INTERP, this_role->roles);
for (i = 0; i < count; ++i) {
- PMC *cur_role = VTABLE_get_pmc_keyed_int(interp, this_role->roles, i);
- if (VTABLE_does_pmc(interp, cur_role, role))
+ PMC *cur_role = VTABLE_get_pmc_keyed_int(INTERP, this_role->roles, i);
+ if (VTABLE_does_pmc(INTERP, cur_role, role))
return 1;
}
@@ -603,9 +603,9 @@
if (got_name) {
/* We'll build a hash just containing the name, then give this to
* init_role_from_hash - saves some code duplication. */
- PMC *naming_hash = Parrot_pmc_new(interp, enum_class_Hash);
- VTABLE_set_string_keyed_str(interp, naming_hash, CONST_STRING(interp, "name"), name);
- init_role_from_hash(interp, SELF, naming_hash);
+ PMC *naming_hash = Parrot_pmc_new(INTERP, enum_class_Hash);
+ VTABLE_set_string_keyed_str(INTERP, naming_hash, CONST_STRING(INTERP, "name"), name);
+ init_role_from_hash(INTERP, SELF, naming_hash);
}
ret_name = role->name;
@@ -643,7 +643,7 @@
*/
METHOD attributes() {
- PMC *ret_attrib_metadata = VTABLE_inspect_str(interp, SELF, CONST_STRING(interp, "attributes"));
+ PMC *ret_attrib_metadata = VTABLE_inspect_str(INTERP, SELF, CONST_STRING(INTERP, "attributes"));
RETURN(PMC *ret_attrib_metadata);
}
@@ -661,7 +661,7 @@
*/
METHOD add_attribute(STRING *attribute_name,
PMC *attribute_type :optional, int got_type :opt_flag) {
- VTABLE_add_attribute(interp, SELF, attribute_name,
+ VTABLE_add_attribute(INTERP, SELF, attribute_name,
got_type ? attribute_type : PMCNULL);
}
@@ -676,7 +676,7 @@
*/
METHOD methods() {
- PMC *ret_methods = VTABLE_inspect_str(interp, SELF, CONST_STRING(interp, "methods"));
+ PMC *ret_methods = VTABLE_inspect_str(INTERP, SELF, CONST_STRING(INTERP, "methods"));
RETURN(PMC *ret_methods);
}
@@ -691,7 +691,7 @@
*/
METHOD add_method(STRING *name, PMC *sub) {
- VTABLE_add_method(interp, SELF, name, sub);
+ VTABLE_add_method(INTERP, SELF, name, sub);
}
/*
@@ -705,7 +705,7 @@
*/
METHOD remove_method(STRING *name)
{
- VTABLE_remove_method(interp, SELF, name);
+ VTABLE_remove_method(INTERP, SELF, name);
}
@@ -719,7 +719,7 @@
*/
METHOD roles() {
- PMC *ret_roles = VTABLE_inspect_str(interp, SELF, CONST_STRING(interp, "roles"));
+ PMC *ret_roles = VTABLE_inspect_str(INTERP, SELF, CONST_STRING(INTERP, "roles"));
RETURN(PMC *ret_roles);
}
@@ -747,12 +747,12 @@
STRING *s_name = NULL;
STRING *r_name = NULL;
- (STRING *s_name) = PCCINVOKE(interp, SELF, "name");
- (STRING *r_name) = PCCINVOKE(interp, role, "name");
+ (STRING *s_name) = PCCINVOKE(INTERP, SELF, "name");
+ (STRING *r_name) = PCCINVOKE(INTERP, role, "name");
UNUSED(s_name);
UNUSED(r_name);
- Parrot_ComposeRole(interp, role, exclude_method, got_exclude_method,
+ Parrot_ComposeRole(INTERP, role, exclude_method, got_exclude_method,
alias_method, got_alias_method,
role_info->methods, role_info->roles);
}
@@ -772,9 +772,9 @@
/* Just delegate to the appropriate vtable. */
if (got_what)
- found = VTABLE_inspect_str(interp, SELF, what);
+ found = VTABLE_inspect_str(INTERP, SELF, what);
else
- found = VTABLE_inspect(interp, SELF);
+ found = VTABLE_inspect(INTERP, SELF);
RETURN(PMC *found);
}
Modified: branches/codestring/src/pmc/scheduler.pmc
==============================================================================
--- branches/codestring/src/pmc/scheduler.pmc Wed May 5 23:52:59 2010 (r46321)
+++ branches/codestring/src/pmc/scheduler.pmc Thu May 6 00:31:08 2010 (r46322)
@@ -61,10 +61,10 @@
/* Set up the core struct. */
core_struct->id = 0;
core_struct->max_tid = 0;
- core_struct->task_list = Parrot_pmc_new(interp, enum_class_Hash);
- core_struct->task_index = Parrot_pmc_new(interp, enum_class_ResizableIntegerArray);
- core_struct->wait_index = Parrot_pmc_new(interp, enum_class_ResizablePMCArray);
- core_struct->handlers = Parrot_pmc_new(interp, enum_class_ResizablePMCArray);
+ core_struct->task_list = Parrot_pmc_new(INTERP, enum_class_Hash);
+ core_struct->task_index = Parrot_pmc_new(INTERP, enum_class_ResizableIntegerArray);
+ core_struct->wait_index = Parrot_pmc_new(INTERP, enum_class_ResizablePMCArray);
+ core_struct->handlers = Parrot_pmc_new(INTERP, enum_class_ResizablePMCArray);
core_struct->messages = Parrot_pmc_new(interp, enum_class_ResizablePMCArray);
core_struct->interp = INTERP;
MUTEX_INIT(core_struct->msg_lock);
@@ -141,7 +141,7 @@
SCHEDULER_cache_valid_CLEAR(SELF);
if (task->vtable->base_type != enum_class_Exception)
- Parrot_cx_runloop_wake(core_struct->interp, SELF);
+ Parrot_cx_runloop_wake(core_struct->INTERP, SELF);
}
@@ -271,11 +271,11 @@
if (PARROT_SCHEDULER(SELF)) {
Parrot_Scheduler_attributes * const core_struct = PARROT_SCHEDULER(SELF);
- Parrot_gc_mark_PMC_alive(interp, core_struct->task_list);
- Parrot_gc_mark_PMC_alive(interp, core_struct->task_index);
- Parrot_gc_mark_PMC_alive(interp, core_struct->wait_index);
- Parrot_gc_mark_PMC_alive(interp, core_struct->handlers);
- Parrot_gc_mark_PMC_alive(interp, core_struct->messages);
+ Parrot_gc_mark_PMC_alive(INTERP, core_struct->task_list);
+ Parrot_gc_mark_PMC_alive(INTERP, core_struct->task_index);
+ Parrot_gc_mark_PMC_alive(INTERP, core_struct->wait_index);
+ Parrot_gc_mark_PMC_alive(INTERP, core_struct->handlers);
+ Parrot_gc_mark_PMC_alive(INTERP, core_struct->messages);
}
}
@@ -432,7 +432,7 @@
}
}
- Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_INVALID_OPERATION,
+ Parrot_ex_throw_from_c_args(INTERP, NULL, EXCEPTION_INVALID_OPERATION,
"No handler to delete.");
}
@@ -449,27 +449,27 @@
*/
METHOD find_handler(PMC *task) {
- STRING * const handled_str = CONST_STRING(interp, "handled");
- STRING * const iter_str = CONST_STRING(interp, "handler_iter");
+ STRING * const handled_str = CONST_STRING(INTERP, "handled");
+ STRING * const iter_str = CONST_STRING(INTERP, "handler_iter");
PMC *iter;
/* Exceptions store the handler iterator for rethrow, other kinds of
* tasks don't (though they could). */
if (task->vtable->base_type == enum_class_Exception
- && VTABLE_get_integer_keyed_str(interp, task, handled_str) == -1) {
- iter = VTABLE_get_attr_str(interp, task, iter_str);
+ && VTABLE_get_integer_keyed_str(INTERP, task, handled_str) == -1) {
+ iter = VTABLE_get_attr_str(INTERP, task, iter_str);
}
else {
PMC *handlers;
- GET_ATTR_handlers(interp, SELF, handlers);
- iter = VTABLE_get_iter(interp, handlers);
+ GET_ATTR_handlers(INTERP, SELF, handlers);
+ iter = VTABLE_get_iter(INTERP, handlers);
if (task->vtable->base_type == enum_class_Exception)
- VTABLE_set_attr_str(interp, task, iter_str, iter);
+ VTABLE_set_attr_str(INTERP, task, iter_str, iter);
}
/* Loop from newest handler to oldest handler. */
- while (VTABLE_get_bool(interp, iter)) {
+ while (VTABLE_get_bool(INTERP, iter)) {
PMC * const handler = VTABLE_shift_pmc(INTERP, iter);
INTVAL valid_handler = 0;
@@ -477,7 +477,7 @@
(const INTVAL valid_handler) = PCCINVOKE(INTERP, handler, "can_handle", PMC *task);
if (valid_handler) {
if (task->vtable->base_type == enum_class_Exception)
- VTABLE_set_integer_native(interp, handler, 1);
+ VTABLE_set_integer_native(INTERP, handler, 1);
RETURN(PMC *handler);
}
}
Modified: branches/codestring/src/pmc/schedulermessage.pmc
==============================================================================
--- branches/codestring/src/pmc/schedulermessage.pmc Wed May 5 23:52:59 2010 (r46321)
+++ branches/codestring/src/pmc/schedulermessage.pmc Thu May 6 00:31:08 2010 (r46322)
@@ -116,7 +116,7 @@
VTABLE INTVAL get_integer() {
const Parrot_SchedulerMessage_attributes * const
core_struct = PARROT_SCHEDULERMESSAGE(SELF);
- UNUSED(interp);
+ UNUSED(INTERP);
return core_struct->id;
}
@@ -133,7 +133,7 @@
VTABLE void set_integer_native(INTVAL value) {
Parrot_SchedulerMessage_attributes * const core_struct = PARROT_SCHEDULERMESSAGE(SELF);
- UNUSED(interp);
+ UNUSED(INTERP);
core_struct->id = value;
}
@@ -151,7 +151,7 @@
STRING * get_string() {
const Parrot_SchedulerMessage_attributes * const core_struct =
PARROT_SCHEDULERMESSAGE(SELF);
- UNUSED(interp);
+ UNUSED(INTERP);
return core_struct->type;
}
@@ -167,7 +167,7 @@
VTABLE void set_string_native(STRING *value) {
Parrot_SchedulerMessage_attributes * const core_struct = PARROT_SCHEDULERMESSAGE(SELF);
- UNUSED(interp);
+ UNUSED(INTERP);
core_struct->type = value;
}
@@ -210,8 +210,8 @@
Parrot_SchedulerMessage_attributes * const core_struct =
PARROT_SCHEDULERMESSAGE(SELF);
- Parrot_gc_mark_STRING_alive(interp, core_struct->type);
- Parrot_gc_mark_PMC_alive(interp, core_struct->data);
+ Parrot_gc_mark_STRING_alive(INTERP, core_struct->type);
+ Parrot_gc_mark_PMC_alive(INTERP, core_struct->data);
}
}
Modified: branches/codestring/src/pmc/socket.pmc
==============================================================================
--- branches/codestring/src/pmc/socket.pmc Wed May 5 23:52:59 2010 (r46321)
+++ branches/codestring/src/pmc/socket.pmc Thu May 6 00:31:08 2010 (r46322)
@@ -63,8 +63,8 @@
Parrot_Socket_attributes * const old_struct = PARROT_SOCKET(SELF);
Parrot_Socket_attributes * const data_struct = PARROT_SOCKET(copy);
- data_struct->local = VTABLE_clone(interp, old_struct->local);
- data_struct->remote = VTABLE_clone(interp, old_struct->remote);
+ data_struct->local = VTABLE_clone(INTERP, old_struct->local);
+ data_struct->remote = VTABLE_clone(INTERP, old_struct->remote);
return SELF;
}
@@ -83,8 +83,8 @@
Parrot_Socket_attributes * const data = PARROT_SOCKET(SELF);
if (data) {
- Parrot_gc_mark_PMC_alive(interp, data->local);
- Parrot_gc_mark_PMC_alive(interp, data->remote);
+ Parrot_gc_mark_PMC_alive(INTERP, data->local);
+ Parrot_gc_mark_PMC_alive(INTERP, data->remote);
}
}
/*
@@ -101,7 +101,7 @@
Parrot_Socket_attributes *data_struct = PARROT_SOCKET(SELF);
if (data_struct->os_handle != PIO_INVALID_HANDLE)
- Parrot_io_close_piohandle(interp, data_struct->os_handle);
+ Parrot_io_close_piohandle(INTERP, data_struct->os_handle);
data_struct->os_handle = PIO_INVALID_HANDLE;
}
}
@@ -136,7 +136,7 @@
METHOD socket(INTVAL fam, INTVAL type, INTVAL proto) {
- if (Parrot_io_socket(interp, SELF, fam, type, proto) < 0)
+ if (Parrot_io_socket(INTERP, SELF, fam, type, proto) < 0)
RETURN(PMC * PMCNULL);
RETURN(PMC * SELF);
}
@@ -171,7 +171,7 @@
*/
METHOD sockaddr(STRING * address, INTVAL port) {
- PMC * res = Parrot_io_sockaddr_in(interp, address, port);
+ PMC * res = Parrot_io_sockaddr_in(INTERP, address, port);
RETURN(PMC * res);
}
@@ -213,7 +213,7 @@
Parrot_Socket_attributes *data_struct = PARROT_SOCKET(SELF);
if (data_struct->os_handle != PIO_INVALID_HANDLE)
- result = Parrot_io_close_piohandle(interp, data_struct->os_handle);
+ result = Parrot_io_close_piohandle(INTERP, data_struct->os_handle);
data_struct->os_handle = PIO_INVALID_HANDLE;
}
RETURN(INTVAL result);
Modified: branches/codestring/src/pmc/string.pmc
==============================================================================
--- branches/codestring/src/pmc/string.pmc Wed May 5 23:52:59 2010 (r46321)
+++ branches/codestring/src/pmc/string.pmc Thu May 6 00:31:08 2010 (r46322)
@@ -628,7 +628,7 @@
*/
METHOD to_int(INTVAL base) {
- PMC * const result = Parrot_pmc_new(INTERP, Parrot_get_ctx_HLL_type(interp,
+ PMC * const result = Parrot_pmc_new(INTERP, Parrot_get_ctx_HLL_type(INTERP,
enum_class_Integer));
/* TODO verify encoding */
@@ -800,13 +800,13 @@
INTVAL *tr_data;
INTVAL i;
- const INTVAL len = Parrot_str_byte_length(interp, src);
+ const INTVAL len = Parrot_str_byte_length(INTERP, src);
if (!len)
RETURN(void);
if (src->charset != Parrot_ascii_charset_ptr)
- Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_INVALID_ENCODING,
+ Parrot_ex_throw_from_c_args(INTERP, NULL, EXCEPTION_INVALID_ENCODING,
"Can't translate non-ascii");
p = (unsigned char *)(src->strstart);
@@ -834,13 +834,13 @@
METHOD is_integer(STRING *src) {
INTVAL i;
unsigned char *p;
- const INTVAL len = Parrot_str_byte_length(interp, src);
+ const INTVAL len = Parrot_str_byte_length(INTERP, src);
if (!len)
RETURN(INTVAL 0);
if (src->charset != Parrot_ascii_charset_ptr)
- Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_INVALID_ENCODING,
+ Parrot_ex_throw_from_c_args(INTERP, NULL, EXCEPTION_INVALID_ENCODING,
"Can't is_integer non-ascii");
i = 0;
@@ -892,7 +892,7 @@
if (start < 0)
RETURN(INTVAL res);
- len = Parrot_str_byte_length(interp, src);
+ len = Parrot_str_byte_length(INTERP, src);
if (!len)
RETURN(INTVAL res);
@@ -900,7 +900,7 @@
if (start >= (INTVAL)len)
RETURN(INTVAL res);
- if (!Parrot_str_byte_length(interp, substring))
+ if (!Parrot_str_byte_length(INTERP, substring))
RETURN(INTVAL res);
res = CHARSET_RINDEX(INTERP, src, substring, (UINTVAL)start);
Modified: branches/codestring/src/pmc/stringhandle.pmc
==============================================================================
--- branches/codestring/src/pmc/stringhandle.pmc Wed May 5 23:52:59 2010 (r46321)
+++ branches/codestring/src/pmc/stringhandle.pmc Thu May 6 00:31:08 2010 (r46322)
@@ -132,10 +132,10 @@
VTABLE void mark() {
Parrot_StringHandle_attributes * const data_struct = PARROT_STRINGHANDLE(SELF);
- Parrot_gc_mark_STRING_alive(interp, data_struct->stringhandle);
- Parrot_gc_mark_STRING_alive(interp, data_struct->mode);
- Parrot_gc_mark_STRING_alive(interp, data_struct->encoding);
- Parrot_gc_mark_STRING_alive(interp, data_struct->filename);
+ Parrot_gc_mark_STRING_alive(INTERP, data_struct->stringhandle);
+ Parrot_gc_mark_STRING_alive(INTERP, data_struct->mode);
+ Parrot_gc_mark_STRING_alive(INTERP, data_struct->encoding);
+ Parrot_gc_mark_STRING_alive(INTERP, data_struct->filename);
}
/*
@@ -346,7 +346,7 @@
METHOD print(PMC *to_print) {
STRING * const string_to_print = VTABLE_get_string(INTERP, to_print);
- Parrot_io_putps(interp, SELF, string_to_print);
+ Parrot_io_putps(INTERP, SELF, string_to_print);
}
/*
@@ -365,19 +365,19 @@
GET_ATTR_stringhandle(INTERP, SELF, old_string);
if (STRING_IS_NULL(old_string))
- Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_PIO_ERROR,
+ Parrot_ex_throw_from_c_args(INTERP, NULL, EXCEPTION_PIO_ERROR,
"Cannot write to a closed filehandle");
GET_ATTR_flags(INTERP, SELF, flags);
if (!(flags & PIO_F_WRITE))
- Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_PIO_ERROR,
+ Parrot_ex_throw_from_c_args(INTERP, NULL, EXCEPTION_PIO_ERROR,
"Cannot write to a filehandle not opened for write");
- new_string = Parrot_str_concat(interp, old_string, to_print);
+ new_string = Parrot_str_concat(INTERP, old_string, to_print);
SET_ATTR_stringhandle(INTERP, SELF, new_string);
- status = Parrot_str_byte_length(interp, new_string);
+ status = Parrot_str_byte_length(INTERP, new_string);
RETURN(INTVAL status);
}
@@ -442,7 +442,7 @@
if (STRING_IS_NULL(stringhandle))
RETURN(INTVAL 0);
- buffer_size = Parrot_str_byte_length(interp, stringhandle);
+ buffer_size = Parrot_str_byte_length(INTERP, stringhandle);
RETURN(INTVAL buffer_size);
@@ -523,7 +523,7 @@
*/
METHOD get_fd() {
- UNUSED(interp);
+ UNUSED(INTERP);
RETURN(INTVAL -1);
}
Modified: branches/codestring/src/pmc/sub.pmc
==============================================================================
--- branches/codestring/src/pmc/sub.pmc Wed May 5 23:52:59 2010 (r46321)
+++ branches/codestring/src/pmc/sub.pmc Thu May 6 00:31:08 2010 (r46322)
@@ -393,8 +393,8 @@
INTERP->current_cont = NULL;
if (ccont == NEED_CONTINUATION) {
- ccont = pmc_new(interp, enum_class_Continuation);
- VTABLE_set_pointer(interp, ccont, next);
+ ccont = pmc_new(INTERP, enum_class_Continuation);
+ VTABLE_set_pointer(INTERP, ccont, next);
}
PARROT_ASSERT(!PMC_IS_NULL(ccont));
@@ -410,9 +410,9 @@
Parrot_pcc_init_context(INTERP, context, caller_ctx);
Parrot_pcc_set_object(INTERP, context, object);
- Parrot_pcc_set_sub(interp, context, SELF);
- Parrot_pcc_set_continuation(interp, context, ccont);
- Parrot_pcc_set_constants(interp, context, sub->seg->const_table->constants);
+ Parrot_pcc_set_sub(INTERP, context, SELF);
+ Parrot_pcc_set_continuation(INTERP, context, ccont);
+ Parrot_pcc_set_constants(INTERP, context, sub->seg->const_table->constants);
/* check recursion/call depth */
if (Parrot_pcc_inc_recursion_depth(INTERP, context) > INTERP->recursion_limit)
@@ -433,26 +433,26 @@
* and factor out common code with coroutine pmc
*/
if (!PMC_IS_NULL(sub->lex_info)) {
- Parrot_pcc_set_lex_pad(interp, context, Parrot_pmc_new_init(INTERP,
- Parrot_get_ctx_HLL_type(interp, enum_class_LexPad),
+ Parrot_pcc_set_lex_pad(INTERP, context, Parrot_pmc_new_init(INTERP,
+ Parrot_get_ctx_HLL_type(INTERP, enum_class_LexPad),
sub->lex_info));
- VTABLE_set_pointer(INTERP, Parrot_pcc_get_lex_pad(interp, context), context);
+ VTABLE_set_pointer(INTERP, Parrot_pcc_get_lex_pad(INTERP, context), context);
}
/* set outer context */
if (!PMC_IS_NULL(sub->outer_ctx))
- Parrot_pcc_set_outer_ctx(interp, context, sub->outer_ctx);
+ Parrot_pcc_set_outer_ctx(INTERP, context, sub->outer_ctx);
else {
/* autoclose */
PMC *c = context;
- PMC *outer_c = Parrot_pcc_get_outer_ctx(interp, c);
+ PMC *outer_c = Parrot_pcc_get_outer_ctx(INTERP, c);
for (c = context; PMC_IS_NULL(outer_c); c = outer_c) {
PMC *outer_pmc;
Parrot_Sub_attributes *current_sub, *outer_sub;
- PMC_get_sub(INTERP, Parrot_pcc_get_sub(interp, c), current_sub);
+ PMC_get_sub(INTERP, Parrot_pcc_get_sub(INTERP, c), current_sub);
outer_pmc = current_sub->outer_sub;
if (PMC_IS_NULL(outer_pmc))
@@ -463,26 +463,26 @@
if (PMC_IS_NULL(outer_sub->ctx)) {
PMC * const dummy = Parrot_alloc_context(INTERP,
outer_sub->n_regs_used, NULL);
- Parrot_pcc_set_sub(interp, dummy, outer_pmc);
+ Parrot_pcc_set_sub(INTERP, dummy, outer_pmc);
if (!PMC_IS_NULL(outer_sub->lex_info)) {
- Parrot_pcc_set_lex_pad(interp, dummy,
+ Parrot_pcc_set_lex_pad(INTERP, dummy,
Parrot_pmc_new_init(INTERP,
- Parrot_get_ctx_HLL_type(interp,
+ Parrot_get_ctx_HLL_type(INTERP,
enum_class_LexPad), outer_sub->lex_info));
VTABLE_set_pointer(INTERP,
- Parrot_pcc_get_lex_pad(interp, dummy), dummy);
+ Parrot_pcc_get_lex_pad(INTERP, dummy), dummy);
}
if (!PMC_IS_NULL(outer_sub->outer_ctx))
- Parrot_pcc_set_outer_ctx(interp, dummy,
+ Parrot_pcc_set_outer_ctx(INTERP, dummy,
outer_sub->outer_ctx);
outer_sub->ctx = dummy;
}
- Parrot_pcc_set_outer_ctx(interp, c, outer_sub->ctx);
+ Parrot_pcc_set_outer_ctx(INTERP, c, outer_sub->ctx);
outer_c = outer_sub->ctx;
}
}
@@ -582,10 +582,10 @@
Parrot_gc_mark_STRING_alive(INTERP, sub->method_name);
Parrot_gc_mark_STRING_alive(INTERP, sub->ns_entry_name);
- Parrot_gc_mark_PMC_alive(interp, sub->ctx);
+ Parrot_gc_mark_PMC_alive(INTERP, sub->ctx);
Parrot_gc_mark_PMC_alive(INTERP, sub->eval_pmc);
Parrot_gc_mark_PMC_alive(INTERP, sub->lex_info);
- Parrot_gc_mark_PMC_alive(interp, sub->outer_ctx);
+ Parrot_gc_mark_PMC_alive(INTERP, sub->outer_ctx);
Parrot_gc_mark_PMC_alive(INTERP, sub->outer_sub);
Parrot_gc_mark_PMC_alive(INTERP, sub->namespace_name);
Parrot_gc_mark_PMC_alive(INTERP, sub->multi_signature);
@@ -760,31 +760,31 @@
{
/* Create a hash, then use inspect_str to get all of its data */
- PMC * const metadata = Parrot_pmc_new(interp, enum_class_Hash);
- STRING * const pos_required_str = CONST_STRING(interp, "pos_required");
- STRING * const pos_optional_str = CONST_STRING(interp, "pos_optional");
- STRING * const named_required_str = CONST_STRING(interp, "named_required");
- STRING * const named_optional_str = CONST_STRING(interp, "named_optional");
- STRING * const pos_slurpy_str = CONST_STRING(interp, "pos_slurpy");
- STRING * const named_slurpy_str = CONST_STRING(interp, "named_slurpy");
-
- VTABLE_set_pmc_keyed_str(interp, metadata, pos_required_str,
- VTABLE_inspect_str(interp, SELF, pos_required_str));
-
- VTABLE_set_pmc_keyed_str(interp, metadata, pos_optional_str,
- VTABLE_inspect_str(interp, SELF, pos_optional_str));
-
- VTABLE_set_pmc_keyed_str(interp, metadata, named_required_str,
- VTABLE_inspect_str(interp, SELF, named_required_str));
+ PMC * const metadata = Parrot_pmc_new(INTERP, enum_class_Hash);
+ STRING * const pos_required_str = CONST_STRING(INTERP, "pos_required");
+ STRING * const pos_optional_str = CONST_STRING(INTERP, "pos_optional");
+ STRING * const named_required_str = CONST_STRING(INTERP, "named_required");
+ STRING * const named_optional_str = CONST_STRING(INTERP, "named_optional");
+ STRING * const pos_slurpy_str = CONST_STRING(INTERP, "pos_slurpy");
+ STRING * const named_slurpy_str = CONST_STRING(INTERP, "named_slurpy");
+
+ VTABLE_set_pmc_keyed_str(INTERP, metadata, pos_required_str,
+ VTABLE_inspect_str(INTERP, SELF, pos_required_str));
+
+ VTABLE_set_pmc_keyed_str(INTERP, metadata, pos_optional_str,
+ VTABLE_inspect_str(INTERP, SELF, pos_optional_str));
+
+ VTABLE_set_pmc_keyed_str(INTERP, metadata, named_required_str,
+ VTABLE_inspect_str(INTERP, SELF, named_required_str));
- VTABLE_set_pmc_keyed_str(interp, metadata, named_optional_str,
- VTABLE_inspect_str(interp, SELF, named_optional_str));
+ VTABLE_set_pmc_keyed_str(INTERP, metadata, named_optional_str,
+ VTABLE_inspect_str(INTERP, SELF, named_optional_str));
- VTABLE_set_pmc_keyed_str(interp, metadata, pos_slurpy_str,
- VTABLE_inspect_str(interp, SELF, pos_slurpy_str));
+ VTABLE_set_pmc_keyed_str(INTERP, metadata, pos_slurpy_str,
+ VTABLE_inspect_str(INTERP, SELF, pos_slurpy_str));
- VTABLE_set_pmc_keyed_str(interp, metadata, named_slurpy_str,
- VTABLE_inspect_str(interp, SELF, named_slurpy_str));
+ VTABLE_set_pmc_keyed_str(INTERP, metadata, named_slurpy_str,
+ VTABLE_inspect_str(INTERP, SELF, named_slurpy_str));
return metadata;
}
@@ -884,26 +884,26 @@
}
/* Return the requested argument information */
- if (Parrot_str_equal(interp, what, CONST_STRING(interp, "pos_required"))) {
+ if (Parrot_str_equal(INTERP, what, CONST_STRING(INTERP, "pos_required"))) {
count_found = (INTVAL)sub->arg_info->pos_required;
}
- else if (Parrot_str_equal(interp, what, CONST_STRING(interp, "pos_optional"))) {
+ else if (Parrot_str_equal(INTERP, what, CONST_STRING(INTERP, "pos_optional"))) {
count_found = (INTVAL)sub->arg_info->pos_optional;
}
- else if (Parrot_str_equal(interp, what, CONST_STRING(interp, "pos_slurpy"))) {
+ else if (Parrot_str_equal(INTERP, what, CONST_STRING(INTERP, "pos_slurpy"))) {
count_found = (INTVAL)sub->arg_info->pos_slurpy;
}
- else if (Parrot_str_equal(interp, what, CONST_STRING(interp, "named_required"))) {
+ else if (Parrot_str_equal(INTERP, what, CONST_STRING(INTERP, "named_required"))) {
count_found = (INTVAL)sub->arg_info->named_required;
}
- else if (Parrot_str_equal(interp, what, CONST_STRING(interp, "named_optional"))) {
+ else if (Parrot_str_equal(INTERP, what, CONST_STRING(INTERP, "named_optional"))) {
count_found = (INTVAL)sub->arg_info->named_optional;
}
- else if (Parrot_str_equal(interp, what, CONST_STRING(interp, "named_slurpy"))) {
+ else if (Parrot_str_equal(INTERP, what, CONST_STRING(INTERP, "named_slurpy"))) {
count_found = (INTVAL)sub->arg_info->named_slurpy;
}
else
- Parrot_ex_throw_from_c_args(interp, NULL,
+ Parrot_ex_throw_from_c_args(INTERP, NULL,
EXCEPTION_INVALID_OPERATION,
"Unknown introspection value '%S'", what);
@@ -1039,7 +1039,7 @@
Parrot_Sub_attributes *sub;
PMC_get_sub(INTERP, SELF, sub);
- subid = sub->subid ? sub->subid : CONST_STRING(interp, "");
+ subid = sub->subid ? sub->subid : CONST_STRING(INTERP, "");
RETURN(STRING *subid);
}
@@ -1069,21 +1069,21 @@
/* Ensure we have lex info. */
if (PMC_IS_NULL(sub->lex_info)) {
- const INTVAL lex_info_id = Parrot_get_ctx_HLL_type(interp,
+ const INTVAL lex_info_id = Parrot_get_ctx_HLL_type(INTERP,
enum_class_LexInfo);
- sub->lex_info = Parrot_pmc_new_init(interp, lex_info_id, SELF);
+ sub->lex_info = Parrot_pmc_new_init(INTERP, lex_info_id, SELF);
}
/* If we've got a context around for the outer sub, set it as the
* outer context. */
- outer_ctx = CURRENT_CONTEXT(interp);
+ outer_ctx = CURRENT_CONTEXT(INTERP);
while (!PMC_IS_NULL(outer_ctx)) {
- if (Parrot_pcc_get_sub(interp, outer_ctx) == outer) {
+ if (Parrot_pcc_get_sub(INTERP, outer_ctx) == outer) {
sub->outer_ctx = outer_ctx;
break;
}
- outer_ctx = Parrot_pcc_get_caller_ctx(interp, outer_ctx);
+ outer_ctx = Parrot_pcc_get_caller_ctx(INTERP, outer_ctx);
}
}
@@ -1100,8 +1100,8 @@
METHOD arity() {
- PMC * const pos_required = VTABLE_inspect_str(interp, SELF, CONST_STRING(interp, "pos_required"));
- PMC * const named_required = VTABLE_inspect_str(interp, SELF, CONST_STRING(interp, "named_required"));
+ PMC * const pos_required = VTABLE_inspect_str(INTERP, SELF, CONST_STRING(INTERP, "pos_required"));
+ PMC * const named_required = VTABLE_inspect_str(INTERP, SELF, CONST_STRING(INTERP, "named_required"));
const INTVAL arity = VTABLE_get_integer(INTERP, pos_required)
+ VTABLE_get_integer(INTERP, named_required);
Modified: branches/codestring/src/pmc/task.pmc
==============================================================================
--- branches/codestring/src/pmc/task.pmc Wed May 5 23:52:59 2010 (r46321)
+++ branches/codestring/src/pmc/task.pmc Thu May 6 00:31:08 2010 (r46322)
@@ -54,10 +54,10 @@
/* Set up the core struct. */
core_struct->id = 0;
- core_struct->type = CONST_STRING(interp, "");
- core_struct->subtype = CONST_STRING(interp, "");
+ core_struct->type = CONST_STRING(INTERP, "");
+ core_struct->subtype = CONST_STRING(INTERP, "");
core_struct->priority = 0;
- core_struct->status = CONST_STRING(interp, "created");
+ core_struct->status = CONST_STRING(INTERP, "created");
core_struct->birthtime = 0.0;
core_struct->codeblock = PMCNULL;
core_struct->data = PMCNULL;
@@ -184,11 +184,11 @@
VTABLE PMC *clone() {
/* Create the new task PMC, of the same type of this one (we may
* have been subclassed). */
- PMC * const copy = Parrot_pmc_new(interp, SELF->vtable->base_type);
+ PMC * const copy = Parrot_pmc_new(INTERP, SELF->vtable->base_type);
Parrot_Task_attributes * const new_struct = PARROT_TASK(copy);
Parrot_Task_attributes * const old_struct = PARROT_TASK(SELF);
- new_struct->codeblock = VTABLE_clone(interp, old_struct->codeblock);
+ new_struct->codeblock = VTABLE_clone(INTERP, old_struct->codeblock);
new_struct->data = old_struct->data;
new_struct->type = old_struct->type;
new_struct->subtype = old_struct->subtype;
@@ -209,29 +209,29 @@
Parrot_Task_attributes * const core_struct = PARROT_TASK(SELF);
PMC *value;
- if (Parrot_str_equal(interp, name, CONST_STRING(interp, "id"))) {
- value = Parrot_pmc_new_init_int(interp, enum_class_Integer,
+ if (Parrot_str_equal(INTERP, name, CONST_STRING(INTERP, "id"))) {
+ value = Parrot_pmc_new_init_int(INTERP, enum_class_Integer,
core_struct->id);
}
- else if (Parrot_str_equal(interp, name, CONST_STRING(interp, "type"))) {
- value = Parrot_pmc_new(interp, enum_class_String);
- VTABLE_set_string_native(interp, value, core_struct->type);
- }
- else if (Parrot_str_equal(interp, name, CONST_STRING(interp, "subtype"))) {
- value = Parrot_pmc_new(interp, enum_class_String);
- VTABLE_set_string_native(interp, value, core_struct->subtype);
+ else if (Parrot_str_equal(INTERP, name, CONST_STRING(INTERP, "type"))) {
+ value = Parrot_pmc_new(INTERP, enum_class_String);
+ VTABLE_set_string_native(INTERP, value, core_struct->type);
+ }
+ else if (Parrot_str_equal(INTERP, name, CONST_STRING(INTERP, "subtype"))) {
+ value = Parrot_pmc_new(INTERP, enum_class_String);
+ VTABLE_set_string_native(INTERP, value, core_struct->subtype);
}
- else if (Parrot_str_equal(interp, name, CONST_STRING(interp, "priority"))) {
- value = Parrot_pmc_new_init_int(interp, enum_class_Integer,
+ else if (Parrot_str_equal(INTERP, name, CONST_STRING(INTERP, "priority"))) {
+ value = Parrot_pmc_new_init_int(INTERP, enum_class_Integer,
core_struct->priority);
}
- else if (Parrot_str_equal(interp, name, CONST_STRING(interp, "status"))) {
- value = Parrot_pmc_new(interp, enum_class_String);
- VTABLE_set_string_native(interp, value, core_struct->status);
- }
- else if (Parrot_str_equal(interp, name, CONST_STRING(interp, "birthtime"))) {
- value = Parrot_pmc_new(interp, enum_class_Float);
- VTABLE_set_number_native(interp, value, core_struct->birthtime);
+ else if (Parrot_str_equal(INTERP, name, CONST_STRING(INTERP, "status"))) {
+ value = Parrot_pmc_new(INTERP, enum_class_String);
+ VTABLE_set_string_native(INTERP, value, core_struct->status);
+ }
+ else if (Parrot_str_equal(INTERP, name, CONST_STRING(INTERP, "birthtime"))) {
+ value = Parrot_pmc_new(INTERP, enum_class_Float);
+ VTABLE_set_number_native(INTERP, value, core_struct->birthtime);
}
else {
value = PMCNULL;
@@ -252,28 +252,28 @@
VTABLE void set_attr_str(STRING *name, PMC *value) {
Parrot_Task_attributes * const core_struct = PARROT_TASK(SELF);
- if (Parrot_str_equal(interp, name, CONST_STRING(interp, "id"))) {
- core_struct->id = VTABLE_get_integer(interp, value);
+ if (Parrot_str_equal(INTERP, name, CONST_STRING(INTERP, "id"))) {
+ core_struct->id = VTABLE_get_integer(INTERP, value);
}
- else if (Parrot_str_equal(interp, name, CONST_STRING(interp, "type"))) {
- core_struct->type = VTABLE_get_string(interp, value);
+ else if (Parrot_str_equal(INTERP, name, CONST_STRING(INTERP, "type"))) {
+ core_struct->type = VTABLE_get_string(INTERP, value);
}
- else if (Parrot_str_equal(interp, name, CONST_STRING(interp, "subtype"))) {
- core_struct->subtype = VTABLE_get_string(interp, value);
+ else if (Parrot_str_equal(INTERP, name, CONST_STRING(INTERP, "subtype"))) {
+ core_struct->subtype = VTABLE_get_string(INTERP, value);
}
- else if (Parrot_str_equal(interp, name, CONST_STRING(interp, "priority"))) {
- core_struct->priority = VTABLE_get_integer(interp, value);
+ else if (Parrot_str_equal(INTERP, name, CONST_STRING(INTERP, "priority"))) {
+ core_struct->priority = VTABLE_get_integer(INTERP, value);
}
- else if (Parrot_str_equal(interp, name, CONST_STRING(interp, "status"))) {
- core_struct->status = VTABLE_get_string(interp, value);
+ else if (Parrot_str_equal(INTERP, name, CONST_STRING(INTERP, "status"))) {
+ core_struct->status = VTABLE_get_string(INTERP, value);
}
- else if (Parrot_str_equal(interp, name, CONST_STRING(interp, "birthtime"))) {
- core_struct->birthtime = VTABLE_get_number(interp, value);
+ else if (Parrot_str_equal(INTERP, name, CONST_STRING(INTERP, "birthtime"))) {
+ core_struct->birthtime = VTABLE_get_number(INTERP, value);
}
- else if (Parrot_str_equal(interp, name, CONST_STRING(interp, "code"))) {
+ else if (Parrot_str_equal(INTERP, name, CONST_STRING(INTERP, "code"))) {
core_struct->codeblock = value;
}
- else if (Parrot_str_equal(interp, name, CONST_STRING(interp, "data"))) {
+ else if (Parrot_str_equal(INTERP, name, CONST_STRING(INTERP, "data"))) {
core_struct->data = value;
}
}
@@ -379,11 +379,11 @@
if (PARROT_TASK(SELF)) {
Parrot_Task_attributes * const core_struct = PARROT_TASK(SELF);
- Parrot_gc_mark_STRING_alive(interp, core_struct->type);
- Parrot_gc_mark_STRING_alive(interp, core_struct->subtype);
- Parrot_gc_mark_STRING_alive(interp, core_struct->status);
- Parrot_gc_mark_PMC_alive(interp, core_struct->codeblock);
- Parrot_gc_mark_PMC_alive(interp, core_struct->data);
+ Parrot_gc_mark_STRING_alive(INTERP, core_struct->type);
+ Parrot_gc_mark_STRING_alive(INTERP, core_struct->subtype);
+ Parrot_gc_mark_STRING_alive(INTERP, core_struct->status);
+ Parrot_gc_mark_PMC_alive(INTERP, core_struct->codeblock);
+ Parrot_gc_mark_PMC_alive(INTERP, core_struct->data);
}
}
Modified: branches/codestring/src/pmc/timer.pmc
==============================================================================
--- branches/codestring/src/pmc/timer.pmc Wed May 5 23:52:59 2010 (r46321)
+++ branches/codestring/src/pmc/timer.pmc Thu May 6 00:31:08 2010 (r46322)
@@ -86,8 +86,8 @@
/* Set up the core struct. */
core_struct->id = 0;
- core_struct->type = CONST_STRING(interp, "timer");
- core_struct->subtype = CONST_STRING(interp, "");
+ core_struct->type = CONST_STRING(INTERP, "timer");
+ core_struct->subtype = CONST_STRING(INTERP, "");
core_struct->priority = 0;
core_struct->status = CONST_STRING(interp, "created");
core_struct->birthtime = 0.0;
@@ -313,7 +313,7 @@
Parrot_Timer_attributes * const core_struct = PARROT_TIMER(SELF);
core_struct->codeblock = value;
*/
- SET_ATTR_codeblock(interp, SELF, value);
+ SET_ATTR_codeblock(INTERP, SELF, value);
}
}
Modified: branches/codestring/src/pmc/undef.pmc
==============================================================================
--- branches/codestring/src/pmc/undef.pmc Wed May 5 23:52:59 2010 (r46321)
+++ branches/codestring/src/pmc/undef.pmc Thu May 6 00:31:08 2010 (r46322)
@@ -50,7 +50,7 @@
}
else {
PMC * const class_ = PARROT_OBJECT(other)->_class;
- PMC *clone = VTABLE_clone(interp, other);
+ PMC *clone = VTABLE_clone(INTERP, other);
void *attrs = PMC_data(clone);
PMC *meta = PMC_metadata(clone);
@@ -61,11 +61,11 @@
/* Restore metadata. */
if (!PMC_IS_NULL(meta)) {
- PMC * const iter = VTABLE_get_iter(interp, meta);
- while (VTABLE_get_bool(interp, iter)) {
- STRING * const key = VTABLE_shift_string(interp, iter);
- PMC * const value = VTABLE_get_pmc_keyed_str(interp, meta, key);
- VTABLE_setprop(interp, SELF, key, value);
+ PMC * const iter = VTABLE_get_iter(INTERP, meta);
+ while (VTABLE_get_bool(INTERP, iter)) {
+ STRING * const key = VTABLE_shift_string(INTERP, iter);
+ PMC * const value = VTABLE_get_pmc_keyed_str(INTERP, meta, key);
+ VTABLE_setprop(INTERP, SELF, key, value);
}
}
PMC_data(clone) = NULL;
@@ -175,7 +175,7 @@
*/
VTABLE STRING *get_string() {
- Parrot_warn(interp, PARROT_WARNINGS_UNDEF_FLAG,
+ Parrot_warn(INTERP, PARROT_WARNINGS_UNDEF_FLAG,
"Stringifying an Undef PMC");
return Parrot_str_new_noinit(INTERP, enum_stringrep_one, 0);
@@ -192,7 +192,7 @@
*/
VTABLE void set_string_native(STRING *value) {
- Parrot_pmc_reuse(interp, SELF, enum_class_String, 0);
+ Parrot_pmc_reuse(INTERP, SELF, enum_class_String, 0);
VTABLE_set_string_native(INTERP, SELF, value);
}
Modified: branches/codestring/src/pmc/unmanagedstruct.pmc
==============================================================================
--- branches/codestring/src/pmc/unmanagedstruct.pmc Wed May 5 23:52:59 2010 (r46321)
+++ branches/codestring/src/pmc/unmanagedstruct.pmc Thu May 6 00:31:08 2010 (r46322)
@@ -900,7 +900,7 @@
VTABLE INTVAL is_equal(PMC *value) {
return (SELF->vtable == value->vtable
- && SELF.get_pointer() == VTABLE_get_pointer(interp, value));
+ && SELF.get_pointer() == VTABLE_get_pointer(INTERP, value));
}
/*
Modified: branches/codestring/src/string/api.c
==============================================================================
--- branches/codestring/src/string/api.c Wed May 5 23:52:59 2010 (r46321)
+++ branches/codestring/src/string/api.c Thu May 6 00:31:08 2010 (r46322)
@@ -374,13 +374,13 @@
/*
-=item C<STRING * Parrot_str_concat(PARROT_INTERP, STRING *a, STRING *b)>
+=item C<STRING * Parrot_str_concat(PARROT_INTERP, const STRING *a, const STRING
+*b)>
Concatenates two Parrot strings. If necessary, converts the second
string's encoding and/or type to match those of the first string. If
either string is C<NULL>, then a copy of the non-C<NULL> string is
-returned. If both strings are C<NULL>, then a new zero-length string is
-created and returned.
+returned. If both strings are C<NULL>, return C<STRINGNULL>.
=cut
@@ -389,12 +389,12 @@
PARROT_EXPORT
PARROT_CANNOT_RETURN_NULL
STRING *
-Parrot_str_concat(PARROT_INTERP, ARGIN_NULLOK(STRING *a),
- ARGIN_NULLOK(STRING *b))
+Parrot_str_concat(PARROT_INTERP, ARGIN_NULLOK(const STRING *a),
+ ARGIN_NULLOK(const STRING *b))
{
ASSERT_ARGS(Parrot_str_concat)
const CHARSET *cs;
- const ENCODING *enc;
+ const ENCODING *enc = NULL;
STRING *dest;
UINTVAL total_length;
@@ -403,23 +403,20 @@
/* If B isn't real, we just bail */
const UINTVAL b_len = b ? Parrot_str_byte_length(interp, b) : 0;
if (!b_len)
- return a;
+ return STRING_IS_NULL(a) ? STRINGNULL : Parrot_str_copy(interp, a);
/* Is A real? */
if (STRING_IS_NULL(a) || Buffer_bufstart(a) == NULL)
- return b;
+ return Parrot_str_copy(interp, b);
ASSERT_STRING_SANITY(a);
ASSERT_STRING_SANITY(b);
cs = string_rep_compatible(interp, a, b, &enc);
- if (cs) {
- a->charset = cs;
- a->encoding = enc;
- }
- else {
+ if (!cs) {
/* upgrade strings for concatenation */
+ cs = Parrot_unicode_charset_ptr;
enc = (a->encoding == Parrot_utf16_encoding_ptr
|| b->encoding == Parrot_utf16_encoding_ptr
|| a->encoding == Parrot_ucs2_encoding_ptr
@@ -435,13 +432,14 @@
if (b->encoding != enc)
b = enc->to_encoding(interp, b);
}
-
/* calc usable and total bytes */
total_length = a->bufused + b->bufused;
dest = Parrot_str_new_noinit(interp, enum_stringrep_one, total_length);
- dest->encoding = a->encoding;
- dest->charset = a->charset;
+ PARROT_ASSERT(enc);
+ PARROT_ASSERT(cs);
+ dest->encoding = enc;
+ dest->charset = cs;
/* Copy A first */
mem_sys_memcopy(dest->strstart, a->strstart, a->bufused);
@@ -900,8 +898,6 @@
Returns a single-character Parrot string.
-TODO - Allow this to take an array of characters?
-
=cut
*/
Modified: branches/codestring/t/src/embed.t
==============================================================================
--- branches/codestring/t/src/embed.t Wed May 5 23:52:59 2010 (r46321)
+++ branches/codestring/t/src/embed.t Thu May 6 00:31:08 2010 (r46322)
@@ -8,7 +8,7 @@
use Test::More;
use Parrot::Test;
-plan tests => 7;
+plan tests => 9;
=head1 NAME
@@ -99,6 +99,84 @@
The opcode 'copy' (copy<0>) was not found. Check the type and number of the arguments
OUTPUT
+c_output_is(linedirective(__LINE__) . <<'CODE', <<'OUTPUT', 'Parrot_compile_string populates the error string when given invalid language string');
+
+#include <stdio.h>
+#include <stdlib.h>
+#include "parrot/embed.h"
+#include "parrot/extend.h"
+
+void fail(const char *msg);
+
+void fail(const char *msg)
+{
+ fprintf(stderr, "failed: %s\n", msg);
+ exit(EXIT_FAILURE);
+}
+
+
+int main(int argc, const char **argv)
+{
+ Parrot_Interp interp;
+ Parrot_String err, lang;
+ Parrot_PMC func_pmc;
+ char *str;
+
+ interp = Parrot_new(NULL);
+ if (! interp)
+ fail("Cannot create parrot interpreter");
+ lang = Parrot_new_string(interp, "Foo", 3, (const char*)NULL, 0);
+
+ func_pmc = Parrot_compile_string(interp, lang, "This doesn't matter", &err);
+ Parrot_printf(interp, "%Ss\n", err);
+ Parrot_destroy(interp);
+ return 0;
+}
+CODE
+Invalid interpreter type
+OUTPUT
+
+
+c_output_is(linedirective(__LINE__) . <<'CODE', <<'OUTPUT', 'Parrot_compile_string populates the error string when there is an IMCC syntax error', 'todo' => 'TT #1610 : does not properly catch IMCC errors');
+
+#include <stdio.h>
+#include <stdlib.h>
+#include "parrot/embed.h"
+#include "parrot/extend.h"
+
+void fail(const char *msg);
+
+void fail(const char *msg)
+{
+ fprintf(stderr, "failed: %s\n", msg);
+ exit(EXIT_FAILURE);
+}
+
+
+int main(int argc, const char **argv)
+{
+ Parrot_Interp interp;
+ Parrot_String err, lang;
+ Parrot_PMC func_pmc;
+ char *str;
+
+ interp = Parrot_new(NULL);
+ if (! interp)
+ fail("Cannot create parrot interpreter");
+ lang = Parrot_new_string(interp, "PIR", 3, (const char*)NULL, 0);
+
+ func_pmc = Parrot_compile_string(interp, lang, "The sleeper must awake", &err);
+ Parrot_printf(interp,"Caught exception\n");
+ Parrot_printf(interp, "%Ss\n", err);
+ Parrot_destroy(interp);
+ return 0;
+}
+CODE
+Caught exception
+error:imcc:syntax error, unexpected IDENTIFIER ('The')
+OUTPUT
+
+
c_output_is(linedirective(__LINE__) . <<'CODE', <<'OUTPUT', "Hello world from main" );
#include <stdio.h>
More information about the parrot-commits
mailing list