436 nmethod* nm = CompileBroker::compile_method(mh, bci, comp_level, mh, mh->invocation_count(), "WhiteBox", THREAD); |
436 nmethod* nm = CompileBroker::compile_method(mh, bci, comp_level, mh, mh->invocation_count(), "WhiteBox", THREAD); |
437 MutexLockerEx mu(Compile_lock); |
437 MutexLockerEx mu(Compile_lock); |
438 return (mh->queued_for_compilation() || nm != NULL); |
438 return (mh->queued_for_compilation() || nm != NULL); |
439 WB_END |
439 WB_END |
440 |
440 |
|
441 class VM_WhiteBoxOperation : public VM_Operation { |
|
442 public: |
|
443 VM_WhiteBoxOperation() { } |
|
444 VMOp_Type type() const { return VMOp_WhiteBoxOperation; } |
|
445 bool allow_nested_vm_operations() const { return true; } |
|
446 }; |
|
447 |
|
448 class AlwaysFalseClosure : public BoolObjectClosure { |
|
449 public: |
|
450 bool do_object_b(oop p) { return false; } |
|
451 }; |
|
452 |
|
453 static AlwaysFalseClosure always_false; |
|
454 |
|
455 class VM_WhiteBoxCleanMethodData : public VM_WhiteBoxOperation { |
|
456 public: |
|
457 VM_WhiteBoxCleanMethodData(MethodData* mdo) : _mdo(mdo) { } |
|
458 void doit() { |
|
459 _mdo->clean_method_data(&always_false); |
|
460 } |
|
461 private: |
|
462 MethodData* _mdo; |
|
463 }; |
|
464 |
441 WB_ENTRY(void, WB_ClearMethodState(JNIEnv* env, jobject o, jobject method)) |
465 WB_ENTRY(void, WB_ClearMethodState(JNIEnv* env, jobject o, jobject method)) |
442 jmethodID jmid = reflected_method_to_jmid(thread, env, method); |
466 jmethodID jmid = reflected_method_to_jmid(thread, env, method); |
443 CHECK_JNI_EXCEPTION(env); |
467 CHECK_JNI_EXCEPTION(env); |
444 methodHandle mh(THREAD, Method::checked_resolve_jmethod_id(jmid)); |
468 methodHandle mh(THREAD, Method::checked_resolve_jmethod_id(jmid)); |
445 MutexLockerEx mu(Compile_lock); |
469 MutexLockerEx mu(Compile_lock); |
451 ResourceMark rm; |
475 ResourceMark rm; |
452 int arg_count = mdo->method()->size_of_parameters(); |
476 int arg_count = mdo->method()->size_of_parameters(); |
453 for (int i = 0; i < arg_count; i++) { |
477 for (int i = 0; i < arg_count; i++) { |
454 mdo->set_arg_modified(i, 0); |
478 mdo->set_arg_modified(i, 0); |
455 } |
479 } |
|
480 VM_WhiteBoxCleanMethodData op(mdo); |
|
481 VMThread::execute(&op); |
456 } |
482 } |
457 |
483 |
458 mh->clear_not_c1_compilable(); |
484 mh->clear_not_c1_compilable(); |
459 mh->clear_not_c2_compilable(); |
485 mh->clear_not_c2_compilable(); |
460 mh->clear_not_c2_osr_compilable(); |
486 mh->clear_not_c2_osr_compilable(); |