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

Commits on Nov 28, 2015

  1. [Truffle] Fix style.

    eregon committed Nov 28, 2015
    Copy the full SHA
    99c3f25 View commit details
  2. Copy the full SHA
    36efc66 View commit details
  3. Copy the full SHA
    3c74fa6 View commit details
  4. [Truffle] Remember the Proc for a define_method, as it may access the…

    … block declaration frame.
    eregon committed Nov 28, 2015
    Copy the full SHA
    c38e955 View commit details
  5. Copy the full SHA
    6df8a4a View commit details
2 changes: 2 additions & 0 deletions spec/truffle/tags/core/kernel/spawn_tags.txt
Original file line number Diff line number Diff line change
@@ -167,3 +167,5 @@ fails:Kernel.spawn when passed close_others: false does not close STDOUT
fails:Kernel.spawn when passed close_others: false does not close STDERR
fails:Kernel#spawn redirects STDOUT to the given file if out: [String name, String mode]
fails:Kernel.spawn redirects STDOUT to the given file if out: [String name, String mode]
fails:Kernel#spawn redirects STDERR to child STDOUT if :err => [:child, :out]
fails:Kernel.spawn redirects STDERR to child STDOUT if :err => [:child, :out]
3 changes: 0 additions & 3 deletions spec/truffle/tags/core/method/element_reference_tags.txt

This file was deleted.

1 change: 1 addition & 0 deletions spec/truffle/tags/core/process/spawn_tags.txt
Original file line number Diff line number Diff line change
@@ -82,3 +82,4 @@ fails:Process.spawn when passed close_others: false does not close STDIN
fails:Process.spawn when passed close_others: false does not close STDOUT
fails:Process.spawn when passed close_others: false does not close STDERR
fails:Process.spawn redirects STDOUT to the given file if out: [String name, String mode]
fails:Process.spawn redirects STDERR to child STDOUT if :err => [:child, :out]
14 changes: 14 additions & 0 deletions spec/truffle/tags/core/string/unicode_normalize_tags.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
fails:String#unicode_normalize normalizes code points in the string according to the form that is specified
fails:String#unicode_normalize defaults to the nfc normalization form if no forms are specified
fails:String#unicode_normalize raises an Encoding::CompatibilityError if string is not in an unicode encoding
fails:String#unicode_normalize raises an ArgumentError if the specified form is invalid
fails:String#unicode_normalize returns normalized form of string by default 03D3 (ϓ) GREEK UPSILON WITH ACUTE AND HOOK SYMBOL
fails:String#unicode_normalize returns normalized form of string by default 03D4 (ϔ) GREEK UPSILON WITH DIAERESIS AND HOOK SYMBOL
fails:String#unicode_normalize returns normalized form of string by default 1E9B (ẛ) LATIN SMALL LETTER LONG S WITH DOT ABOVE
fails:String#unicode_normalize! normalizes code points and modifies the receiving string
fails:String#unicode_normalize! modifies original string (nfc)
fails:String#unicode_normalize! modifies self in place (nfd)
fails:String#unicode_normalize! modifies self in place (nfkc)
fails:String#unicode_normalize! modifies self in place (nfkd)
fails:String#unicode_normalize! raises an Encoding::CompatibilityError if the string is not in an unicode encoding
fails:String#unicode_normalize! raises an ArgumentError if the specified form is invalid
7 changes: 7 additions & 0 deletions spec/truffle/tags/core/string/unicode_normalized_tags.txt
Original file line number Diff line number Diff line change
@@ -10,3 +10,10 @@ fails:unicode_normalized? returns true if str is in Unicode normalization form (
fails:unicode_normalized? returns true if str is in Unicode normalization form (nfd)
fails:unicode_normalized? returns true if str is in Unicode normalization form (nfkc)
fails:unicode_normalized? returns true if str is in Unicode normalization form (nfkd)
fails:String#unicode_normalized? returns true if string is in the specified normalization form
fails:String#unicode_normalized? returns false if string is not in the supplied normalization form
fails:String#unicode_normalized? defaults to the nfc normalization form if no forms are specified
fails:String#unicode_normalized? returns true if string is empty
fails:String#unicode_normalized? returns true if string does not contain any unicode codepoints
fails:String#unicode_normalized? raises an Encoding::CompatibilityError if the string is not in an unicode encoding
fails:String#unicode_normalized? raises an ArgumentError if the specified form is invalid
Original file line number Diff line number Diff line change
@@ -3,3 +3,5 @@ fails:Socket#getservbyname returns the port for service 'http' with protocol 'tc
fails:Socket#getservbyname returns the port for service 'domain' with protocol 'udp'
fails:Socket#getservbyname returns the port for service 'daytime'
fails:Socket#getservbyname raises a SocketError when the service or port is invalid
fails:Socket#getservbyname returns the port for service 'discard'
fails:Socket#getservbyname returns the port for service 'discard' with protocol 'tcp'
Original file line number Diff line number Diff line change
@@ -91,7 +91,7 @@ public int arity(DynamicObject method) {

}

@CoreMethod(names = "call", needsBlock = true, rest = true)
@CoreMethod(names = { "call", "[]" }, needsBlock = true, rest = true)
public abstract static class CallNode extends CoreMethodArrayArgumentsNode {

@Child ProcOrNullNode procOrNullNode;
Original file line number Diff line number Diff line change
@@ -1107,7 +1107,7 @@ private DynamicObject defineMethod(DynamicObject module, String name, DynamicObj
final RubyRootNode newRootNode = new RubyRootNode(getContext(), info.getSourceSection(), rootNode.getFrameDescriptor(), info, newBody);
final CallTarget newCallTarget = Truffle.getRuntime().createCallTarget(newRootNode);

final InternalMethod method = new InternalMethod(info, name, module, Visibility.PUBLIC, newCallTarget);
final InternalMethod method = InternalMethod.fromProc(info, name, module, Visibility.PUBLIC, proc, newCallTarget);
return addMethod(module, name, method);
}

Original file line number Diff line number Diff line change
@@ -52,7 +52,8 @@ public static Object[] packArguments(DynamicObject proc, Object... args) {
return RubyArguments.pack(
Layouts.PROC.getMethod(proc),
Layouts.PROC.getDeclarationFrame(proc),
null, Layouts.PROC.getSelf(proc),
null,
Layouts.PROC.getSelf(proc),
Layouts.PROC.getBlock(proc),
DeclarationContext.BLOCK,
args);
Original file line number Diff line number Diff line change
@@ -632,6 +632,10 @@ public Set<DynamicObject> getAdjacentObjects() {
}
}

for (InternalMethod method : methods.values()) {
adjacent.addAll(method.getAdjacentObjects());
}

return adjacent;
}

Original file line number Diff line number Diff line change
@@ -36,22 +36,29 @@ public class InternalMethod implements ObjectGraphNode {
private final DynamicObject declaringModule;
private final Visibility visibility;
private final boolean undefined;
private final DynamicObject proc; // only if method is created from a Proc

private final CallTarget callTarget;

public static InternalMethod fromProc(SharedMethodInfo sharedMethodInfo, String name, DynamicObject declaringModule,
Visibility visibility, DynamicObject proc, CallTarget callTarget) {
return new InternalMethod(sharedMethodInfo, name, declaringModule, visibility, false, proc, callTarget);
}

public InternalMethod(SharedMethodInfo sharedMethodInfo, String name, DynamicObject declaringModule,
Visibility visibility, CallTarget callTarget) {
this(sharedMethodInfo, name, declaringModule, visibility, false, callTarget);
this(sharedMethodInfo, name, declaringModule, visibility, false, null, callTarget);
}

private InternalMethod(SharedMethodInfo sharedMethodInfo, String name, DynamicObject declaringModule,
Visibility visibility, boolean undefined, CallTarget callTarget) {
Visibility visibility, boolean undefined, DynamicObject proc, CallTarget callTarget) {
assert RubyGuards.isRubyModule(declaringModule);
this.sharedMethodInfo = sharedMethodInfo;
this.declaringModule = declaringModule;
this.name = name;
this.visibility = visibility;
this.undefined = undefined;
this.proc = proc;
this.callTarget = callTarget;
}

@@ -85,28 +92,28 @@ public InternalMethod withDeclaringModule(DynamicObject newDeclaringModule) {
if (newDeclaringModule == declaringModule) {
return this;
} else {
return new InternalMethod(sharedMethodInfo, name, newDeclaringModule, visibility, undefined, callTarget);
return new InternalMethod(sharedMethodInfo, name, newDeclaringModule, visibility, undefined, proc, callTarget);
}
}

public InternalMethod withName(String newName) {
if (newName.equals(name)) {
return this;
} else {
return new InternalMethod(sharedMethodInfo, newName, declaringModule, visibility, undefined, callTarget);
return new InternalMethod(sharedMethodInfo, newName, declaringModule, visibility, undefined, proc, callTarget);
}
}

public InternalMethod withVisibility(Visibility newVisibility) {
if (newVisibility == visibility) {
return this;
} else {
return new InternalMethod(sharedMethodInfo, name, declaringModule, newVisibility, undefined, callTarget);
return new InternalMethod(sharedMethodInfo, name, declaringModule, newVisibility, undefined, proc, callTarget);
}
}

public InternalMethod undefined() {
return new InternalMethod(sharedMethodInfo, name, declaringModule, visibility, true, callTarget);
return new InternalMethod(sharedMethodInfo, name, declaringModule, visibility, true, proc, callTarget);
}

public boolean isVisibleTo(Node currentNode, DynamicObject callerClass) {
@@ -148,6 +155,10 @@ public Set<DynamicObject> getAdjacentObjects() {
adjacent.add(declaringModule);
}

if (proc != null) {
adjacent.add(proc);
}

return adjacent;
}