Skip to content

Commit

Permalink
Showing 92 changed files with 140 additions and 23,975 deletions.
5 changes: 3 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -11,12 +11,13 @@ before_install:
- echo $LANG
- echo $LC_ALL
- if [ $TRAVIS_OS_NAME == linux ]; then ./scripts/llvm.sh; fi
- if [ $TRAVIS_OS_NAME == osx ]; then brew update && brew install llvm35 && brew link --force llvm35; fi
- if [ $TRAVIS_OS_NAME == osx ]; then brew update && brew install llvm; fi
- gem update --system
- gem --version
before_script:
- travis_retry bundle
- ./configure
- if [ $TRAVIS_OS_NAME == linux ]; then travis_retry ./configure --llvm-config=llvm-config-3.6; fi
- if [ $TRAVIS_OS_NAME == osx ]; then travis_retry ./configure; fi
script: rake ci
after_success:
- if [ $TRAVIS_BRANCH == $TRAVIS_TAG ]; then ./scripts/deploy.sh release github website triggers; fi
42 changes: 12 additions & 30 deletions configure
Original file line number Diff line number Diff line change
@@ -58,7 +58,6 @@ class Configure
@gem = nil

# LLVM settings
@llvm_enabled = true
@llvm_path = nil
@llvm_system_name = get_system_name
@llvm_configure = nil
@@ -336,10 +335,6 @@ class Configure

o.doc "\n LLVM settings"

o.on "--disable-llvm", "Don't build with LLVM" do
@llvm_enabled = false
end

o.on "--system-name", "NAME", "Name of OS (eg fedora-8, ubuntu-10.04)" do |name|
@llvm_system_name = name
end
@@ -565,11 +560,6 @@ class Configure
end

def setup_llvm
unless @llvm_enabled
@log.write "WARNING: LLVM disabled."
return false
end

@log.print " Checking for 'llvm-config': "

config = @llvm_configure
@@ -583,8 +573,8 @@ class Configure
if macports?
config = macports_llvm_config
else
out = Bundler.with_clean_env { `brew --prefix llvm35` }.chomp
config = "#{out}/bin/llvm-config-3.5" if $?.success?
out = Bundler.with_clean_env { `brew --prefix llvm` }.chomp
config = "#{out}/bin/llvm-config" if $?.success?
end
end
end
@@ -604,8 +594,8 @@ class Configure
unless failed
parts = version.sub(/svn$/, "").split(".").map { |i| i.to_i }
api_version = ("%d%02d" % parts[0..1]).to_i
if api_version < 300 or api_version > 305
@log.write "only LLVM 3.0-3.5 is supported"
if api_version < 306
@log.write "only LLVM 3.6+ is supported"
else
@log.write "found! (version #{version} - api: #{api_version})"
@llvm = :config
@@ -666,19 +656,16 @@ int main() { LLVMContext &Context = getGlobalContext(); }
def check_llvm_flags
flags = '--ldflags'

if @llvm_api_version >= 305
# Starting with LLVM 3.5 the --system-libs option is required in order to
# link against libraries such as zlib. Prior to 3.5 this was handled by
# --ldflags.
flags << ' --system-libs'
end
@llvm_cxxflags << " -std=c++11"

# Starting with LLVM 3.5 the --system-libs option is required in order to
# link against libraries such as zlib. Prior to 3.5 this was handled by
# --ldflags.
flags << ' --system-libs'

# Generate the actual flags. For whatever reason llvm-config also includes
# newlines in the output, so lets get rid of those while we're at it.
@llvm_ldflags = `#{@llvm_configure} #{flags}`.strip.gsub("\n", ' ')

# We use some C++11 features in the VM source, so we need to enable support.
@llvm_cxxflags << " -std=c++11"
end

def env(which)
@@ -717,7 +704,7 @@ int main() { LLVMContext &Context = getGlobalContext(); }
check_tool_version @cc, '-dumpversion', [4, 1]
check_tool_version @cxx, '-dumpversion', [4, 1]

unless @cc == "clang" and @cxx == "clang++"
unless @cc =~ /clang/ and @cxx =~ /clang\+\+/
@log.deprecated <<-EOM
Support for compilers other than clang/clang++ is deprecated and will be
removed soon. If your platform does not have support for clang/clang++,
@@ -1532,10 +1519,6 @@ int main() { return tgetnum(""); }
def write_configure_files
@log.write "\nWriting configuration files..."

unless @llvm_enabled
@llvm_configure = ""
end

@bin_links.delete @program_name

config_settings = {
@@ -1544,7 +1527,6 @@ int main() { return tgetnum(""); }
:build_make => @make,
:build_rake => @rake,
:build_perl => @perl,
:llvm_enabled => @llvm_enabled,
:llvm_path => @llvm_path,
:llvm_system_name => @llvm_system_name,
:llvm_configure => @llvm_configure,
@@ -2073,7 +2055,7 @@ Available commands are:
# Query MacPorts for the path to the latest installed version of
# llvm-config that is within the range of supported LLVM versions.
def macports_llvm_config
supported_versions = (3.0 .. 3.5)
supported_versions = (3.6..3.9)
installed_ports = `port installed | egrep -o 'llvm-[^ ]+'`.split
latest_usable_port = installed_ports.sort.select do |fname|
version = fname.match(/-\K.*/)[0].to_f
2 changes: 2 additions & 0 deletions core/jit.rb
Original file line number Diff line number Diff line change
@@ -5,6 +5,8 @@ class << self
attr_accessor :enabled
attr_accessor :properties

@enabled = false

alias_method :available?, :available
alias_method :enabled?, :enabled

4 changes: 2 additions & 2 deletions gems_list.txt
Original file line number Diff line number Diff line change
@@ -13,7 +13,7 @@ rubinius-ast-3.6.gem
rubinius-bridge-2.2.gem
rubinius-code-3.0.gem
rubinius-compiler-3.4.gem
rubinius-coverage-2.0.3.gem
rubinius-coverage-2.1.gem
rubinius-debugger-2.4.gem
rubinius-developer_tools-2.0.0.gem
rubinius-instructions-3.0.gem
@@ -31,7 +31,7 @@ rubysl-cgi-session-2.1.0.gem
rubysl-cmath-2.0.0.gem
rubysl-complex-2.0.0.gem
rubysl-continuation-2.0.0.gem
rubysl-coverage-2.0.3.gem
rubysl-coverage-2.1.gem
rubysl-csv-2.0.2.gem
rubysl-curses-2.0.1.gem
rubysl-date-2.0.9.gem
83 changes: 0 additions & 83 deletions library/rubinius/configuration.rb
Original file line number Diff line number Diff line change
@@ -46,85 +46,6 @@
"How many bytes allocated by C extensions til the GC is run"
end

c.section "jit" do |s|
s.vm_variable "dump_code", 0,
"1 == show simple IR, 2 == show optimized IR, 4 == show machine code"

s.section "threshold" do |t|
t.vm_variable "compile", 32000,
"Number of method calls that trigger the JIT compiler"

t.vm_variable "inline", 8000,
"Number of method calls that trigger inlining the method"
end

s.section "limit" do |l|
l.vm_variable "deoptimize", 500,
"Number of times the JIT assumptions are false before a method is deoptimized"

l.vm_variable "overflow", 5000,
"Number of times the inline cache overflows before emitting a send from the JIT to call the method"

l.vm_variable "method_size", 5000,
"The maximum size of a method that will be JIT compiled"

l.vm_variable "search", 5,
"The maximum depth to search for an inlininging target"

l.section "inline" do |i|
i.vm_variable "method", 200,
"The maximum size of a method to be considered for inlining"

i.vm_variable "small", 2000,
"The maximum total inlining budget size for a small method"

i.vm_variable "normal", 3000,
"The maximum total inlining budget for a normal method"

i.vm_variable "large", 5000,
"The maximum total inlining budget for a large method"
end
end

s.vm_variable "show", false,
:as => "jit_show_compiling",
:description => "Print out a status message when the JIT is operating"

s.vm_variable "profile", false,
"The JIT will emit code to be sure JITd methods can be profiled"

s.section "inline" do |i|
i.vm_variable "generic", false, "Have the JIT inline generic methods"

i.vm_variable "blocks", false,
"Have the JIT try to inline methods and their literal blocks"

i.vm_variable "debug", false,
"Have the JIT print out information about inlining"
end

s.vm_variable "log", :string,
"Send JIT debugging output to this file rather than stdout"

s.vm_variable "debug", false,
"Have the JIT print debugging information"

s.vm_variable "sync", false,
"Wait for the JIT to finish compiling each method"

s.vm_variable "uncommon.print", false,
"Print out information on when methods are deoptimized due to uncommon traps"

s.vm_variable "removal.print", false,
"Print out whenever the JIT is removing unused code"

s.vm_variable "check_debugging", false,
"Allow JITd methods to deoptimize if there is a debugging request"

s.vm_variable "type.optz", true,
"Enable optimizations based on type flow"
end

c.section "fiber" do |s|
s.vm_variable "stacks", 10,
"The number of stacks in each Threads stack pool"
@@ -145,10 +66,6 @@
"Lock around using CAPI methods"
end

c.vm_variable "int", true,
:as => "jit_disabled",
:description => "Force the JIT to never turn on"

c.vm_variable "config.print", 0,
:as => "print_config",
:description => "blank or 1 == names and values, 2 == description as well"
12 changes: 2 additions & 10 deletions machine/builtin/block_environment.cpp
Original file line number Diff line number Diff line change
@@ -20,10 +20,6 @@
#include "builtin/tuple.hpp"
#include "builtin/variable_scope.hpp"

#ifdef ENABLE_LLVM
#include "jit/llvm/state.hpp"
#endif

#include <iostream>

namespace rubinius {
@@ -74,11 +70,9 @@ namespace rubinius {

state->vm()->metrics().machine.blocks_invoked++;

#ifdef ENABLE_LLVM
if(executor ptr = mcode->unspecialized) {
return (*((BlockExecutor)ptr))(state, env, args, invocation);
}
#endif

return execute_interpreter(state, env, args, invocation);
}
@@ -389,9 +383,9 @@ namespace rubinius {
return 0;
}

#ifdef ENABLE_LLVM
if(mcode->call_count >= 0) {
if(mcode->call_count >= state->shared().config.jit_threshold_compile) {
// TODO: JIT
if(false /*mcode->call_count >= state->shared().config.jit_threshold_compile*/) {
OnStack<1> os(state, env);

G(jit)->compile_soon(state, env->compiled_code(),
@@ -400,7 +394,6 @@ namespace rubinius {
mcode->call_count++;
}
}
#endif

StackVariables* scope = ALLOCA_STACKVARIABLES(mcode->number_of_locals);

@@ -439,7 +432,6 @@ namespace rubinius {
call_frame->dispatch_data = env;
call_frame->compiled_code = env->compiled_code();
call_frame->scope = scope;
call_frame->optional_jit_data = NULL;
call_frame->top_scope_ = env->top_scope();
call_frame->flags = invocation.flags | CallFrame::cMultipleScopes
| CallFrame::cBlock;
Loading

0 comments on commit 4faa59b

Please sign in to comment.