@@ -38,7 +38,7 @@ getTrace(Thread* t, unsigned skipCount)
38
38
{
39
39
return true ;
40
40
} else {
41
- trace = reinterpret_cast <object>( makeTrace (t, walker) );
41
+ trace = makeTrace (t, walker);
42
42
return false ;
43
43
}
44
44
} else {
@@ -54,16 +54,14 @@ getTrace(Thread* t, unsigned skipCount)
54
54
55
55
t->m ->processor ->walkStack (t, &v);
56
56
57
- if (v.trace == 0 ) v.trace = reinterpret_cast <object>( makeObjectArray (t, 0 ) );
57
+ if (v.trace == 0 ) v.trace = makeObjectArray (t, 0 );
58
58
59
59
return v.trace ;
60
60
}
61
61
62
62
bool
63
- compatibleArrayTypes (Thread* t, object ao, object bo )
63
+ compatibleArrayTypes (Thread* t UNUSED, GcClass* a, GcClass* b )
64
64
{
65
- GcClass* a = cast<GcClass>(t, ao);
66
- GcClass* b = cast<GcClass>(t, bo);
67
65
return a->arrayElementSize ()
68
66
and b->arrayElementSize ()
69
67
and (a == b
@@ -77,7 +75,7 @@ arrayCopy(Thread* t, object src, int32_t srcOffset, object dst,
77
75
{
78
76
if (LIKELY (src and dst)) {
79
77
if (LIKELY (compatibleArrayTypes
80
- (t, reinterpret_cast <object>( objectClass (t, src)), reinterpret_cast <object>( objectClass (t, dst) ))))
78
+ (t, objectClass (t, src), objectClass (t, dst))))
81
79
{
82
80
unsigned elementSize = objectClass (t, src)->arrayElementSize ();
83
81
@@ -300,46 +298,46 @@ makeStackTraceElement(Thread* t, GcTraceElement* e)
300
298
PROTECT (t, method_name);
301
299
302
300
GcString* method_name_string = t->m ->classpath ->makeString
303
- (t, reinterpret_cast <object>( method_name) , 0 , method_name->length () - 1 );
301
+ (t, method_name, 0 , method_name->length () - 1 );
304
302
PROTECT (t, method_name_string);
305
303
306
304
unsigned line = t->m ->processor ->lineNumber
307
305
(t, method, e->ip ());
308
306
309
307
GcByteArray* file = method->class_ ()->sourceFile ();
310
308
GcString* file_string = file ? t->m ->classpath ->makeString
311
- (t, reinterpret_cast <object>( file) , 0 , file->length () - 1 ) : 0 ;
309
+ (t, file, 0 , file->length () - 1 ) : 0 ;
312
310
313
311
return makeStackTraceElement (t, class_name_string, method_name_string, file_string, line);
314
312
}
315
313
316
- object
314
+ GcObject*
317
315
translateInvokeResult (Thread* t, unsigned returnCode, object o)
318
316
{
319
317
switch (returnCode) {
320
318
case ByteField:
321
- return reinterpret_cast <object>( makeByte (t, cast<GcInt>(t, o)->value () ));
319
+ return makeByte (t, cast<GcInt>(t, o)->value ());
322
320
323
321
case BooleanField:
324
- return reinterpret_cast <object>( makeBoolean (t, cast<GcInt>(t, o)->value () != 0 ) );
322
+ return makeBoolean (t, cast<GcInt>(t, o)->value () != 0 );
325
323
326
324
case CharField:
327
- return reinterpret_cast <object>( makeChar (t, cast<GcInt>(t, o)->value () ));
325
+ return makeChar (t, cast<GcInt>(t, o)->value ());
328
326
329
327
case ShortField:
330
- return reinterpret_cast <object>( makeShort (t, cast<GcInt>(t, o)->value () ));
328
+ return makeShort (t, cast<GcInt>(t, o)->value ());
331
329
332
330
case FloatField:
333
- return reinterpret_cast <object>( makeFloat (t, cast<GcInt>(t, o)->value () ));
331
+ return makeFloat (t, cast<GcInt>(t, o)->value ());
334
332
335
333
case IntField:
336
334
case LongField:
337
335
case ObjectField:
338
336
case VoidField:
339
- return o ;
337
+ return reinterpret_cast <GcObject*>(o) ;
340
338
341
339
case DoubleField:
342
- return reinterpret_cast <object>( makeDouble (t, cast<GcLong>(t, o)->value () ));
340
+ return makeDouble (t, cast<GcLong>(t, o)->value ());
343
341
344
342
default :
345
343
abort (t);
@@ -400,7 +398,7 @@ resolveParameterTypes(Thread* t, GcClassLoader* loader, GcByteArray* spec,
400
398
(t, loader, reinterpret_cast <char *>(&spec->body ()[start]),
401
399
offset - start);
402
400
403
- list = makePair (t, reinterpret_cast <object>( type), reinterpret_cast <object>( list) );
401
+ list = makePair (t, type, list);
404
402
405
403
++ count;
406
404
} break ;
@@ -424,13 +422,13 @@ resolveParameterTypes(Thread* t, GcClassLoader* loader, GcByteArray* spec,
424
422
(t, loader, reinterpret_cast <char *>(&spec->body ()[start]),
425
423
offset - start);
426
424
427
- list = makePair (t, reinterpret_cast <object>( type), reinterpret_cast <object>( list) );
425
+ list = makePair (t, type, list);
428
426
++ count;
429
427
} break ;
430
428
431
429
default :
432
430
list = makePair
433
- (t, reinterpret_cast <object>( primitiveClass (t, spec->body ()[offset])), reinterpret_cast <object>( list) );
431
+ (t, primitiveClass (t, spec->body ()[offset]), list);
434
432
++ offset;
435
433
++ count;
436
434
break ;
@@ -456,7 +454,7 @@ resolveParameterJTypes(Thread* t, GcClassLoader* loader, GcByteArray* spec,
456
454
PROTECT (t, array);
457
455
458
456
for (int i = *parameterCount - 1 ; i >= 0 ; --i) {
459
- object c = reinterpret_cast <object>( getJClass (t, cast<GcClass>(t, list->first () )));
457
+ object c = getJClass (t, cast<GcClass>(t, list->first ()));
460
458
reinterpret_cast <GcArray*>(array)->setBodyElement (t, i, c);
461
459
list = cast<GcPair>(t, list->second ());
462
460
}
@@ -489,12 +487,12 @@ resolveExceptionJTypes(Thread* t, GcClassLoader* loader, GcMethodAddendum* adden
489
487
object o = singletonObject (t, addendum->pool ()->as <GcSingleton>(t), index );
490
488
491
489
if (objectClass (t, o) == type (t, GcReference::Type)) {
492
- o = reinterpret_cast <object>( resolveClass (t, loader, cast<GcReference>(t, o)->name () ));
490
+ o = resolveClass (t, loader, cast<GcReference>(t, o)->name ());
493
491
494
492
addendum->pool ()->setBodyElement (t, index , reinterpret_cast <uintptr_t >(o));
495
493
}
496
494
497
- o = reinterpret_cast <object>( getJClass (t, cast<GcClass>(t, o) ));
495
+ o = getJClass (t, cast<GcClass>(t, o));
498
496
499
497
reinterpret_cast <GcArray*>(array)->setBodyElement (t, i, o);
500
498
}
@@ -615,7 +613,7 @@ intercept(Thread* t, GcClass* c, const char* name, const char* spec,
615
613
// through the vtable.
616
614
clone->flags () |= ACC_PRIVATE;
617
615
618
- GcNativeIntercept* native = makeNativeIntercept (t, function, true , reinterpret_cast <object>( clone) );
616
+ GcNativeIntercept* native = makeNativeIntercept (t, function, true , clone);
619
617
620
618
PROTECT (t, native);
621
619
@@ -691,7 +689,7 @@ getDeclaredClasses(Thread* t, GcClass* c, bool publicOnly)
691
689
for (unsigned i = 0 ; i < table->length (); ++i) {
692
690
GcInnerClassReference* reference = cast<GcInnerClassReference>(t, table->body ()[i]);
693
691
GcByteArray* outer = reference->outer ();
694
- if (outer and byteArrayEqual (t, reinterpret_cast <object>( outer), reinterpret_cast <object>( c->name () ))
692
+ if (outer and byteArrayEqual (t, outer, c->name ())
695
693
and ((not publicOnly)
696
694
or (reference->flags () & ACC_PUBLIC)))
697
695
{
@@ -705,16 +703,16 @@ getDeclaredClasses(Thread* t, GcClass* c, bool publicOnly)
705
703
for (unsigned i = 0 ; i < table->length (); ++i) {
706
704
GcInnerClassReference* reference = cast<GcInnerClassReference>(t, table->body ()[i]);
707
705
GcByteArray* outer = reference->outer ();
708
- if (outer and byteArrayEqual (t, reinterpret_cast <object>( outer), reinterpret_cast <object>( c->name () ))
706
+ if (outer and byteArrayEqual (t, outer, c->name ())
709
707
and ((not publicOnly)
710
708
or (reference->flags () & ACC_PUBLIC)))
711
709
{
712
- object inner = reinterpret_cast <object>( getJClass (
710
+ object inner = getJClass (
713
711
t,
714
712
resolveClass (
715
713
t,
716
714
c->loader (),
717
- reference->inner ()))) ;
715
+ reference->inner ()));
718
716
719
717
-- count;
720
718
reinterpret_cast <GcArray*>(result)->setBodyElement (t, count, inner);
0 commit comments