comparison src/cpu/sparc/vm/templateInterpreter_sparc.cpp @ 6123:2fe087c3e814

7172967: Eliminate constMethod's _method backpointer to methodOop. Summary: Eliminate constMethod's _method backpointer to methodOop, and move the _constant field from methodOop to constMethod. Reviewed-by: roland, bdelsart, kamg
author jiangli
date Wed, 06 Jun 2012 14:33:43 -0400
parents 8a48c2906f91
children 1d7922586cf6
comparison
equal deleted inserted replaced
6115:6e2633440960 6123:2fe087c3e814
1 /* 1 /*
2 * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. 2 * Copyright (c) 1997, 2012, 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.
369 const int mirror_offset = in_bytes(Klass::java_mirror_offset()); 369 const int mirror_offset = in_bytes(Klass::java_mirror_offset());
370 __ btst(JVM_ACC_STATIC, O0); 370 __ btst(JVM_ACC_STATIC, O0);
371 __ br( Assembler::zero, true, Assembler::pt, done); 371 __ br( Assembler::zero, true, Assembler::pt, done);
372 __ delayed()->ld_ptr(Llocals, Interpreter::local_offset_in_bytes(0), O0); // get receiver for not-static case 372 __ delayed()->ld_ptr(Llocals, Interpreter::local_offset_in_bytes(0), O0); // get receiver for not-static case
373 373
374 __ ld_ptr( Lmethod, in_bytes(methodOopDesc::constants_offset()), O0); 374 __ ld_ptr( Lmethod, in_bytes(methodOopDesc::const_offset()), O0);
375 __ ld_ptr( O0, in_bytes(constMethodOopDesc::constants_offset()), O0);
375 __ ld_ptr( O0, constantPoolOopDesc::pool_holder_offset_in_bytes(), O0); 376 __ ld_ptr( O0, constantPoolOopDesc::pool_holder_offset_in_bytes(), O0);
376 377
377 // lock the mirror, not the klassOop 378 // lock the mirror, not the klassOop
378 __ ld_ptr( O0, mirror_offset, O0); 379 __ ld_ptr( O0, mirror_offset, O0);
379 380
668 __ sll(G1_scratch, 2*BitsPerByte, G1_scratch); 669 __ sll(G1_scratch, 2*BitsPerByte, G1_scratch);
669 __ srl(G1_scratch, 2*BitsPerByte - exact_log2(in_words( 670 __ srl(G1_scratch, 2*BitsPerByte - exact_log2(in_words(
670 ConstantPoolCacheEntry::size()) * BytesPerWord), G1_scratch); 671 ConstantPoolCacheEntry::size()) * BytesPerWord), G1_scratch);
671 672
672 // get constant pool cache 673 // get constant pool cache
673 __ ld_ptr(G5_method, methodOopDesc::constants_offset(), G3_scratch); 674 __ ld_ptr(G5_method, methodOopDesc::const_offset(), G3_scratch);
675 __ ld_ptr(G3_scratch, constMethodOopDesc::constants_offset(), G3_scratch);
674 __ ld_ptr(G3_scratch, constantPoolOopDesc::cache_offset_in_bytes(), G3_scratch); 676 __ ld_ptr(G3_scratch, constantPoolOopDesc::cache_offset_in_bytes(), G3_scratch);
675 677
676 // get specific constant pool cache entry 678 // get specific constant pool cache entry
677 __ add(G3_scratch, G1_scratch, G3_scratch); 679 __ add(G3_scratch, G1_scratch, G3_scratch);
678 680
991 // get native function entry point(O0 is a good temp until the very end) 993 // get native function entry point(O0 is a good temp until the very end)
992 __ delayed()->ld_ptr(Lmethod, in_bytes(methodOopDesc::native_function_offset()), O0); 994 __ delayed()->ld_ptr(Lmethod, in_bytes(methodOopDesc::native_function_offset()), O0);
993 // for static methods insert the mirror argument 995 // for static methods insert the mirror argument
994 const int mirror_offset = in_bytes(Klass::java_mirror_offset()); 996 const int mirror_offset = in_bytes(Klass::java_mirror_offset());
995 997
996 __ ld_ptr(Lmethod, methodOopDesc:: constants_offset(), O1); 998 __ ld_ptr(Lmethod, methodOopDesc:: const_offset(), O1);
999 __ ld_ptr(O1, constMethodOopDesc::constants_offset(), O1);
997 __ ld_ptr(O1, constantPoolOopDesc::pool_holder_offset_in_bytes(), O1); 1000 __ ld_ptr(O1, constantPoolOopDesc::pool_holder_offset_in_bytes(), O1);
998 __ ld_ptr(O1, mirror_offset, O1); 1001 __ ld_ptr(O1, mirror_offset, O1);
999 #ifdef ASSERT 1002 #ifdef ASSERT
1000 if (!PrintSignatureHandlers) // do not dirty the output with this 1003 if (!PrintSignatureHandlers) // do not dirty the output with this
1001 { Label L; 1004 { Label L;