mirror of
https://github.com/corda/corda.git
synced 2025-02-14 14:42:32 +00:00
Merge remote branch 'origin/master' into r0.5
This commit is contained in:
commit
5da8b96931
@ -4763,9 +4763,17 @@ class BranchEvent: public Event {
|
|||||||
|
|
||||||
if (not unreachable(this)) {
|
if (not unreachable(this)) {
|
||||||
if (firstConstant and secondConstant) {
|
if (firstConstant and secondConstant) {
|
||||||
if (shouldJump(c, type, size, firstConstant->value->value(),
|
int64_t firstValue = firstConstant->value->value();
|
||||||
secondConstant->value->value()))
|
int64_t secondValue = secondConstant->value->value();
|
||||||
{
|
|
||||||
|
if (size > BytesPerWord) {
|
||||||
|
firstValue |= findConstantSite
|
||||||
|
(c, first->nextWord)->value->value() << 32;
|
||||||
|
secondValue |= findConstantSite
|
||||||
|
(c, second->nextWord)->value->value() << 32;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (shouldJump(c, type, size, firstValue, secondValue)) {
|
||||||
apply(c, Jump, BytesPerWord, address->source, address->source);
|
apply(c, Jump, BytesPerWord, address->source, address->source);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
@ -2258,7 +2258,7 @@ Thread::Thread(Machine* m, object javaThread, Thread* parent):
|
|||||||
vtable(&(m->jniEnvVTable)),
|
vtable(&(m->jniEnvVTable)),
|
||||||
m(m),
|
m(m),
|
||||||
parent(parent),
|
parent(parent),
|
||||||
peer((parent ? parent->child : 0)),
|
peer(0),
|
||||||
child(0),
|
child(0),
|
||||||
waitNext(0),
|
waitNext(0),
|
||||||
state(NoState),
|
state(NoState),
|
||||||
@ -2331,9 +2331,6 @@ Thread::init()
|
|||||||
javaThread = m->classpath->makeThread(this, 0);
|
javaThread = m->classpath->makeThread(this, 0);
|
||||||
|
|
||||||
threadPeer(this, javaThread) = reinterpret_cast<jlong>(this);
|
threadPeer(this, javaThread) = reinterpret_cast<jlong>(this);
|
||||||
} else {
|
|
||||||
peer = parent->child;
|
|
||||||
parent->child = this;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
expect(this, m->system->success(m->system->make(&lock)));
|
expect(this, m->system->success(m->system->make(&lock)));
|
||||||
@ -2538,6 +2535,7 @@ enter(Thread* t, Thread::State s)
|
|||||||
-- t->m->daemonCount;
|
-- t->m->daemonCount;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
t->state = s;
|
t->state = s;
|
||||||
|
|
||||||
t->m->stateLock->notifyAll(t->systemThread);
|
t->m->stateLock->notifyAll(t->systemThread);
|
||||||
@ -3436,8 +3434,10 @@ postInitClass(Thread* t, object c)
|
|||||||
ACQUIRE(t, t->m->classLock);
|
ACQUIRE(t, t->m->classLock);
|
||||||
|
|
||||||
if (t->exception) {
|
if (t->exception) {
|
||||||
|
object exception = t->exception;
|
||||||
|
t->exception = 0;
|
||||||
t->exception = makeThrowable
|
t->exception = makeThrowable
|
||||||
(t, Machine::ExceptionInInitializerErrorType, 0, 0, t->exception);
|
(t, Machine::ExceptionInInitializerErrorType, 0, 0, exception);
|
||||||
|
|
||||||
classVmFlags(t, c) |= NeedInitFlag | InitErrorFlag;
|
classVmFlags(t, c) |= NeedInitFlag | InitErrorFlag;
|
||||||
classVmFlags(t, c) &= ~InitFlag;
|
classVmFlags(t, c) &= ~InitFlag;
|
||||||
@ -3737,7 +3737,10 @@ collect(Thread* t, Heap::CollectionType type)
|
|||||||
|
|
||||||
m->finalizeThread = m->processor->makeThread(m, javaThread, m->rootThread);
|
m->finalizeThread = m->processor->makeThread(m, javaThread, m->rootThread);
|
||||||
|
|
||||||
|
addThread(t, m->finalizeThread);
|
||||||
|
|
||||||
if (not startThread(t, m->finalizeThread)) {
|
if (not startThread(t, m->finalizeThread)) {
|
||||||
|
removeThread(t, m->finalizeThread);
|
||||||
m->finalizeThread = 0;
|
m->finalizeThread = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -3882,6 +3885,7 @@ makeTrace(Thread* t, Processor::StackWalker* walker)
|
|||||||
virtual bool visit(Processor::StackWalker* walker) {
|
virtual bool visit(Processor::StackWalker* walker) {
|
||||||
if (trace == 0) {
|
if (trace == 0) {
|
||||||
trace = makeObjectArray(t, walker->count());
|
trace = makeObjectArray(t, walker->count());
|
||||||
|
vm_assert(t, trace);
|
||||||
}
|
}
|
||||||
|
|
||||||
object e = makeTraceElement(t, walker->method(), walker->ip());
|
object e = makeTraceElement(t, walker->method(), walker->ip());
|
||||||
|
@ -1757,14 +1757,45 @@ startThread(Thread* t, Thread* p)
|
|||||||
return t->m->system->success(t->m->system->start(&(p->runnable)));
|
return t->m->system->success(t->m->system->start(&(p->runnable)));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
inline void
|
||||||
|
addThread(Thread* t, Thread* p)
|
||||||
|
{
|
||||||
|
ACQUIRE_RAW(t, t->m->stateLock);
|
||||||
|
|
||||||
|
assert(t, p->state == Thread::NoState);
|
||||||
|
|
||||||
|
p->state = Thread::IdleState;
|
||||||
|
++ t->m->liveCount;
|
||||||
|
|
||||||
|
p->peer = p->parent->child;
|
||||||
|
p->parent->child = p;
|
||||||
|
}
|
||||||
|
|
||||||
|
inline void
|
||||||
|
removeThread(Thread* t, Thread* p)
|
||||||
|
{
|
||||||
|
ACQUIRE_RAW(t, t->m->stateLock);
|
||||||
|
|
||||||
|
assert(t, p->state == Thread::IdleState);
|
||||||
|
|
||||||
|
-- t->m->liveCount;
|
||||||
|
|
||||||
|
t->m->stateLock->notifyAll(t->systemThread);
|
||||||
|
|
||||||
|
p->parent->child = p->peer;
|
||||||
|
}
|
||||||
|
|
||||||
inline Thread*
|
inline Thread*
|
||||||
startThread(Thread* t, object javaThread)
|
startThread(Thread* t, object javaThread)
|
||||||
{
|
{
|
||||||
Thread* p = t->m->processor->makeThread(t->m, javaThread, t);
|
Thread* p = t->m->processor->makeThread(t->m, javaThread, t);
|
||||||
|
|
||||||
|
addThread(t, p);
|
||||||
|
|
||||||
if (startThread(t, p)) {
|
if (startThread(t, p)) {
|
||||||
return p;
|
return p;
|
||||||
} else {
|
} else {
|
||||||
|
removeThread(t, p);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1795,6 +1826,8 @@ attachThread(Machine* m, bool daemon)
|
|||||||
Thread* t = m->processor->makeThread(m, 0, m->rootThread);
|
Thread* t = m->processor->makeThread(m, 0, m->rootThread);
|
||||||
m->system->attach(&(t->runnable));
|
m->system->attach(&(t->runnable));
|
||||||
|
|
||||||
|
addThread(t, t);
|
||||||
|
|
||||||
enter(t, Thread::ActiveState);
|
enter(t, Thread::ActiveState);
|
||||||
|
|
||||||
t->javaThread = m->classpath->makeThread(t, m->rootThread);
|
t->javaThread = m->classpath->makeThread(t, m->rootThread);
|
||||||
|
@ -60,6 +60,11 @@ public class Longs {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static void main(String[] args) throws Exception {
|
public static void main(String[] args) throws Exception {
|
||||||
|
{ long a = 0x1FFFFFFFFL;
|
||||||
|
long b = -1;
|
||||||
|
expect(a != b);
|
||||||
|
}
|
||||||
|
|
||||||
expect(Math.abs(-123L) == 123L);
|
expect(Math.abs(-123L) == 123L);
|
||||||
|
|
||||||
expect(readLongFrom(new java.io.InputStream() {
|
expect(readLongFrom(new java.io.InputStream() {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user