Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: jruby/jruby
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: e8ee76309f9a
Choose a base ref
...
head repository: jruby/jruby
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: dfb56fe5cc4b
Choose a head ref
  • 10 commits
  • 10 files changed
  • 1 contributor

Commits on Mar 29, 2016

  1. Copy the full SHA
    dacfc92 View commit details
  2. Copy the full SHA
    91beaa5 View commit details
  3. Copy the full SHA
    113f6ed View commit details
  4. Copy the full SHA
    0c5667e View commit details
  5. [Truffle] formatting

    pitr-ch committed Mar 29, 2016
    Copy the full SHA
    630c9a9 View commit details
  6. [Truffle] update AS excludes

    pitr-ch committed Mar 29, 2016
    Copy the full SHA
    482198f View commit details
  7. 2
    Copy the full SHA
    ad44636 View commit details
  8. Copy the full SHA
    44da0ee View commit details
  9. [Truffle] Code formatting

    pitr-ch committed Mar 29, 2016
    Copy the full SHA
    7859644 View commit details
  10. Copy the full SHA
    dfb56fe View commit details
Original file line number Diff line number Diff line change
@@ -42,8 +42,7 @@
# mock method_source gem
method_source.rb: nil
exclude_tests.rb: |
crashes = {
FileStoreTest: :test_two_classes_autoloading,
silences_io = {
KernelTest: [:test_silence_stream,
:test_quietly,
:test_capture] }
@@ -60,16 +59,13 @@
StringInflectionsTest: [:test_string_parameterized_no_separator,
:test_string_parameterized_normal,
:test_string_parameterized_underscore,
:test_titleize],
TimeExtCalculationsTest: [:test_seconds_since_midnight_at_daylight_savings_time_end,
:test_seconds_until_end_of_day_at_daylight_savings_time_end],
TimeWithZoneTest: [:test_no_method_error_has_proper_context] }
:test_titleize] }
undefine = if ENV['CI']
crashes.merge(failures)
silences_io.merge(failures)
else
crashes
silences_io
end
undefine.each do |mod_name, tests|
5 changes: 0 additions & 5 deletions spec/truffle/tags/core/marshal/load_tags.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
fails:Marshal.load returns the value of the proc when called with a proc
fails:Marshal.load calls the proc for recursively visited data
fails:Marshal.load loads an array containing objects having _dump method, and with proc
fails:Marshal.load loads an array containing objects having marshal_dump method, and with proc
fails:Marshal.load loads an Array with proc
fails:Marshal.load loads a Random
fails:Marshal.load for an Array loads an array containing the same objects
fails:Marshal.load for an Exception loads a marshalled exception with no message
@@ -12,9 +9,7 @@ fails:Marshal.load for a user Class raises ArgumentError if the object from an '
fails:Marshal.load for a user Class that extends a core type other than Object or BasicObject raises ArgumentError if the resulting class does not extend the same type
fails:Marshal.load for a wrapped C pointer loads
fails:Marshal.load for a wrapped C pointer raises ArgumentError when the local class is a regular object
fails:Marshal.load when a class with the same name as the dumped one exists outside the namespace invokes Module#const_missing
fails:Marshal.load when called with a proc returns the value of the proc
fails:Marshal.load when called with a proc calls the proc for recursively visited data
fails:Marshal.load when called with a proc loads an Array with proc
fails:Marshal.load for a Hash loads an extended hash object containing a user-marshaled object
fails:Marshal.load when a class does not exist in the namespace raises an ArgumentError
4 changes: 0 additions & 4 deletions spec/truffle/tags/core/time/local_tags.txt

This file was deleted.

4 changes: 0 additions & 4 deletions spec/truffle/tags/core/time/mktime_tags.txt

This file was deleted.

3 changes: 0 additions & 3 deletions spec/truffle/tags/core/time/new_tags.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
fails:Time.new with a utc_offset argument disallows a value for minutes greater than 59
fails:Time.new timezone changes correctly adjusts the timezone change to 'EET' on 'Europe/Istanbul'
fails:Time.new timezone changes correctly adjusts the timezone change to 'CEST' on 'Europe/Amsterdam'
fails(Joda Time behavior):Time.new respects rare old timezones
fails:Time.new with a utc_offset argument returns a Time with a UTC offset of the specified number of Rational seconds
fails:Time.new with a utc_offset argument with an argument that responds to #to_r coerces using #to_r
1 change: 0 additions & 1 deletion spec/truffle/tags/core/time/zone_tags.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
fails:Time#zone Encoding.default_internal is set returns the string with the default internal encoding
fails:Time#zone Encoding.default_internal is set returns an ASCII string
5 changes: 3 additions & 2 deletions tool/jt.rb
Original file line number Diff line number Diff line change
@@ -409,8 +409,9 @@ def test(*args)
when nil
test_tck
test_specs('run')
test_mri
test_integration
# test_mri # TODO (pitr-ch 29-Mar-2016): temporarily disabled
test_integration('all')
test_compiler
when 'compiler' then test_compiler(*rest)
when 'integration' then test_integration(*rest)
when 'specs' then test_specs('run', *rest)
23 changes: 14 additions & 9 deletions truffle/src/main/java/org/jruby/truffle/core/CoreLibrary.java
Original file line number Diff line number Diff line change
@@ -729,7 +729,7 @@ private void initializeSignalConstants() {
int i = 0;
for (Map.Entry<String, Integer> signal : SignalManager.SIGNALS_LIST.entrySet()) {
DynamicObject signalName = StringOperations.createString(context, StringOperations.encodeRope(signal.getKey(), UTF8Encoding.INSTANCE));
Object[] objects = new Object[]{signalName, signal.getValue()};
Object[] objects = new Object[]{ signalName, signal.getValue() };
signals[i++] = Layouts.ARRAY.createArray(Layouts.CLASS.getInstanceFactory(arrayClass), objects, objects.length);
}

@@ -1258,12 +1258,13 @@ public DynamicObject noSuperMethodError(String name, Node currentNode) {

public DynamicObject noMethodErrorOnReceiver(String name, Object receiver, Node currentNode) {
CompilerAsserts.neverPartOfCompilation();
DynamicObject logicalClass = getLogicalClass(receiver);
String repr = Layouts.MODULE.getFields(logicalClass).getName();
if (RubyGuards.isRubyModule(receiver)) {
repr = Layouts.MODULE.getFields(((DynamicObject) receiver)).getName() + ":" + repr;
}
return noMethodError(String.format("undefined method `%s' for %s", name, repr), name, currentNode);
final DynamicObject logicalClass = getLogicalClass(receiver);
final String moduleName = Layouts.MODULE.getFields(logicalClass).getName();

// Do not call to_s on BasicObject
final Object to_s = getContext().getCodeLoader().inline(currentNode, "o.to_s if c.instance_methods.include?(:to_s)", "o", receiver, "c", logicalClass);

return noMethodError(String.format("undefined method `%s' for %s:%s", name, to_s, moduleName), name, currentNode);
}

public DynamicObject privateMethodError(String name, Object self, Node currentNode) {
@@ -1463,7 +1464,9 @@ public DynamicObject getHashClass() {
return hashClass;
}

public DynamicObject getStandardErrorClass() { return standardErrorClass; }
public DynamicObject getStandardErrorClass() {
return standardErrorClass;
}

public DynamicObject getLoadErrorClass() {
return loadErrorClass;
@@ -1537,7 +1540,9 @@ public DynamicObject getTimeClass() {
return timeClass;
}

public DynamicObject getTypeErrorClass() { return typeErrorClass; }
public DynamicObject getTypeErrorClass() {
return typeErrorClass;
}

public DynamicObject getTrueClass() {
return trueClass;
Original file line number Diff line number Diff line change
@@ -301,11 +301,11 @@ private DynamicObject buildTime(DynamicObject timeClass, int sec, int min, int h
DateTime dt = new DateTime(year, 1, 1, 0, 0, 0, 0, DateTimeZone.UTC);

dt = dt.plusMonths(month - 1)
.plusDays(mday - 1)
.plusHours(hour)
.plusMinutes(min)
.plusSeconds(sec)
.plusMillis( nsec / 1_000_000 );
.plusDays(mday - 1)
.plusHours(hour)
.plusMinutes(min)
.plusSeconds(sec)
.plusMillis(nsec / 1_000_000);

final DateTimeZone zone;
final boolean relativeOffset;
@@ -317,7 +317,7 @@ private DynamicObject buildTime(DynamicObject timeClass, int sec, int min, int h
} else if (utcoffset == nil()) {
zone = TimeZoneParser.parse(this, StringOperations.getString(getContext(), envZon));
// TODO BJF 16-Feb-2016 verify which zone the following date time should be in
final String zoneName = TimeZoneParser.getShortZoneName( dt.withZoneRetainFields(zone), zone);
final String zoneName = TimeZoneParser.getShortZoneName(dt.withZoneRetainFields(zone), zone);
zoneToStore = createString(StringOperations.encodeRope(zoneName, UTF8Encoding.INSTANCE));
relativeOffset = false;
} else if (utcoffset instanceof Integer) {
@@ -339,25 +339,15 @@ private DynamicObject buildTime(DynamicObject timeClass, int sec, int min, int h

dt = dt.withZoneRetainFields(zone);

// Following if block copied over from RubyTime.java createTime method
// If we're at a DST boundary, we need to choose the correct side of the boundary
if (isdst != -1) {
final DateTime beforeDstBoundary = dt.withEarlierOffsetAtOverlap();
final DateTime afterDstBoundary = dt.withLaterOffsetAtOverlap();

final int offsetBeforeBoundary = zone.getOffset(beforeDstBoundary);
final int offsetAfterBoundary = zone.getOffset(afterDstBoundary);

// If the time is during DST, we need to pick the time with the highest offset
dt = offsetBeforeBoundary > offsetAfterBoundary ? beforeDstBoundary : afterDstBoundary;
if (isdst == 0) {
dt = dt.withLaterOffsetAtOverlap();
}

if (isdst == -1) {
return allocateObjectNode.allocate(timeClass, dt, nsec % 1_000_000, zoneToStore, utcoffset, relativeOffset, fromutc);
} else {
// TODO (pitr 26-Nov-2015): is this correct to create the DateTime without isdst application?
return allocateObjectNode.allocate(timeClass, dt, nsec % 1_000_000, zoneToStore, utcoffset, relativeOffset, fromutc);
if (isdst == 1) {
dt = dt.withEarlierOffsetAtOverlap();
}

return allocateObjectNode.allocate(timeClass, dt, nsec % 1_000_000, zoneToStore, utcoffset, relativeOffset, fromutc);
}

private static int cast(Object value) {
14 changes: 9 additions & 5 deletions truffle/src/main/ruby/core/rubinius/common/marshal.rb
Original file line number Diff line number Diff line change
@@ -471,11 +471,15 @@ def const_lookup(name, type = nil)

parts = String(name).split '::'
parts.each do |part|
unless Rubinius::Type.const_exists?(mod, part)
raise ArgumentError, "undefined class/module #{name}"
end

mod = Rubinius::Type.const_get(mod, part, false)
mod = if Rubinius::Type.const_exists?(mod, part)
Rubinius::Type.const_get(mod, part, false)
else
begin
mod.const_missing(part)
rescue NameError
raise ArgumentError, "undefined class/module #{name}"
end
end
end

if type and not mod.instance_of? type