equal
deleted
inserted
replaced
1 /* |
1 /* |
2 * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. |
2 * Copyright (c) 1997, 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. |
209 inline oop oopDesc::decode_heap_oop_not_null(narrowOop v) { |
209 inline oop oopDesc::decode_heap_oop_not_null(narrowOop v) { |
210 assert(!is_null(v), "narrow oop value can never be zero"); |
210 assert(!is_null(v), "narrow oop value can never be zero"); |
211 address base = Universe::narrow_oop_base(); |
211 address base = Universe::narrow_oop_base(); |
212 int shift = Universe::narrow_oop_shift(); |
212 int shift = Universe::narrow_oop_shift(); |
213 oop result = (oop)(void*)((uintptr_t)base + ((uintptr_t)v << shift)); |
213 oop result = (oop)(void*)((uintptr_t)base + ((uintptr_t)v << shift)); |
214 assert(check_obj_alignment(result), err_msg("address not aligned: " PTR_FORMAT, (void*) result)); |
214 assert(check_obj_alignment(result), err_msg("address not aligned: " INTPTR_FORMAT, p2i((void*) result))); |
215 return result; |
215 return result; |
216 } |
216 } |
217 |
217 |
218 inline oop oopDesc::decode_heap_oop(narrowOop v) { |
218 inline oop oopDesc::decode_heap_oop(narrowOop v) { |
219 return is_null(v) ? (oop)NULL : decode_heap_oop_not_null(v); |
219 return is_null(v) ? (oop)NULL : decode_heap_oop_not_null(v); |