comparison src/share/vm/prims/jvmtiEventController.cpp @ 1213:6deeaebad47a

6902182: 4/4 Starting with jdwp agent should not incur performance penalty Summary: Rename can_post_exceptions support to can_post_on_exceptions. Add support for should_post_on_exceptions flag to permit per JavaThread optimizations. Reviewed-by: never, kvn, dcubed Contributed-by: tom.deneau@amd.com
author dcubed
date Mon, 01 Feb 2010 17:35:05 -0700
parents ea20d7ce26b0
children c18cbe5936b8
comparison
equal deleted inserted replaced
1196:f3345b7b01b4 1213:6deeaebad47a
1 /* 1 /*
2 * Copyright 2003-2007 Sun Microsystems, Inc. All Rights Reserved. 2 * Copyright 2003-2010 Sun Microsystems, Inc. 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.
80 static const jlong EARLY_EVENT_BITS = CLASS_FILE_LOAD_HOOK_BIT | 80 static const jlong EARLY_EVENT_BITS = CLASS_FILE_LOAD_HOOK_BIT |
81 VM_START_BIT | VM_INIT_BIT | VM_DEATH_BIT | NATIVE_METHOD_BIND_BIT | 81 VM_START_BIT | VM_INIT_BIT | VM_DEATH_BIT | NATIVE_METHOD_BIND_BIT |
82 THREAD_START_BIT | THREAD_END_BIT | 82 THREAD_START_BIT | THREAD_END_BIT |
83 DYNAMIC_CODE_GENERATED_BIT; 83 DYNAMIC_CODE_GENERATED_BIT;
84 static const jlong GLOBAL_EVENT_BITS = ~THREAD_FILTERED_EVENT_BITS; 84 static const jlong GLOBAL_EVENT_BITS = ~THREAD_FILTERED_EVENT_BITS;
85 85 static const jlong SHOULD_POST_ON_EXCEPTIONS_BITS = EXCEPTION_BITS | METHOD_EXIT_BIT | FRAME_POP_BIT;
86 86
87 /////////////////////////////////////////////////////////////// 87 ///////////////////////////////////////////////////////////////
88 // 88 //
89 // JvmtiEventEnabled 89 // JvmtiEventEnabled
90 // 90 //
509 enter_interp_only_mode(state); 509 enter_interp_only_mode(state);
510 } else { 510 } else {
511 leave_interp_only_mode(state); 511 leave_interp_only_mode(state);
512 } 512 }
513 } 513 }
514 } 514
515 // update the JavaThread cached value for thread-specific should_post_on_exceptions value
516 bool should_post_on_exceptions = (any_env_enabled & SHOULD_POST_ON_EXCEPTIONS_BITS) != 0;
517 state->set_should_post_on_exceptions(should_post_on_exceptions);
518 }
519
515 return any_env_enabled; 520 return any_env_enabled;
516 } 521 }
517 522
518 523
519 // Compute truly enabled events - meaning if the event can and could be 524 // Compute truly enabled events - meaning if the event can and could be
613 } 618 }
614 } 619 }
615 620
616 // set global truly enabled, that is, any thread in any environment 621 // set global truly enabled, that is, any thread in any environment
617 JvmtiEventController::_universal_global_event_enabled.set_bits(any_env_thread_enabled); 622 JvmtiEventController::_universal_global_event_enabled.set_bits(any_env_thread_enabled);
623
624 // set global should_post_on_exceptions
625 JvmtiExport::set_should_post_on_exceptions((any_env_thread_enabled & SHOULD_POST_ON_EXCEPTIONS_BITS) != 0);
626
618 } 627 }
619 628
620 EC_TRACE(("JVMTI [-] # recompute enabled - after %llx", any_env_thread_enabled)); 629 EC_TRACE(("JVMTI [-] # recompute enabled - after %llx", any_env_thread_enabled));
621 } 630 }
622 631