mirror of
https://github.com/corda/corda.git
synced 2025-01-21 03:55:00 +00:00
fix frame object map size calculations
This commit is contained in:
parent
bd618a51f6
commit
f7a79f4874
@ -3793,6 +3793,13 @@ compareMethodBounds(Thread* t, object a, object b)
|
|||||||
(&singletonValue(t, methodCompiled(t, b), 0));
|
(&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
|
object
|
||||||
finish(MyThread* t, Context* context, const char* name)
|
finish(MyThread* t, Context* context, const char* name)
|
||||||
{
|
{
|
||||||
@ -3836,6 +3843,8 @@ finish(MyThread* t, Context* context, const char* name)
|
|||||||
TraceElement* elements[context->traceLogCount];
|
TraceElement* elements[context->traceLogCount];
|
||||||
unsigned index = 0;
|
unsigned index = 0;
|
||||||
for (TraceElement* p = context->traceLog; p; p = p->next) {
|
for (TraceElement* p = context->traceLog; p; p = p->next) {
|
||||||
|
assert(t, index < context->traceLogCount);
|
||||||
|
|
||||||
elements[index++] = p;
|
elements[index++] = p;
|
||||||
p->addressValue = p->address->value(c);
|
p->addressValue = p->address->value(c);
|
||||||
|
|
||||||
@ -3855,6 +3864,9 @@ finish(MyThread* t, Context* context, const char* name)
|
|||||||
+ ceiling(context->traceLogCount * size, 32),
|
+ ceiling(context->traceLogCount * size, 32),
|
||||||
false);
|
false);
|
||||||
|
|
||||||
|
assert(t, intArrayLength(t, map) == context->traceLogCount
|
||||||
|
+ frameObjectMapSize(t, context->method, map));
|
||||||
|
|
||||||
for (unsigned i = 0; i < context->traceLogCount; ++i) {
|
for (unsigned i = 0; i < context->traceLogCount; ++i) {
|
||||||
TraceElement* p = elements[i];
|
TraceElement* p = elements[i];
|
||||||
|
|
||||||
@ -4302,8 +4314,7 @@ unsigned
|
|||||||
frameMapIndex(MyThread* t, object method, int32_t offset)
|
frameMapIndex(MyThread* t, object method, int32_t offset)
|
||||||
{
|
{
|
||||||
object map = codePool(t, methodCode(t, method));
|
object map = codePool(t, methodCode(t, method));
|
||||||
unsigned mapSize = ceiling
|
unsigned mapSize = frameObjectMapSize(t, method, map);
|
||||||
(intArrayLength(t, map), (32 / frameSize(t, method)) + 1);
|
|
||||||
unsigned indexSize = intArrayLength(t, map) - mapSize;
|
unsigned indexSize = intArrayLength(t, map) - mapSize;
|
||||||
|
|
||||||
unsigned bottom = 0;
|
unsigned bottom = 0;
|
||||||
|
@ -2258,6 +2258,7 @@ inline object
|
|||||||
makeSingleton(Thread* t, unsigned count)
|
makeSingleton(Thread* t, unsigned count)
|
||||||
{
|
{
|
||||||
object o = makeSingleton(t, count + singletonMaskSize(count), true);
|
object o = makeSingleton(t, count + singletonMaskSize(count), true);
|
||||||
|
assert(t, singletonLength(t, o) == count + singletonMaskSize(t, o));
|
||||||
if (count) {
|
if (count) {
|
||||||
singletonMask(t, o)[0] = 1;
|
singletonMask(t, o)[0] = 1;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user