1 /* |
1 /* |
2 * Copyright 2003-2006 Sun Microsystems, Inc. All Rights Reserved. |
2 * Copyright 2003-2009 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. |
74 BAD_MAGIC = 0xDEAD |
74 BAD_MAGIC = 0xDEAD |
75 }; |
75 }; |
76 |
76 |
77 jvmtiEnv _jvmti_external; |
77 jvmtiEnv _jvmti_external; |
78 jint _magic; |
78 jint _magic; |
|
79 jint _version; // version value passed to JNI GetEnv() |
79 JvmtiEnvBase* _next; |
80 JvmtiEnvBase* _next; |
80 bool _is_retransformable; |
81 bool _is_retransformable; |
81 const void *_env_local_storage; // per env agent allocated data. |
82 const void *_env_local_storage; // per env agent allocated data. |
82 jvmtiEventCallbacks _event_callbacks; |
83 jvmtiEventCallbacks _event_callbacks; |
83 jvmtiExtEventCallbacks _ext_event_callbacks; |
84 jvmtiExtEventCallbacks _ext_event_callbacks; |
89 static volatile bool _needs_clean_up; |
90 static volatile bool _needs_clean_up; |
90 char** _native_method_prefixes; |
91 char** _native_method_prefixes; |
91 int _native_method_prefix_count; |
92 int _native_method_prefix_count; |
92 |
93 |
93 protected: |
94 protected: |
94 JvmtiEnvBase(); |
95 JvmtiEnvBase(jint version); |
95 ~JvmtiEnvBase(); |
96 ~JvmtiEnvBase(); |
96 void dispose(); |
97 void dispose(); |
97 void env_dispose(); |
98 void env_dispose(); |
98 |
99 |
99 void set_env_local_storage(const void* data) { _env_local_storage = data; } |
100 void set_env_local_storage(const void* data) { _env_local_storage = data; } |
119 static JvmtiEnv* head_environment() { return (JvmtiEnv*)_head_environment; } |
120 static JvmtiEnv* head_environment() { return (JvmtiEnv*)_head_environment; } |
120 |
121 |
121 public: |
122 public: |
122 |
123 |
123 bool is_valid(); |
124 bool is_valid(); |
|
125 |
|
126 bool use_version_1_0_semantics(); // agent asked for version 1.0 |
|
127 bool use_version_1_1_semantics(); // agent asked for version 1.1 |
124 |
128 |
125 bool is_retransformable() { return _is_retransformable; } |
129 bool is_retransformable() { return _is_retransformable; } |
126 |
130 |
127 static ByteSize jvmti_external_offset() { |
131 static ByteSize jvmti_external_offset() { |
128 return byte_offset_of(JvmtiEnvBase, _jvmti_external); |
132 return byte_offset_of(JvmtiEnvBase, _jvmti_external); |