[macruby-changes] [2407] MacRuby/trunk/parse.y

source_changes at macosforge.org source_changes at macosforge.org
Fri Aug 28 14:01:14 PDT 2009


Revision: 2407
          http://trac.macosforge.org/projects/ruby/changeset/2407
Author:   lsansonetti at apple.com
Date:     2009-08-28 14:01:13 -0700 (Fri, 28 Aug 2009)
Log Message:
-----------
changed the way we generate internal IDs to support AOT compilation

Modified Paths:
--------------
    MacRuby/trunk/parse.y

Modified: MacRuby/trunk/parse.y
===================================================================
--- MacRuby/trunk/parse.y	2009-08-28 21:00:45 UTC (rev 2406)
+++ MacRuby/trunk/parse.y	2009-08-28 21:01:13 UTC (rev 2407)
@@ -9430,12 +9430,21 @@
 }
 #endif
 
+// XXX not thread-safe
+static long internal_count = 0;
+
 static ID
 internal_id_gen(struct parser_params *parser)
 {
+#if 1
+    char buf[100];
+    snprintf(buf, sizeof buf, "__internal_id_tmp_%ld__", internal_count++);
+    return rb_intern(buf);
+#else
     ID id = (ID)vtable_size(lvtbl->args) + (ID)vtable_size(lvtbl->vars);
     id += ((tLAST_TOKEN - ID_INTERNAL) >> ID_SCOPE_SHIFT) + 1;
     return ID_INTERNAL | (id << ID_SCOPE_SHIFT);
+#endif
 }
 
 static int
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macruby-changes/attachments/20090828/93c6d9ac/attachment-0001.html>


More information about the macruby-changes mailing list