Mercurial > hg > graal-compiler
comparison src/share/vm/ci/ciReplay.cpp @ 10197:7b23cb975cf2
8011675: adding compilation level to replay data
Reviewed-by: kvn, vlivanov
author | iignatyev |
---|---|
date | Thu, 25 Apr 2013 11:09:24 -0700 |
parents | e12c9b3740db |
children | f9be75d21404 |
comparison
equal
deleted
inserted
replaced
10196:dc7db03f5aa2 | 10197:7b23cb975cf2 |
---|---|
367 } else { | 367 } else { |
368 report_error("unknown command"); | 368 report_error("unknown command"); |
369 } | 369 } |
370 } | 370 } |
371 | 371 |
372 // compile <klass> <name> <signature> <entry_bci> | 372 // validation of comp_level |
373 bool is_valid_comp_level(int comp_level) { | |
374 const int msg_len = 256; | |
375 char* msg = NULL; | |
376 if (!is_compile(comp_level)) { | |
377 msg = NEW_RESOURCE_ARRAY(char, msg_len); | |
378 jio_snprintf(msg, msg_len, "%d isn't compilation level", comp_level); | |
379 } else if (!TieredCompilation && (comp_level != CompLevel_highest_tier)) { | |
380 msg = NEW_RESOURCE_ARRAY(char, msg_len); | |
381 switch (comp_level) { | |
382 case CompLevel_simple: | |
383 jio_snprintf(msg, msg_len, "compilation level %d requires Client VM or TieredCompilation", comp_level); | |
384 break; | |
385 case CompLevel_full_optimization: | |
386 jio_snprintf(msg, msg_len, "compilation level %d requires Server VM", comp_level); | |
387 break; | |
388 default: | |
389 jio_snprintf(msg, msg_len, "compilation level %d requires TieredCompilation", comp_level); | |
390 } | |
391 } | |
392 if (msg != NULL) { | |
393 report_error(msg); | |
394 return false; | |
395 } | |
396 return true; | |
397 } | |
398 | |
399 // compile <klass> <name> <signature> <entry_bci> <comp_level> | |
373 void process_compile(TRAPS) { | 400 void process_compile(TRAPS) { |
374 // methodHandle method; | 401 // methodHandle method; |
375 Method* method = parse_method(CHECK); | 402 Method* method = parse_method(CHECK); |
376 int entry_bci = parse_int("entry_bci"); | 403 int entry_bci = parse_int("entry_bci"); |
404 const char* comp_level_label = "comp_level"; | |
405 int comp_level = parse_int(comp_level_label); | |
406 // old version w/o comp_level | |
407 if (had_error() && (error_message() == comp_level_label)) { | |
408 comp_level = CompLevel_full_optimization; | |
409 } | |
410 if (!is_valid_comp_level(comp_level)) { | |
411 return; | |
412 } | |
377 Klass* k = method->method_holder(); | 413 Klass* k = method->method_holder(); |
378 ((InstanceKlass*)k)->initialize(THREAD); | 414 ((InstanceKlass*)k)->initialize(THREAD); |
379 if (HAS_PENDING_EXCEPTION) { | 415 if (HAS_PENDING_EXCEPTION) { |
380 oop throwable = PENDING_EXCEPTION; | 416 oop throwable = PENDING_EXCEPTION; |
381 java_lang_Throwable::print(throwable, tty); | 417 java_lang_Throwable::print(throwable, tty); |
386 } else { | 422 } else { |
387 return; | 423 return; |
388 } | 424 } |
389 } | 425 } |
390 // Make sure the existence of a prior compile doesn't stop this one | 426 // Make sure the existence of a prior compile doesn't stop this one |
391 nmethod* nm = (entry_bci != InvocationEntryBci) ? method->lookup_osr_nmethod_for(entry_bci, CompLevel_full_optimization, true) : method->code(); | 427 nmethod* nm = (entry_bci != InvocationEntryBci) ? method->lookup_osr_nmethod_for(entry_bci, comp_level, true) : method->code(); |
392 if (nm != NULL) { | 428 if (nm != NULL) { |
393 nm->make_not_entrant(); | 429 nm->make_not_entrant(); |
394 } | 430 } |
395 replay_state = this; | 431 replay_state = this; |
396 CompileBroker::compile_method(method, entry_bci, CompLevel_full_optimization, | 432 CompileBroker::compile_method(method, entry_bci, comp_level, |
397 methodHandle(), 0, "replay", THREAD); | 433 methodHandle(), 0, "replay", THREAD); |
398 replay_state = NULL; | 434 replay_state = NULL; |
399 reset(); | 435 reset(); |
400 } | 436 } |
401 | 437 |