Add encoding specs for String#gsub
Encoding fix for String#gsub

Evaluates now, which encoding should be used while merging strings.
Throws an error, if no compatible encoding could be found.
Add encoding specs for String#gsub!
Encoding fix for String#gsub!

Evaluates now, which encoding should be used while merging strings.
Throws an error, if no compatible encoding could be found.
Use num_bytes setting instead because it resets char size
Add support in the jit for instance variables in VM objects

Before this was following the slow path, even though we can staticly
compute the offsets and write these values directly. This change adds
support for that, so it makes for example setting @shared in a String
much faster.
Replace usage of new_struct with new_object

The only difference between these two is that new_struct allowed for an
optional size. This optional argument was never used, so it was
equivalent to new_object. Therefore we can clean this up.
Allow allocating dirty objects

In various places we don't have to clear the entire object, for example
because it will be cleared for bytearray's with zeroes anyway, or when
an object copy is immediately created. This allows for allocation
methods that give back these dirty objects to prevent having to set data
twice.
Improve test descriptions
Remove not necessary comparisons
Merge pull request #2106 from Stormwind/gsub-fix

Fix for encoding problems with String#gsub and String#gsub!
Add failing spec for Fixnum#public_methods
Override public_singleton_methods in ImmediateValue

This fixes an issue where calling public_methods on a Fixnum would call
Kernel#public_singleton_methods and raise a TypeError.
Merge pull request #2107 from rf-/fixnum_public_methods

Fixnum#public_methods raises TypeError
Add spec for String#slice with invalid encoded strings
Treat invalid characters as single byte for length
Unshare string when modified
Add specs to Range#max and Range#min

The one that fails under 1.9 mode is "(5..5).max.should equal(5)".
Fix Range#max behavior in 1.9 mode

This rolls back a change made in 04c2c40d. If a range is inclusive and
the start and end points are the same, Range#max should return the
endpoint, not nil.
Merge pull request #2109 from rf-/fix_range_max

Fix Range#max behavior in 1.9 mode with inclusive ranges