Author: jonathan
Date: Fri Jan  9 10:07:32 2009
New Revision: 35314

Modified:
   trunk/languages/perl6/src/builtins/control.pir
   trunk/languages/perl6/src/builtins/guts.pir

Log:
[rakudo] Get rid of !TYPECHECKPARAM, and make the one thing use it just do the 
check itself (will go away once we get Perl 6 prelude).

Modified: trunk/languages/perl6/src/builtins/control.pir
==============================================================================
--- trunk/languages/perl6/src/builtins/control.pir      (original)
+++ trunk/languages/perl6/src/builtins/control.pir      Fri Jan  9 10:07:32 2009
@@ -299,7 +299,10 @@
     .param int have_lang       :opt_flag
 
     $P0 = get_hll_global 'Str'
-    '!TYPECHECKPARAM'($P0, code)
+    $I0 = $P0.'ACCEPTS'(code)
+    if $I0 goto type_ok
+    'die'("Parameter type check failed on call to 'eval'.")
+  type_ok:
 
     .local pmc compiler, invokable
     .local pmc res, exception

Modified: trunk/languages/perl6/src/builtins/guts.pir
==============================================================================
--- trunk/languages/perl6/src/builtins/guts.pir (original)
+++ trunk/languages/perl6/src/builtins/guts.pir Fri Jan  9 10:07:32 2009
@@ -139,35 +139,6 @@
 .end
 
 
-=item !TYPECHECKPARAM
-
-Checks the type of a parameter.
-
-=cut
-
-.sub '!TYPECHECKPARAM'
-    .param pmc type
-    .param pmc value
-    $P0 = getinterp
-    $P0 = $P0['lexpad';1]
-    if null $P0 goto no_match_to_copy
-    $P0 = $P0['$/']
-    .lex "$/", $P0
-  no_match_to_copy:
-
-    $I0 = type.'ACCEPTS'(value)
-    if $I0 goto ok
-    $P0 = getinterp
-    $P0 = $P0['sub' ; 1]
-    $S0 = $P0
-    if $S0 goto have_name
-    $S0 = '<anon>'
-  have_name:
-    'die'('Parameter type check failed in call to ', $S0)
-ok:
-.end
-
-
 =item !SAMETYPE_EXACT
 
 Takes two types and returns true if they match exactly (not accounting for any

Reply via email to