Add debug.rb for compatibility with MRI/JRuby.
Add more specs for Thread#raise with no arg inside rescue
Make Thread#raise not raise $!

There is 1.8/1.9-specific behaviors when calling Thread#raise with no arguments
inside a rescue clause and the called thread is also inside a rescue clause.

First of all, Thread#raise doesn't use the exception in the calling thread. In
other words, Thread#raise doesn't use $!, only Kernel#raise does.

In 1.8, the raised exception is the exception in the called thread.

In 1.9, it is always a RuntimeError.
Remove passing tags
Move directory parameters evaluation out of option parsing.

Move the logic into #set_filesystem_paths, since there is not
enough information to correctly evaluate the parameters earlier.
Don't modify paths if --preserve-prefix option is used.

All compilation output goes into staging directory in this case. There
is no reason to check if there is some colision with some existing
directories in this case.
Don't crash when no prefix is specified.
Merge pull request #1946 from voxik/fix-preserve-prefix-expansion

Fix --preserve-prefix expansion
Merge pull request #1944 from postmodern/debug

Add debug.rb for compatibility with MRI/JRuby.
Always emit code for pushing a block in the JIT

There are situations where we create incorrect code before this fix.

Imagine the following code:

def x
  y do
    true
  end
end

def y
  z { yield }
end

def z
  yield
end

Now if in this case we decide to compile 'x', we can inline y into x and
z into y. The problem occurs when we try to inline z but we can't due to
it being too complex, or when it blows the inline budget. In that case
the block hasn't been pushed so z will raise a NoJumpError because it
can't find the block.

In the future we need to make the JIT logic here smarter. We need to
keep track of whether we end up using the block in the whole chain down
when we compile a method and if we don't end up using the block, we can
remove the code for pushing it.

Fixes #1940
Fix race condition when shutting down

When we request an auxilary thread to shutdown, maybe another thread is
still waiting to do GC. Therefore we need to guard here so we don't
deadlock when somebody requested a GC but we're also shutting down.

Related to #1952
Fix the specs for rb_enc_associate_index

The index values are only valid if they are also retrieved properly. The
integer values don't cary any meaning themselves and therefore cannot be
used directly in the specs.
Add specs for rb_enc_get_index
rb_enc_get_index returns -1 for the encoding for non symbol immediates
rb_str_new creates ASCII-8BIT strings in 1.9 mode
Add tags for failing C-API specs
Add tags for 2.0 mode
Fix local storage and retrieval for inactive fibers

When a variable scope is allocated on a fiber, we need to use the
displacement so we find the proper location of the locals. When the
fiber is active, the displacement is 0, but if it's inactive, it will
not be zero. So we need to handle that case so we can properly find the
correct memory location.
Improve thread debugging information
Update the thread id and lock count after setting inflated header

Before we first were setting the thread id and lock count before
updating the inflated header with the current header word. This results
in actually loosing one count, because the header word still has the old
count, but the passed in count parameter is already increased by one.

This would cause an error for the last recursive unlock if we do
recursive locking so often that we need to inflate the header.