Skip to content

Commit

Permalink
Load jitted_ops.bc as module with all precompiled stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
bacek committed Mar 26, 2011
1 parent 9093704 commit c53341e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 17 deletions.
8 changes: 8 additions & 0 deletions compilers/opsc/src/Ops/JIT.pm
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ has $!constants;
has $!bytecode;
has $!opmap;

# LLVM stuff
has $!module;

=item new
Create new JITter for given PBC and OpsFile.
Expand Down Expand Up @@ -80,6 +83,11 @@ method _load_pbc(Str $file) {
Initialize LLVM
method _init_llvm() {
# t/jit/jitted_ops.bc generated by:
# ./ops2c -d t/jit/jitted.ops
# llvm-gcc-4.2 -emit-llvm -O0 -Iinclude -I/usr/include/i486-linux-gnu -o t/jit/jitted_ops.bc -c t/jit/jitted_ops.c
$!module := LLVM::Module.create('JIT');
$!module.read("t/jit/jitted_ops.bc") // die("Couldn't read t/jit/jitted_ops.bc");
}

=begin Processing
Expand Down
17 changes: 0 additions & 17 deletions t/jit/proto.t
Original file line number Diff line number Diff line change
Expand Up @@ -31,23 +31,6 @@ my $jitter := Ops::JIT.new($pbc, $ops_file, $oplib);
ok( 1, "JITter created");

=begin
my $dir := $pf.get_directory();
ok( pir::defined($dir), "Got PF Directory");

my $bc := $dir{'BYTECODE_' ~ $pir};
ok( pir::defined($bc), "Got bytecode" );

my $opmap := $bc.opmap();
ok( pir::defined($opmap), "Got OpMap");

# Convert it to hash for faster lookup. Also cleanup a bit.
my %parsed_op;
for $ops_file.ops -> $op {
Ops::Util::strip_source($op);
%parsed_op{$op.full_name} := $op;
};
#_dumper(%parsed_op);

my $trans := Ops::Trans::JIT.new;
ok( 1, "Got Ops::Trans::JIT" );

Expand Down

0 comments on commit c53341e

Please sign in to comment.