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

Commits on Jul 18, 2016

  1. Removed some dead code.

    nirvdrum committed Jul 18, 2016
    Copy the full SHA
    3fe0132 View commit details
  2. Copy the full SHA
    48011b5 View commit details
  3. 4
    Copy the full SHA
    6987494 View commit details
Original file line number Diff line number Diff line change
@@ -495,8 +495,6 @@ public IRubyObject rubyEncodingFromObject(IRubyObject str) {
* @return the charset
*/
public Charset charsetForEncoding(Encoding encoding) {
Charset charset = encoding.getCharset();

if (encoding.toString().equals("ASCII-8BIT")) {
return Charset.forName("ISO-8859-1");
}
Original file line number Diff line number Diff line change
@@ -119,6 +119,7 @@ public Object doCatch(VirtualFrame frame, Object tag, DynamicObject block,
@Primitive(name = "vm_gc_start", needsSelf = false)
public static abstract class VMGCStartPrimitiveNode extends PrimitiveArrayArgumentsNode {

@TruffleBoundary
@Specialization
public DynamicObject vmGCStart() {
System.gc();
Original file line number Diff line number Diff line change
@@ -174,7 +174,7 @@ public Object instanceEval(VirtualFrame frame, Object receiver, DynamicObject st
final Rope code = StringOperations.rope(string);

// TODO (pitr 15-Oct-2015): fix this ugly hack, required for AS, copy-paste
final String space = new String(new char[Math.max(line - 1, 0)]).replace("\0", "\n");
final String space = getSpace(line);
final Source source = getContext().getSourceLoader().loadFragment(space + code.toString(), StringOperations.rope(fileName).toString());

final RubyRootNode rootNode = getContext().getCodeLoader().parse(source, code.getEncoding(), ParserContext.EVAL, null, true, this);
@@ -198,6 +198,11 @@ public Object instanceEval(VirtualFrame frame, Object receiver, NotProvided stri
return yield.dispatchWithModifiedSelf(frame, block, receiver, receiver);
}

@TruffleBoundary
private String getSpace(int line) {
return new String(new char[Math.max(line - 1, 0)]).replace("\0", "\n");
}

}

@CoreMethod(names = "instance_exec", needsBlock = true, rest = true)
Original file line number Diff line number Diff line change
@@ -55,6 +55,7 @@ public TraceManager(RubyContext context, Instrumenter instrumenter) {
this.instrumenter = instrumenter;
}

@TruffleBoundary
public void setTraceFunc(final DynamicObject traceFunc) {
assert RubyGuards.isRubyProc(traceFunc);

Original file line number Diff line number Diff line change
@@ -113,7 +113,7 @@ public DynamicObject localtime(VirtualFrame frame, DynamicObject time, NotProvid
Layouts.TIME.setIsUtc(time, false);
Layouts.TIME.setRelativeOffset(time, false);
Layouts.TIME.setZone(time, zone);
Layouts.TIME.setDateTime(time, dateTime.withZone(dateTimeZone));
Layouts.TIME.setDateTime(time, withZone(dateTime, dateTimeZone));

return time;
}
@@ -126,7 +126,7 @@ public DynamicObject localtime(DynamicObject time, long offset) {
Layouts.TIME.setIsUtc(time, false);
Layouts.TIME.setRelativeOffset(time, true);
Layouts.TIME.setZone(time, nil());
Layouts.TIME.setDateTime(time, dateTime.withZone(zone));
Layouts.TIME.setDateTime(time, withZone(dateTime, zone));

return time;
}
@@ -136,6 +136,11 @@ public DateTimeZone getDateTimeZone(int offset) {
return DateTimeZone.forOffsetMillis(offset * 1000);
}

@TruffleBoundary
private DateTime withZone(DateTime dateTime, DateTimeZone zone) {
return dateTime.withZone(zone);
}

}

@CoreMethod(names = "add_internal!", required = 2, visibility = Visibility.PROTECTED)
Original file line number Diff line number Diff line change
@@ -9,6 +9,7 @@
*/
package org.jruby.truffle.tools.simpleshell;

import com.oracle.truffle.api.TruffleOptions;
import com.oracle.truffle.api.frame.MaterializedFrame;
import com.oracle.truffle.api.nodes.Node;
import com.oracle.truffle.api.object.DynamicObject;
@@ -40,7 +41,7 @@ public class SimpleShell {
public SimpleShell(RubyContext context) {
this.context = context;

if (System.console() == null) {
if (!TruffleOptions.AOT && System.console() == null) {
shellInterface = new StandardShellInterface();
} else {
shellInterface = new ConsoleShellInterface();