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: 0cab1730fc5e
Choose a base ref
...
head repository: jruby/jruby
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 48d89740d328
Choose a head ref
  • 3 commits
  • 32 files changed
  • 1 contributor

Commits on Feb 15, 2015

  1. [Truffle] Include first line of stack trace in error message when tra…

    …nslating Java exceptions.
    chrisseaton committed Feb 15, 2015
    Copy the full SHA
    9e4bc23 View commit details
  2. Copy the full SHA
    a1d3118 View commit details
  3. Copy the full SHA
    48d8974 View commit details
Showing with 84 additions and 199 deletions.
  1. +0 −1 spec/truffle/tags/core/time/day_tags.txt
  2. +0 −2 spec/truffle/tags/core/time/friday_tags.txt
  3. +0 −6 spec/truffle/tags/core/time/gm_tags.txt
  4. +0 −4 spec/truffle/tags/core/time/gmt_offset_tags.txt
  5. +0 −4 spec/truffle/tags/core/time/gmtoff_tags.txt
  6. +0 −1 spec/truffle/tags/core/time/hour_tags.txt
  7. +0 −1 spec/truffle/tags/core/time/inspect_tags.txt
  8. +0 −31 spec/truffle/tags/core/time/local_tags.txt
  9. +0 −1 spec/truffle/tags/core/time/mday_tags.txt
  10. +0 −1 spec/truffle/tags/core/time/min_tags.txt
  11. +0 −31 spec/truffle/tags/core/time/mktime_tags.txt
  12. +0 −1 spec/truffle/tags/core/time/mon_tags.txt
  13. +0 −2 spec/truffle/tags/core/time/monday_tags.txt
  14. +0 −1 spec/truffle/tags/core/time/month_tags.txt
  15. +0 −45 spec/truffle/tags/core/time/new_tags.txt
  16. +0 −2 spec/truffle/tags/core/time/saturday_tags.txt
  17. +0 −27 spec/truffle/tags/core/time/strftime_tags.txt
  18. +0 −1 spec/truffle/tags/core/time/sunday_tags.txt
  19. +0 −2 spec/truffle/tags/core/time/thursday_tags.txt
  20. +0 −1 spec/truffle/tags/core/time/to_s_tags.txt
  21. +0 −2 spec/truffle/tags/core/time/tuesday_tags.txt
  22. +0 −4 spec/truffle/tags/core/time/utc_offset_tags.txt
  23. +0 −8 spec/truffle/tags/core/time/utc_tags.txt
  24. +0 −2 spec/truffle/tags/core/time/wednesday_tags.txt
  25. +0 −1 spec/truffle/tags/core/time/year_tags.txt
  26. +0 −2 spec/truffle/tags/core/time/zone_tags.txt
  27. +2 −2 truffle/src/main/java/org/jruby/truffle/nodes/core/ArrayBuilderNode.java
  28. +1 −1 truffle/src/main/java/org/jruby/truffle/nodes/core/TimeNodes.java
  29. +1 −2 truffle/src/main/java/org/jruby/truffle/nodes/methods/ExceptionTranslatingNode.java
  30. +64 −8 truffle/src/main/java/org/jruby/truffle/nodes/rubinius/TimePrimitiveNodes.java
  31. +12 −2 truffle/src/main/java/org/jruby/truffle/runtime/core/RubyTime.java
  32. +4 −0 truffle/src/main/ruby/core/shims.rb
1 change: 0 additions & 1 deletion spec/truffle/tags/core/time/day_tags.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
fails:Time#day returns the day of the month (1..n) for a local Time
fails:Time#day returns the day of the month for a UTC Time
2 changes: 0 additions & 2 deletions spec/truffle/tags/core/time/friday_tags.txt

This file was deleted.

6 changes: 0 additions & 6 deletions spec/truffle/tags/core/time/gm_tags.txt
Original file line number Diff line number Diff line change
@@ -26,15 +26,9 @@ fails:Time.gm interprets all numerals as base 10
fails:Time.gm handles fractional seconds as a Float
fails:Time.gm handles fractional seconds as a Rational
fails:Time.gm handles years from 0 as such
fails:Time.gm raises an ArgumentError for out of range month
fails:Time.gm raises an ArgumentError for out of range day
fails:Time.gm raises an ArgumentError for out of range hour
fails:Time.gm raises an ArgumentError for out of range minute
fails:Time.gm raises an ArgumentError for out of range second
fails:Time.gm returns subclass instances
fails:Time.gm handles string arguments
fails:Time.gm handles float arguments
fails:Time.gm raises an ArgumentError for out of range values
fails:Time.gm handles microseconds
fails:Time.gm handles fractional microseconds as a Float
fails:Time.gm handles fractional microseconds as a Rational
4 changes: 0 additions & 4 deletions spec/truffle/tags/core/time/gmt_offset_tags.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
fails:Time#gmt_offset returns the offset in seconds between the timezone of time and UTC
fails:Time#gmt_offset returns the correct offset for US Eastern time zone around daylight savings time change
fails:Time#gmt_offset returns the correct offset for Hawaii around daylight savings time change
fails:Time#gmt_offset returns the correct offset for New Zealand around daylight savings time change
fails:Time#gmt_offset returns offset as Rational
fails:Time#gmt_offset given positive offset returns a positive offset
fails:Time#gmt_offset given negative offset returns a negative offset
4 changes: 0 additions & 4 deletions spec/truffle/tags/core/time/gmtoff_tags.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
fails:Time#gmtoff returns the offset in seconds between the timezone of time and UTC
fails:Time#gmtoff returns the correct offset for US Eastern time zone around daylight savings time change
fails:Time#gmtoff returns the correct offset for Hawaii around daylight savings time change
fails:Time#gmtoff returns the correct offset for New Zealand around daylight savings time change
fails:Time#gmtoff returns offset as Rational
fails:Time#gmtoff given positive offset returns a positive offset
fails:Time#gmtoff given negative offset returns a negative offset
1 change: 0 additions & 1 deletion spec/truffle/tags/core/time/hour_tags.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
fails:Time#hour returns the hour of the day (0..23) for a local Time
fails:Time#hour returns the hour of the day for a UTC Time
1 change: 0 additions & 1 deletion spec/truffle/tags/core/time/inspect_tags.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
fails:Time#inspect formats the local time following the pattern 'yyyy-MM-dd HH:mm:ss Z'
fails:Time#inspect formats the UTC time following the pattern 'yyyy-MM-dd HH:mm:ss UTC'
31 changes: 0 additions & 31 deletions spec/truffle/tags/core/time/local_tags.txt
Original file line number Diff line number Diff line change
@@ -1,46 +1,15 @@
fails:Time.local respects rare old timezones
fails:Time.local creates a time based on given C-style gmtime arguments, interpreted in the local time zone
fails:Time.local creates the correct time just before dst change
fails:Time.local creates the correct time just after dst change
fails:Time.local accepts 1 argument (year)
fails:Time.local accepts 2 arguments (year, month)
fails:Time.local accepts 3 arguments (year, month, day)
fails:Time.local accepts 4 arguments (year, month, day, hour)
fails:Time.local accepts 5 arguments (year, month, day, hour, minute)
fails:Time.local accepts nil month, day, hour, minute, and second
fails:Time.local handles a String year
fails:Time.local coerces the year with #to_int
fails:Time.local handles a String month given as a numeral
fails:Time.local handles a String month given as a short month name
fails:Time.local coerces the month with #to_str
fails:Time.local coerces the month with #to_int
fails:Time.local handles a String day
fails:Time.local coerces the day with #to_int
fails:Time.local handles a String hour
fails:Time.local coerces the hour with #to_int
fails:Time.local handles a String minute
fails:Time.local coerces the minute with #to_int
fails:Time.local handles a String second
fails:Time.local coerces the second with #to_int
fails:Time.local interprets all numerals as base 10
fails:Time.local handles fractional seconds as a Float
fails:Time.local handles fractional seconds as a Rational
fails:Time.local handles years from 0 as such
fails:Time.local raises an ArgumentError for out of range month
fails:Time.local raises an ArgumentError for out of range day
fails:Time.local raises an ArgumentError for out of range hour
fails:Time.local raises an ArgumentError for out of range minute
fails:Time.local raises an ArgumentError for out of range second
fails:Time.local returns subclass instances
fails:Time.local handles string arguments
fails:Time.local handles float arguments
fails:Time.local raises an ArgumentError for out of range values
fails:Time.local handles microseconds
fails:Time.local handles fractional microseconds as a Float
fails:Time.local handles fractional microseconds as a Rational
fails:Time.local ignores fractional seconds if a passed whole number of microseconds
fails:Time.local ignores fractional seconds if a passed fractional number of microseconds
fails:Time.local raises ArgumentError when given 9 arguments
fails:Time.local raises ArgumentError when given 11 arguments
fails:Time.local creates a time based on given values, interpreted in the local time zone
fails:Time.local accepts various year ranges
1 change: 0 additions & 1 deletion spec/truffle/tags/core/time/mday_tags.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
fails:Time#mday returns the day of the month (1..n) for a local Time
fails:Time#mday returns the day of the month for a UTC Time
1 change: 0 additions & 1 deletion spec/truffle/tags/core/time/min_tags.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
fails:Time#min returns the minute of the hour (0..59) for a local Time
fails:Time#min returns the minute of the hour for a UTC Time
31 changes: 0 additions & 31 deletions spec/truffle/tags/core/time/mktime_tags.txt
Original file line number Diff line number Diff line change
@@ -1,46 +1,15 @@
fails:Time.mktime respects rare old timezones
fails:Time.mktime creates a time based on given C-style gmtime arguments, interpreted in the local time zone
fails:Time.mktime creates the correct time just before dst change
fails:Time.mktime creates the correct time just after dst change
fails:Time.mktime accepts 1 argument (year)
fails:Time.mktime accepts 2 arguments (year, month)
fails:Time.mktime accepts 3 arguments (year, month, day)
fails:Time.mktime accepts 4 arguments (year, month, day, hour)
fails:Time.mktime accepts 5 arguments (year, month, day, hour, minute)
fails:Time.mktime accepts nil month, day, hour, minute, and second
fails:Time.mktime handles a String year
fails:Time.mktime coerces the year with #to_int
fails:Time.mktime handles a String month given as a numeral
fails:Time.mktime handles a String month given as a short month name
fails:Time.mktime coerces the month with #to_str
fails:Time.mktime coerces the month with #to_int
fails:Time.mktime handles a String day
fails:Time.mktime coerces the day with #to_int
fails:Time.mktime handles a String hour
fails:Time.mktime coerces the hour with #to_int
fails:Time.mktime handles a String minute
fails:Time.mktime coerces the minute with #to_int
fails:Time.mktime handles a String second
fails:Time.mktime coerces the second with #to_int
fails:Time.mktime interprets all numerals as base 10
fails:Time.mktime handles fractional seconds as a Float
fails:Time.mktime handles fractional seconds as a Rational
fails:Time.mktime handles years from 0 as such
fails:Time.mktime raises an ArgumentError for out of range month
fails:Time.mktime raises an ArgumentError for out of range day
fails:Time.mktime raises an ArgumentError for out of range hour
fails:Time.mktime raises an ArgumentError for out of range minute
fails:Time.mktime raises an ArgumentError for out of range second
fails:Time.mktime raises ArgumentError when given 9 arguments
fails:Time.mktime raises ArgumentError when given 11 arguments
fails:Time.mktime returns subclass instances
fails:Time.mktime handles string arguments
fails:Time.mktime handles float arguments
fails:Time.mktime raises an ArgumentError for out of range values
fails:Time.mktime handles microseconds
fails:Time.mktime handles fractional microseconds as a Float
fails:Time.mktime handles fractional microseconds as a Rational
fails:Time.mktime ignores fractional seconds if a passed whole number of microseconds
fails:Time.mktime ignores fractional seconds if a passed fractional number of microseconds
fails:Time.mktime creates a time based on given values, interpreted in the local time zone
fails:Time.mktime accepts various year ranges
1 change: 0 additions & 1 deletion spec/truffle/tags/core/time/mon_tags.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
fails:Time#mon returns the month of the year for a local Time
fails:Time#mon returns the month of the year for a UTC Time
2 changes: 0 additions & 2 deletions spec/truffle/tags/core/time/monday_tags.txt

This file was deleted.

1 change: 0 additions & 1 deletion spec/truffle/tags/core/time/month_tags.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
fails:Time#month returns the month of the year for a local Time
fails:Time#month returns the month of the year for a UTC Time
45 changes: 0 additions & 45 deletions spec/truffle/tags/core/time/new_tags.txt
Original file line number Diff line number Diff line change
@@ -1,50 +1,5 @@
fails:Time.new respects rare old timezones
fails:Time.new accepts 1 argument (year)
fails:Time.new accepts 2 arguments (year, month)
fails:Time.new accepts 3 arguments (year, month, day)
fails:Time.new accepts 4 arguments (year, month, day, hour)
fails:Time.new accepts 5 arguments (year, month, day, hour, minute)
fails:Time.new accepts nil month, day, hour, minute, and second
fails:Time.new handles a String year
fails:Time.new coerces the year with #to_int
fails:Time.new handles a String month given as a numeral
fails:Time.new handles a String month given as a short month name
fails:Time.new coerces the month with #to_str
fails:Time.new coerces the month with #to_int
fails:Time.new handles a String day
fails:Time.new coerces the day with #to_int
fails:Time.new handles a String hour
fails:Time.new coerces the hour with #to_int
fails:Time.new handles a String minute
fails:Time.new coerces the minute with #to_int
fails:Time.new handles a String second
fails:Time.new coerces the second with #to_int
fails:Time.new interprets all numerals as base 10
fails:Time.new handles fractional seconds as a Float
fails:Time.new handles fractional seconds as a Rational
fails:Time.new handles years from 0 as such
fails:Time.new raises an ArgumentError for out of range month
fails:Time.new raises an ArgumentError for out of range day
fails:Time.new raises an ArgumentError for out of range hour
fails:Time.new raises an ArgumentError for out of range minute
fails:Time.new raises an ArgumentError for out of range second
fails:Time.new raises ArgumentError when given 9 arguments
fails:Time.new raises ArgumentError when given 11 arguments
fails:Time.new returns subclass instances
fails:Time.new with a utc_offset argument returns a non-UTC time
fails:Time.new with a utc_offset argument returns a Time with a UTC offset of the specified number of Integer seconds
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 returns a Time with a UTC offset specified as +HH:MM
fails:Time.new with a utc_offset argument returns a Time with a UTC offset specified as -HH:MM
fails:Time.new with a utc_offset argument returns a local Time if the argument is nil
fails:Time.new with a utc_offset argument adds one hour if the minute value is greater than 59
fails:Time.new with a utc_offset argument raises ArgumentError if the String argument is not of the form (+|-)HH:MM
fails:Time.new with a utc_offset argument raises ArgumentError if the hour value is greater than 23
fails:Time.new with a utc_offset argument raises ArgumentError if the String argument is not in an ASCII-compatible encoding
fails:Time.new with a utc_offset argument raises ArgumentError if the argument represents a value less than or equal to -86400 seconds
fails:Time.new with a utc_offset argument raises ArgumentError if the argument represents a value greater than or equal to 86400 seconds
fails:Time.new with a utc_offset argument with an argument that responds to #to_int coerces using #to_int
fails:Time.new with a utc_offset argument with an argument that responds to #to_r coerces using #to_r
fails:Time.new with a utc_offset argument with an argument that responds to #to_str coerces using #to_str
fails:Time.new creates a time based on given values, interpreted in the local time zone
fails:Time.new accepts various year ranges
2 changes: 0 additions & 2 deletions spec/truffle/tags/core/time/saturday_tags.txt

This file was deleted.

27 changes: 0 additions & 27 deletions spec/truffle/tags/core/time/strftime_tags.txt
Original file line number Diff line number Diff line change
@@ -6,32 +6,5 @@ fails:Time#strftime with %N formats the microseconds of of the second with %6N
fails:Time#strftime with %N formats the nanoseconds of of the second with %9N
fails:Time#strftime with %N formats the picoseconds of of the second with %12N
fails:Time#strftime with %z formats a UTC time offset as '+0000'
fails:Time#strftime with %z formats a local time with positive UTC offset as '+HHMM'
fails:Time#strftime with %z formats a local time with negative UTC offset as '-HHMM'
fails:Time#strftime with %z rounds fixed offset to the nearest second
fails:Time#strftime formats time according to the directives in the given format string
fails:Time#strftime supports week of year format with %U and %W
fails:Time#strftime supports 12-hr formatting with %l
fails:Time#strftime supports AM/PM formatting with %p
fails:Time#strftime returns the abbreviated weekday with %a
fails:Time#strftime returns the full weekday with %A
fails:Time#strftime returns the abbreviated month with %b
fails:Time#strftime returns the full month with %B
fails:Time#strftime returns the day of the month with %d
fails:Time#strftime returns the 24-based hour with %H
fails:Time#strftime returns the 12-based hour with %I
fails:Time#strftime returns the Julian date with %j
fails:Time#strftime returns the month with %m
fails:Time#strftime returns the minute with %M
fails:Time#strftime returns the second with %S
fails:Time#strftime returns the enumerated day of the week with %w
fails:Time#strftime returns the date alone with %x
fails:Time#strftime returns the time alone with %X
fails:Time#strftime returns the year wihout a century with %y
fails:Time#strftime returns the year with %Y
fails:Time#strftime returns the timezone with %Z
fails:Time#strftime supports am/pm formatting with %P
fails:Time#strftime supports GNU modificators
fails:Time#strftime supports the '-' modifier to drop leading zeros
fails:Time#strftime supports the '-' modifier for padded format directives
fails:Time#strftime passes the format string's encoding to the result string
1 change: 0 additions & 1 deletion spec/truffle/tags/core/time/sunday_tags.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
fails:Time#sunday? returns true if time represents Sunday
fails:Time#sunday? returns false if time doesn't represent Sunday
2 changes: 0 additions & 2 deletions spec/truffle/tags/core/time/thursday_tags.txt

This file was deleted.

1 change: 0 additions & 1 deletion spec/truffle/tags/core/time/to_s_tags.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
fails:Time#to_s formats the local time following the pattern 'yyyy-MM-dd HH:mm:ss Z'
fails:Time#to_s formats the UTC time following the pattern 'yyyy-MM-dd HH:mm:ss UTC'
2 changes: 0 additions & 2 deletions spec/truffle/tags/core/time/tuesday_tags.txt

This file was deleted.

4 changes: 0 additions & 4 deletions spec/truffle/tags/core/time/utc_offset_tags.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
fails:Time#utc_offset returns the offset in seconds between the timezone of time and UTC
fails:Time#utc_offset returns the correct offset for US Eastern time zone around daylight savings time change
fails:Time#utc_offset returns the correct offset for Hawaii around daylight savings time change
fails:Time#utc_offset returns the correct offset for New Zealand around daylight savings time change
fails:Time#utc_offset returns offset as Rational
fails:Time#utc_offset given positive offset returns a positive offset
fails:Time#utc_offset given negative offset returns a negative offset
8 changes: 0 additions & 8 deletions spec/truffle/tags/core/time/utc_tags.txt
Original file line number Diff line number Diff line change
@@ -27,17 +27,9 @@ fails:Time.utc interprets all numerals as base 10
fails:Time.utc handles fractional seconds as a Float
fails:Time.utc handles fractional seconds as a Rational
fails:Time.utc handles years from 0 as such
fails:Time.utc raises an ArgumentError for out of range month
fails:Time.utc raises an ArgumentError for out of range day
fails:Time.utc raises an ArgumentError for out of range hour
fails:Time.utc raises an ArgumentError for out of range minute
fails:Time.utc raises an ArgumentError for out of range second
fails:Time.utc raises ArgumentError when given 9 arguments
fails:Time.utc raises ArgumentError when given 11 arguments
fails:Time.utc returns subclass instances
fails:Time.utc handles string arguments
fails:Time.utc handles float arguments
fails:Time.utc raises an ArgumentError for out of range values
fails:Time.utc handles microseconds
fails:Time.utc handles fractional microseconds as a Float
fails:Time.utc handles fractional microseconds as a Rational
2 changes: 0 additions & 2 deletions spec/truffle/tags/core/time/wednesday_tags.txt

This file was deleted.

1 change: 0 additions & 1 deletion spec/truffle/tags/core/time/year_tags.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
fails:Time#year returns the four digit year for a local Time as an Integer
fails:Time#year returns the four digit year for a UTC Time as an Integer
2 changes: 0 additions & 2 deletions spec/truffle/tags/core/time/zone_tags.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
fails:Time#zone returns nil for a Time with a fixed offset
fails:Time#zone returns the correct timezone for a local time
fails:Time#zone returns nil when getting the local time with a fixed offset
fails:Time#zone Encoding.default_internal is set returns the string with the default internal encoding
fails:Time#zone Encoding.default_internal is set doesn't raise errors for a Time with a fixed offset
Original file line number Diff line number Diff line change
@@ -443,8 +443,8 @@ public Object append(Object store, int index, RubyArray array) {
if (otherStore instanceof int[]) {
// TODO CS 5-Feb-15 hack to get things working with empty int[] store

if (((int[]) otherStore).length > 0) {
throw new UnsupportedOperationException();
for (int n = 0; n < array.getSize(); n++) {
((Object[]) store)[index + n] = ((int[]) otherStore)[n];
}

return store;
Original file line number Diff line number Diff line change
@@ -31,7 +31,7 @@ public InternalGMTNode(InternalGMTNode prev) {

@Specialization
public boolean internalGMT(RubyTime time) {
return time.getDateTime().getZone().equals(DateTimeZone.UTC);
return time.getOffset() == null && time.getDateTime().getZone().equals(DateTimeZone.UTC);
}
}

Original file line number Diff line number Diff line change
@@ -151,14 +151,13 @@ public RubyException translate(Throwable throwable) {
throwable.printStackTrace();
}
} catch (NullPointerException e) {

}

if (Options.TRUFFLE_PANIC_ON_JAVA_ASSERT.load() && throwable instanceof AssertionError) {
DebugOperations.panic(getContext(), this, throwable.toString());
}

return getContext().getCoreLibrary().internalError(String.format("%s %s", throwable.getClass().getSimpleName(), throwable.getMessage()), this);
return getContext().getCoreLibrary().internalError(String.format("%s %s %s", throwable.getClass().getSimpleName(), throwable.getMessage(), throwable.getStackTrace()[0].toString()), this);
}

}
Loading