[macruby-changes] [2636] MacRuby/trunk
source_changes at macosforge.org
source_changes at macosforge.org
Fri Sep 25 11:32:25 PDT 2009
Revision: 2636
http://trac.macosforge.org/projects/ruby/changeset/2636
Author: lsansonetti at apple.com
Date: 2009-09-25 11:32:24 -0700 (Fri, 25 Sep 2009)
Log Message:
-----------
remove code that was using the LLVM interpreter
Modified Paths:
--------------
MacRuby/trunk/vm.cpp
MacRuby/trunk/vm.h
Modified: MacRuby/trunk/vm.cpp
===================================================================
--- MacRuby/trunk/vm.cpp 2009-09-25 10:03:37 UTC (rev 2635)
+++ MacRuby/trunk/vm.cpp 2009-09-25 18:32:24 UTC (rev 2636)
@@ -177,20 +177,6 @@
}
};
-#define FROM_GV(gv,t) ((t)(gv.IntVal.getZExtValue()))
-static GenericValue
-value2gv(VALUE v)
-{
- GenericValue GV;
-#if __LP64__
- GV.IntVal = APInt(64, v);
-#else
- GV.IntVal = APInt(32, v);
-#endif
- return GV;
-}
-#define VALUE_TO_GV(v) (value2gv((VALUE)v))
-
extern "C" void *__cxa_allocate_exception(size_t);
extern "C" void __cxa_throw(void *, void *, void (*)(void *));
@@ -213,7 +199,7 @@
bs_parser = NULL;
- //llvm_start_multithreaded();
+ llvm_start_multithreaded();
emp = new ExistingModuleProvider(RoxorCompiler::module);
jmm = new RoxorJITManager;
@@ -243,14 +229,6 @@
// Eliminate tail calls.
fpm->add(createTailCallEliminationPass());
-#if USE_LLVM_INTERPRETER
- iee = ExecutionEngine::create(emp, true, &err);
- if (iee == NULL) {
- fprintf(stderr, "error while creating Interpreter: %s\n", err.c_str());
- abort();
- }
-#endif
-
#if ROXOR_VM_DEBUG
functions_compiled = 0;
#endif
@@ -423,17 +401,6 @@
return imp;
}
-#if USE_LLVM_INTERPRETER
-VALUE
-RoxorCore::interpret(Function *func)
-{
- std::vector<GenericValue> args;
- args.push_back(PTOGV((void *)GET_VM()->get_current_top_object()));
- args.push_back(PTOGV(NULL));
- return (VALUE)iee->runFunction(func, args).IntVal.getZExtValue();
-}
-#endif
-
bool
RoxorCore::symbolize_call_address(void *addr, void **startp, char *path,
size_t path_len, unsigned long *ln, char *name, size_t name_len)
@@ -1134,22 +1101,6 @@
}
extern "C"
-GenericValue
-lle_X_rb_vm_define_class(const FunctionType *FT,
- const std::vector<GenericValue> &Args)
-{
- assert(Args.size() == 4);
-
- return VALUE_TO_GV(
- rb_vm_define_class(
- FROM_GV(Args[0], ID),
- FROM_GV(Args[1], VALUE),
- FROM_GV(Args[2], VALUE),
- FROM_GV(Args[3], int),
- FROM_GV(Args[3], unsigned char)));
-}
-
-extern "C"
VALUE
rb_vm_ivar_get(VALUE obj, ID name, int *slot_cache)
{
@@ -1854,27 +1805,7 @@
GET_CORE()->get_methods(ary, (Class)mod, include_objc_methods, filter);
}
-#if 0
extern "C"
-GenericValue
-lle_X_rb_vm_prepare_method(const FunctionType *FT,
- const std::vector<GenericValue> &Args)
-{
- assert(Args.size() == 4);
-
- rb_vm_prepare_method(
- FROM_GV(Args[0], Class),
- (SEL)GVTOP(Args[1]),
- (Function *)GVTOP(Args[2]),
- (NODE *)GVTOP(Args[3]));
-
- GenericValue GV;
- GV.IntVal = 0;
- return GV;
-}
-#endif
-
-extern "C"
void
rb_vm_copy_methods(Class from_class, Class to_class)
{
@@ -4833,15 +4764,6 @@
vm->pop_current_binding(false);
}
-#if USE_LLVM_INTERPRETER
- if (inside_eval) {
- return GET_CORE()->interpret(function);
- }
- else {
- IMP imp = GET_CORE()->compile(function);
- return ((VALUE(*)(VALUE, SEL))imp)(vm->get_current_top_object(), 0);
- }
-#else
IMP imp = GET_CORE()->compile(function);
// For symbolication.
@@ -4852,7 +4774,6 @@
mnode->flags = 0;
return ((VALUE(*)(VALUE, SEL))imp)(vm->get_current_top_object(), 0);
-#endif
}
extern "C"
Modified: MacRuby/trunk/vm.h
===================================================================
--- MacRuby/trunk/vm.h 2009-09-25 10:03:37 UTC (rev 2635)
+++ MacRuby/trunk/vm.h 2009-09-25 18:32:24 UTC (rev 2636)
@@ -522,10 +522,6 @@
READER(name, type) \
WRITER(name, type)
-// Flip this switch to enable LLVM Interpreter. Note that this is still under
-// development.
-#define USE_LLVM_INTERPRETER 0
-
// The Core class is a singleton, it's only created once and it's used by the
// VMs. All calls to the Core are thread-safe, they acquire a shared lock.
class RoxorCore {
@@ -537,9 +533,6 @@
ExistingModuleProvider *emp;
RoxorJITManager *jmm;
ExecutionEngine *ee;
-#if USE_LLVM_INTERPRETER
- ExecutionEngine *iee;
-#endif
FunctionPassManager *fpm;
// Running threads.
@@ -628,9 +621,6 @@
void optimize(Function *func);
IMP compile(Function *func);
-#if USE_LLVM_INTERPRETER
- VALUE interpret(Function *func);
-#endif
void load_bridge_support(const char *path, const char *framework_path,
int options);
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macruby-changes/attachments/20090925/3249708d/attachment.html>
More information about the macruby-changes
mailing list