comparison test/hotspot/jtreg/vmTestbase/nsk/jvmti/unit/refignore/refignore.c @ 51250:c9e7dc7976ae

8204961: JVMTI jtreg tests build warnings on 32-bit platforms Reviewed-by: sspitsyn, dholmes
author bulasevich
date Mon, 18 Jun 2018 20:50:23 -0400
parents 46c67f5e27c2
children
comparison
equal deleted inserted replaced
0:94fe0254247e 1:7d7176d17264
130 } 130 }
131 131
132 obj_class = (*env)->GetObjectClass(env, obj); 132 obj_class = (*env)->GetObjectClass(env, obj);
133 133
134 err = (*jvmti)->GetTag(jvmti, obj_class, &haba); 134 err = (*jvmti)->GetTag(jvmti, obj_class, &haba);
135 class_tag = (MyTag*)haba; 135 class_tag = (MyTag*)(intptr_t)haba;
136 if (err != JVMTI_ERROR_NONE) { 136 if (err != JVMTI_ERROR_NONE) {
137 printf("Error (GetTag): %s (%d)\n", TranslateError(err), err); 137 printf("Error (GetTag): %s (%d)\n", TranslateError(err), err);
138 result = STATUS_FAILED; 138 result = STATUS_FAILED;
139 } 139 }
140 if (class_tag != NULL && class_tag->kind != rclass) { 140 if (class_tag != NULL && class_tag->kind != rclass) {
142 result = STATUS_FAILED; 142 result = STATUS_FAILED;
143 } 143 }
144 144
145 new_tag = newTag(kind, class_tag, size, name); 145 new_tag = newTag(kind, class_tag, size, name);
146 146
147 err = (*jvmti)->SetTag(jvmti, obj, (jlong)new_tag); 147 err = (*jvmti)->SetTag(jvmti, obj, (intptr_t)new_tag);
148 if (err != JVMTI_ERROR_NONE) { 148 if (err != JVMTI_ERROR_NONE) {
149 printf("Error (SetTag): %s (%d)\n", TranslateError(err), err); 149 printf("Error (SetTag): %s (%d)\n", TranslateError(err), err);
150 result = STATUS_FAILED; 150 result = STATUS_FAILED;
151 } 151 }
152 } 152 }
291 return JNI_OK; 291 return JNI_OK;
292 } 292 }
293 293
294 jvmtiIterationControl JNICALL 294 jvmtiIterationControl JNICALL
295 heapMarkCallback(jlong class_tag, jlong size, jlong* tag_ptr, void* user_data) { 295 heapMarkCallback(jlong class_tag, jlong size, jlong* tag_ptr, void* user_data) {
296 const MyTag* const tag = newTag(rmark, (const MyTag*)class_tag, size, NULL); 296 const MyTag* const tag = newTag(rmark, (const MyTag*)(intptr_t)class_tag, size, NULL);
297 *tag_ptr = (jlong)tag; 297 *tag_ptr = (intptr_t)tag;
298 298
299 if (user_data != &dummy_user_data && user_data_error_flag == JNI_FALSE) { 299 if (user_data != &dummy_user_data && user_data_error_flag == JNI_FALSE) {
300 user_data_error_flag = JNI_TRUE; 300 user_data_error_flag = JNI_TRUE;
301 printf("Error (heapMarkCallback): unexpected value of user_data\n"); 301 printf("Error (heapMarkCallback): unexpected value of user_data\n");
302 result = STATUS_FAILED; 302 result = STATUS_FAILED;
310 jlong* tag_ptr, void* user_data) { 310 jlong* tag_ptr, void* user_data) {
311 refKind kind = rother; 311 refKind kind = rother;
312 312
313 if (0 == *tag_ptr) { 313 if (0 == *tag_ptr) {
314 /* new tag */ 314 /* new tag */
315 MyTag* tag = newTag(kind, (MyTag*)class_tag, size, NULL); 315 MyTag* tag = newTag(kind, (MyTag*)(intptr_t)class_tag, size, NULL);
316 addRef(fakeRoot, HEAP_ROOT_REF_KIND_BASE+root_kind, tag); 316 addRef(fakeRoot, HEAP_ROOT_REF_KIND_BASE+root_kind, tag);
317 *tag_ptr = (jlong)tag; 317 *tag_ptr = (intptr_t)tag;
318 } else { 318 } else {
319 /* existing tag */ 319 /* existing tag */
320 addRef(fakeRoot, HEAP_ROOT_REF_KIND_BASE+root_kind, (MyTag*)*tag_ptr); 320 addRef(fakeRoot, HEAP_ROOT_REF_KIND_BASE+root_kind, (MyTag*)(intptr_t)*tag_ptr);
321 } 321 }
322 322
323 if (user_data != &dummy_user_data && user_data_error_flag == JNI_FALSE) { 323 if (user_data != &dummy_user_data && user_data_error_flag == JNI_FALSE) {
324 user_data_error_flag = JNI_TRUE; 324 user_data_error_flag = JNI_TRUE;
325 printf("Error (heapRootCallback): unexpected value of user_data\n"); 325 printf("Error (heapRootCallback): unexpected value of user_data\n");
336 jint slot, void* user_data) { 336 jint slot, void* user_data) {
337 refKind kind = rother; 337 refKind kind = rother;
338 338
339 if (0 == *tag_ptr) { 339 if (0 == *tag_ptr) {
340 /* new tag */ 340 /* new tag */
341 MyTag* tag = newTag(kind, (MyTag*)class_tag, size, NULL); 341 MyTag* tag = newTag(kind, (MyTag*)(intptr_t)class_tag, size, NULL);
342 addRef(fakeRoot, HEAP_ROOT_REF_KIND_BASE+root_kind, tag); 342 addRef(fakeRoot, HEAP_ROOT_REF_KIND_BASE+root_kind, tag);
343 *tag_ptr = (jlong)tag; 343 *tag_ptr = (intptr_t)tag;
344 } else { 344 } else {
345 /* existing tag */ 345 /* existing tag */
346 addRef(fakeRoot, HEAP_ROOT_REF_KIND_BASE+root_kind, (MyTag*)*tag_ptr); 346 addRef(fakeRoot, HEAP_ROOT_REF_KIND_BASE+root_kind, (MyTag*)(intptr_t)*tag_ptr);
347 } 347 }
348 if (user_data != &dummy_user_data && user_data_error_flag == JNI_FALSE) { 348 if (user_data != &dummy_user_data && user_data_error_flag == JNI_FALSE) {
349 user_data_error_flag = JNI_TRUE; 349 user_data_error_flag = JNI_TRUE;
350 printf("Error (stackReferenceCallback): unexpected value of user_data\n"); 350 printf("Error (stackReferenceCallback): unexpected value of user_data\n");
351 result = STATUS_FAILED; 351 result = STATUS_FAILED;
362 MyTag* referrer = NULL; 362 MyTag* referrer = NULL;
363 363
364 if (0 == referrer_tag) { 364 if (0 == referrer_tag) {
365 referrer = missed; 365 referrer = missed;
366 } else { 366 } else {
367 referrer = (MyTag *)referrer_tag; 367 referrer = (MyTag *)(intptr_t)referrer_tag;
368 } 368 }
369 369
370 if (0 == *tag_ptr) { 370 if (0 == *tag_ptr) {
371 /* new tag */ 371 /* new tag */
372 MyTag* tag = newTag(kind, (MyTag*)class_tag, size, NULL); 372 MyTag* tag = newTag(kind, (MyTag*)(intptr_t)class_tag, size, NULL);
373 addRef(referrer, reference_kind, tag); 373 addRef(referrer, reference_kind, tag);
374 *tag_ptr = (jlong) tag; 374 *tag_ptr = (intptr_t) tag;
375 } else { 375 } else {
376 /* existing tag */ 376 /* existing tag */
377 MyTag* tag = (MyTag*)*tag_ptr; 377 MyTag* tag = (MyTag*)(intptr_t)*tag_ptr;
378 addRef(referrer, reference_kind, tag); 378 addRef(referrer, reference_kind, tag);
379 } 379 }
380 if (user_data != &dummy_user_data && user_data_error_flag == JNI_FALSE) { 380 if (user_data != &dummy_user_data && user_data_error_flag == JNI_FALSE) {
381 user_data_error_flag = JNI_TRUE; 381 user_data_error_flag = JNI_TRUE;
382 printf("Error (objectReferenceCallback): unexpected value of user_data\n"); 382 printf("Error (objectReferenceCallback): unexpected value of user_data\n");