fix frame object map size calculations

This commit is contained in:
Joel Dice 2008-04-11 15:00:18 -06:00
parent bd618a51f6
commit f7a79f4874
2 changed files with 14 additions and 2 deletions

View File

@ -3793,6 +3793,13 @@ compareMethodBounds(Thread* t, object a, object b)
(&singletonValue(t, methodCompiled(t, b), 0));
}
unsigned
frameObjectMapSize(MyThread* t, object method, object map)
{
int size = frameSize(t, method);
return ceiling(intArrayLength(t, map) * size, 32 + size);
}
object
finish(MyThread* t, Context* context, const char* name)
{
@ -3836,6 +3843,8 @@ finish(MyThread* t, Context* context, const char* name)
TraceElement* elements[context->traceLogCount];
unsigned index = 0;
for (TraceElement* p = context->traceLog; p; p = p->next) {
assert(t, index < context->traceLogCount);
elements[index++] = p;
p->addressValue = p->address->value(c);
@ -3855,6 +3864,9 @@ finish(MyThread* t, Context* context, const char* name)
+ ceiling(context->traceLogCount * size, 32),
false);
assert(t, intArrayLength(t, map) == context->traceLogCount
+ frameObjectMapSize(t, context->method, map));
for (unsigned i = 0; i < context->traceLogCount; ++i) {
TraceElement* p = elements[i];
@ -4302,8 +4314,7 @@ unsigned
frameMapIndex(MyThread* t, object method, int32_t offset)
{
object map = codePool(t, methodCode(t, method));
unsigned mapSize = ceiling
(intArrayLength(t, map), (32 / frameSize(t, method)) + 1);
unsigned mapSize = frameObjectMapSize(t, method, map);
unsigned indexSize = intArrayLength(t, map) - mapSize;
unsigned bottom = 0;

View File

@ -2258,6 +2258,7 @@ inline object
makeSingleton(Thread* t, unsigned count)
{
object o = makeSingleton(t, count + singletonMaskSize(count), true);
assert(t, singletonLength(t, o) == count + singletonMaskSize(t, o));
if (count) {
singletonMask(t, o)[0] = 1;
}