[macruby-changes] [4141] MacRuby/trunk

source_changes at macosforge.org source_changes at macosforge.org
Mon May 24 16:35:14 PDT 2010


Revision: 4141
          http://trac.macosforge.org/projects/ruby/changeset/4141
Author:   lsansonetti at apple.com
Date:     2010-05-24 16:35:12 -0700 (Mon, 24 May 2010)
Log Message:
-----------
some fixes for bleeding-edge adventurers

Modified Paths:
--------------
    MacRuby/trunk/gc.c
    MacRuby/trunk/include/ruby/ruby.h
    MacRuby/trunk/vm.cpp

Modified: MacRuby/trunk/gc.c
===================================================================
--- MacRuby/trunk/gc.c	2010-05-24 08:41:48 UTC (rev 4140)
+++ MacRuby/trunk/gc.c	2010-05-24 23:35:12 UTC (rev 4141)
@@ -259,7 +259,7 @@
 VALUE rb_mGC;
 
 void
-rb_gc_assign_weak_ref(const void *value, void *const*location)
+rb_gc_assign_weak_ref(const void *value, const void **location)
 {
     auto_assign_weak_reference(__auto_zone, value, location, NULL);
 }

Modified: MacRuby/trunk/include/ruby/ruby.h
===================================================================
--- MacRuby/trunk/include/ruby/ruby.h	2010-05-24 08:41:48 UTC (rev 4140)
+++ MacRuby/trunk/include/ruby/ruby.h	2010-05-24 23:35:12 UTC (rev 4141)
@@ -1117,6 +1117,9 @@
 }
 #define GC_RELEASE(obj) (rb_objc_release((void *)obj))
 
+void *rb_gc_read_weak_ref(void **referrer);
+void rb_gc_assign_weak_ref(const void *value, const void **location);
+
 #if RUBY_INCLUDED_AS_FRAMEWORK
 #include <MacRuby/ruby/missing.h>
 #include <MacRuby/ruby/intern.h>

Modified: MacRuby/trunk/vm.cpp
===================================================================
--- MacRuby/trunk/vm.cpp	2010-05-24 08:41:48 UTC (rev 4140)
+++ MacRuby/trunk/vm.cpp	2010-05-24 23:35:12 UTC (rev 4141)
@@ -267,9 +267,8 @@
 	    std::string path;
 	    for (std::vector<EmittedFunctionDetails::LineStart>::const_iterator iter = Details.LineStarts.begin(); iter != Details.LineStarts.end(); ++iter) {
 #if LLVM_TOT
-		//MDNode *scope = iter->Loc.getScope(F.getContext());
-		//DILocation dil = DILocation(scope);
-		DILocation dil = Details.MF->getDILocation(iter->Loc);
+		MDNode *scope = iter->Loc.getAsMDNode(F.getContext());
+		DILocation dil = DILocation(scope);
 		if (path.size() == 0) {
 		    DIScope scope = dil.getScope();
 		    path.append(scope.getDirectory());
@@ -2777,14 +2776,6 @@
     return rb_proc_get_block(proc);
 }
 
-extern "C"
-void*
-rb_gc_read_weak_ref(void **referrer);
-
-extern "C"
-void
-rb_gc_assign_weak_ref(const void *value, void *const*location);
-
 static const int VM_LVAR_USES_SIZE = 8;
 enum {
     VM_LVAR_USE_TYPE_BLOCK   = 1,
@@ -2816,7 +2807,7 @@
     }
 
     const int current_index = (*var_uses)->uses_count;
-    rb_gc_assign_weak_ref(use, &(*var_uses)->uses[current_index]);
+    rb_gc_assign_weak_ref(use, (const void **)&(*var_uses)->uses[current_index]);
     (*var_uses)->use_types[current_index] = use_type;
     ++(*var_uses)->uses_count;
 }
@@ -2927,7 +2918,7 @@
 		}
 
 		// indicate to the GC that we do not have a reference here anymore
-		rb_gc_assign_weak_ref(NULL, &current->uses[use_index]);
+		rb_gc_assign_weak_ref(NULL, (const void **)&current->uses[use_index]);
 	    }
 	}
 	void *old_current = current;
@@ -4633,10 +4624,19 @@
     kernel_end = kernel_beg + kernel_i386_bc_len - 1;
 #endif
 
+#if LLVM_TOT
+    MemoryBuffer *mbuf = MemoryBuffer::getMemBuffer(StringRef(kernel_beg,
+		kernel_end - kernel_beg));
+#else
     MemoryBuffer *mbuf = MemoryBuffer::getMemBuffer(kernel_beg, kernel_end);
+#endif
     assert(mbuf != NULL);
-    RoxorCompiler::module = ParseBitcodeFile(mbuf, getGlobalContext());
+    std::string err;
+    RoxorCompiler::module = ParseBitcodeFile(mbuf, getGlobalContext(), &err);
     delete mbuf;
+    if (RoxorCompiler::module == NULL) {
+	printf("kernel bitcode couldn't be read: %s\n", err.c_str());
+    }
     assert(RoxorCompiler::module != NULL);
 
     RoxorCompiler::module->setTargetTriple(TARGET_TRIPLE);
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macruby-changes/attachments/20100524/ec6a7dd5/attachment.html>


More information about the macruby-changes mailing list