Mercurial > hg > truffle
comparison src/share/vm/prims/jvmtiImpl.cpp @ 612:afa80fa86d22
Merge
author | dcubed |
---|---|
date | Mon, 02 Mar 2009 14:43:36 -0700 |
parents | 2f716c0acb64 |
children | c18cbe5936b8 |
comparison
equal
deleted
inserted
replaced
593:1b68c738c0d9 | 612:afa80fa86d22 |
---|---|
236 #endif | 236 #endif |
237 _magic = 0; | 237 _magic = 0; |
238 } | 238 } |
239 | 239 |
240 | 240 |
241 bool | |
242 JvmtiRawMonitor::is_valid() { | |
243 int value = 0; | |
244 | |
245 // This object might not be a JvmtiRawMonitor so we can't assume | |
246 // the _magic field is properly aligned. Get the value in a safe | |
247 // way and then check against JVMTI_RM_MAGIC. | |
248 | |
249 switch (sizeof(_magic)) { | |
250 case 2: | |
251 value = Bytes::get_native_u2((address)&_magic); | |
252 break; | |
253 | |
254 case 4: | |
255 value = Bytes::get_native_u4((address)&_magic); | |
256 break; | |
257 | |
258 case 8: | |
259 value = Bytes::get_native_u8((address)&_magic); | |
260 break; | |
261 | |
262 default: | |
263 guarantee(false, "_magic field is an unexpected size"); | |
264 } | |
265 | |
266 return value == JVMTI_RM_MAGIC; | |
267 } | |
268 | |
269 | |
241 // | 270 // |
242 // class JvmtiBreakpoint | 271 // class JvmtiBreakpoint |
243 // | 272 // |
244 | 273 |
245 JvmtiBreakpoint::JvmtiBreakpoint() { | 274 JvmtiBreakpoint::JvmtiBreakpoint() { |