diff --git a/src/compile.cpp b/src/compile.cpp index 9845ec598a..22fc715c49 100644 --- a/src/compile.cpp +++ b/src/compile.cpp @@ -3875,11 +3875,11 @@ finish(MyThread* t, Context* context) strcmp (reinterpret_cast (&byteArrayBody(t, className(t, methodClass(t, context->method)), 0)), - "java/lang/Class") == 0 and + "java/lang/Number") == 0 and strcmp (reinterpret_cast (&byteArrayBody(t, methodName(t, context->method), 0)), - "replace") == 0) + "") == 0) { asm("int3"); } diff --git a/src/compiler.cpp b/src/compiler.cpp index 06ec5fb361..86d36f8cfd 100644 --- a/src/compiler.cpp +++ b/src/compiler.cpp @@ -332,7 +332,7 @@ class Event { virtual void compile(Context* c) = 0; - virtual bool isBranch() { return false; }; + virtual bool skipMove(unsigned) { return false; } Event* next; Stack* stack; @@ -682,6 +682,11 @@ class ValueSite: public AbstractSite { if (s and s->type(c) == RegisterOperand) { return s; } else { + for (Site* s = r->value->sites; s; s = s->next) { + if (s->type(c) == RegisterOperand) { + return s; + } + } return freeRegister(c, r->size, true); } } @@ -988,6 +993,10 @@ class PushEvent: public Event { nextRead(c, s->value); } + virtual bool skipMove(unsigned size) { + return active and size >= 4; + } + Stack* s; bool active; }; @@ -1182,9 +1191,9 @@ class MoveEvent: public Event { Site* target; unsigned cost; if (type == Move - and size >= BytesPerWord and dst->reads - and next == dst->reads->event) + and next == dst->reads->event + and dst->reads->event->skipMove(size)) { target = src->source; cost = 0; @@ -1575,8 +1584,6 @@ class BranchEvent: public Event { nextRead(c, address); } - virtual bool isBranch() { return true; }; - UnaryOperation type; Value* address; };