Skip to content

Commit

Permalink
Showing 4 changed files with 18 additions and 6 deletions.
16 changes: 13 additions & 3 deletions core/src/main/java/org/jruby/runtime/marshal/UnmarshalStream.java
Original file line number Diff line number Diff line change
@@ -285,16 +285,19 @@ private IRubyObject unmarshalObjectDirectly(int type, MarshalState state, boolea
}

private IRubyObject unmarshalRegexp(MarshalState state) throws IOException {
IRubyObject rubyObj;ByteList byteList = unmarshalString();
ByteList byteList = unmarshalString();
byte opts = readSignedByte();
RegexpOptions reOpts = RegexpOptions.fromJoniOptions(opts);

IRubyObject ivarHolder = null;

if (state.isIvarWaiting()) {
RubyString tmpStr = RubyString.newString(runtime, byteList);
registerLinkTarget(tmpStr);
defaultVariablesUnmarshal(tmpStr);
byteList = tmpStr.getByteList();
state.setIvarWaiting(false);
ivarHolder = tmpStr;
}
if (byteList.getEncoding() == ASCIIEncoding.INSTANCE) {
/* 1.8 compatibility; remove escapes undefined in 1.8 */
@@ -348,8 +351,15 @@ private IRubyObject unmarshalRegexp(MarshalState state) throws IOException {
byteList.setRealSize(dst - ptr);
}

rubyObj = RubyRegexp.newRegexp(runtime, byteList, reOpts);
return rubyObj;
RubyRegexp regexp = RubyRegexp.newRegexp(runtime, byteList, reOpts);

if (ivarHolder != null) {
ivarHolder.getInstanceVariables().copyInstanceVariablesInto(regexp);
}

registerLinkTarget(regexp);

return regexp;
}

public Ruby getRuntime() {
2 changes: 1 addition & 1 deletion mx.jruby/mx_jruby.py
Original file line number Diff line number Diff line change
@@ -397,7 +397,7 @@ def runBenchmark(self, benchmark, bmSuiteArgs):
'metric.iteration': n,
'extra.metric.warmedup': 'true' if n / float(len(samples)) >= 0.5 else 'false',
'extra.metric.elapsed-num': e,
'extra.metric.human': '%d/%d %fs' % (n, len(samples), warmed_up_mean)
'extra.metric.human': '%d/%d %f op/s' % (n, len(samples), warmed_up_mean)
} for n, (e, sample) in enumerate(zip(elapsed, samples))]
else:
sys.stderr.write(out.data)
2 changes: 1 addition & 1 deletion tool/jt.rb
Original file line number Diff line number Diff line change
@@ -75,7 +75,7 @@ def self.find_graal_javacmd_and_options
else
mx_options = ''
end
command_line = `mx -v #{mx_options} -p #{graal_home} vm -version 2>/dev/null`.lines.to_a.last
command_line = `mx -v #{mx_options} -p #{graal_home} vm -version`.lines.to_a.last
vm_args = command_line.split
vm_args.pop # Drop "-version"
javacmd = vm_args.shift
Original file line number Diff line number Diff line change
@@ -9,6 +9,7 @@
*/
package org.jruby.truffle.platform;

import com.oracle.truffle.api.TruffleOptions;
import org.jruby.ext.ffi.Platform;
import org.jruby.truffle.RubyContext;
import org.jruby.truffle.platform.darwin.DarwinPlatform;
@@ -18,7 +19,8 @@
public abstract class NativePlatformFactory {

public static NativePlatform createPlatform(RubyContext context) {
if (context.getOptions().PLATFORM_USE_JAVA || (Platform.getPlatform().getOS() == Platform.OS_TYPE.WINDOWS)) {
if (!TruffleOptions.AOT &&
(context.getOptions().PLATFORM_USE_JAVA || (Platform.getPlatform().getOS() == Platform.OS_TYPE.WINDOWS))) {
return new JavaPlatform(context);
}

0 comments on commit b743851

Please sign in to comment.