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: 58557e853d01
Choose a base ref
...
head repository: jruby/jruby
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 80f1f6e0ec4c
Choose a head ref
  • 2 commits
  • 2 files changed
  • 1 contributor

Commits on Dec 14, 2017

  1. Copy the full SHA
    63193b5 View commit details
  2. Unbreak AOT/persistence

    enebo committed Dec 14, 2017
    Copy the full SHA
    80f1f6e View commit details
Showing with 4 additions and 13 deletions.
  1. +1 −1 core/src/main/java/org/jruby/ir/persistence/IRWriter.java
  2. +3 −12 core/src/main/java/org/jruby/runtime/load/CompiledScriptLoader.java
2 changes: 1 addition & 1 deletion core/src/main/java/org/jruby/ir/persistence/IRWriter.java
Original file line number Diff line number Diff line change
@@ -78,7 +78,7 @@ private static void persistScopeHeader(IRWriterEncoder file, IRScope scope) {
if (RubyInstanceConfig.IR_WRITING_DEBUG) System.out.println("IRScopeType = " + scope.getScopeType());
file.encode(scope.getScopeType()); // type is enum of kind of scope
if (RubyInstanceConfig.IR_WRITING_DEBUG) System.out.println("NAME = " + scope.getName());
file.encode(scope.getName());
file.encode(scope.getByteName());
if (RubyInstanceConfig.IR_WRITING_DEBUG) System.out.println("Line # = " + scope.getLineNumber());
file.encode(scope.getLineNumber());
if (RubyInstanceConfig.IR_WRITING_DEBUG) System.out.println("# of temp vars = " + scope.getTemporaryVariablesCount());
Original file line number Diff line number Diff line change
@@ -11,7 +11,6 @@
import org.jruby.util.OneShotClassLoader;
import org.objectweb.asm.ClassReader;

import java.io.BufferedInputStream;
import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.IOException;
@@ -73,16 +72,8 @@ private static Class loadCompiledScriptFromClass(Ruby runtime, InputStream in) t
}

public static String getFilenameFromPathAndName(File resourcePath, String resourceName, boolean isAbsolute) {
String name = normalizeSeps(resourceName);
File path = resourcePath;

if(path != null && !isAbsolute) {
// Note: We use RubyFile's canonicalize rather than Java's,
// because Java's will follow symlinks and result in __FILE__
// being set to the target of the symlink rather than the
// filename provided.
name = normalizeSeps(canonicalize(path.getPath()));
}
return name;
// Note: We use RubyFile's canonicalize rather than Java's for relative paths because Java's will follow
// symlinks and result in __FILE__ being set to the target of the symlink rather than the filename provided.
return normalizeSeps(resourcePath != null && !isAbsolute ? canonicalize(resourcePath.getPath()) : resourceName);
}
}