1.1 --- a/src/share/vm/oops/fieldStreams.hpp Fri Aug 31 16:39:35 2012 -0700 1.2 +++ b/src/share/vm/oops/fieldStreams.hpp Sat Sep 01 13:25:18 2012 -0400 1.3 @@ -1,5 +1,5 @@ 1.4 /* 1.5 - * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved. 1.6 + * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved. 1.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 1.8 * 1.9 * This code is free software; you can redistribute it and/or modify it 1.10 @@ -38,13 +38,13 @@ 1.11 // cases. 1.12 class FieldStreamBase : public StackObj { 1.13 protected: 1.14 - typeArrayHandle _fields; 1.15 + Array<u2>* _fields; 1.16 constantPoolHandle _constants; 1.17 int _index; 1.18 int _limit; 1.19 int _generic_signature_slot; 1.20 1.21 - FieldInfo* field() const { return FieldInfo::from_field_array(_fields(), _index); } 1.22 + FieldInfo* field() const { return FieldInfo::from_field_array(_fields, _index); } 1.23 1.24 int init_generic_signature_start_slot() { 1.25 int length = _fields->length(); 1.26 @@ -55,7 +55,7 @@ 1.27 /* Scan from 0 to the current _index. Count the number of generic 1.28 signature slots for field[0] to field[_index - 1]. */ 1.29 for (int i = 0; i < _index; i++) { 1.30 - fi = FieldInfo::from_field_array(_fields(), i); 1.31 + fi = FieldInfo::from_field_array(_fields, i); 1.32 flags.set_flags(fi->access_flags()); 1.33 if (flags.field_has_generic_signature()) { 1.34 length --; 1.35 @@ -64,7 +64,7 @@ 1.36 } 1.37 /* Scan from the current _index. */ 1.38 for (int i = _index; i*FieldInfo::field_slots < length; i++) { 1.39 - fi = FieldInfo::from_field_array(_fields(), i); 1.40 + fi = FieldInfo::from_field_array(_fields, i); 1.41 flags.set_flags(fi->access_flags()); 1.42 if (flags.field_has_generic_signature()) { 1.43 length --; 1.44 @@ -76,7 +76,7 @@ 1.45 return num_fields; 1.46 } 1.47 1.48 - FieldStreamBase(typeArrayHandle fields, constantPoolHandle constants, int start, int limit) { 1.49 + FieldStreamBase(Array<u2>* fields, constantPoolHandle constants, int start, int limit) { 1.50 _fields = fields; 1.51 _constants = constants; 1.52 _index = start; 1.53 @@ -88,7 +88,7 @@ 1.54 } 1.55 } 1.56 1.57 - FieldStreamBase(typeArrayHandle fields, constantPoolHandle constants) { 1.58 + FieldStreamBase(Array<u2>* fields, constantPoolHandle constants) { 1.59 _fields = fields; 1.60 _constants = constants; 1.61 _index = 0; 1.62 @@ -96,7 +96,7 @@ 1.63 } 1.64 1.65 public: 1.66 - FieldStreamBase(instanceKlass* klass) { 1.67 + FieldStreamBase(InstanceKlass* klass) { 1.68 _fields = klass->fields(); 1.69 _constants = klass->constants(); 1.70 _index = 0; 1.71 @@ -149,7 +149,7 @@ 1.72 Symbol* generic_signature() const { 1.73 if (access_flags().field_has_generic_signature()) { 1.74 assert(_generic_signature_slot < _fields->length(), "out of bounds"); 1.75 - int index = _fields->short_at(_generic_signature_slot); 1.76 + int index = _fields->at(_generic_signature_slot); 1.77 return _constants->symbol_at(index); 1.78 } else { 1.79 return NULL; 1.80 @@ -168,7 +168,6 @@ 1.81 // Iterate over only the internal fields 1.82 class JavaFieldStream : public FieldStreamBase { 1.83 public: 1.84 - JavaFieldStream(instanceKlass* k): FieldStreamBase(k->fields(), k->constants(), 0, k->java_fields_count()) {} 1.85 JavaFieldStream(instanceKlassHandle k): FieldStreamBase(k->fields(), k->constants(), 0, k->java_fields_count()) {} 1.86 1.87 int name_index() const { 1.88 @@ -191,7 +190,7 @@ 1.89 assert(!field()->is_internal(), "regular only"); 1.90 if (access_flags().field_has_generic_signature()) { 1.91 assert(_generic_signature_slot < _fields->length(), "out of bounds"); 1.92 - return _fields->short_at(_generic_signature_slot); 1.93 + return _fields->at(_generic_signature_slot); 1.94 } else { 1.95 return 0; 1.96 } 1.97 @@ -200,7 +199,7 @@ 1.98 assert(!field()->is_internal(), "regular only"); 1.99 if (access_flags().field_has_generic_signature()) { 1.100 assert(_generic_signature_slot < _fields->length(), "out of bounds"); 1.101 - _fields->short_at_put(_generic_signature_slot, index); 1.102 + _fields->at_put(_generic_signature_slot, index); 1.103 } 1.104 } 1.105 int initval_index() const { 1.106 @@ -217,15 +216,15 @@ 1.107 // Iterate over only the internal fields 1.108 class InternalFieldStream : public FieldStreamBase { 1.109 public: 1.110 - InternalFieldStream(instanceKlass* k): FieldStreamBase(k->fields(), k->constants(), k->java_fields_count(), 0) {} 1.111 + InternalFieldStream(InstanceKlass* k): FieldStreamBase(k->fields(), k->constants(), k->java_fields_count(), 0) {} 1.112 InternalFieldStream(instanceKlassHandle k): FieldStreamBase(k->fields(), k->constants(), k->java_fields_count(), 0) {} 1.113 }; 1.114 1.115 1.116 class AllFieldStream : public FieldStreamBase { 1.117 public: 1.118 - AllFieldStream(typeArrayHandle fields, constantPoolHandle constants): FieldStreamBase(fields, constants) {} 1.119 - AllFieldStream(instanceKlass* k): FieldStreamBase(k->fields(), k->constants()) {} 1.120 + AllFieldStream(Array<u2>* fields, constantPoolHandle constants): FieldStreamBase(fields, constants) {} 1.121 + AllFieldStream(InstanceKlass* k): FieldStreamBase(k->fields(), k->constants()) {} 1.122 AllFieldStream(instanceKlassHandle k): FieldStreamBase(k->fields(), k->constants()) {} 1.123 }; 1.124