diff src/share/vm/runtime/fieldDescriptor.cpp @ 3602: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 634b8615a6ba
children 18fb7da42534
line wrap: on
line diff
--- a/src/share/vm/runtime/fieldDescriptor.cpp	Fri Aug 31 16:39:35 2012 -0700
+++ b/src/share/vm/runtime/fieldDescriptor.cpp	Sat Sep 01 13:25:18 2012 -0400
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -27,6 +27,7 @@
 #include "classfile/vmSymbols.hpp"
 #include "memory/resourceArea.hpp"
 #include "memory/universe.inline.hpp"
+#include "oops/annotations.hpp"
 #include "oops/instanceKlass.hpp"
 #include "oops/fieldStreams.hpp"
 #include "runtime/fieldDescriptor.hpp"
@@ -35,7 +36,7 @@
 
 
 oop fieldDescriptor::loader() const {
-  return instanceKlass::cast(_cp->pool_holder())->class_loader();
+  return InstanceKlass::cast(_cp->pool_holder())->class_loader();
 }
 
 Symbol* fieldDescriptor::generic_signature() const {
@@ -44,7 +45,7 @@
   }
 
   int idx = 0;
-  instanceKlass* ik = instanceKlass::cast(field_holder());
+  InstanceKlass* ik = InstanceKlass::cast(field_holder());
   for (AllFieldStream fs(ik); !fs.done(); fs.next()) {
     if (idx == _index) {
       return fs.generic_signature();
@@ -56,12 +57,12 @@
   return NULL;
 }
 
-typeArrayOop fieldDescriptor::annotations() const {
-  instanceKlass* ik = instanceKlass::cast(field_holder());
-  objArrayOop md = ik->fields_annotations();
+AnnotationArray* fieldDescriptor::annotations() const {
+  InstanceKlass* ik = InstanceKlass::cast(field_holder());
+  Array<AnnotationArray*>* md = ik->fields_annotations();
   if (md == NULL)
     return NULL;
-  return typeArrayOop(md->obj_at(index()));
+  return md->at(index());
 }
 
 constantTag fieldDescriptor::initial_value_tag() const {
@@ -85,11 +86,10 @@
 }
 
 oop fieldDescriptor::string_initial_value(TRAPS) const {
-  return constants()->string_at(initial_value_index(), CHECK_0);
+  return constants()->uncached_string_at(initial_value_index(), CHECK_0);
 }
 
-void fieldDescriptor::initialize(klassOop k, int index) {
-  instanceKlass* ik = instanceKlass::cast(k);
+void fieldDescriptor::initialize(InstanceKlass* ik, int index) {
   _cp = ik->constants();
   FieldInfo* f = ik->field(index);
   assert(!f->is_internal(), "regular Java fields only");