Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

added libyaml as a build requirement #1860

Closed
wants to merge 138 commits into
from

Conversation

Projects
None yet
Contributor

Gibheer commented Aug 14, 2012

This will add libyaml as a build requirement to the documentation.

ryoqun and others added some commits Jul 5, 2012

Make Proc::from_env reset klass if appropriate
Make Proc::from_env duplicate a passed object (env) and reset its klass if the
receiver class is different from env's class to support following code:

    class MyProc < Proc
    end
    MyProc.new(&proc) # => should return an instance of MyProc

By this modification, we shoudn't use the Proc::from_env to assign a block
to a method parameter like this:

    def each(&block)
      # ...
    end

Instead, we should use the original Proc::from_env. The reason is that when a
sub-classed proc instance is passed to such a method, the proc would
unnecessarily be converted to a Proc by the modified Proc::from_env.
Support splat in operator assignment. Fixes #1798.
To support splats in operator assignments (e.g. array[*args] += 3), this commit
changes to use ActualArguments in OpAssign1 from custom index bytecode
generation.
Added spec for Struct with hyphenated attributes
Because Struct._specialize (delta) does not check
attribute names, there are a number of names that
could lead to syntactically correct code generated
by _specialize that will raise runtime errors.

See #1811
Support non-tIVAR attribute names in Struct._specialize
Check attribute names before code generation in order
to distinguish between names that are valid tIVAR tokens
and can therefore be written as direct instance variables
and names which cannot. Use instance_variable_(get|set)
for other names instead.

Fixes #1811
Fix #inspect, #to_s, and #message for ArgumentError
Define #to_s rather than #message so the custom behaviour gets used by
Exception#inspect which calls #to_s. Properly handle the case where there is
neither a normal exception message nor a @given/@expected/@method_name message
from Exception::make_argument_error by calling super.
Don't try to use info since it's not allocated anymore
This was causing segfaults in certain conditions because info was
allocated on the stack, but already popped off but still referred to as
the root in the jit context.
Array#sample implementation
Add new implementation for ruby 1.9
Move old implemntation to array18.rb
Array#shuffle and Array#shuffle! implementation
Add specs and implementation for ruby 1.9
Don't execute sudo during build.
There are systems that don't have sudo and there are people
that believe executing sudo without the user's permission is
rude. For example, a user may have run a sudo command for
something else and then the sudo in the rbx build will run
without prompting for permission.

For these reasons, it's better to just let the user handle
the situation explicitly.
Allow RUBYLIB to be set, but issue a huge warning.
It's possible the user has a really good reason for setting RUBYLIB. In this
case, we shouldn't force an exit. Unknowing users will get a warning, which
they can choose to heed. At least errors from RUBYLIB being set won't be as
hidden as before we added the check.
No need to switch on language state here
Since on 1.8 mode strings don't have an encoding anyway, it will
fallback to the logic for strings without encoding which means that it
will be byte based.
Fix MatchData handling of multibyte strings
We only convert to character offsets at the end. This allows for us to
keep using byte offsets internally, which is better performance wise
since we don't have to convert back and forth to character indexes all
the time.

Fixes #1805
Patch for incorrect handling of arguments by method object
Ruby 1.8:
When argument is array in array ([ [1] ]) we can pass whole array.
Because Rubinius will execute method with one argument /method(1)/. Another
situation is when the array has more than one element ([ [1, 2]
]). In this case Rubinius will execute method with /method([1, 2])/
instead of /method(1, 2)/.

[ [1] ] # => method([1])
[ [1, 2] ] # => method(1, 2)

Ruby 1.9:
Rubinius always execute method with one argument.

[ [1] ] # => method([1])
[ [1, 2] ] # => method([1,2])

Fixes #1833

dbussink and others added some commits Jul 30, 2012

ruby 1.9: File.expand_path returns a string in the default external e…
…nconding

Ensure File.expand_path returns a string in the default external
encoding.
Extend File.expand_path spec
Ensure File.expand_path raises a Encoding::CompatibilityError when
the encoding of the string containing the path is not compatible with the
external one.
Make CodeLoader more robust.
We shouldn't fail if for some reason the compilation cache disappears
on use or is otherwise unavailable. We just recompile.
Remove incompatible lib/missing.rb
lib/missing.rb doesn't exist in MRI. So following code succeeds on Rubinius,
but not on MRI. This is an incompatible behavior.

  require "missing"

This is found by the following actual code on the wild.

  https://github.com/cookpad/chanko/blob/v1.0.6/spec/lib/updating_load_spec.rb#L12
Use a consistent type for code size
If we just read it as a size_t* we can read additional garbage so
define it as a size_t in the first place.
Cache the default_external and default_internal encoding
This happens quite a lot, especially since 27e43a6 which caused CI runs
for 1.9 mode to run at least 30 seconds longer on my system locally. We
use undefined here as the default value and as the marker to reset the
value, since nil can be a valid value here and in that case we don't
want to look it up each time either.

The ontology change was needed, because otherwise undefined was not the
correct value yet when the encodings were initialized.
Use consistent PrimitiveFailure exception messages.
Primitives can fail at any time, even during VM boot where the backtrace can
be primitive or possibly missing. The following format of the PrimitiveFailure
exception message provides all necessary information to index directly to the
Ruby method and then to the primitive implementation:

  "[module scope]::class_name[.#]method_name primitive failed"

This is the minimum required exception message. If there exists only a single
possible cause of failure, that can be appended to, but does not replace,
the basic exception message.
Add polymorphic call site caches with up to 3 entries
Instead of keeping on the most recent call cached, we keep the last
three that have happened. In case of overflow it always updates the
latest entry. In the future we would want a smarter eviction algorithm
to handle this.
Make sure to return after setting the entry
We were filling all the entries with a pointer to the exact same method
cache entry which is of course not very smart and actually defeats the
fact that the jit can optimize this properly.
Remove seen_classes since same functionality is already provided
The multiple method cache entries already provide the same information.
Since we already track those, we can remove the seen_classes since it
basically just duplicates functionality.
Add fallback to send after a configurable number of overflows
If the inline cache overflows too often, we don't use uncommon exit
anymore, but fallback to a regular send. This helps performance for
megamorphic call sites that keep seeing new types and are best off when
falling back to a regular method send.
Ensure we're seeing an actual class here to prevent race condition
It can happen that the inline cache changed since we got the request to
JIT it. Therefore guard that we're actually seeing a proper class here
so we fallback to regular sends in that case.
Remove outdated tags for singleton class
Remove singleton class tags outdated by renaming in the following commit:

  31f5cbe
  Rename and cleanup the singleton classspec
Fixed Encoding.find performance issue.
In 47f6c18, we changed the encoding map and now store the key
as an upcased symbol, so lookup is very fast.

@Gibheer Gibheer closed this Aug 14, 2012

Contributor

Gibheer commented Aug 14, 2012

Something went very wrong with this, sorry

This pull request fails (merged ae959d4 into 49fcc23).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment