Mercurial > hg > graal-jvmci-8
comparison src/share/vm/graal/graalEnv.cpp @ 3650:0e8a2a629afb
Pass-by compilation broker.
author | Thomas Wuerthinger <thomas.wuerthinger@oracle.com> |
---|---|
date | Wed, 16 Nov 2011 21:27:28 +0100 |
parents | 2fd96b3040b9 |
children | 6aef50c6d967 |
comparison
equal
deleted
inserted
replaced
3649:5a8c44b5fb80 | 3650:0e8a2a629afb |
---|---|
150 // ------------------------------------------------------------------ | 150 // ------------------------------------------------------------------ |
151 // ciEnv::get_klass_by_name | 151 // ciEnv::get_klass_by_name |
152 KlassHandle GraalEnv::get_klass_by_name(KlassHandle accessing_klass, | 152 KlassHandle GraalEnv::get_klass_by_name(KlassHandle accessing_klass, |
153 Symbol* klass_name, | 153 Symbol* klass_name, |
154 bool require_local) { | 154 bool require_local) { |
155 ResourceMark rm; | |
155 return get_klass_by_name_impl(accessing_klass, | 156 return get_klass_by_name_impl(accessing_klass, |
156 constantPoolHandle(), | 157 constantPoolHandle(), |
157 klass_name, | 158 klass_name, |
158 require_local); | 159 require_local); |
159 } | 160 } |
226 // Get a klass from the constant pool. | 227 // Get a klass from the constant pool. |
227 KlassHandle GraalEnv::get_klass_by_index(constantPoolHandle cpool, | 228 KlassHandle GraalEnv::get_klass_by_index(constantPoolHandle cpool, |
228 int index, | 229 int index, |
229 bool& is_accessible, | 230 bool& is_accessible, |
230 KlassHandle accessor) { | 231 KlassHandle accessor) { |
232 ResourceMark rm; | |
231 return get_klass_by_index_impl(cpool, index, is_accessible, accessor); | 233 return get_klass_by_index_impl(cpool, index, is_accessible, accessor); |
232 } | 234 } |
233 | 235 |
234 // ------------------------------------------------------------------ | 236 // ------------------------------------------------------------------ |
235 // ciEnv::get_field_by_index_impl | 237 // ciEnv::get_field_by_index_impl |
284 // ciEnv::get_field_by_index | 286 // ciEnv::get_field_by_index |
285 // | 287 // |
286 // Get a field by index from a klass's constant pool. | 288 // Get a field by index from a klass's constant pool. |
287 void GraalEnv::get_field_by_index(instanceKlassHandle accessor, fieldDescriptor& fd, | 289 void GraalEnv::get_field_by_index(instanceKlassHandle accessor, fieldDescriptor& fd, |
288 int index) { | 290 int index) { |
291 ResourceMark rm; | |
289 return get_field_by_index_impl(accessor, fd, index); | 292 return get_field_by_index_impl(accessor, fd, index); |
290 } | 293 } |
291 | 294 |
292 // ------------------------------------------------------------------ | 295 // ------------------------------------------------------------------ |
293 // ciEnv::lookup_method | 296 // ciEnv::lookup_method |
336 int index, Bytecodes::Code bc, | 339 int index, Bytecodes::Code bc, |
337 instanceKlass* accessor) { | 340 instanceKlass* accessor) { |
338 int holder_index = cpool->klass_ref_index_at(index); | 341 int holder_index = cpool->klass_ref_index_at(index); |
339 bool holder_is_accessible; | 342 bool holder_is_accessible; |
340 KlassHandle holder = get_klass_by_index_impl(cpool, holder_index, holder_is_accessible, KlassHandle(Thread::current(), accessor)); | 343 KlassHandle holder = get_klass_by_index_impl(cpool, holder_index, holder_is_accessible, KlassHandle(Thread::current(), accessor)); |
341 instanceKlass* declared_holder = get_instance_klass_for_declared_method_holder(holder); | |
342 | 344 |
343 // Get the method's name and signature. | 345 // Get the method's name and signature. |
344 Symbol* name_sym = cpool->name_ref_at(index); | 346 Symbol* name_sym = cpool->name_ref_at(index); |
345 Symbol* sig_sym = cpool->signature_ref_at(index); | 347 Symbol* sig_sym = cpool->signature_ref_at(index); |
346 | 348 |
347 if (holder_is_accessible) { // Our declared holder is loaded. | 349 if (holder_is_accessible) { // Our declared holder is loaded. |
348 instanceKlass* lookup = declared_holder; | 350 instanceKlass* lookup = get_instance_klass_for_declared_method_holder(holder); |
349 methodOop m = lookup_method(accessor, lookup, name_sym, sig_sym, bc); | 351 methodOop m = lookup_method(accessor, lookup, name_sym, sig_sym, bc); |
350 if (m != NULL && | 352 if (m != NULL && |
351 (bc == Bytecodes::_invokestatic | 353 (bc == Bytecodes::_invokestatic |
352 ? instanceKlass::cast(m->method_holder())->is_not_initialized() | 354 ? instanceKlass::cast(m->method_holder())->is_not_initialized() |
353 : !instanceKlass::cast(m->method_holder())->is_loaded())) { | 355 : !instanceKlass::cast(m->method_holder())->is_loaded())) { |
391 // ------------------------------------------------------------------ | 393 // ------------------------------------------------------------------ |
392 // ciEnv::get_method_by_index | 394 // ciEnv::get_method_by_index |
393 methodHandle GraalEnv::get_method_by_index(constantPoolHandle cpool, | 395 methodHandle GraalEnv::get_method_by_index(constantPoolHandle cpool, |
394 int index, Bytecodes::Code bc, | 396 int index, Bytecodes::Code bc, |
395 instanceKlass* accessor) { | 397 instanceKlass* accessor) { |
398 ResourceMark rm; | |
396 assert(bc != Bytecodes::_invokedynamic, "invokedynamic not yet supported"); | 399 assert(bc != Bytecodes::_invokedynamic, "invokedynamic not yet supported"); |
397 return get_method_by_index_impl(cpool, index, bc, accessor); | 400 return get_method_by_index_impl(cpool, index, bc, accessor); |
398 } | 401 } |
399 | 402 |
400 // ------------------------------------------------------------------ | 403 // ------------------------------------------------------------------ |