[svn:mod_parrot] r489 - in mod_parrot/trunk/lib: . ModParrot/HLL

[email protected] Wed, 12 Nov 2008 18:50:18 -0800 (PST)
Newsgroups perl.cvs.mod_parrot
Message-ID <[email protected]>
Author: jhorwitz
Date: Wed Nov 12 18:50:17 2008
New Revision: 489

Modified:
   mod_parrot/trunk/lib/ModParrot/HLL/perl6.pir
   mod_parrot/trunk/lib/mod_parrot.pir

Log:
call "use" to load mod_perl6.pm so we can precompile it
obviates need for find_file_in_path since "use" will do it for us


Modified: mod_parrot/trunk/lib/ModParrot/HLL/perl6.pir
==============================================================================
--- mod_parrot/trunk/lib/ModParrot/HLL/perl6.pir	(original)
+++ mod_parrot/trunk/lib/ModParrot/HLL/perl6.pir	Wed Nov 12 18:50:17 2008
@@ -15,19 +15,13 @@
 # limitations under the License.
 
 .sub __onload :anon :load
-    .local string mp6_path
-    .local pmc find_file_in_path
-
     load_bytecode 'languages/perl6/perl6.pbc'
     load_bytecode 'ModParrot/Apache/Module.pbc'
     load_bytecode 'ModParrot/Constants.pbc'
 
-    $P0 = new 'Env'
-    $S0 = $P0['PERL6LIB']
-    find_file_in_path = get_hll_global ['ModParrot'], 'find_file_in_path'
-    mp6_path = find_file_in_path($S0, 'mod_perl6.pm')
+    # load mod_perl6.pm, which may be precompiled
     $P0 = compreg 'Perl6'
-    $P1 = $P0.'evalfiles'(mp6_path)
+    $P1 = $P0.'compile'('use mod_perl6')
 
     # register mod_parrot classes as Perl6 meta classes so Perl 6 can access
     # them natively.  use 'name' to register the class under a different

Modified: mod_parrot/trunk/lib/mod_parrot.pir
==============================================================================
--- mod_parrot/trunk/lib/mod_parrot.pir	(original)
+++ mod_parrot/trunk/lib/mod_parrot.pir	Wed Nov 12 18:50:17 2008
@@ -129,24 +129,3 @@
 
     .return(count)
 .end
-
-.sub find_file_in_path
-    .param string search_path
-    .param string filename
-    .local string path
-    .local pmc iter
-
-    $P0 = split ':', search_path
-    iter = new 'Iterator', $P0
-  iter_start:
-    null path
-    unless iter goto return_path
-    $S0 = shift iter
-    path = concat $S0, '/'
-    path .= filename
-    $I0 = stat path, 0
-    unless $I0 goto iter_start
-
-  return_path:
-    .return(path)
-.end