mirror of
https://github.com/corda/corda.git
synced 2025-01-31 16:35:43 +00:00
fix regressions for non-bootimage case
This commit is contained in:
parent
93d4fbc43d
commit
58a90f2b84
29
src/heap.cpp
29
src/heap.cpp
@ -430,15 +430,18 @@ class Segment {
|
|||||||
|
|
||||||
class Fixie {
|
class Fixie {
|
||||||
public:
|
public:
|
||||||
Fixie(unsigned size, bool hasMask, Fixie** handle, bool immortal):
|
Fixie(Context* c, unsigned size, bool hasMask, Fixie** handle,
|
||||||
|
bool immortal):
|
||||||
age(immortal ? FixieTenureThreshold + 1 : 0),
|
age(immortal ? FixieTenureThreshold + 1 : 0),
|
||||||
hasMask(hasMask),
|
hasMask(hasMask),
|
||||||
marked(false),
|
marked(false),
|
||||||
dirty(false),
|
dirty(false),
|
||||||
size(size)
|
size(size),
|
||||||
|
next(0),
|
||||||
|
handle(0)
|
||||||
{
|
{
|
||||||
memset(mask(), 0, maskSize(size, hasMask));
|
memset(mask(), 0, maskSize(size, hasMask));
|
||||||
add(handle);
|
add(c, handle);
|
||||||
if (DebugFixies) {
|
if (DebugFixies) {
|
||||||
fprintf(stderr, "make fixie %p of size %d\n", this, totalSize());
|
fprintf(stderr, "make fixie %p of size %d\n", this, totalSize());
|
||||||
}
|
}
|
||||||
@ -448,7 +451,10 @@ class Fixie {
|
|||||||
return age == FixieTenureThreshold + 1;
|
return age == FixieTenureThreshold + 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
void add(Fixie** handle) {
|
void add(Context* c UNUSED, Fixie** handle) {
|
||||||
|
assert(c, this->handle == 0);
|
||||||
|
assert(c, next == 0);
|
||||||
|
|
||||||
this->handle = handle;
|
this->handle = handle;
|
||||||
if (handle) {
|
if (handle) {
|
||||||
next = *handle;
|
next = *handle;
|
||||||
@ -467,6 +473,7 @@ class Fixie {
|
|||||||
if (next) {
|
if (next) {
|
||||||
next->handle = handle;
|
next->handle = handle;
|
||||||
}
|
}
|
||||||
|
next = 0;
|
||||||
handle = 0;
|
handle = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -476,7 +483,7 @@ class Fixie {
|
|||||||
}
|
}
|
||||||
|
|
||||||
remove(c);
|
remove(c);
|
||||||
add(handle);
|
add(c, handle);
|
||||||
}
|
}
|
||||||
|
|
||||||
void** body() {
|
void** body() {
|
||||||
@ -857,14 +864,14 @@ sweepFixies(Context* c)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (f->dirty) {
|
if (f->dirty) {
|
||||||
f->add(&(c->dirtyTenuredFixies));
|
f->add(c, &(c->dirtyTenuredFixies));
|
||||||
} else {
|
} else {
|
||||||
f->add(&(c->tenuredFixies));
|
f->add(c, &(c->tenuredFixies));
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
c->untenuredFixieFootprint += f->totalSize();
|
c->untenuredFixieFootprint += f->totalSize();
|
||||||
|
|
||||||
f->add(&(c->fixies));
|
f->add(c, &(c->fixies));
|
||||||
}
|
}
|
||||||
|
|
||||||
f->marked = false;
|
f->marked = false;
|
||||||
@ -1470,7 +1477,7 @@ visitMarkedFixies(Context* c)
|
|||||||
|
|
||||||
c->client->walk(f->body(), &w);
|
c->client->walk(f->body(), &w);
|
||||||
|
|
||||||
f->add(&(c->visitedFixies));
|
f->move(c, &(c->visitedFixies));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1730,7 +1737,7 @@ class MyHeap: public Heap {
|
|||||||
{
|
{
|
||||||
*totalInBytes = Fixie::totalSize(sizeInWords, objectMask);
|
*totalInBytes = Fixie::totalSize(sizeInWords, objectMask);
|
||||||
return (new (allocator->allocate(*totalInBytes))
|
return (new (allocator->allocate(*totalInBytes))
|
||||||
Fixie(sizeInWords, objectMask, &(c.fixies), false))->body();
|
Fixie(&c, sizeInWords, objectMask, &(c.fixies), false))->body();
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void* allocateImmortalFixed(Allocator* allocator,
|
virtual void* allocateImmortalFixed(Allocator* allocator,
|
||||||
@ -1739,7 +1746,7 @@ class MyHeap: public Heap {
|
|||||||
{
|
{
|
||||||
*totalInBytes = Fixie::totalSize(sizeInWords, objectMask);
|
*totalInBytes = Fixie::totalSize(sizeInWords, objectMask);
|
||||||
return (new (allocator->allocate(*totalInBytes))
|
return (new (allocator->allocate(*totalInBytes))
|
||||||
Fixie(sizeInWords, objectMask, 0, true))->body();
|
Fixie(&c, sizeInWords, objectMask, 0, true))->body();
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual bool needsMark(void* p) {
|
virtual bool needsMark(void* p) {
|
||||||
|
@ -1572,6 +1572,8 @@ boot(Thread* t)
|
|||||||
|
|
||||||
m->stringMap = makeWeakHashMap(t, 0, 0);
|
m->stringMap = makeWeakHashMap(t, 0, 0);
|
||||||
|
|
||||||
|
m->processor->boot(t, 0);
|
||||||
|
|
||||||
{ object bootCode = makeCode(t, 0, 0, 0, 0, 0, 1, false);
|
{ object bootCode = makeCode(t, 0, 0, 0, 0, 0, 1, false);
|
||||||
codeBody(t, bootCode, 0) = impdep1;
|
codeBody(t, bootCode, 0) = impdep1;
|
||||||
object bootMethod = makeMethod
|
object bootMethod = makeMethod
|
||||||
@ -1816,7 +1818,6 @@ Thread::init()
|
|||||||
m->processor->boot(this, image);
|
m->processor->boot(this, image);
|
||||||
} else {
|
} else {
|
||||||
boot(this);
|
boot(this);
|
||||||
m->processor->boot(this, 0);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
m->monitorMap = makeWeakHashMap(this, 0, 0);
|
m->monitorMap = makeWeakHashMap(this, 0, 0);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user