Mercurial > hg > truffle
comparison src/share/vm/classfile/javaClasses.hpp @ 132:60b728ec77c1
6652736: well known classes in system dictionary are inefficiently processed
Summary: combine many scalar variables into a single enum-indexed array in SystemDictionary.
Reviewed-by: kvn
author | jrose |
---|---|
date | Tue, 29 Apr 2008 19:45:22 -0700 |
parents | ba764ed4b6f2 |
children | 437d03ea40b1 |
comparison
equal
deleted
inserted
replaced
131:6e825ad773c6 | 132:60b728ec77c1 |
---|---|
43 | 43 |
44 class java_lang_String : AllStatic { | 44 class java_lang_String : AllStatic { |
45 private: | 45 private: |
46 enum { | 46 enum { |
47 hc_value_offset = 0, | 47 hc_value_offset = 0, |
48 hc_offset_offset = 1, | 48 hc_offset_offset = 1 |
49 hc_count_offset = 2, | 49 //hc_count_offset = 2 -- not a word-scaled offset |
50 hc_hash_offset = 3 | 50 //hc_hash_offset = 3 -- not a word-scaled offset |
51 }; | 51 }; |
52 | 52 |
53 static int value_offset; | 53 static int value_offset; |
54 static int offset_offset; | 54 static int offset_offset; |
55 static int count_offset; | 55 static int count_offset; |
147 static oop create_mirror(KlassHandle k, TRAPS); | 147 static oop create_mirror(KlassHandle k, TRAPS); |
148 static oop create_basic_type_mirror(const char* basic_type_name, BasicType type, TRAPS); | 148 static oop create_basic_type_mirror(const char* basic_type_name, BasicType type, TRAPS); |
149 // Conversion | 149 // Conversion |
150 static klassOop as_klassOop(oop java_class); | 150 static klassOop as_klassOop(oop java_class); |
151 // Testing | 151 // Testing |
152 static bool is_instance(oop obj) { | |
153 return obj != NULL && obj->klass() == SystemDictionary::class_klass(); | |
154 } | |
152 static bool is_primitive(oop java_class); | 155 static bool is_primitive(oop java_class); |
153 static BasicType primitive_type(oop java_class); | 156 static BasicType primitive_type(oop java_class); |
154 static oop primitive_mirror(BasicType t); | 157 static oop primitive_mirror(BasicType t); |
155 // JVM_NewInstance support | 158 // JVM_NewInstance support |
156 static methodOop resolved_constructor(oop java_class); | 159 static methodOop resolved_constructor(oop java_class); |
649 enum { | 652 enum { |
650 hc_value_offset = 0 | 653 hc_value_offset = 0 |
651 }; | 654 }; |
652 static int value_offset; | 655 static int value_offset; |
653 | 656 |
654 static oop initialize_and_allocate(klassOop klass, TRAPS); | 657 static oop initialize_and_allocate(BasicType type, TRAPS); |
655 public: | 658 public: |
656 // Allocation. Returns a boxed value, or NULL for invalid type. | 659 // Allocation. Returns a boxed value, or NULL for invalid type. |
657 static oop create(BasicType type, jvalue* value, TRAPS); | 660 static oop create(BasicType type, jvalue* value, TRAPS); |
658 // Accessors. Returns the basic type being boxed, or T_ILLEGAL for invalid oop. | 661 // Accessors. Returns the basic type being boxed, or T_ILLEGAL for invalid oop. |
659 static BasicType get_value(oop box, jvalue* value); | 662 static BasicType get_value(oop box, jvalue* value); |
660 static BasicType set_value(oop box, jvalue* value); | 663 static BasicType set_value(oop box, jvalue* value); |
664 static BasicType basic_type(oop box); | |
665 static bool is_instance(oop box) { return basic_type(box) != T_ILLEGAL; } | |
666 static bool is_instance(oop box, BasicType type) { return basic_type(box) == type; } | |
661 | 667 |
662 static int value_offset_in_bytes() { return value_offset; } | 668 static int value_offset_in_bytes() { return value_offset; } |
663 | 669 |
664 // Debugging | 670 // Debugging |
665 friend class JavaClasses; | 671 friend class JavaClasses; |
919 | 925 |
920 class JavaClasses : AllStatic { | 926 class JavaClasses : AllStatic { |
921 private: | 927 private: |
922 static bool check_offset(const char *klass_name, int offset, const char *field_name, const char* field_sig) PRODUCT_RETURN0; | 928 static bool check_offset(const char *klass_name, int offset, const char *field_name, const char* field_sig) PRODUCT_RETURN0; |
923 static bool check_static_offset(const char *klass_name, int hardcoded_offset, const char *field_name, const char* field_sig) PRODUCT_RETURN0; | 929 static bool check_static_offset(const char *klass_name, int hardcoded_offset, const char *field_name, const char* field_sig) PRODUCT_RETURN0; |
930 static bool check_constant(const char *klass_name, int constant, const char *field_name, const char* field_sig) PRODUCT_RETURN0; | |
924 public: | 931 public: |
925 static void compute_hard_coded_offsets(); | 932 static void compute_hard_coded_offsets(); |
926 static void compute_offsets(); | 933 static void compute_offsets(); |
927 static void check_offsets() PRODUCT_RETURN; | 934 static void check_offsets() PRODUCT_RETURN; |
928 }; | 935 }; |