[macruby-changes] [4209] MacRuby/trunk
source_changes at macosforge.org
source_changes at macosforge.org
Fri Jun 4 22:09:23 PDT 2010
Revision: 4209
http://trac.macosforge.org/projects/ruby/changeset/4209
Author: lsansonetti at apple.com
Date: 2010-06-04 22:09:21 -0700 (Fri, 04 Jun 2010)
Log Message:
-----------
enable kernel inlining if optz level is 3 (temporary)
Modified Paths:
--------------
MacRuby/trunk/HACKING.rdoc
MacRuby/trunk/compiler.cpp
MacRuby/trunk/vm.cpp
MacRuby/trunk/vm.h
Modified: MacRuby/trunk/HACKING.rdoc
===================================================================
--- MacRuby/trunk/HACKING.rdoc 2010-06-05 04:14:46 UTC (rev 4208)
+++ MacRuby/trunk/HACKING.rdoc 2010-06-05 05:09:21 UTC (rev 4209)
@@ -127,8 +127,6 @@
* VM_OPT_LEVEL: set it either to 0, 1, 2 or 3 to change the optimization level
of the LLVM code generator.
-* VM_DISABLE_INLINING: set it to any value to disable function inlining.
-
* DYLD_LIBRARY_PATH: in case you are debugging a Cocoa application, set this
variable to "." before starting gdb, and you won't have to re-install MacRuby
every time you re-compile it.
Modified: MacRuby/trunk/compiler.cpp
===================================================================
--- MacRuby/trunk/compiler.cpp 2010-06-05 04:14:46 UTC (rev 4208)
+++ MacRuby/trunk/compiler.cpp 2010-06-05 05:09:21 UTC (rev 4209)
@@ -6302,16 +6302,6 @@
rescue_invoke_bb = old_rescue_invoke_bb;
#endif
-#if 0 // XXX
- if (ruby_func != NULL) {
- // Now that the function is finished, we can inline the Ruby method.
- if (CallInst::classof(ruby_call_insn)) {
- CallInst *insn = cast<CallInst>(ruby_call_insn);
- InlineFunction(insn);
- }
- }
-#endif
-
return f;
}
Modified: MacRuby/trunk/vm.cpp
===================================================================
--- MacRuby/trunk/vm.cpp 2010-06-05 04:14:46 UTC (rev 4208)
+++ MacRuby/trunk/vm.cpp 2010-06-05 05:09:21 UTC (rev 4209)
@@ -302,7 +302,6 @@
{
running = false;
abort_on_exception = false;
- inlining_enabled = false; //XXX getenv("VM_DISABLE_INLINING") == NULL;
pthread_assert(pthread_mutex_init(&gl, 0));
@@ -328,6 +327,8 @@
InitializeNativeTarget();
CodeGenOpt::Level opt = CodeGenOpt::Default;
+ inlining_enabled = false;
+ optims_enabled = true;
const char *env_str = getenv("VM_OPT_LEVEL");
if (env_str != NULL) {
const int tmp = atoi(env_str);
@@ -335,6 +336,7 @@
switch (tmp) {
case 0:
opt = CodeGenOpt::None;
+ optims_enabled = false;
break;
case 1:
opt = CodeGenOpt::Less;
@@ -344,6 +346,7 @@
break;
case 3:
opt = CodeGenOpt::Aggressive;
+ inlining_enabled = true;
break;
}
}
@@ -536,7 +539,9 @@
if (inlining_enabled) {
RoxorCompiler::shared->inline_function_calls(func);
}
- fpm->run(*func);
+ if (optims_enabled) {
+ fpm->run(*func);
+ }
}
extern "C"
Modified: MacRuby/trunk/vm.h
===================================================================
--- MacRuby/trunk/vm.h 2010-06-05 04:14:46 UTC (rev 4208)
+++ MacRuby/trunk/vm.h 2010-06-05 05:09:21 UTC (rev 4209)
@@ -668,6 +668,7 @@
// State.
bool inlining_enabled;
+ bool optims_enabled;
bool running;
bool abort_on_exception;
VALUE loaded_features;
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macruby-changes/attachments/20100604/ae13ac18/attachment.html>
More information about the macruby-changes
mailing list