Permalink
Browse files

Merge context_pmc3 branch into trunk.

DRAGONS ENTER THE BUILDING.

git-svn-id: https://svn.parrot.org/parrot/trunk@40958 d31e2699-5ff4-0310-a27c-f18f2fbe73fe
  • Loading branch information...
1 parent 616568b commit 540d4c3169aeef56b741d1684c940ae760aa3ac0 @bacek bacek committed Sep 3, 2009
Showing with 2,720 additions and 1,283 deletions.
  1. +4 −0 MANIFEST
  2. +2 −2 compilers/imcc/imcc.y
  3. +2 −2 compilers/imcc/imcparser.c
  4. +5 −5 compilers/imcc/parser_util.c
  5. +3 −3 compilers/imcc/pbc.c
  6. +1 −0 config/gen/makefiles/root.in
  7. +477 −17 include/parrot/call.h
  8. +74 −0 include/parrot/context.h
  9. +14 −95 include/parrot/interpreter.h
  10. +110 −42 include/parrot/register.h
  11. +8 −17 include/parrot/sub.h
  12. +7 −13 include/parrot/warnings.h
  13. +1 −1 lib/Parrot/OpTrans/C.pm
  14. +3 −3 lib/Parrot/OpTrans/CGP.pm
  15. +1 −1 lib/Parrot/OpTrans/CGoto.pm
  16. +1 −1 lib/Parrot/OpTrans/CPrederef.pm
  17. +2 −2 lib/Parrot/OpTrans/CSwitch.pm
  18. +1 −1 lib/Parrot/Ops2c/Utils.pm
  19. +12 −13 lib/Parrot/Pmc2c/PCCMETHOD.pm
  20. +952 −0 src/call/context.c
  21. +29 −42 src/call/ops.c
  22. +119 −114 src/call/pcc.c
  23. +19 −17 src/debug.c
  24. +10 −10 src/embed.c
  25. +7 −6 src/exceptions.c
  26. +3 −3 src/extend.c
  27. +220 −296 src/gc/alloc_register.c
  28. +3 −5 src/gc/mark_sweep.c
  29. +7 −7 src/global.c
  30. +4 −2 src/global_setup.c
  31. +2 −2 src/hll.c
  32. +6 −7 src/interp/inter_create.c
  33. +4 −4 src/interp/inter_misc.c
  34. +9 −6 src/jit.c
  35. +3 −1 src/jit/amd64/jit_defs.c
  36. +7 −10 src/jit/i386/core.jit
  37. +18 −18 src/jit/i386/jit_defs.c
  38. +8 −6 src/jit/ppc/core.jit
  39. +3 −1 src/jit/ppc/jit_emit.h
  40. +6 −2 src/jit/sun4/jit_emit.h
  41. +2 −1 src/multidispatch.c
  42. +2 −2 src/oo.c
  43. +27 −30 src/ops/core.ops
  44. +2 −2 src/ops/debug.ops
  45. +2 −2 src/ops/object.ops
  46. +23 −23 src/ops/pic.ops
  47. +20 −17 src/ops/var.ops
  48. +7 −6 src/packfile.c
  49. +16 −16 src/pic.c
  50. +1 −1 src/pmc.c
  51. +4 −4 src/pmc/class.pmc
  52. +165 −0 src/pmc/context.pmc
  53. +13 −25 src/pmc/continuation.pmc
  54. +25 −29 src/pmc/coroutine.pmc
  55. +13 −31 src/pmc/exception.pmc
  56. +1 −1 src/pmc/exporter.pmc
  57. +6 −6 src/pmc/lexpad.pmc
  58. +1 −1 src/pmc/nci.pmc
  59. +5 −5 src/pmc/object.pmc
  60. +19 −18 src/pmc/parrotinterpreter.pmc
  61. +1 −2 src/pmc/retcontinuation.pmc
  62. +1 −1 src/pmc/role.pmc
  63. +4 −1 src/pmc/scheduler.pmc
  64. +50 −75 src/pmc/sub.pmc
  65. +26 −19 src/runcore/cores.c
  66. +5 −10 src/runcore/main.c
  67. +32 −30 src/scheduler.c
  68. +37 −145 src/sub.c
  69. +1 −2 src/warnings.c
  70. +1 −0 t/compilers/pge/06-grammar.t
  71. BIN t/native_pbc/annotations.pbc
  72. BIN t/native_pbc/integer_1.pbc
  73. BIN t/native_pbc/number_1.pbc
  74. BIN t/native_pbc/string_1.pbc
  75. +3 −0 t/op/annotate.t
  76. +35 −0 t/pmc/context.t
  77. +3 −1 t/pmc/exceptionhandler.t
View
@@ -951,6 +951,7 @@ include/parrot/call.h [main]include
include/parrot/cclass.h [main]include
include/parrot/charset.h [main]include
include/parrot/compiler.h [main]include
+include/parrot/context.h [main]include
include/parrot/core_types.h [main]include
include/parrot/datatypes.h [main]include
include/parrot/debugger.h [main]include
@@ -1242,6 +1243,7 @@ runtime/parrot/library/yaml_dumper.pir [library]
src/atomic/gcc_x86.c []
src/atomic/sparc_v9.s []
src/byteorder.c []
+src/call/context.c []
src/call/ops.c []
src/call/pcc.c []
src/datatypes.c []
@@ -1392,6 +1394,7 @@ src/pmc/capture.pmc [devel]src
src/pmc/class.pmc [devel]src
src/pmc/codestring.pmc [devel]src
src/pmc/complex.pmc [devel]src
+src/pmc/context.pmc [devel]src
src/pmc/continuation.pmc [devel]src
src/pmc/coroutine.pmc [devel]src
src/pmc/cpointer.pmc [devel]src
@@ -1845,6 +1848,7 @@ t/pmc/class.t [test]
t/pmc/codestring.t [test]
t/pmc/complex.t [test]
t/pmc/config.t [test]
+t/pmc/context.t [test]
t/pmc/continuation.t [test]
t/pmc/coroutine.t [test]
t/pmc/cpointer.t [test]
@@ -1210,8 +1210,8 @@ hll_def:
HLL STRINGC
{
STRING * const hll_name = Parrot_str_unescape(interp, $2 + 1, '"', NULL);
- CONTEXT(interp)->current_HLL =
- Parrot_register_HLL(interp, hll_name);
+ Parrot_pcc_set_HLL(interp, CURRENT_CONTEXT(interp),
+ Parrot_register_HLL(interp, hll_name));
IMCC_INFO(interp)->cur_namespace = NULL;
mem_sys_free($2);
@@ -3318,8 +3318,8 @@ int yynerrs;
#line 1211 "compilers/imcc/imcc.y"
{
STRING * const hll_name = Parrot_str_unescape(interp, (yyvsp[(2) - (2)].s) + 1, '"', NULL);
- CONTEXT(interp)->current_HLL =
- Parrot_register_HLL(interp, hll_name);
+ Parrot_pcc_set_HLL(interp, CURRENT_CONTEXT(interp),
+ Parrot_register_HLL(interp, hll_name));
IMCC_INFO(interp)->cur_namespace = NULL;
mem_sys_free((yyvsp[(2) - (2)].s));
@@ -626,7 +626,7 @@ imcc_compile(PARROT_INTERP, ARGIN(const char *s), int pasm_file,
struct _imc_info_t *imc_info = NULL;
struct parser_state_t *next;
void *yyscanner;
- Parrot_Context *ignored;
+ PMC *ignored;
INTVAL regs_used[4] = {3, 3, 3, 3};
INTVAL eval_number;
@@ -869,10 +869,10 @@ imcc_compile_pir_ex(PARROT_INTERP, ARGIN(const char *s))
* Continuations (this happens when something is the target of a :outer)
* trying to return values using them when invoked. (See TT#500 for the
* report of the bug this fixes). */
- opcode_t *save_results = CONTEXT(interp)->current_results;
- CONTEXT(interp)->current_results = NULL;
+ opcode_t *save_results = Parrot_pcc_get_results(interp, CURRENT_CONTEXT(interp));
+ Parrot_pcc_set_results(interp, CURRENT_CONTEXT(interp), NULL);
sub = imcc_compile(interp, s, 0, &error_message);
- CONTEXT(interp)->current_results = save_results;
+ Parrot_pcc_set_results(interp, CURRENT_CONTEXT(interp), save_results);
if (sub)
return sub;
@@ -904,7 +904,7 @@ imcc_compile_file(PARROT_INTERP, ARGIN(const char *fullname),
const char *ext;
FILE *fp;
STRING *fs;
- Parrot_Context *ignored;
+ PMC *ignored;
/* need at least 3 regs for compilation of constant math e.g.
* add_i_ic_ic - see also IMCC_subst_constants() */
@@ -1280,9 +1280,9 @@ find_outer(PARROT_INTERP, ARGIN(const IMC_Unit *unit))
}
/* could be eval too; check if :outer is the current sub */
- current = CONTEXT(interp)->current_sub;
+ current = Parrot_pcc_get_sub(interp, CURRENT_CONTEXT(interp));
- if (!current)
+ if (PMC_IS_NULL(current))
IMCC_fatal(interp, 1, "Undefined :outer sub '%s'.\n",
unit->outer->name);
@@ -1434,7 +1434,7 @@ add_const_pmc_sub(PARROT_INTERP, ARGMOD(SymReg *r), size_t offs, size_t end)
sub->namespace_name = ns_pmc;
sub->start_offs = offs;
sub->end_offs = end;
- sub->HLL_id = CONTEXT(interp)->current_HLL;
+ sub->HLL_id = Parrot_pcc_get_HLL(interp, CURRENT_CONTEXT(interp));
for (i = 0; i < 4; ++i)
sub->n_regs_used[i] = unit->n_regs_used[i];
@@ -441,6 +441,7 @@ INTERP_O_FILES := \
$(SRC_DIR)/interp/inter_create$(O) \
$(SRC_DIR)/interp/inter_misc$(O) \
$(SRC_DIR)/call/ops$(O) \
+ $(SRC_DIR)/call/context$(O) \
$(SRC_DIR)/key$(O) \
$(SRC_DIR)/library$(O) \
$(SRC_DIR)/list$(O) \
Oops, something went wrong.

0 comments on commit 540d4c3

Please sign in to comment.