comparison src/share/vm/graal/graalCodeInstaller.cpp @ 3663:8c46cdb684d4

Fixed another possible safepoint in the code installer.
author Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
date Thu, 17 Nov 2011 18:33:33 +0100
parents d24f157f2ba8
children 6e1abd79e7c8
comparison
equal deleted inserted replaced
3662:e0bbc6b1c4a1 3663:8c46cdb684d4
231 } 231 }
232 232
233 // constructor used to create a method 233 // constructor used to create a method
234 CodeInstaller::CodeInstaller(Handle target_method, nmethod*& nm, bool install_code) { 234 CodeInstaller::CodeInstaller(Handle target_method, nmethod*& nm, bool install_code) {
235 _env = CURRENT_ENV; 235 _env = CURRENT_ENV;
236 GraalCompiler::initialize_buffer_blob();
237 CodeBuffer buffer(JavaThread::current()->get_buffer_blob());
238
236 { 239 {
237 No_Safepoint_Verifier no_safepoint; 240 No_Safepoint_Verifier no_safepoint;
238 initialize_fields(target_method); 241 initialize_fields(target_method);
239 }
240
241 // (very) conservative estimate: each site needs a relocation
242 //CodeBuffer buffer("temp graal method", _total_size, _sites->length() * relocInfo::length_limit);
243 GraalCompiler::initialize_buffer_blob();
244 CodeBuffer buffer(JavaThread::current()->get_buffer_blob());
245 {
246 No_Safepoint_Verifier no_safepoint;
247 initialize_buffer(buffer); 242 initialize_buffer(buffer);
248 process_exception_handlers(); 243 process_exception_handlers();
249 } 244 }
250 245
251 if (_assumptions != NULL) { 246 if (_assumptions != NULL) {
379 ciKlass* type = (ciKlass*) CURRENT_ENV->get_object(java_lang_Class::as_klassOop(HotSpotTypeResolved::javaMirror(type_handle))); 374 ciKlass* type = (ciKlass*) CURRENT_ENV->get_object(java_lang_Class::as_klassOop(HotSpotTypeResolved::javaMirror(type_handle)));
380 375
381 _dependencies->assert_leaf_type(type); 376 _dependencies->assert_leaf_type(type);
382 if (context != type) { 377 if (context != type) {
383 assert(context->is_abstract(), ""); 378 assert(context->is_abstract(), "");
384 ThreadToNativeFromVM trans(JavaThread::current());
385 _dependencies->assert_abstract_with_unique_concrete_subtype(context, type); 379 _dependencies->assert_abstract_with_unique_concrete_subtype(context, type);
386 } 380 }
387 } 381 }
388 382
389 void CodeInstaller::assumption_ConcreteMethod(Handle assumption) { 383 void CodeInstaller::assumption_ConcreteMethod(Handle assumption) {
393 methodHandle context = getMethodFromHotSpotMethod(context_handle()); 387 methodHandle context = getMethodFromHotSpotMethod(context_handle());
394 388
395 ciMethod* m = (ciMethod*) CURRENT_ENV->get_object(method()); 389 ciMethod* m = (ciMethod*) CURRENT_ENV->get_object(method());
396 ciMethod* c = (ciMethod*) CURRENT_ENV->get_object(context()); 390 ciMethod* c = (ciMethod*) CURRENT_ENV->get_object(context());
397 ciKlass* context_klass = c->holder(); 391 ciKlass* context_klass = c->holder();
398 { 392 _dependencies->assert_unique_concrete_method(context_klass, m);
399 ThreadToNativeFromVM trans(JavaThread::current());
400 _dependencies->assert_unique_concrete_method(context_klass, m);
401 }
402 } 393 }
403 394
404 void CodeInstaller::process_exception_handlers() { 395 void CodeInstaller::process_exception_handlers() {
405 // allocate some arrays for use by the collection code. 396 // allocate some arrays for use by the collection code.
406 const int num_handlers = 5; 397 const int num_handlers = 5;