Mercurial > hg > truffle
comparison agent/src/share/classes/sun/jvm/hotspot/utilities/soql/JSJavaInstanceKlass.java @ 6725:da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
Summary: Remove PermGen, allocate meta-data in metaspace linked to class loaders, rewrite GC walking, rewrite and rename metadata to be C++ classes
Reviewed-by: jmasa, stefank, never, coleenp, kvn, brutisso, mgerdin, dholmes, jrose, twisti, roland
Contributed-by: jmasa <jon.masamitsu@oracle.com>, stefank <stefan.karlsson@oracle.com>, mgerdin <mikael.gerdin@oracle.com>, never <tom.rodriguez@oracle.com>
author | coleenp |
---|---|
date | Sat, 01 Sep 2012 13:25:18 -0400 |
parents | c18cbe5936b8 |
children | 6bd680e9ea35 |
comparison
equal
deleted
inserted
replaced
6724:36d1d483d5d6 | 6725:da91efe96a93 |
---|---|
1 /* | 1 /* |
2 * Copyright (c) 2003, 2007, Oracle and/or its affiliates. All rights reserved. | 2 * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. | 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 * | 4 * |
5 * This code is free software; you can redistribute it and/or modify it | 5 * This code is free software; you can redistribute it and/or modify it |
6 * under the terms of the GNU General Public License version 2 only, as | 6 * under the terms of the GNU General Public License version 2 only, as |
7 * published by the Free Software Foundation. | 7 * published by the Free Software Foundation. |
284 } | 284 } |
285 return null; | 285 return null; |
286 } | 286 } |
287 } | 287 } |
288 | 288 |
289 private Object getFieldValue(Field fld, String name, InstanceKlass oop) { | |
290 FieldType fd = fld.getFieldType(); | |
291 if (fd.isObject() || fd.isArray()) { | |
292 return factory.newJSJavaObject(((OopField)fld).getValue(oop)); | |
293 } else if (fd.isByte()) { | |
294 return new Byte(((ByteField)fld).getValue(oop)); | |
295 } else if (fd.isChar()) { | |
296 return new String(new char[] { ((CharField)fld).getValue(oop) }); | |
297 } else if (fd.isDouble()) { | |
298 return new Double(((DoubleField)fld).getValue(oop)); | |
299 } else if (fd.isFloat()) { | |
300 return new Float(((FloatField)fld).getValue(oop)); | |
301 } else if (fd.isInt()) { | |
302 return new Integer(((IntField)fld).getValue(oop)); | |
303 } else if (fd.isLong()) { | |
304 return new Long(((LongField)fld).getValue(oop)); | |
305 } else if (fd.isShort()) { | |
306 return new Short(((ShortField)fld).getValue(oop)); | |
307 } else if (fd.isBoolean()) { | |
308 return Boolean.valueOf(((BooleanField)fld).getValue(oop)); | |
309 } else { | |
310 if (Assert.ASSERTS_ENABLED) { | |
311 Assert.that(false, "invalid field type for " + name); | |
312 } | |
313 return null; | |
314 } | |
315 } | |
316 | |
289 private Field findInstanceField(String name) { | 317 private Field findInstanceField(String name) { |
290 Field fld = (Field) instanceFields.get(name); | 318 Field fld = (Field) instanceFields.get(name); |
291 if (fld != null) { | 319 if (fld != null) { |
292 return fld; | 320 return fld; |
293 } else { | 321 } else { |