diff --git a/src/compile.cpp b/src/compile.cpp index f09917e268..fde69807f0 100644 --- a/src/compile.cpp +++ b/src/compile.cpp @@ -129,8 +129,9 @@ compareIpToMethodBounds(Thread* t, intptr_t ip, object method) if (ip < start) { return -1; - } else if (ip < start + (singletonCount(t, methodCompiled(t, method)) - * BytesPerWord)) + } else if (ip < start + static_cast + (singletonCount(t, methodCompiled(t, method)) + * BytesPerWord)) { return 0; } else { diff --git a/src/windows.cpp b/src/windows.cpp index 2cbca5cbf2..932ab2e2e2 100644 --- a/src/windows.cpp +++ b/src/windows.cpp @@ -564,35 +564,28 @@ class MySystem: public System { } } - virtual Status visit(System::Thread* st, System::Thread* sTarget, + virtual Status visit(System::Thread* st UNUSED, System::Thread* sTarget, ThreadVisitor* visitor) { assert(this, st != sTarget); - Thread* t = static_cast(st); Thread* target = static_cast(sTarget); - ACQUIRE_MONITOR(t, visitLock); + ACQUIRE(this, mutex); - while (target->visitor) traceLock->wait(t); - - target->visitor = visitor; - - DWORD rv = SuspendThread(target->thread); + int rv = SuspendThread(target->thread); expect(this, rv != -1); CONTEXT context; rv = GetThreadContext(target->thread, &context); expect(this, rv); - visitor->visit(reinterpret_cast(context->Eip), - reinterpret_cast(context->Ebp), - reinterpret_cast(context->Esp)); + visitor->visit(reinterpret_cast(context.Eip), + reinterpret_cast(context.Ebp), + reinterpret_cast(context.Esp)); rv = ResumeThread(target->thread); expect(this, rv != -1); - - target->visitor = 0; return 0; }