diff --git a/classpath/java/util/Hashtable.java b/classpath/java/util/Hashtable.java index 2043fc0633..6bfd96b68d 100644 --- a/classpath/java/util/Hashtable.java +++ b/classpath/java/util/Hashtable.java @@ -11,6 +11,10 @@ public class Hashtable implements Map { this(0); } + public String toString() { + return map.toString(); + } + public synchronized int size() { return map.size(); } diff --git a/classpath/java/util/LinkedList.java b/classpath/java/util/LinkedList.java index 5deae40931..3cfa4447e1 100644 --- a/classpath/java/util/LinkedList.java +++ b/classpath/java/util/LinkedList.java @@ -32,8 +32,8 @@ public class LinkedList implements List { if (front == null) { front = rear = c; } else { - c.prev = rear; - rear = c; + c.next = front; + front = c; } } @@ -43,8 +43,8 @@ public class LinkedList implements List { if (front == null) { front = rear = c; } else { - c.next = front; - front = c; + c.prev = rear; + rear = c; } } diff --git a/makefile b/makefile index ff0ad44095..f4b84a877e 100644 --- a/makefile +++ b/makefile @@ -173,6 +173,14 @@ debug-jscheme: $(executable) $(input) vg-jscheme: $(executable) $(input) LD_LIBRARY_PATH=$(bld) $(vg) $(<) -cp $(cls):$(jscheme) $(jscheme-command) +.PHONY: profile-jscheme +profile-jscheme: $(executable) $(input) + opcontrol --start; \ + echo '(+ 5 6)' | LD_LIBRARY_PATH=$(bld) \ + $(<) -cp $(cls):$(jscheme) jscheme/REPL; \ + opcontrol --stop; \ + opreport -l $(<) + .PHONY: clean clean: @echo "removing build" diff --git a/src/builtin.cpp b/src/builtin.cpp index 1f4cf5f0a6..4307107f15 100644 --- a/src/builtin.cpp +++ b/src/builtin.cpp @@ -16,10 +16,11 @@ replace(char a, char b, char* c) jstring Object_toString(Thread* t, jobject this_) { + unsigned hash = objectHash(t, *this_); object s = makeString - (t, "%s@%p", + (t, "%s@0x%x", &byteArrayBody(t, className(t, objectClass(t, *this_)), 0), - *this_); + hash); return pushReference(t, s); } diff --git a/src/heap.cpp b/src/heap.cpp index 35dab96254..9b0a8d95c5 100644 --- a/src/heap.cpp +++ b/src/heap.cpp @@ -744,7 +744,7 @@ bitsetSet(uintptr_t* p, unsigned i, bool v) } } -unsigned +bool bitsetHasMore(uintptr_t* p) { switch (*p) { @@ -770,7 +770,8 @@ bitsetHasMore(uintptr_t* p) unsigned bitsetNext(Context* c, uintptr_t* p) { - assert(c, bitsetHasMore(p)); + bool more UNUSED = bitsetHasMore(p); + assert(c, more); switch (*p) { case 0: abort(c); diff --git a/src/machine.cpp b/src/machine.cpp index 6571e82b40..d2046e815c 100644 --- a/src/machine.cpp +++ b/src/machine.cpp @@ -1708,9 +1708,11 @@ isAssignableFrom(Thread* t, object a, object b) if (classFlags(t, a) & ACC_INTERFACE) { for (; b; b = classSuper(t, b)) { object itable = classInterfaceTable(t, b); - for (unsigned i = 0; i < arrayLength(t, itable); i += 2) { - if (arrayBody(t, itable, i) == a) { - return true; + if (itable) { + for (unsigned i = 0; i < arrayLength(t, itable); i += 2) { + if (arrayBody(t, itable, i) == a) { + return true; + } } } }