Mercurial > hg > graal-jvmci-8
comparison src/share/vm/classfile/javaClasses.hpp @ 18058:54bc75c144b0
Merge
author | asaha |
---|---|
date | Thu, 29 May 2014 13:14:25 -0700 |
parents | 9428a0b94204 |
children | 52b4284cb496 27188ae8bbbb |
comparison
equal
deleted
inserted
replaced
18055:1fa005fb28f5 | 18058:54bc75c144b0 |
---|---|
1 /* | 1 /* |
2 * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. | 2 * Copyright (c) 1997, 2014, 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. |
59 | 59 |
60 static bool initialized; | 60 static bool initialized; |
61 | 61 |
62 static Handle basic_create(int length, TRAPS); | 62 static Handle basic_create(int length, TRAPS); |
63 | 63 |
64 static void set_value( oop string, typeArrayOop buffer) { | |
65 assert(initialized, "Must be initialized"); | |
66 string->obj_field_put(value_offset, (oop)buffer); | |
67 } | |
68 static void set_offset(oop string, int offset) { | 64 static void set_offset(oop string, int offset) { |
69 assert(initialized, "Must be initialized"); | 65 assert(initialized, "Must be initialized"); |
70 if (offset_offset > 0) { | 66 if (offset_offset > 0) { |
71 string->int_field_put(offset_offset, offset); | 67 string->int_field_put(offset_offset, offset); |
72 } | 68 } |
120 static int hash_offset_in_bytes() { | 116 static int hash_offset_in_bytes() { |
121 assert(initialized && (hash_offset > 0), "Must be initialized"); | 117 assert(initialized && (hash_offset > 0), "Must be initialized"); |
122 return hash_offset; | 118 return hash_offset; |
123 } | 119 } |
124 | 120 |
121 static void set_value(oop string, typeArrayOop buffer) { | |
122 assert(initialized && (value_offset > 0), "Must be initialized"); | |
123 string->obj_field_put(value_offset, (oop)buffer); | |
124 } | |
125 static void set_hash(oop string, unsigned int hash) { | |
126 assert(initialized && (hash_offset > 0), "Must be initialized"); | |
127 string->int_field_put(hash_offset, hash); | |
128 } | |
129 | |
125 // Accessors | 130 // Accessors |
126 static typeArrayOop value(oop java_string) { | 131 static typeArrayOop value(oop java_string) { |
127 assert(initialized && (value_offset > 0), "Must be initialized"); | 132 assert(initialized && (value_offset > 0), "Must be initialized"); |
128 assert(is_instance(java_string), "must be java_string"); | 133 assert(is_instance(java_string), "must be java_string"); |
129 return (typeArrayOop) java_string->obj_field(value_offset); | 134 return (typeArrayOop) java_string->obj_field(value_offset); |
135 } | |
136 static unsigned int hash(oop java_string) { | |
137 assert(initialized && (hash_offset > 0), "Must be initialized"); | |
138 assert(is_instance(java_string), "must be java_string"); | |
139 return java_string->int_field(hash_offset); | |
130 } | 140 } |
131 static int offset(oop java_string) { | 141 static int offset(oop java_string) { |
132 assert(initialized, "Must be initialized"); | 142 assert(initialized, "Must be initialized"); |
133 assert(is_instance(java_string), "must be java_string"); | 143 assert(is_instance(java_string), "must be java_string"); |
134 if (offset_offset > 0) { | 144 if (offset_offset > 0) { |
234 static int classRedefinedCount_offset; | 244 static int classRedefinedCount_offset; |
235 static GrowableArray<Klass*>* _fixup_mirror_list; | 245 static GrowableArray<Klass*>* _fixup_mirror_list; |
236 | 246 |
237 static void set_init_lock(oop java_class, oop init_lock); | 247 static void set_init_lock(oop java_class, oop init_lock); |
238 static void set_protection_domain(oop java_class, oop protection_domain); | 248 static void set_protection_domain(oop java_class, oop protection_domain); |
249 static void initialize_mirror_fields(KlassHandle k, Handle mirror, Handle protection_domain, TRAPS); | |
239 public: | 250 public: |
240 static void compute_offsets(); | 251 static void compute_offsets(); |
241 | 252 |
242 // Instance creation | 253 // Instance creation |
243 static oop create_mirror(KlassHandle k, Handle protection_domain, TRAPS); | 254 static void create_mirror(KlassHandle k, Handle protection_domain, TRAPS); |
244 static void fixup_mirror(KlassHandle k, TRAPS); | 255 static void fixup_mirror(KlassHandle k, TRAPS); |
245 static oop create_basic_type_mirror(const char* basic_type_name, BasicType type, TRAPS); | 256 static oop create_basic_type_mirror(const char* basic_type_name, BasicType type, TRAPS); |
246 // Conversion | 257 // Conversion |
247 static Klass* as_Klass(oop java_class); | 258 static Klass* as_Klass(oop java_class); |
248 static void set_klass(oop java_class, Klass* klass); | 259 static void set_klass(oop java_class, Klass* klass); |