1.1 --- a/src/share/vm/memory/allocation.cpp Thu May 15 18:23:26 2014 -0400 1.2 +++ b/src/share/vm/memory/allocation.cpp Thu May 22 15:52:41 2014 -0400 1.3 @@ -1,5 +1,5 @@ 1.4 /* 1.5 - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. 1.6 + * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. 1.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 1.8 * 1.9 * This code is free software; you can redistribute it and/or modify it 1.10 @@ -79,7 +79,7 @@ 1.11 } 1.12 1.13 void MetaspaceObj::print_address_on(outputStream* st) const { 1.14 - st->print(" {"INTPTR_FORMAT"}", this); 1.15 + st->print(" {" INTPTR_FORMAT "}", p2i(this)); 1.16 } 1.17 1.18 void* ResourceObj::operator new(size_t size, allocation_type type, MEMFLAGS flags) throw() { 1.19 @@ -142,7 +142,7 @@ 1.20 void ResourceObj::set_allocation_type(address res, allocation_type type) { 1.21 // Set allocation type in the resource object 1.22 uintptr_t allocation = (uintptr_t)res; 1.23 - assert((allocation & allocation_mask) == 0, err_msg("address should be aligned to 4 bytes at least: " PTR_FORMAT, res)); 1.24 + assert((allocation & allocation_mask) == 0, err_msg("address should be aligned to 4 bytes at least: " INTPTR_FORMAT, p2i(res))); 1.25 assert(type <= allocation_mask, "incorrect allocation type"); 1.26 ResourceObj* resobj = (ResourceObj *)res; 1.27 resobj->_allocation_t[0] = ~(allocation + type); 1.28 @@ -179,7 +179,7 @@ 1.29 // Operator new() was called and type was set. 1.30 assert(!allocated_on_stack(), 1.31 err_msg("not embedded or stack, this(" PTR_FORMAT ") type %d a[0]=(" PTR_FORMAT ") a[1]=(" PTR_FORMAT ")", 1.32 - this, get_allocation_type(), _allocation_t[0], _allocation_t[1])); 1.33 + p2i(this), get_allocation_type(), _allocation_t[0], _allocation_t[1])); 1.34 } else { 1.35 // Operator new() was not called. 1.36 // Assume that it is embedded or stack object. 1.37 @@ -193,7 +193,7 @@ 1.38 // Note: garbage may resembles valid value. 1.39 assert(~(_allocation_t[0] | allocation_mask) != (uintptr_t)this || !is_type_set(), 1.40 err_msg("embedded or stack only, this(" PTR_FORMAT ") type %d a[0]=(" PTR_FORMAT ") a[1]=(" PTR_FORMAT ")", 1.41 - this, get_allocation_type(), _allocation_t[0], _allocation_t[1])); 1.42 + p2i(this), get_allocation_type(), _allocation_t[0], _allocation_t[1])); 1.43 set_allocation_type((address)this, STACK_OR_EMBEDDED); 1.44 _allocation_t[1] = 0; // Zap verification value 1.45 } 1.46 @@ -202,7 +202,7 @@ 1.47 // Used in InlineTree::ok_to_inline() for WarmCallInfo. 1.48 assert(allocated_on_stack(), 1.49 err_msg("copy only into local, this(" PTR_FORMAT ") type %d a[0]=(" PTR_FORMAT ") a[1]=(" PTR_FORMAT ")", 1.50 - this, get_allocation_type(), _allocation_t[0], _allocation_t[1])); 1.51 + p2i(this), get_allocation_type(), _allocation_t[0], _allocation_t[1])); 1.52 // Keep current _allocation_t value; 1.53 return *this; 1.54 } 1.55 @@ -218,13 +218,13 @@ 1.56 1.57 void trace_heap_malloc(size_t size, const char* name, void* p) { 1.58 // A lock is not needed here - tty uses a lock internally 1.59 - tty->print_cr("Heap malloc " INTPTR_FORMAT " " SIZE_FORMAT " %s", p, size, name == NULL ? "" : name); 1.60 + tty->print_cr("Heap malloc " INTPTR_FORMAT " " SIZE_FORMAT " %s", p2i(p), size, name == NULL ? "" : name); 1.61 } 1.62 1.63 1.64 void trace_heap_free(void* p) { 1.65 // A lock is not needed here - tty uses a lock internally 1.66 - tty->print_cr("Heap free " INTPTR_FORMAT, p); 1.67 + tty->print_cr("Heap free " INTPTR_FORMAT, p2i(p)); 1.68 } 1.69 1.70 //-------------------------------------------------------------------------------------- 1.71 @@ -723,11 +723,11 @@ 1.72 void AllocatedObj::print_value() const { print_value_on(tty); } 1.73 1.74 void AllocatedObj::print_on(outputStream* st) const { 1.75 - st->print_cr("AllocatedObj(" INTPTR_FORMAT ")", this); 1.76 + st->print_cr("AllocatedObj(" INTPTR_FORMAT ")", p2i(this)); 1.77 } 1.78 1.79 void AllocatedObj::print_value_on(outputStream* st) const { 1.80 - st->print("AllocatedObj(" INTPTR_FORMAT ")", this); 1.81 + st->print("AllocatedObj(" INTPTR_FORMAT ")", p2i(this)); 1.82 } 1.83 1.84 julong Arena::_bytes_allocated = 0;