[kaffe] [patch] Class.forName rewrite

Dalibor Topic robilad@yahoo.com
Sun, 2 Jun 2002 17:31:18 -0700 (PDT)


--0-1114583979-1023064278=:63728
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

Hi,

the atached patch does two things: It replaces the
native
Class.forName method by a java implementation, with
the fall-out from
the C version being heopfully included in the right
places, and it
encapsulates the lookup of the class loader of the
calling clas using
stack inspection into its own small class, hiding away
the ugly
details.

Since this patch touches very sensitive parts of the
class library, it
would be nice if you could test it, and tell me if it
breaks.

Performance should be equivalent to the former
version. Tested on i686
linux using jit3.

cheers,

dalibor topic


__________________________________________________
Do You Yahoo!?
Yahoo! - Official partner of 2002 FIFA World Cup
http://fifaworldcup.yahoo.com
--0-1114583979-1023064278=:63728
Content-Type: application/octet-stream; name=ChangeLog
Content-Transfer-Encoding: base64
Content-Description: ChangeLog
Content-Disposition: attachment; filename=ChangeLog

CSogbGlicmFyaWVzL2NsaWIvbmF0aXZlL0NsYXNzLmM6CgkoamF2YV9sYW5n
X0NsYXNzX2Zvck5hbWUpIGRlbGV0ZWQuIEltcGxlbWVudGVkIGluIEphdmEu
CgkqIGxpYnJhcmllcy9jbGliL25hdGl2ZS9DbGFzc0xvYWRlci5jOgoJKGph
dmFfbGFuZ19DbGFzc0xvYWRlcl9yZXNvbHZlQ2xhc3MwKSBwcm9jZXNzIGZp
bGVzIHRvCglDU1RBVEVfQ09NUExFVEUuCgkqIGxpYnJhcmllcy9jbGliL25h
dGl2ZS9TeXN0ZW1DbGFzc0xvYWRlci5jOgoJKGthZmZlX2xhbmdfU3lzdGVt
Q2xhc3NMb2FkZXJfZmluZENsYXNzMCkgQWRkZWQgY29kZSB0byBsb2FkCglh
cnJheXMuIE1lcmdlZCBjb2RlIHRvIGhhbmRsZSBOb0NsYXNzRGVmRm91bmRF
cnJvcnMgd2l0aCBzdWNoIGNvZGUKCWZyb20gamF2YV9sYW5nX0NsYXNzX2Zv
ck5hbWUuCgkqIGxpYnJhcmllcy9qYXZhbGliL2phdmEvbGFuZy9DbGFzcy5q
YXZhOgoJKGZvck5hbWUpIHJld3JpdHRlbiBpbiBKYXZhLgoJKENhbGxTdGFj
aykgbmV3IGlubmVyIGNsYXNzIGZvciBjYWxsIHN0YWNrIGluc3BlY3Rpb24u
CgkqIGxpYnJhcmllcy9qYXZhbGliL2phdmEvbGFuZy9SdW50aW1lLmphdmE6
CgkobG9hZExpYnJhcnkpIHVzZSBDYWxsU3RhY2suZ2V0Q2FsbGVyc0NsYXNz
TG9hZGVyKCkuCgkobG9hZCkgc2FtZS4KCWxpYnJhcmllcy9qYXZhbGliL2ph
dmEvbGFuZy9TeXN0ZW0uamF2YToKCShsb2FkKSB1c2UgQ2FsbFN0YWNrLmdl
dENhbGxlcnNDbGFzc0xvYWRlcigpLgoJKGxvYWRMaWJyYXJ5KSBzYW1lLgoJ
bGlicmFyaWVzL2phdmFsaWIva2FmZmUvbGFuZy9TeXN0ZW1DbGFzc0xvYWRl
ci5qYXZhOgoJKGNvbXBvbmVudFR5cGUpIG5ldyBwcml2YXRlIG1ldGhvZCB0
byBnZXQgdGhlIG5hbWUgb2YgdGhlCglpbm5lcm1vc3QgY29tcG9uZW50IHR5
cGUgb2YgYW4gYXJyYXkuCgkoZmluZENsYXNzKSBNb3ZlZCBzb21lIGVycm9y
IGNoZWNrcyBmcm9tIGphdmFfbGFuZ19DbGFzc19mb3JOYW1lCgloZXJlLgo=


--0-1114583979-1023064278=:63728
Content-Type: application/octet-stream; name="patch.diff"
Content-Transfer-Encoding: base64
Content-Description: patch.diff
Content-Disposition: attachment; filename="patch.diff"

ZGlmZiAtdXIgLXggQ1ZTIC14IE1ha2UqIC9ob21lL3RvcGljL2thZmZlL2xp
YnJhcmllcy9jbGliL25hdGl2ZS9DbGFzcy5jIGxpYnJhcmllcy9jbGliL25h
dGl2ZS9DbGFzcy5jCi0tLSAvaG9tZS90b3BpYy9rYWZmZS9saWJyYXJpZXMv
Y2xpYi9uYXRpdmUvQ2xhc3MuYwlUaH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