Mercurial > hg > truffle
comparison src/share/vm/c1/c1_Runtime1.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 | 4ce7240d622c |
children | 230fac611b50 |
comparison
equal
deleted
inserted
replaced
1196:f3345b7b01b4 | 1213:6deeaebad47a |
---|---|
1 /* | 1 /* |
2 * Copyright 1999-2009 Sun Microsystems, Inc. All Rights Reserved. | 2 * Copyright 1999-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. |
108 if ( !caller_is_deopted()) { | 108 if ( !caller_is_deopted()) { |
109 JavaThread* thread = JavaThread::current(); | 109 JavaThread* thread = JavaThread::current(); |
110 RegisterMap reg_map(thread, false); | 110 RegisterMap reg_map(thread, false); |
111 frame runtime_frame = thread->last_frame(); | 111 frame runtime_frame = thread->last_frame(); |
112 frame caller_frame = runtime_frame.sender(®_map); | 112 frame caller_frame = runtime_frame.sender(®_map); |
113 VM_DeoptimizeFrame deopt(thread, caller_frame.id()); | 113 // bypass VM_DeoptimizeFrame and deoptimize the frame directly |
114 VMThread::execute(&deopt); | 114 Deoptimization::deoptimize_frame(thread, caller_frame.id()); |
115 assert(caller_is_deopted(), "Must be deoptimized"); | 115 assert(caller_is_deopted(), "Must be deoptimized"); |
116 } | 116 } |
117 } | 117 } |
118 | 118 |
119 | 119 |
352 THROW(vmSymbolHandles::java_lang_ArrayStoreException()); | 352 THROW(vmSymbolHandles::java_lang_ArrayStoreException()); |
353 JRT_END | 353 JRT_END |
354 | 354 |
355 | 355 |
356 JRT_ENTRY(void, Runtime1::post_jvmti_exception_throw(JavaThread* thread)) | 356 JRT_ENTRY(void, Runtime1::post_jvmti_exception_throw(JavaThread* thread)) |
357 if (JvmtiExport::can_post_exceptions()) { | 357 if (JvmtiExport::can_post_on_exceptions()) { |
358 vframeStream vfst(thread, true); | 358 vframeStream vfst(thread, true); |
359 address bcp = vfst.method()->bcp_from(vfst.bci()); | 359 address bcp = vfst.method()->bcp_from(vfst.bci()); |
360 JvmtiExport::post_exception_throw(thread, vfst.method(), bcp, thread->exception_oop()); | 360 JvmtiExport::post_exception_throw(thread, vfst.method(), bcp, thread->exception_oop()); |
361 } | 361 } |
362 JRT_END | 362 JRT_END |
435 // enough space on the stack to do so. Use fast exceptions only if the guard | 435 // enough space on the stack to do so. Use fast exceptions only if the guard |
436 // pages are enabled. | 436 // pages are enabled. |
437 bool guard_pages_enabled = thread->stack_yellow_zone_enabled(); | 437 bool guard_pages_enabled = thread->stack_yellow_zone_enabled(); |
438 if (!guard_pages_enabled) guard_pages_enabled = thread->reguard_stack(); | 438 if (!guard_pages_enabled) guard_pages_enabled = thread->reguard_stack(); |
439 | 439 |
440 if (JvmtiExport::can_post_exceptions()) { | 440 if (JvmtiExport::can_post_on_exceptions()) { |
441 // To ensure correct notification of exception catches and throws | 441 // To ensure correct notification of exception catches and throws |
442 // we have to deoptimize here. If we attempted to notify the | 442 // we have to deoptimize here. If we attempted to notify the |
443 // catches and throws during this exception lookup it's possible | 443 // catches and throws during this exception lookup it's possible |
444 // we could deoptimize on the way out of the VM and end back in | 444 // we could deoptimize on the way out of the VM and end back in |
445 // the interpreter at the throw site. This would result in double | 445 // the interpreter at the throw site. This would result in double |