diff src/pt-loop.h @ 14906:3f81e8b42955

JIT for loops over ranges * src/pt-eval.cc (tree_evaluator::visit_statment): Removed jit. (tree_evaluator::visit_simple_for_command): Added jit. * src/pt-jit.cc: Implement JIT of range based for loops. * src/pt-jit.h: Implement JI of range based for loops. * src/pt-loop.h (tree_simple_for_command::get_info, tree_simple_for_command::stash_info): New functions. * src/pt-loop.cc (tree_simple_for_command::~tree_simple_for_command): Delete stashed info.
author Max Brister <max@2bass.com>
date Thu, 17 May 2012 16:07:21 -0600
parents 72c96de7a403
children 51d4b1018efb
line wrap: on
line diff
--- a/src/pt-loop.h	Tue May 15 18:43:18 2012 -0600
+++ b/src/pt-loop.h	Thu May 17 16:07:21 2012 -0600
@@ -36,6 +36,9 @@
 #include "pt-cmd.h"
 #include "symtab.h"
 
+class jit_info;
+class jit_type;
+
 // While.
 
 class
@@ -180,7 +183,20 @@
 
   void accept (tree_walker& tw);
 
+  // some functions use by tree_jit
+  jit_info *get_info (jit_type *type) const
+  {
+    compiled_map::const_iterator iter = compiled.find (type);
+    return iter != compiled.end () ? iter->second : 0;
+  }
+
+  void stash_info (jit_type *type, jit_info *jinfo)
+  {
+    compiled[type] = jinfo;
+  }
+
 private:
+  typedef std::map<jit_type *, jit_info *> compiled_map;
 
   // TRUE means operate in parallel (subject to the value of the
   // maxproc expression).
@@ -205,6 +221,9 @@
   // Comment preceding ENDFOR token.
   octave_comment_list *trail_comm;
 
+  // a map from iterator types -> compiled functions
+  compiled_map compiled;
+
   // No copying!
 
   tree_simple_for_command (const tree_simple_for_command&);