mirror of
https://github.com/corda/corda.git
synced 2025-03-05 13:30:50 +00:00
put all commented code in if(false) blocks instead; fix ensuing broken code
This commit is contained in:
parent
4e9da8deb2
commit
80f19abf3a
@ -594,9 +594,13 @@ object invoke(Thread* t, GcMethod* method, object instance, object args)
|
||||
object arg = objectArrayBody(t, args, i++);
|
||||
if ((arg == 0 and (not objectType))
|
||||
or (arg and (not instanceOf(t, type, arg)))) {
|
||||
// fprintf(stderr, "%s is not a %s\n", arg ? &byteArrayBody(t,
|
||||
// className(t, objectClass(t, arg)), 0) : reinterpret_cast<const
|
||||
// int8_t*>("<null>"), &byteArrayBody(t, className(t, type), 0));
|
||||
if (false) {
|
||||
fprintf(stderr,
|
||||
"%s is not a %s\n",
|
||||
arg ? objectClass(t, arg)->name()->body().begin()
|
||||
: reinterpret_cast<const int8_t*>("<null>"),
|
||||
type->name()->body().begin());
|
||||
}
|
||||
|
||||
throwNew(t, GcIllegalArgumentException::Type);
|
||||
}
|
||||
@ -661,12 +665,17 @@ void intercept(Thread* t,
|
||||
} else {
|
||||
// If we can't find the method, just ignore it, since ProGuard may
|
||||
// have stripped it out as unused. Otherwise, the code below can
|
||||
// be uncommented for debugging purposes.
|
||||
// be enabled for debugging purposes.
|
||||
|
||||
// fprintf(stderr, "unable to find %s%s in %s\n",
|
||||
// name, spec, &byteArrayBody(t, c->name(), 0));
|
||||
if (false) {
|
||||
fprintf(stderr,
|
||||
"unable to find %s%s in %s\n",
|
||||
name,
|
||||
spec,
|
||||
c->name()->body().begin());
|
||||
|
||||
// abort(t);
|
||||
abort(t);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1354,11 +1354,14 @@ unsigned frameFootprint(Context* c, Stack* s)
|
||||
|
||||
void visit(Context* c, Link* link)
|
||||
{
|
||||
// fprintf(stderr, "visit link from %d to %d fork %p junction %p\n",
|
||||
// link->predecessor->logicalInstruction->index,
|
||||
// link->successor->logicalInstruction->index,
|
||||
// link->forkState,
|
||||
// link->junctionState);
|
||||
if (false) {
|
||||
fprintf(stderr,
|
||||
"visit link from %d to %d fork %p junction %p\n",
|
||||
link->predecessor->logicalInstruction->index,
|
||||
link->successor->logicalInstruction->index,
|
||||
link->forkState,
|
||||
link->junctionState);
|
||||
}
|
||||
|
||||
ForkState* forkState = link->forkState;
|
||||
if (forkState) {
|
||||
@ -1366,8 +1369,9 @@ void visit(Context* c, Link* link)
|
||||
ForkElement* p = forkState->elements + i;
|
||||
Value* v = p->value;
|
||||
v->reads = p->read->nextTarget();
|
||||
// fprintf(stderr, "next read %p for %p from %p\n", v->reads, v,
|
||||
// p->read);
|
||||
if (false) {
|
||||
fprintf(stderr, "next read %p for %p from %p\n", v->reads, v, p->read);
|
||||
}
|
||||
if (not live(c, v)) {
|
||||
v->clearSites(c);
|
||||
}
|
||||
@ -1865,9 +1869,16 @@ void restore(Context* c, Event* e, Snapshot* snapshots)
|
||||
}
|
||||
}
|
||||
|
||||
// char buffer[256]; sitesToString(c, s->sites, buffer, 256);
|
||||
// fprintf(stderr, "restore %p buddy %p sites %s live %p\n",
|
||||
// s->value, s->value->buddy, buffer, live(c, s->value));
|
||||
if (false) {
|
||||
char buffer[256];
|
||||
sitesToString(c, s->sites, buffer, 256);
|
||||
fprintf(stderr,
|
||||
"restore %p buddy %p sites %s live %p\n",
|
||||
s->value,
|
||||
s->value->buddy,
|
||||
buffer,
|
||||
live(c, s->value));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -148,9 +148,9 @@ void Event::addRead(Context* c, Value* v, Read* r)
|
||||
}
|
||||
|
||||
if (v->lastRead) {
|
||||
// if (DebugReads) {
|
||||
// fprintf(stderr, "append %p to %p for %p\n", r, v->lastRead, v);
|
||||
// }
|
||||
if (DebugReads) {
|
||||
fprintf(stderr, "append %p to %p for %p\n", r, v->lastRead, v);
|
||||
}
|
||||
|
||||
v->lastRead->append(c, r);
|
||||
} else {
|
||||
@ -298,9 +298,9 @@ Value* slicePushWord(Context* c,
|
||||
assertT(c, slice.count < slice.capacity);
|
||||
slice.push(v);
|
||||
|
||||
// if (DebugFrame) {
|
||||
// fprintf(stderr, "push %p\n", v);
|
||||
// }
|
||||
if (false) {
|
||||
fprintf(stderr, "push %p\n", v);
|
||||
}
|
||||
|
||||
if (v) {
|
||||
v->home = frameIndex(c, index + stackBase + c->localFootprint);
|
||||
@ -1102,13 +1102,19 @@ class CombineEvent : public Event {
|
||||
c,
|
||||
firstValue->source->type(c) == firstValue->nextWord->source->type(c));
|
||||
|
||||
// if (secondValue->source->type(c) !=
|
||||
// secondValue->nextWord->source->type(c)) {
|
||||
// fprintf(stderr, "%p %p %d : %p %p %d\n",
|
||||
// secondValue, secondValue->source, secondValue->source->type(c),
|
||||
// secondValue->nextWord, secondValue->nextWord->source,
|
||||
// secondValue->nextWord->source->type(c));
|
||||
// }
|
||||
if (false) {
|
||||
if (secondValue->source->type(c)
|
||||
!= secondValue->nextWord->source->type(c)) {
|
||||
fprintf(stderr,
|
||||
"%p %p %d : %p %p %d\n",
|
||||
secondValue,
|
||||
secondValue->source,
|
||||
secondValue->source->type(c),
|
||||
secondValue->nextWord,
|
||||
secondValue->nextWord->source,
|
||||
secondValue->nextWord->source->type(c));
|
||||
}
|
||||
}
|
||||
|
||||
assertT(
|
||||
c,
|
||||
@ -1149,10 +1155,16 @@ class CombineEvent : public Event {
|
||||
resultHighMask)
|
||||
: low);
|
||||
|
||||
// fprintf(stderr, "combine %p:%p and %p:%p into %p:%p\n",
|
||||
// firstValue, firstValue->nextWord,
|
||||
// secondValue, secondValue->nextWord,
|
||||
// resultValue, resultValue->nextWord);
|
||||
if (false) {
|
||||
fprintf(stderr,
|
||||
"combine %p:%p and %p:%p into %p:%p\n",
|
||||
firstValue,
|
||||
firstValue->nextWord,
|
||||
secondValue,
|
||||
secondValue->nextWord,
|
||||
resultValue,
|
||||
resultValue->nextWord);
|
||||
}
|
||||
|
||||
apply(c,
|
||||
op,
|
||||
|
@ -123,7 +123,9 @@ void MultiRead::append(Context* c, Read* r)
|
||||
}
|
||||
lastRead = cell;
|
||||
|
||||
// fprintf(stderr, "append %p to %p for %p\n", r, lastTarget, this);
|
||||
if (false) {
|
||||
fprintf(stderr, "append %p to %p for %p\n", r, lastTarget, this);
|
||||
}
|
||||
|
||||
lastTarget->item = r;
|
||||
}
|
||||
@ -137,7 +139,9 @@ void MultiRead::allocateTarget(Context* c)
|
||||
{
|
||||
List<Read*>* cell = cons<Read*>(c, 0, 0);
|
||||
|
||||
// fprintf(stderr, "allocate target for %p: %p\n", this, cell);
|
||||
if (false) {
|
||||
fprintf(stderr, "allocate target for %p: %p\n", this, cell);
|
||||
}
|
||||
|
||||
if (lastTarget) {
|
||||
lastTarget->next = cell;
|
||||
@ -149,7 +153,9 @@ void MultiRead::allocateTarget(Context* c)
|
||||
|
||||
Read* MultiRead::nextTarget()
|
||||
{
|
||||
// fprintf(stderr, "next target for %p: %p\n", this, firstTarget);
|
||||
if (false) {
|
||||
fprintf(stderr, "next target for %p: %p\n", this, firstTarget);
|
||||
}
|
||||
|
||||
Read* r = firstTarget->item;
|
||||
firstTarget = firstTarget->next;
|
||||
|
@ -989,8 +989,12 @@ class MyAssembler : public Assembler {
|
||||
static_cast<target_uintptr_t*>(e->address),
|
||||
e->callOffset ? dst + e->callOffset->value() + 8 : 0);
|
||||
}
|
||||
// fprintf(stderr, "constant %p at %p\n",
|
||||
// reinterpret_cast<void*>(e->constant->value()), e->address);
|
||||
if (false) {
|
||||
fprintf(stderr,
|
||||
"constant %p at %p\n",
|
||||
reinterpret_cast<void*>(e->constant->value()),
|
||||
e->address);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -450,20 +450,18 @@ void nextFrame(MyThread* t,
|
||||
methodIsMostRecent = false;
|
||||
}
|
||||
|
||||
// fprintf(stderr, "nextFrame %s.%s%s target %s.%s%s ip %p sp %p\n",
|
||||
// method->class_()->name()->body().begin(),
|
||||
// method->name()->body().begin(),
|
||||
// method->spec()->body().begin(),
|
||||
// target
|
||||
// ? &byteArrayBody(t, target->class_()->name(), 0)
|
||||
// : 0,
|
||||
// target
|
||||
// ? &byteArrayBody(t, target->name(), 0)
|
||||
// : 0,
|
||||
// target
|
||||
// ? &byteArrayBody(t, target->spec(), 0)
|
||||
// : 0,
|
||||
// *ip, *sp);
|
||||
if (false) {
|
||||
fprintf(stderr,
|
||||
"nextFrame %s.%s%s target %s.%s%s ip %p sp %p\n",
|
||||
method->class_()->name()->body().begin(),
|
||||
method->name()->body().begin(),
|
||||
method->spec()->body().begin(),
|
||||
target ? target->class_()->name()->body().begin() : 0,
|
||||
target ? target->name()->body().begin() : 0,
|
||||
target ? target->spec()->body().begin() : 0,
|
||||
*ip,
|
||||
*sp);
|
||||
}
|
||||
|
||||
t->arch->nextFrame(reinterpret_cast<void*>(start),
|
||||
code->compiledSize(),
|
||||
@ -474,7 +472,9 @@ void nextFrame(MyThread* t,
|
||||
ip,
|
||||
sp);
|
||||
|
||||
// fprintf(stderr, "next frame ip %p sp %p\n", *ip, *sp);
|
||||
if (false) {
|
||||
fprintf(stderr, "next frame ip %p sp %p\n", *ip, *sp);
|
||||
}
|
||||
}
|
||||
|
||||
void* getIp(MyThread* t, void* ip, void* stack)
|
||||
@ -556,7 +556,9 @@ class MyStackWalker : public Processor::StackWalker {
|
||||
bool valid()
|
||||
{
|
||||
while (true) {
|
||||
// fprintf(stderr, "state: %d\n", state);
|
||||
if (false) {
|
||||
fprintf(stderr, "state: %d\n", state);
|
||||
}
|
||||
switch (state) {
|
||||
case Start:
|
||||
if (trace and trace->nativeMethod) {
|
||||
@ -638,9 +640,12 @@ class MyStackWalker : public Processor::StackWalker {
|
||||
|
||||
virtual GcMethod* method()
|
||||
{
|
||||
// fprintf(stderr, "method %s.%s\n", &byteArrayBody
|
||||
// (t, className(t, methodClass(t, method_)), 0),
|
||||
// &byteArrayBody(t, methodName(t, method_), 0));
|
||||
if (false) {
|
||||
fprintf(stderr,
|
||||
"method %s.%s\n",
|
||||
method_->class_()->name()->body().begin(),
|
||||
method_->name()->body().begin());
|
||||
}
|
||||
return method_;
|
||||
}
|
||||
|
||||
@ -3924,8 +3929,6 @@ loop:
|
||||
c->threadRegister());
|
||||
}
|
||||
|
||||
// fprintf(stderr, "ip: %d map: %ld\n", ip, *(frame->map));
|
||||
|
||||
if (DebugInstructions) {
|
||||
unsigned startingIp = ip;
|
||||
fprintf(stderr, " stack: [");
|
||||
@ -6991,10 +6994,13 @@ void compile(MyThread* t, Context* context)
|
||||
{
|
||||
avian::codegen::Compiler* c = context->compiler;
|
||||
|
||||
// fprintf(stderr, "compiling %s.%s%s\n",
|
||||
// context->method->class_()->name()->body().begin(),
|
||||
// context->method->name()->body().begin(),
|
||||
// context->method->spec()->body().begin());
|
||||
if (false) {
|
||||
fprintf(stderr,
|
||||
"compiling %s.%s%s\n",
|
||||
context->method->class_()->name()->body().begin(),
|
||||
context->method->name()->body().begin(),
|
||||
context->method->spec()->body().begin());
|
||||
}
|
||||
|
||||
unsigned footprint = context->method->parameterFootprint();
|
||||
unsigned locals = localSize(t, context->method);
|
||||
@ -9527,8 +9533,13 @@ void fixupHeap(MyThread* t UNUSED,
|
||||
|
||||
if (number) {
|
||||
*p = reinterpret_cast<uintptr_t>(heap + (number - 1)) | mark;
|
||||
// fprintf(stderr, "fixup %d: %d 0x%x\n", index,
|
||||
// static_cast<unsigned>(number), static_cast<unsigned>(*p));
|
||||
if (false) {
|
||||
fprintf(stderr,
|
||||
"fixup %d: %d 0x%x\n",
|
||||
index,
|
||||
static_cast<unsigned>(number),
|
||||
static_cast<unsigned>(*p));
|
||||
}
|
||||
} else {
|
||||
*p = mark;
|
||||
}
|
||||
@ -9675,14 +9686,19 @@ void boot(MyThread* t, BootImage* image, uint8_t* code)
|
||||
|
||||
t->heapImage = p->heapImage = heap;
|
||||
|
||||
// fprintf(stderr, "heap from %p to %p\n",
|
||||
// heap, heap + ceilingDivide(image->heapSize, BytesPerWord));
|
||||
if (false) {
|
||||
fprintf(stderr,
|
||||
"heap from %p to %p\n",
|
||||
heap,
|
||||
heap + ceilingDivide(image->heapSize, BytesPerWord));
|
||||
}
|
||||
|
||||
t->codeImage = p->codeImage = code;
|
||||
p->codeImageSize = image->codeSize;
|
||||
|
||||
// fprintf(stderr, "code from %p to %p\n",
|
||||
// code, code + image->codeSize);
|
||||
if (false) {
|
||||
fprintf(stderr, "code from %p to %p\n", code, code + image->codeSize);
|
||||
}
|
||||
|
||||
if (not image->initialized) {
|
||||
fixupHeap(t, heapMap, heapMapSizeInWords, heap);
|
||||
|
@ -3088,9 +3088,14 @@ uint64_t registerNatives(Thread* t, uintptr_t* arguments)
|
||||
// case, but that would prevent using a code shrinker like
|
||||
// ProGuard effectively. Instead, we just ignore it.
|
||||
|
||||
// fprintf(stderr, "not found: %s.%s%s\n", &byteArrayBody(t,
|
||||
// className(t, (*c)->vmClass()), 0), methods[i].name, sig);
|
||||
// abort(t);
|
||||
if (false) {
|
||||
fprintf(stderr,
|
||||
"not found: %s.%s%s\n",
|
||||
(*c)->vmClass()->name()->body().begin(),
|
||||
methods[i].name,
|
||||
sig);
|
||||
abort(t);
|
||||
}
|
||||
} else {
|
||||
registerNative(t, method, methods[i].function);
|
||||
}
|
||||
|
@ -3536,16 +3536,18 @@ object findInTable(Thread* t,
|
||||
}
|
||||
}
|
||||
|
||||
// fprintf(stderr, "%s %s not in\n",
|
||||
// name->body().begin(),
|
||||
// spec->body().begin();
|
||||
if (false) {
|
||||
fprintf(
|
||||
stderr, "%s %s not in\n", name->body().begin(), spec->body().begin());
|
||||
|
||||
// for (unsigned i = 0; i < arrayLength(t, table); ++i) {
|
||||
// object o = arrayBody(t, table, i);
|
||||
// fprintf(stderr, "\t%s %s\n",
|
||||
// &byteArrayBody(t, getName(t, o), 0),
|
||||
// &byteArrayBody(t, getSpec(t, o), 0));
|
||||
// }
|
||||
for (unsigned i = 0; i < table->length(); ++i) {
|
||||
object o = table->body()[i];
|
||||
fprintf(stderr,
|
||||
"\t%s %s\n",
|
||||
getName(t, o)->body().begin(),
|
||||
getSpec(t, o)->body().begin());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
@ -354,7 +354,9 @@ GcTriple* makeCodeImage(Thread* t,
|
||||
|
||||
if (endsWith(".class", name, nameSize)
|
||||
and (className == 0 or strncmp(name, className, nameSize - 6) == 0)) {
|
||||
// fprintf(stderr, "pass 1 %.*s\n", nameSize - 6, name);
|
||||
if (false) {
|
||||
fprintf(stderr, "pass 1 %.*s\n", nameSize - 6, name);
|
||||
}
|
||||
GcClass* c
|
||||
= resolveSystemClass(t,
|
||||
roots(t)->bootLoader(),
|
||||
@ -690,7 +692,9 @@ GcTriple* makeCodeImage(Thread* t,
|
||||
|
||||
if (endsWith(".class", name, nameSize)
|
||||
and (className == 0 or strncmp(name, className, nameSize - 6) == 0)) {
|
||||
// fprintf(stderr, "pass 2 %.*s\n", nameSize - 6, name);
|
||||
if (false) {
|
||||
fprintf(stderr, "pass 2 %.*s\n", nameSize - 6, name);
|
||||
}
|
||||
GcClass* c = 0;
|
||||
PROTECT(t, c);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user