[svn:parrot] r42195 - in branches/context_auto_attrs: include/parrot lib/Parrot/OpTrans src/call src/pmc src/runcore
bacek at svn.parrot.org
bacek at svn.parrot.org
Sat Oct 31 23:25:08 UTC 2009
Author: bacek
Date: Sat Oct 31 23:25:07 2009
New Revision: 42195
URL: https://trac.parrot.org/parrot/changeset/42195
Log:
Get rid of Parrot_Context structure.
Modified:
branches/context_auto_attrs/include/parrot/context.h
branches/context_auto_attrs/lib/Parrot/OpTrans/C.pm
branches/context_auto_attrs/src/call/context.c
branches/context_auto_attrs/src/call/context_accessors.c
branches/context_auto_attrs/src/pmc/multisub.pmc
branches/context_auto_attrs/src/runcore/cores.c
branches/context_auto_attrs/src/runcore/main.c
branches/context_auto_attrs/src/runcore/profiling.c
Modified: branches/context_auto_attrs/include/parrot/context.h
==============================================================================
--- branches/context_auto_attrs/include/parrot/context.h Sat Oct 31 23:24:32 2009 (r42194)
+++ branches/context_auto_attrs/include/parrot/context.h Sat Oct 31 23:25:07 2009 (r42195)
@@ -13,6 +13,8 @@
#include "parrot/compiler.h"
struct PackFile_Constant;
+struct Parrot_Context_attributes;
+typedef struct Parrot_Context_attributes Parrot_Context;
typedef union {
PMC **regs_p;
@@ -24,47 +26,6 @@
INTVAL *regs_i;
} Regs_ni;
-struct Parrot_Context {
- PMC *caller_ctx; /* caller context */
- Regs_ni bp; /* pointers to FLOATVAL & INTVAL */
- Regs_ps bp_ps; /* pointers to PMC & STR */
-
- /* end common header */
- UINTVAL n_regs_used[4]; /* INSP in PBC points to Sub */
- PMC *lex_pad; /* LexPad PMC */
- PMC *outer_ctx; /* outer context, if a closure */
-
- /* new call scheme and introspective variables */
- PMC *current_sub; /* the Sub we are executing */
-
- /* for now use a return continuation PMC */
- PMC *handlers; /* local handlers for the context */
- PMC *current_cont; /* the return continuation PMC */
- PMC *current_object; /* current object if a method call */
- PMC *current_namespace; /* The namespace we're currently in */
- PMC *results_signature; /* non-const results signature PMC */
- opcode_t *current_pc; /* program counter of Sub invocation */
- opcode_t *current_results; /* ptr into code with get_results opcode */
- PMC *current_sig; /* temporary CallSignature PMC for active call */
-
- /* deref the constants - we need it all the time */
- struct PackFile_Constant **constants;
-
- INTVAL current_HLL; /* see also src/hll.c */
-
- UINTVAL warns; /* Keeps track of what warnings
- * have been activated */
- UINTVAL errors; /* fatals that can be turned off */
- UINTVAL trace_flags;
- UINTVAL recursion_depth; /* Sub call recursion depth */
-
- /* code->prederefed.code - code->base.data in opcodes
- * to simplify conversion between code ptrs in e.g. invoke */
- size_t pred_offset;
-};
-
-typedef struct Parrot_Context Parrot_Context;
-
/*
* Macros to make accessing registers more convenient/readable.
*/
Modified: branches/context_auto_attrs/lib/Parrot/OpTrans/C.pm
==============================================================================
--- branches/context_auto_attrs/lib/Parrot/OpTrans/C.pm Sat Oct 31 23:24:32 2009 (r42194)
+++ branches/context_auto_attrs/lib/Parrot/OpTrans/C.pm Sat Oct 31 23:25:07 2009 (r42195)
@@ -52,6 +52,8 @@
sub defines {
my $type = __PACKAGE__;
return <<END;
+#include "../pmc/pmc_context.h"
+
/* defines - $0 -> $type */
#undef CONST
#define REL_PC ((size_t)(cur_opcode - (opcode_t *)interp->code->base.data))
Modified: branches/context_auto_attrs/src/call/context.c
==============================================================================
--- branches/context_auto_attrs/src/call/context.c Sat Oct 31 23:24:32 2009 (r42194)
+++ branches/context_auto_attrs/src/call/context.c Sat Oct 31 23:25:07 2009 (r42195)
@@ -15,6 +15,7 @@
#include "parrot/parrot.h"
#include "parrot/call.h"
#include "../pmc/pmc_sub.h"
+#include "../pmc/pmc_context.h"
/*
Modified: branches/context_auto_attrs/src/call/context_accessors.c
==============================================================================
--- branches/context_auto_attrs/src/call/context_accessors.c Sat Oct 31 23:24:32 2009 (r42194)
+++ branches/context_auto_attrs/src/call/context_accessors.c Sat Oct 31 23:25:07 2009 (r42195)
@@ -14,6 +14,7 @@
#include "parrot/parrot.h"
#include "parrot/call.h"
+#include "../pmc/pmc_context.h"
#ifndef NDEBUG
Modified: branches/context_auto_attrs/src/pmc/multisub.pmc
==============================================================================
--- branches/context_auto_attrs/src/pmc/multisub.pmc Sat Oct 31 23:24:32 2009 (r42194)
+++ branches/context_auto_attrs/src/pmc/multisub.pmc Sat Oct 31 23:25:07 2009 (r42195)
@@ -19,6 +19,8 @@
*/
+#include "pmc_context.h"
+
pmclass MultiSub extends ResizablePMCArray auto_attrs provides array {
VTABLE void push_pmc(PMC *value) {
Modified: branches/context_auto_attrs/src/runcore/cores.c
==============================================================================
--- branches/context_auto_attrs/src/runcore/cores.c Sat Oct 31 23:24:32 2009 (r42194)
+++ branches/context_auto_attrs/src/runcore/cores.c Sat Oct 31 23:25:07 2009 (r42195)
@@ -249,6 +249,7 @@
#include "parrot/dynext.h"
#include "../pmc/pmc_sub.h"
+#include "../pmc/pmc_context.h"
#ifdef HAVE_COMPUTED_GOTO
# include "parrot/oplib/core_ops_cg.h"
Modified: branches/context_auto_attrs/src/runcore/main.c
==============================================================================
--- branches/context_auto_attrs/src/runcore/main.c Sat Oct 31 23:24:32 2009 (r42194)
+++ branches/context_auto_attrs/src/runcore/main.c Sat Oct 31 23:25:07 2009 (r42195)
@@ -46,6 +46,7 @@
#endif
#include "parrot/dynext.h"
#include "../pmc/pmc_parrotlibrary.h"
+#include "../pmc/pmc_context.h"
/* HEADERIZER HFILE: include/parrot/runcore_api.h */
Modified: branches/context_auto_attrs/src/runcore/profiling.c
==============================================================================
--- branches/context_auto_attrs/src/runcore/profiling.c Sat Oct 31 23:24:32 2009 (r42194)
+++ branches/context_auto_attrs/src/runcore/profiling.c Sat Oct 31 23:25:07 2009 (r42195)
@@ -18,6 +18,7 @@
#include "profiling.str"
#include "../pmc/pmc_sub.h"
+#include "../pmc/pmc_context.h"
#ifdef WIN32
# define getpid _getpid
More information about the parrot-commits
mailing list