fix windows build

This commit is contained in:
Joel Dice 2008-04-11 17:01:17 -06:00
parent 680cb85b5b
commit aa9cb5c086
2 changed files with 9 additions and 15 deletions

View File

@ -129,8 +129,9 @@ compareIpToMethodBounds(Thread* t, intptr_t ip, object method)
if (ip < start) { if (ip < start) {
return -1; return -1;
} else if (ip < start + (singletonCount(t, methodCompiled(t, method)) } else if (ip < start + static_cast<intptr_t>
* BytesPerWord)) (singletonCount(t, methodCompiled(t, method))
* BytesPerWord))
{ {
return 0; return 0;
} else { } else {

View File

@ -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) ThreadVisitor* visitor)
{ {
assert(this, st != sTarget); assert(this, st != sTarget);
Thread* t = static_cast<Thread*>(st);
Thread* target = static_cast<Thread*>(sTarget); Thread* target = static_cast<Thread*>(sTarget);
ACQUIRE_MONITOR(t, visitLock); ACQUIRE(this, mutex);
while (target->visitor) traceLock->wait(t); int rv = SuspendThread(target->thread);
target->visitor = visitor;
DWORD rv = SuspendThread(target->thread);
expect(this, rv != -1); expect(this, rv != -1);
CONTEXT context; CONTEXT context;
rv = GetThreadContext(target->thread, &context); rv = GetThreadContext(target->thread, &context);
expect(this, rv); expect(this, rv);
visitor->visit(reinterpret_cast<void*>(context->Eip), visitor->visit(reinterpret_cast<void*>(context.Eip),
reinterpret_cast<void*>(context->Ebp), reinterpret_cast<void*>(context.Ebp),
reinterpret_cast<void*>(context->Esp)); reinterpret_cast<void*>(context.Esp));
rv = ResumeThread(target->thread); rv = ResumeThread(target->thread);
expect(this, rv != -1); expect(this, rv != -1);
target->visitor = 0;
return 0; return 0;
} }