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

Commits on Mar 3, 2016

  1. [Truffle] Fix warnings.

    eregon committed Mar 3, 2016
    Copy the full SHA
    7b5f4bf View commit details
  2. Revert "[Truffle] Don't report the instrumentation server thread when…

    … doing /stacks"
    
    This reverts commit 518703d.
    eregon committed Mar 3, 2016
    Copy the full SHA
    3b1477a View commit details
  3. [Truffle] Remove confusing comments.

    * Just use Call Hierarchy to figure out why they exist.
    eregon committed Mar 3, 2016
    Copy the full SHA
    160b6fc View commit details
  4. Copy the full SHA
    07f25d3 View commit details
Original file line number Diff line number Diff line change
@@ -192,14 +192,7 @@ public void initializeCurrentThread(DynamicObject thread) {

@TruffleBoundary
public DynamicObject getCurrentThread() {
DynamicObject current = currentThread.get();

if (current == null) {
current = rootThread;
currentThread.set(current);
}

return current;
return currentThread.get();
}

public synchronized void registerThread(DynamicObject thread) {
Original file line number Diff line number Diff line change
@@ -125,14 +125,12 @@ public static void run(DynamicObject thread, final RubyContext context, Node cur
}
}

// Only used by the main thread which cannot easily wrap everything inside a try/finally.
public static void start(RubyContext context, DynamicObject thread) {
assert RubyGuards.isRubyThread(thread);
Layouts.THREAD.setThread(thread, Thread.currentThread());
context.getThreadManager().registerThread(thread);
}

// Only used by the main thread which cannot easily wrap everything inside a try/finally.
public static void cleanup(RubyContext context, DynamicObject thread) {
assert RubyGuards.isRubyThread(thread);

Original file line number Diff line number Diff line change
@@ -22,12 +22,12 @@
import org.jruby.truffle.language.backtrace.Backtrace;
import org.jruby.truffle.language.backtrace.BacktraceFormatter;
import org.jruby.truffle.tools.simpleshell.SimpleShell;

import java.io.IOException;
import java.io.OutputStream;
import java.net.InetSocketAddress;
import java.util.List;

@SuppressWarnings("restriction")
public class InstrumentationServerManager {

private final RubyContext context;
@@ -57,16 +57,10 @@ public void handle(HttpExchange httpExchange) {
try {
final StringBuilder builder = new StringBuilder();

final Thread serverThread = Thread.currentThread();

context.getSafepointManager().pauseAllThreadsAndExecuteFromNonRubyThread(false, new SafepointAction() {
@Override
public void run(DynamicObject thread, Node currentNode) {
synchronized (this) {
if (Thread.currentThread() == serverThread) {
return;
}

try {
final Backtrace backtrace = context.getCallStack().getBacktrace(null);