1 // Copyright 2003 Adam Megacz, see the COPYING file for licensing [GPL]
7 /** encapsulates a single JavaScript thread and its state */
10 private static Hash javaThreadToContextMap = new Hash();
12 public Vec stack = new Vec();
14 /** at any point in time, one JS Context can be bound to each Java thread; this determines which context any call()s execute in */
15 public void bindToCurrentThread() { javaThreadToContextMap.put(Thread.currentThread(), this); }
16 public static Context getContextForCurrentThread() {
17 Context ret = (Context)javaThreadToContextMap.get(Thread.currentThread());
20 ret.bindToCurrentThread();
25 public static class CallMarker { public CallMarker() { } }
26 public static class LoopMarker { public int location; public LoopMarker(int location) { this.location = location; } }