Browse files

finish the bulk of the conversions, parrot builds

git-svn-id: https://svn.parrot.org/parrot/branches/pmc_func_cleanup@44036 d31e2699-5ff4-0310-a27c-f18f2fbe73fe
  • Loading branch information...
1 parent 847522f commit dc5a60b3c26364e5d82f1ad2aab4ed238d853f71 @Whiteknight Whiteknight committed Feb 16, 2010
View
4 compilers/imcc/imcc.y
@@ -532,7 +532,7 @@ mk_pmc_const_named(PARROT_INTERP, ARGMOD(IMC_Unit *unit),
}
r[1] = rhs;
- rhs->pmc_type = pmc_type(interp,
+ rhs->pmc_type = Parrot_pmc_get_type_str(interp,
Parrot_str_new(interp, unquoted_name, name_length));
mem_sys_free(unquoted_name);
@@ -2026,7 +2026,7 @@ classname:
{
/* there'd normally be a mem_sys_strdup() here, but the lexer already
* copied the string, so it's safe to use directly */
- if ((IMCC_INFO(interp)->cur_pmc_type = pmc_type(interp,
+ if ((IMCC_INFO(interp)->cur_pmc_type = Parrot_pmc_get_type_str(interp,
Parrot_str_new(interp, $1, 0))) <= 0) {
IMCC_fataly(interp, EXCEPTION_SYNTAX_ERROR,
"Unknown PMC type '%s'\n", $1);
View
1,395 compilers/imcc/imcparser.c
999 additions, 396 deletions not shown because the diff is too large. Please use a local Git client to view these changes.
View
44 compilers/imcc/imcparser.h
@@ -9,27 +9,26 @@
*/
/* HEADERIZER HFILE: none */
/* HEADERIZER STOP */
-/* A Bison parser, made by GNU Bison 2.3. */
-/* Skeleton interface for Bison's Yacc-like parsers in C
+/* A Bison parser, made by GNU Bison 2.4.1. */
- Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006
+/* Skeleton interface for Bison's Yacc-like parsers in C
+
+ Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006
Free Software Foundation, Inc.
-
- This program is free software; you can redistribute it and/or modify
+
+ This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2, or (at your option)
- any later version.
-
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
-
+
You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA. */
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
/* As a special exception, you may create a larger work that contains
part or all of the Bison parser skeleton and distribute that work
@@ -40,10 +39,11 @@
special exception, which will cause the skeleton and the resulting
Bison output files to be licensed under the GNU General Public
License without this special exception.
-
+
This special exception was added by the Free Software Foundation in
version 2.2 of Bison. */
+
/* Tokens. */
#ifndef YYTOKENTYPE
# define YYTOKENTYPE
@@ -297,21 +297,27 @@
#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
typedef union YYSTYPE
-#line 1059 "compilers/imcc/imcc.y"
{
+
+/* Line 1676 of yacc.c */
+#line 1059 "compilers/imcc/imcc.y"
+
IdList * idlist;
int t;
char * s;
SymReg * sr;
Instruction *i;
-}
-/* Line 1489 of yacc.c. */
-#line 299 "compilers/imcc/imcparser.h"
- YYSTYPE;
+
+
+
+/* Line 1676 of yacc.c */
+#line 304 "compilers/imcc/imcparser.h"
+} YYSTYPE;
+# define YYSTYPE_IS_TRIVIAL 1
# define yystype YYSTYPE /* obsolescent; will be withdrawn */
# define YYSTYPE_IS_DECLARED 1
-# define YYSTYPE_IS_TRIVIAL 1
#endif
+
View
2 compilers/imcc/parser_util.c
@@ -154,7 +154,7 @@ iNEW(PARROT_INTERP, ARGMOD(IMC_Unit *unit), ARGMOD(SymReg *r0),
SymReg *regs[3];
SymReg *pmc;
int nargs;
- const int pmc_num = pmc_type(interp,
+ const int pmc_num = Parrot_pmc_get_type_str(interp,
Parrot_str_new(interp, *type == '.' ? type + 1 : type, 0));
snprintf(fmt, sizeof (fmt), "%d", pmc_num);
View
8 compilers/imcc/pbc.c
@@ -1058,7 +1058,7 @@ mk_multi_sig(PARROT_INTERP, ARGIN(const SymReg *r))
if (r->set == 'S') {
STRING * const type_name = ct->constants[r->color]->u.string;
- const INTVAL type_num = pmc_type(interp, type_name);
+ const INTVAL type_num = Parrot_pmc_get_type_str(interp, type_name);
if (type_num == enum_type_undef) {
sig_pmc = Parrot_pmc_new(interp, enum_class_String);
@@ -1292,7 +1292,7 @@ add_const_pmc_sub(PARROT_INTERP, ARGMOD(SymReg *r), size_t offs, size_t end)
if (!PMC_IS_NULL(classobj))
sub_pmc = VTABLE_instantiate(interp, classobj, PMCNULL);
else {
- const INTVAL type = pmc_type(interp, classname);
+ const INTVAL type = Parrot_pmc_get_type_str(interp, classname);
if (type <= 0)
Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_NO_CLASS,
"Class '%Ss' specified in :instanceof(...) not found",
@@ -1348,7 +1348,7 @@ add_const_pmc_sub(PARROT_INTERP, ARGMOD(SymReg *r), size_t offs, size_t end)
ns_pmc = ct->constants[ns_const]->u.key;
break;
case PFC_STRING:
- ns_pmc = constant_Parrot_pmc_new(interp, enum_class_String);
+ ns_pmc = Parrot_pmc_new_constant(interp, enum_class_String);
VTABLE_set_string_native(interp, ns_pmc, ct->constants[ns_const]->u.string);
break;
default:
@@ -1805,7 +1805,7 @@ make_pmc_const(PARROT_INTERP, ARGMOD(SymReg *r))
else
s = Parrot_str_unescape(interp, r->name, 0, NULL);
- p = constant_Parrot_pmc_new(interp, r->pmc_type);
+ p = Parrot_pmc_new_constant(interp, r->pmc_type);
switch (r->pmc_type) {
case enum_class_Integer:
View
2 compilers/pirc/src/bcgen.c
@@ -1108,7 +1108,7 @@ get_namespace_pmc(ARGIN(bytecode * const bc), ARGIN_NULLOK(multi_type * const ns
switch (ns->entry_type) {
case MULTI_TYPE_IDENT: {
- PMC *namespace_pmc = constant_Parrot_pmc_new(bc->interp, enum_class_String);
+ PMC *namespace_pmc = Parrot_pmc_new_constant(bc->interp, enum_class_String);
PARROT_NAMESPACE(namespace_pmc)->name =
add_string_const_from_cstring(bc, ns->entry.ident);
break;
View
2 src/pmc.c
@@ -567,7 +567,7 @@ Parrot_pmc_new_init(PARROT_INTERP, INTVAL base_type, ARGOUT(PMC *init))
=item C<PMC * Parrot_pmc_new_constant_init(PARROT_INTERP, INTVAL base_type, PMC
*init)>
-As C<constant_Parrot_pmc_new>, but passes C<init> to the PMC's C<init_pmc> vtable
+As C<Parrot_pmc_new_constant>, but passes C<init> to the PMC's C<init_pmc> vtable
entry.
=cut
View
2 src/pmc/complex.pmc
@@ -1176,7 +1176,7 @@ Sets C<dest> to the absolute value of SELF that is the distance from (0.0).
GET_ATTR_re(INTERP, SELF, re);
GET_ATTR_im(INTERP, SELF, im);
d = sqrt(re*re + im*im);
- pmc_reuse(INTERP, SELF, enum_class_Float, 0);
+ Parrot_pmc_reuse(INTERP, SELF, enum_class_Float, 0);
VTABLE_set_number_native(INTERP, SELF, d);
}
View
6 src/pmc/fixedintegerarray.pmc
@@ -81,7 +81,7 @@ Creates and returns a copy of the array.
INTVAL * int_array;
PMC * const dest =
PObj_constant_TEST(SELF)
- ? constant_Parrot_pmc_new(INTERP, SELF->vtable->base_type)
+ ? Parrot_pmc_new_constant(INTERP, SELF->vtable->base_type)
: Parrot_pmc_new(INTERP, SELF->vtable->base_type);
GET_ATTR_int_array(INTERP, SELF, int_array);
@@ -422,10 +422,10 @@ Sets the Parrot string value of the element at index C<key> to C<value>.
VTABLE void set_string_keyed_int(INTVAL key, STRING *value) {
INTVAL tempInt;
- PMC * const tempPMC = temporary_Parrot_pmc_new(INTERP, enum_class_Integer);
+ PMC * const tempPMC = Parrot_pmc_new_temporary(INTERP, enum_class_Integer);
VTABLE_set_string_native(INTERP, tempPMC, value);
tempInt = VTABLE_get_integer(INTERP, tempPMC);
- temporary_pmc_free(interp, tempPMC);
+ Parrot_pmc_free_temporary(interp, tempPMC);
SELF.set_integer_keyed_int(key, tempInt);
}
View
6 src/pmc/float.pmc
@@ -134,12 +134,12 @@ Returns a Parrot string representation of the number.
*/
VTABLE void set_integer_native(INTVAL value) {
- pmc_reuse(INTERP, SELF, enum_class_Integer, 0);
+ Parrot_pmc_reuse(INTERP, SELF, enum_class_Integer, 0);
SELF.set_integer_native(value);
}
VTABLE void set_bool(INTVAL value) {
- pmc_reuse(INTERP, SELF, enum_class_Boolean, 0);
+ Parrot_pmc_reuse(INTERP, SELF, enum_class_Boolean, 0);
SELF.set_bool(value);
}
@@ -170,7 +170,7 @@ Note that this method morphs the number into a C<String>.
*/
VTABLE void set_string_native(STRING *value) {
- pmc_reuse(INTERP, SELF, enum_class_String, 0);
+ Parrot_pmc_reuse(INTERP, SELF, enum_class_String, 0);
SELF.set_string_native(value);
}
View
2 src/pmc/hashiterator.pmc
@@ -246,7 +246,7 @@ the next one.
VTABLE STRING* shift_string() {
PMC * const key = SELF.shift_pmc();
STRING * const ret = VTABLE_get_string(INTERP, key);
- temporary_pmc_free(INTERP, key);
+ Parrot_pmc_free_temporary(INTERP, key);
return ret;
}
View
16 src/pmc/integer.pmc
@@ -38,7 +38,7 @@ upgrade_self_to_bignum(PARROT_INTERP, PMC *self)
/* Do an in-place upgrade to a Bignum of SELF and return a pointer
to it (which is probably redundant, but whatever). */
const INTVAL a = VTABLE_get_integer(interp, self);
- pmc_reuse(interp, self, enum_class_BigInt, 0);
+ Parrot_pmc_reuse(interp, self, enum_class_BigInt, 0);
VTABLE_set_integer_native(interp, self, a);
return self;
}
@@ -230,20 +230,20 @@ Morphs the integer to a C<String> and sets the value from C<value>.
*/
VTABLE void set_number_native(FLOATVAL value) {
- pmc_reuse(INTERP, SELF, enum_class_Float, 0);
+ Parrot_pmc_reuse(INTERP, SELF, enum_class_Float, 0);
SELF.set_number_native(value);
}
VTABLE void set_bool(INTVAL value) {
- pmc_reuse(INTERP, SELF, enum_class_Boolean, 0);
+ Parrot_pmc_reuse(INTERP, SELF, enum_class_Boolean, 0);
SELF.set_bool(value);
}
VTABLE void set_string_native(STRING *value) {
- pmc_reuse(INTERP, SELF, enum_class_String, 0);
+ Parrot_pmc_reuse(INTERP, SELF, enum_class_String, 0);
SELF.set_string_native(value);
}
@@ -354,7 +354,7 @@ Adds C<value> to C<SELF> inplace.
MULTI void i_add(Complex value) {
const INTVAL a = SELF.get_integer();
- pmc_reuse(INTERP, SELF, enum_class_Complex, 0);
+ Parrot_pmc_reuse(INTERP, SELF, enum_class_Complex, 0);
VTABLE_set_number_native(INTERP, SELF,
SELF.get_integer() + VTABLE_get_number(INTERP, value));
}
@@ -515,7 +515,7 @@ Subtracts C<value> from C<SELF> inplace.
MULTI void i_subtract(Complex value) {
const INTVAL a = SELF.get_integer();
- pmc_reuse(INTERP, SELF, enum_class_Complex, 0);
+ Parrot_pmc_reuse(INTERP, SELF, enum_class_Complex, 0);
VTABLE_set_number_native(INTERP, SELF,
(FLOATVAL)a - VTABLE_get_number_keyed_int(INTERP, value, 0));
VTABLE_set_number_keyed_int(INTERP, SELF, 1,
@@ -1107,7 +1107,7 @@ Increments the integer.
if ((c^a) >= 0 || (c^1) >= 0)
SET_ATTR_iv(interp, SELF, c);
else {
- pmc_reuse(interp, SELF, enum_class_BigInt, 0);
+ Parrot_pmc_reuse(interp, SELF, enum_class_BigInt, 0);
VTABLE_set_integer_native(interp, SELF, a);
VTABLE_increment(interp, SELF);
}
@@ -1131,7 +1131,7 @@ Decrements the integer.
if ((c^a) >= 0 || (c^~1) >= 0)
VTABLE_set_integer_native(interp, SELF, c);
else {
- pmc_reuse(INTERP, SELF, enum_class_BigInt, 0);
+ Parrot_pmc_reuse(INTERP, SELF, enum_class_BigInt, 0);
VTABLE_set_integer_native(interp, SELF, a);
VTABLE_decrement(interp, SELF);
}
View
2 src/pmc/parrotthread.pmc
@@ -71,7 +71,7 @@ static INTVAL do_thread_run(PARROT_INTERP, PMC *thread,
interp->flags &= ~PARROT_THR_COPY_INTERP; /* XXX */
pt_thread_run(interp, thread, sub, args);
- pmc_reuse(interp, thread, enum_class_ParrotRunningThread, 0);
+ Parrot_pmc_reuse(interp, thread, enum_class_ParrotRunningThread, 0);
PObj_custom_mark_CLEAR(thread);
VTABLE_set_integer_native(interp, thread, tid);
View
12 src/pmc/scalar.pmc
@@ -39,15 +39,15 @@ according to the type of C<*value>.
if (self_type == enum_class_Boolean)
/* doesn't morph */
- pmc_reuse(INTERP, SELF, val_type, 0);
+ Parrot_pmc_reuse(INTERP, SELF, val_type, 0);
if (val_type == enum_class_Undef) {
- pmc_reuse(INTERP, SELF, val_type, 0);
+ Parrot_pmc_reuse(INTERP, SELF, val_type, 0);
return;
}
if (VTABLE_isa(INTERP, value, CONST_STRING(INTERP, "Undef"))) {
- pmc_reuse(INTERP, SELF, enum_class_Undef, 0);
+ Parrot_pmc_reuse(INTERP, SELF, enum_class_Undef, 0);
return;
}
@@ -68,7 +68,7 @@ according to the type of C<*value>.
SELF.set_string_native(v);
return;
}
- pmc_reuse(INTERP, SELF, val_type, 0);
+ Parrot_pmc_reuse(INTERP, SELF, val_type, 0);
SELF.set_pmc(value);
}
@@ -148,7 +148,7 @@ Adds C<value> to C<SELF> inplace.
MULTI void i_add(Complex value) {
const FLOATVAL a = SELF.get_number();
- pmc_reuse(INTERP, SELF, enum_class_Complex, 0);
+ Parrot_pmc_reuse(INTERP, SELF, enum_class_Complex, 0);
VTABLE_set_number_native(INTERP, SELF,
a + VTABLE_get_number_keyed_int(INTERP, value, 0));
VTABLE_set_number_keyed_int(INTERP, SELF, 1,
@@ -230,7 +230,7 @@ Subtracts C<value> from C<SELF> inplace.
MULTI void i_subtract(Complex value) {
const FLOATVAL a = SELF.get_number();
- pmc_reuse(INTERP, SELF, enum_class_Complex, 0);
+ Parrot_pmc_reuse(INTERP, SELF, enum_class_Complex, 0);
VTABLE_set_number_native(INTERP, SELF,
a - VTABLE_get_number_keyed_int(INTERP, value, 0));
VTABLE_set_number_keyed_int(INTERP, SELF, 1,
View
8 src/pmc/undef.pmc
@@ -41,7 +41,7 @@ appropriate type.
VTABLE void set_pmc(PMC *other) {
if (!PObj_is_object_TEST(other)) {
- pmc_reuse(INTERP, SELF, other->vtable->base_type, 0);
+ Parrot_pmc_reuse(INTERP, SELF, other->vtable->base_type, 0);
VTABLE_set_pmc(INTERP, SELF, other);
}
else {
@@ -127,7 +127,7 @@ Morphs the current PMC to an C<Integer> and sets the value from C<value>.
*/
VTABLE void set_integer_native(INTVAL value) {
- pmc_reuse(INTERP, SELF, enum_class_Integer, 0);
+ Parrot_pmc_reuse(INTERP, SELF, enum_class_Integer, 0);
VTABLE_set_integer_native(INTERP, SELF, value);
}
@@ -156,7 +156,7 @@ Morphs the current PMC to a C<Float> and sets the value from C<value>.
*/
VTABLE void set_number_native(FLOATVAL value) {
- pmc_reuse(INTERP, SELF, enum_class_Float, 0);
+ Parrot_pmc_reuse(INTERP, SELF, enum_class_Float, 0);
VTABLE_set_number_native(INTERP, SELF, value);
}
@@ -188,7 +188,7 @@ Morphs the current PMC to a C<String> and sets the value from C<value>.
*/
VTABLE void set_string_native(STRING *value) {
- pmc_reuse(interp, SELF, enum_class_String, 0);
+ Parrot_pmc_reuse(interp, SELF, enum_class_String, 0);
VTABLE_set_string_native(INTERP, SELF, value);
}
View
2 src/runcore/profiling.c
@@ -222,7 +222,7 @@ init_profiling_core(PARROT_INTERP, ARGIN(Parrot_profiling_runcore_t *runcore), A
}
/* put profile_filename in the gc root set so it won't get collected */
- gc_register_pmc(interp, (PMC *) runcore->profile_filename);
+ Parrot_pmc_gc_register(interp, (PMC *) runcore->profile_filename);
Profiling_first_loop_SET(runcore);

0 comments on commit dc5a60b

Please sign in to comment.