Mercurial > hg > truffle
comparison src/share/vm/prims/jvmtiEnvBase.hpp @ 14521:29ccc4cbabca
Merge
author | Gilles Duboscq <duboscq@ssw.jku.at> |
---|---|
date | Wed, 12 Mar 2014 13:30:08 +0100 |
parents | 402677ca28ed |
children | 0d8d78c0329a 4ca6dc0799b6 |
comparison
equal
deleted
inserted
replaced
14520:f84115370178 | 14521:29ccc4cbabca |
---|---|
1 /* | 1 /* |
2 * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved. | 2 * Copyright (c) 2003, 2014, Oracle and/or its affiliates. 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. |
354 _owned_monitors_list = owned_monitor_list; | 354 _owned_monitors_list = owned_monitor_list; |
355 _result = JVMTI_ERROR_NONE; | 355 _result = JVMTI_ERROR_NONE; |
356 } | 356 } |
357 VMOp_Type type() const { return VMOp_GetOwnedMonitorInfo; } | 357 VMOp_Type type() const { return VMOp_GetOwnedMonitorInfo; } |
358 void doit() { | 358 void doit() { |
359 ((JvmtiEnvBase *)_env)->get_owned_monitors(_calling_thread, _java_thread, | 359 _result = JVMTI_ERROR_THREAD_NOT_ALIVE; |
360 _owned_monitors_list); | 360 if (Threads::includes(_java_thread) && !_java_thread->is_exiting() |
361 && _java_thread->threadObj() != NULL) { | |
362 _result = ((JvmtiEnvBase *)_env)->get_owned_monitors(_calling_thread, _java_thread, | |
363 _owned_monitors_list); | |
364 } | |
361 } | 365 } |
362 jvmtiError result() { return _result; } | 366 jvmtiError result() { return _result; } |
363 }; | 367 }; |
364 | 368 |
365 | 369 |
437 _count_ptr = count_ptr; | 441 _count_ptr = count_ptr; |
438 } | 442 } |
439 jvmtiError result() { return _result; } | 443 jvmtiError result() { return _result; } |
440 VMOp_Type type() const { return VMOp_GetStackTrace; } | 444 VMOp_Type type() const { return VMOp_GetStackTrace; } |
441 void doit() { | 445 void doit() { |
442 _result = ((JvmtiEnvBase *)_env)->get_stack_trace(_java_thread, | 446 _result = JVMTI_ERROR_THREAD_NOT_ALIVE; |
443 _start_depth, _max_count, | 447 if (Threads::includes(_java_thread) && !_java_thread->is_exiting() |
444 _frame_buffer, _count_ptr); | 448 && _java_thread->threadObj() != NULL) { |
449 _result = ((JvmtiEnvBase *)_env)->get_stack_trace(_java_thread, | |
450 _start_depth, _max_count, | |
451 _frame_buffer, _count_ptr); | |
452 } | |
445 } | 453 } |
446 }; | 454 }; |
447 | 455 |
448 // forward declaration | 456 // forward declaration |
449 struct StackInfoNode; | 457 struct StackInfoNode; |
531 _count_ptr = count_ptr; | 539 _count_ptr = count_ptr; |
532 } | 540 } |
533 VMOp_Type type() const { return VMOp_GetFrameCount; } | 541 VMOp_Type type() const { return VMOp_GetFrameCount; } |
534 jvmtiError result() { return _result; } | 542 jvmtiError result() { return _result; } |
535 void doit() { | 543 void doit() { |
536 _result = ((JvmtiEnvBase*)_env)->get_frame_count(_state, _count_ptr); | 544 _result = JVMTI_ERROR_THREAD_NOT_ALIVE; |
545 JavaThread* jt = _state->get_thread(); | |
546 if (Threads::includes(jt) && !jt->is_exiting() && jt->threadObj() != NULL) { | |
547 _result = ((JvmtiEnvBase*)_env)->get_frame_count(_state, _count_ptr); | |
548 } | |
537 } | 549 } |
538 }; | 550 }; |
539 | 551 |
540 // VM operation to frame location at safepoint. | 552 // VM operation to frame location at safepoint. |
541 class VM_GetFrameLocation : public VM_Operation { | 553 class VM_GetFrameLocation : public VM_Operation { |
557 _location_ptr = location_ptr; | 569 _location_ptr = location_ptr; |
558 } | 570 } |
559 VMOp_Type type() const { return VMOp_GetFrameLocation; } | 571 VMOp_Type type() const { return VMOp_GetFrameLocation; } |
560 jvmtiError result() { return _result; } | 572 jvmtiError result() { return _result; } |
561 void doit() { | 573 void doit() { |
562 _result = ((JvmtiEnvBase*)_env)->get_frame_location(_java_thread, _depth, | 574 _result = JVMTI_ERROR_THREAD_NOT_ALIVE; |
563 _method_ptr, _location_ptr); | 575 if (Threads::includes(_java_thread) && !_java_thread->is_exiting() && |
576 _java_thread->threadObj() != NULL) { | |
577 _result = ((JvmtiEnvBase*)_env)->get_frame_location(_java_thread, _depth, | |
578 _method_ptr, _location_ptr); | |
579 } | |
564 } | 580 } |
565 }; | 581 }; |
566 | 582 |
567 | 583 |
568 // ResourceTracker | 584 // ResourceTracker |