mirror of
https://github.com/corda/corda.git
synced 2025-02-11 21:26:23 +00:00
Merge branch 'master' of oss.readytalk.com:/var/local/git/avian
This commit is contained in:
commit
843b9102f2
@ -38,6 +38,7 @@ public final class Class <T> implements Type, GenericDeclaration {
|
|||||||
private byte arrayDimensions;
|
private byte arrayDimensions;
|
||||||
private int[] objectMask;
|
private int[] objectMask;
|
||||||
private byte[] name;
|
private byte[] name;
|
||||||
|
private byte[] sourceFile;
|
||||||
private Class super_;
|
private Class super_;
|
||||||
private Object[] interfaceTable;
|
private Object[] interfaceTable;
|
||||||
private Method[] virtualTable;
|
private Method[] virtualTable;
|
||||||
|
@ -827,19 +827,25 @@ Avian_java_lang_Throwable_resolveTrace
|
|||||||
object class_ = 0;
|
object class_ = 0;
|
||||||
PROTECT(t, class_);
|
PROTECT(t, class_);
|
||||||
|
|
||||||
|
object method = 0;
|
||||||
|
PROTECT(t, method);
|
||||||
|
|
||||||
for (unsigned i = 0; i < length; ++i) {
|
for (unsigned i = 0; i < length; ++i) {
|
||||||
e = arrayBody(t, trace, i);
|
e = arrayBody(t, trace, i);
|
||||||
|
|
||||||
class_ = className(t, methodClass(t, traceElementMethod(t, e)));
|
class_ = className(t, methodClass(t, traceElementMethod(t, e)));
|
||||||
class_ = makeString(t, class_, 0, byteArrayLength(t, class_) - 1, 0);
|
class_ = makeString(t, class_, 0, byteArrayLength(t, class_) - 1, 0);
|
||||||
|
|
||||||
object method = methodName(t, traceElementMethod(t, e));
|
method = methodName(t, traceElementMethod(t, e));
|
||||||
method = makeString(t, method, 0, byteArrayLength(t, method) - 1, 0);
|
method = makeString(t, method, 0, byteArrayLength(t, method) - 1, 0);
|
||||||
|
|
||||||
unsigned line = t->m->processor->lineNumber
|
unsigned line = t->m->processor->lineNumber
|
||||||
(t, traceElementMethod(t, e), traceElementIp(t, e));
|
(t, traceElementMethod(t, e), traceElementIp(t, e));
|
||||||
|
|
||||||
object ste = makeStackTraceElement(t, class_, method, 0, line);
|
object file = classSourceFile(t, methodClass(t, traceElementMethod(t, e)));
|
||||||
|
file = file ? makeString(t, file, 0, byteArrayLength(t, file) - 1, 0) : 0;
|
||||||
|
|
||||||
|
object ste = makeStackTraceElement(t, class_, method, file, line);
|
||||||
set(t, array, ArrayBody + (i * BytesPerWord), ste);
|
set(t, array, ArrayBody + (i * BytesPerWord), ste);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -6466,6 +6466,7 @@ class MyProcessor: public Processor {
|
|||||||
uint8_t arrayDimensions,
|
uint8_t arrayDimensions,
|
||||||
object objectMask,
|
object objectMask,
|
||||||
object name,
|
object name,
|
||||||
|
object sourceFile,
|
||||||
object super,
|
object super,
|
||||||
object interfaceTable,
|
object interfaceTable,
|
||||||
object virtualTable,
|
object virtualTable,
|
||||||
@ -6477,8 +6478,8 @@ class MyProcessor: public Processor {
|
|||||||
{
|
{
|
||||||
return vm::makeClass
|
return vm::makeClass
|
||||||
(t, flags, vmFlags, fixedSize, arrayElementSize, arrayDimensions,
|
(t, flags, vmFlags, fixedSize, arrayElementSize, arrayDimensions,
|
||||||
objectMask, name, super, interfaceTable, virtualTable, fieldTable,
|
objectMask, name, sourceFile, super, interfaceTable, virtualTable,
|
||||||
methodTable, staticTable, loader, vtableLength);
|
fieldTable, methodTable, staticTable, loader, vtableLength);
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void
|
virtual void
|
||||||
|
@ -3109,6 +3109,7 @@ class MyProcessor: public Processor {
|
|||||||
uint8_t arrayDimensions,
|
uint8_t arrayDimensions,
|
||||||
object objectMask,
|
object objectMask,
|
||||||
object name,
|
object name,
|
||||||
|
object sourceFile,
|
||||||
object super,
|
object super,
|
||||||
object interfaceTable,
|
object interfaceTable,
|
||||||
object virtualTable,
|
object virtualTable,
|
||||||
@ -3120,8 +3121,8 @@ class MyProcessor: public Processor {
|
|||||||
{
|
{
|
||||||
return vm::makeClass
|
return vm::makeClass
|
||||||
(t, flags, vmFlags, fixedSize, arrayElementSize, arrayDimensions,
|
(t, flags, vmFlags, fixedSize, arrayElementSize, arrayDimensions,
|
||||||
objectMask, name, super, interfaceTable, virtualTable, fieldTable,
|
objectMask, name, sourceFile, super, interfaceTable, virtualTable,
|
||||||
methodTable, staticTable, loader, 0);
|
fieldTable, methodTable, staticTable, loader, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void
|
virtual void
|
||||||
|
@ -1594,6 +1594,24 @@ parseMethodTable(Thread* t, Stream& s, object class_, object pool)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
parseAttributeTable(Thread* t, Stream& s, object class_, object pool)
|
||||||
|
{
|
||||||
|
unsigned attributeCount = s.read2();
|
||||||
|
for (unsigned j = 0; j < attributeCount; ++j) {
|
||||||
|
object name = singletonObject(t, pool, s.read2() - 1);
|
||||||
|
unsigned length = s.read4();
|
||||||
|
|
||||||
|
if (vm::strcmp(reinterpret_cast<const int8_t*>("SourceFile"),
|
||||||
|
&byteArrayBody(t, name, 0)) == 0)
|
||||||
|
{
|
||||||
|
set(t, class_, ClassSourceFile, singletonObject(t, pool, s.read2() - 1));
|
||||||
|
} else {
|
||||||
|
s.skip(length);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
updateClassTables(Thread* t, object newClass, object oldClass)
|
updateClassTables(Thread* t, object newClass, object oldClass)
|
||||||
{
|
{
|
||||||
@ -1672,6 +1690,7 @@ makeArrayClass(Thread* t, object loader, unsigned dimensions, object spec,
|
|||||||
dimensions,
|
dimensions,
|
||||||
classObjectMask(t, arrayBody(t, t->m->types, Machine::ArrayType)),
|
classObjectMask(t, arrayBody(t, t->m->types, Machine::ArrayType)),
|
||||||
spec,
|
spec,
|
||||||
|
0,
|
||||||
arrayBody(t, t->m->types, Machine::JobjectType),
|
arrayBody(t, t->m->types, Machine::JobjectType),
|
||||||
0,
|
0,
|
||||||
vtable,
|
vtable,
|
||||||
@ -1806,8 +1825,8 @@ bootClass(Thread* t, Machine::Type type, int superType, uint32_t objectMask,
|
|||||||
super = (superType >= 0 ? arrayBody(t, t->m->types, superType) : 0);
|
super = (superType >= 0 ? arrayBody(t, t->m->types, superType) : 0);
|
||||||
|
|
||||||
object class_ = t->m->processor->makeClass
|
object class_ = t->m->processor->makeClass
|
||||||
(t, 0, BootstrapFlag, fixedSize, arrayElementSize, 0, mask, 0, super, 0, 0,
|
(t, 0, BootstrapFlag, fixedSize, arrayElementSize, 0, mask, 0, 0, super, 0,
|
||||||
0, 0, 0, t->m->loader, vtableLength);
|
0, 0, 0, 0, t->m->loader, vtableLength);
|
||||||
|
|
||||||
set(t, t->m->types, ArrayBody + (type * BytesPerWord), class_);
|
set(t, t->m->types, ArrayBody + (type * BytesPerWord), class_);
|
||||||
}
|
}
|
||||||
@ -2800,6 +2819,7 @@ parseClass(Thread* t, object loader, const uint8_t* data, unsigned size)
|
|||||||
0, // object mask
|
0, // object mask
|
||||||
referenceName
|
referenceName
|
||||||
(t, singletonObject(t, pool, name - 1)),
|
(t, singletonObject(t, pool, name - 1)),
|
||||||
|
0,
|
||||||
0, // super
|
0, // super
|
||||||
0, // interfaces
|
0, // interfaces
|
||||||
0, // vtable
|
0, // vtable
|
||||||
@ -2832,6 +2852,9 @@ parseClass(Thread* t, object loader, const uint8_t* data, unsigned size)
|
|||||||
parseMethodTable(t, s, class_, pool);
|
parseMethodTable(t, s, class_, pool);
|
||||||
if (UNLIKELY(t->exception)) return 0;
|
if (UNLIKELY(t->exception)) return 0;
|
||||||
|
|
||||||
|
parseAttributeTable(t, s, class_, pool);
|
||||||
|
if (UNLIKELY(t->exception)) return 0;
|
||||||
|
|
||||||
object vtable = classVirtualTable(t, class_);
|
object vtable = classVirtualTable(t, class_);
|
||||||
unsigned vtableLength = (vtable ? arrayLength(t, vtable) : 0);
|
unsigned vtableLength = (vtable ? arrayLength(t, vtable) : 0);
|
||||||
|
|
||||||
@ -2844,6 +2867,7 @@ parseClass(Thread* t, object loader, const uint8_t* data, unsigned size)
|
|||||||
classArrayDimensions(t, class_),
|
classArrayDimensions(t, class_),
|
||||||
classObjectMask(t, class_),
|
classObjectMask(t, class_),
|
||||||
className(t, class_),
|
className(t, class_),
|
||||||
|
classSourceFile(t, class_),
|
||||||
classSuper(t, class_),
|
classSuper(t, class_),
|
||||||
classInterfaceTable(t, class_),
|
classInterfaceTable(t, class_),
|
||||||
classVirtualTable(t, class_),
|
classVirtualTable(t, class_),
|
||||||
|
@ -66,6 +66,7 @@ class Processor {
|
|||||||
uint8_t arrayDimensions,
|
uint8_t arrayDimensions,
|
||||||
object objectMask,
|
object objectMask,
|
||||||
object name,
|
object name,
|
||||||
|
object sourceFile,
|
||||||
object super,
|
object super,
|
||||||
object interfaceTable,
|
object interfaceTable,
|
||||||
object virtualTable,
|
object virtualTable,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user