diff src/interp-core/jit-ir.cc @ 15124:0464e3ceb85b

Skip functions when resolving end context in JIT * src/interp-core/jit-ir.cc (jit_magic_end::resolve_context): Skip functions. * src/interp-core/jit-typeinfo.cc (jit_type::jit_type): Add askip_paren parameter. (jit_typeinfo::addbuiltin): Skip end resolution for builtin functions. * src/interp-core/jit-typeinfo.h (jit_type::skip_paren): New function. (jit_typeinfo::new_type): Add skip_paren argument.
author Max Brister <max@2bass.com>
date Tue, 07 Aug 2012 14:59:58 -0500
parents d29f2583cf7b
children 7a19e8275d41
line wrap: on
line diff
--- a/src/interp-core/jit-ir.cc	Tue Aug 07 09:01:02 2012 -0700
+++ b/src/interp-core/jit-ir.cc	Tue Aug 07 14:59:58 2012 -0500
@@ -619,9 +619,19 @@
 jit_magic_end::context
 jit_magic_end::resolve_context (void) const
 {
-  // FIXME: We need to have a way of marking functions so we can skip them here
-  context ret = contexts[0];
-  ret.value = argument (0);
+  size_t idx;
+  for (idx = 0; idx < contexts.size (); ++idx)
+    {
+      jit_type *ctx_type = contexts[idx].value->type ();
+      if (! ctx_type || ctx_type->skip_paren ())
+        break;
+    }
+
+  if (idx >= contexts.size ())
+    idx = 0;
+
+  context ret = contexts[idx];
+  ret.value = argument (idx);
   return ret;
 }