Skip to content

Commit

Permalink
rebootstrap ops
Browse files Browse the repository at this point in the history
  • Loading branch information
Whiteknight committed Mar 10, 2012
1 parent f528aca commit 1b2a3df
Show file tree
Hide file tree
Showing 7 changed files with 4,449 additions and 4,509 deletions.
1 change: 1 addition & 0 deletions compilers/data_json/data_json.pir
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ the documentation at L<http://www.json.org/>.
.end

.sub '__onload' :tag('load')
'load_bytecode'('P6object.pbc', 'load')
'load_bytecode'('PGE.pbc', 'load')
'load_bytecode'('PGE/Util.pbc', 'load')
'load_bytecode'('TGE.pbc', 'load')
Expand Down
6 changes: 5 additions & 1 deletion compilers/opsc/src/Ops/OpLib.pm
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,11 @@
# Copyright (C) 2009-2010, Parrot Foundation.

INIT {
pir::load_bytecode("dumper.pbc");
my $pbc := pir::load_bytecode__ps("dumper.pbc");
if (!$pbc.is_initialized('load')) {
for $pbc.subs_by_tag('load') -> $sub { $sub(); }
$pbc.mark_initialized('load');
}
};

class Ops::OpLib is Hash;
Expand Down
4 changes: 0 additions & 4 deletions include/parrot/oplib/core_ops.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,8 @@ op_lib_t *Parrot_DynOp_core_4_1_0(PARROT_INTERP, long init);
opcode_t * Parrot_noop(opcode_t *, PARROT_INTERP);
opcode_t * Parrot_check_events(opcode_t *, PARROT_INTERP);
opcode_t * Parrot_check_events__(opcode_t *, PARROT_INTERP);
opcode_t * Parrot_load_bytecode_s(opcode_t *, PARROT_INTERP);
opcode_t * Parrot_load_bytecode_sc(opcode_t *, PARROT_INTERP);
opcode_t * Parrot_load_bytecode_p_s(opcode_t *, PARROT_INTERP);
opcode_t * Parrot_load_bytecode_p_sc(opcode_t *, PARROT_INTERP);
opcode_t * Parrot_load_language_s(opcode_t *, PARROT_INTERP);
opcode_t * Parrot_load_language_sc(opcode_t *, PARROT_INTERP);
opcode_t * Parrot_load_language_p_s(opcode_t *, PARROT_INTERP);
opcode_t * Parrot_load_language_p_sc(opcode_t *, PARROT_INTERP);
opcode_t * Parrot_branch_i(opcode_t *, PARROT_INTERP);
Expand Down
2,214 changes: 1,105 additions & 1,109 deletions include/parrot/oplib/ops.h

Large diffs are not rendered by default.

2,214 changes: 1,105 additions & 1,109 deletions include/parrot/opsenum.h

Large diffs are not rendered by default.

4,498 changes: 2,213 additions & 2,285 deletions src/ops/core_ops.c

Large diffs are not rendered by default.

21 changes: 20 additions & 1 deletion tools/dev/nci_thunk_gen.pir
Original file line number Diff line number Diff line change
Expand Up @@ -1122,11 +1122,30 @@ JSON
set_global .SIG_TABLE_GLOBAL_NAME, table
.end

.sub 'load_language'
.param string langname
.param string tagname

$P0 = load_language langname
$I0 = $P0.'is_initialized'(tagname)
if $I0 goto done_initializing
$P1 = $P0.'subs_by_tag'(tagname)
$P2 = iter $P1
loop_top:
unless $P2 goto loop_bottom
$P3 = shift $P2
$P3()
goto loop_top
loop_bottom:
$P0.'mark_initialized'(tagname)
done_initializing:
.end

.sub 'from_json'
.param string json_str

.local pmc compiler
load_language 'data_json'
'load_language'('data_json', 'load')
compiler = compreg 'data_json'

$P0 = compiler.'compile'(json_str)
Expand Down

0 comments on commit 1b2a3df

Please sign in to comment.