comparison src/share/vm/runtime/stackValue.cpp @ 331:cecd8eb4e0ca

6706829: Compressed Oops: add debug info for narrow oops Summary: Add support for narrow oops in debug info to avoid decoding. Reviewed-by: rasbold, never
author kvn
date Wed, 10 Sep 2008 18:23:32 -0700
parents a61af66fc99e
children b109e761e927
comparison
equal deleted inserted replaced
330:1c6e3bfb543a 331:cecd8eb4e0ca
1 /* 1 /*
2 * Copyright 1997-2006 Sun Microsystems, Inc. All Rights Reserved. 2 * Copyright 1997-2008 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.
84 // Double value in an aligned adjacent pair 84 // Double value in an aligned adjacent pair
85 return new StackValue(*(intptr_t*)value_addr); 85 return new StackValue(*(intptr_t*)value_addr);
86 case Location::lng: 86 case Location::lng:
87 // Long value in an aligned adjacent pair 87 // Long value in an aligned adjacent pair
88 return new StackValue(*(intptr_t*)value_addr); 88 return new StackValue(*(intptr_t*)value_addr);
89 case Location::narrowoop: {
90 union { intptr_t p; narrowOop noop;} value;
91 value.p = (intptr_t) CONST64(0xDEADDEAFDEADDEAF);
92 if (loc.is_register()) {
93 // The callee has no clue whether the register holds an int,
94 // long or is unused. He always saves a long. Here we know
95 // a long was saved, but we only want an int back. Narrow the
96 // saved long to the int that the JVM wants.
97 value.noop = (narrowOop) *(julong*) value_addr;
98 } else {
99 value.noop = *(narrowOop*) value_addr;
100 }
101 // Decode narrowoop and wrap a handle around the oop
102 Handle h(oopDesc::decode_heap_oop(value.noop));
103 return new StackValue(h);
104 }
89 #endif 105 #endif
90 case Location::oop: { 106 case Location::oop: {
91 Handle h(*(oop *)value_addr); // Wrap a handle around the oop 107 Handle h(*(oop *)value_addr); // Wrap a handle around the oop
92 return new StackValue(h); 108 return new StackValue(h);
93 } 109 }