[macruby-changes] [5243] MacRuby/branches/0.9

source_changes at macosforge.org source_changes at macosforge.org
Wed Feb 23 16:35:51 PST 2011


Revision: 5243
          http://trac.macosforge.org/projects/ruby/changeset/5243
Author:   lsansonetti at apple.com
Date:     2011-02-23 16:35:50 -0800 (Wed, 23 Feb 2011)
Log Message:
-----------
merge r5242 from trunk

Revision Links:
--------------
    http://trac.macosforge.org/projects/ruby/changeset/5242

Modified Paths:
--------------
    MacRuby/branches/0.9/compiler.cpp
    MacRuby/branches/0.9/vm.cpp

Property Changed:
----------------
    MacRuby/branches/0.9/


Property changes on: MacRuby/branches/0.9
___________________________________________________________________
Modified: svn:mergeinfo
   - /MacRuby/branches/icu:3533-3744
/MacRuby/trunk:5240
   + /MacRuby/branches/icu:3533-3744
/MacRuby/trunk:5240,5242

Modified: MacRuby/branches/0.9/compiler.cpp
===================================================================
--- MacRuby/branches/0.9/compiler.cpp	2011-02-24 00:33:59 UTC (rev 5242)
+++ MacRuby/branches/0.9/compiler.cpp	2011-02-24 00:35:50 UTC (rev 5243)
@@ -2091,12 +2091,14 @@
 	    *flags = DEFINE_SUB_OUTER;
 	}
 	if (outer_level != NULL) {
-	    // Count the number of outers minus the current one.
+	    // Count the number of outers.
 	    int level = 0;
-	    for (NODE *n = node; n != NULL; n = n->nd_next) {
+	    NODE *n = node;
+	    while (n != NULL && nd_type(n) == NODE_COLON2) {
+		n = n->nd_head;
 		level++;
 	    }
-	    *outer_level = level + 1;
+	    *outer_level = level;
 	}
 	return compile_node(node->nd_head);
     }
@@ -3936,16 +3938,12 @@
 			    = ivars_slots_cache;
 			old_ivars_slots_cache.clear();
 
-			uint64_t old_outer_mask = outer_mask;
-			if (current_outer_level > 0) {
-			    outer_mask <<= current_outer_level;
-			    for (int i = 0; i < current_outer_level; i++) {
-				outer_mask |= (1 << i + 1);
-			    } 
-			}
-			else {
-			    outer_mask <<= 1;
-			}
+			// Increase the outer mask.
+			int old_outer_mask = outer_mask;
+			outer_mask <<= current_outer_level + 1;
+			for (int i = 0; i < current_outer_level; i++) {
+			    outer_mask |= (1 << (i + 1));
+			} 
 
 			DEBUG_LEVEL_INC();
 			Value *val = compile_node(body);
@@ -4861,6 +4859,9 @@
 Function *
 RoxorCompiler::compile_main_function(NODE *node, bool *can_interpret_p)
 {
+    save_compiler_state();
+    reset_compiler_state();
+
     should_interpret = true;
     can_interpret = false;
 
@@ -4871,7 +4872,7 @@
     if (can_interpret_p != NULL) {
 	*can_interpret_p = should_interpret;
     }
-
+    restore_compiler_state();
     return func;
 }
 

Modified: MacRuby/branches/0.9/vm.cpp
===================================================================
--- MacRuby/branches/0.9/vm.cpp	2011-02-24 00:33:59 UTC (rev 5242)
+++ MacRuby/branches/0.9/vm.cpp	2011-02-24 00:35:50 UTC (rev 5243)
@@ -1244,7 +1244,7 @@
 	// the given constant in all modules under the given outer.
 	GET_CORE()->lock();
 	struct rb_vm_outer *o = GET_CORE()->get_outer((Class)outer);
-	uint64_t n = 0;
+	unsigned int n = 0;
 	while (o != NULL && o->klass != (Class)rb_cNSObject) {
 	    // If the current outer isn't in the mask, it means we can use it
 	    // for const lookup. The outer mask is used when performing const
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macruby-changes/attachments/20110223/375f4f56/attachment.html>


More information about the macruby-changes mailing list