Mercurial > hg > graal-jvmci-8
comparison src/cpu/sparc/vm/cppInterpreter_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) 2007, 2011, Oracle and/or its affiliates. All rights reserved. | 2 * Copyright (c) 2007, 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. |
488 __ sll(G1_scratch, 2*BitsPerByte, G1_scratch); | 488 __ sll(G1_scratch, 2*BitsPerByte, G1_scratch); |
489 __ srl(G1_scratch, 2*BitsPerByte - exact_log2(in_words( | 489 __ srl(G1_scratch, 2*BitsPerByte - exact_log2(in_words( |
490 ConstantPoolCacheEntry::size()) * BytesPerWord), G1_scratch); | 490 ConstantPoolCacheEntry::size()) * BytesPerWord), G1_scratch); |
491 | 491 |
492 // get constant pool cache | 492 // get constant pool cache |
493 __ ld_ptr(G5_method, in_bytes(methodOopDesc::constants_offset()), G3_scratch); | 493 __ ld_ptr(G5_method, in_bytes(methodOopDesc::const_offset()), G3_scratch); |
494 __ ld_ptr(G3_scratch, in_bytes(constMethodOopDesc::constants_offset()), G3_scratch); | |
494 __ ld_ptr(G3_scratch, constantPoolOopDesc::cache_offset_in_bytes(), G3_scratch); | 495 __ ld_ptr(G3_scratch, constantPoolOopDesc::cache_offset_in_bytes(), G3_scratch); |
495 | 496 |
496 // get specific constant pool cache entry | 497 // get specific constant pool cache entry |
497 __ add(G3_scratch, G1_scratch, G3_scratch); | 498 __ add(G3_scratch, G1_scratch, G3_scratch); |
498 | 499 |
766 // get native function entry point(O0 is a good temp until the very end) | 767 // get native function entry point(O0 is a good temp until the very end) |
767 ld_ptr(Address(G5_method, 0, in_bytes(methodOopDesc::native_function_offset())), O0); | 768 ld_ptr(Address(G5_method, 0, in_bytes(methodOopDesc::native_function_offset())), O0); |
768 // for static methods insert the mirror argument | 769 // for static methods insert the mirror argument |
769 const int mirror_offset = in_bytes(Klass::java_mirror_offset()); | 770 const int mirror_offset = in_bytes(Klass::java_mirror_offset()); |
770 | 771 |
771 __ ld_ptr(Address(G5_method, 0, in_bytes(methodOopDesc:: constants_offset())), O1); | 772 __ ld_ptr(Address(G5_method, 0, in_bytes(methodOopDesc:: const_offset())), O1); |
773 __ ld_ptr(Address(O1, 0, in_bytes(constMethodOopDesc::constants_offset())), O1); | |
772 __ ld_ptr(Address(O1, 0, constantPoolOopDesc::pool_holder_offset_in_bytes()), O1); | 774 __ ld_ptr(Address(O1, 0, constantPoolOopDesc::pool_holder_offset_in_bytes()), O1); |
773 __ ld_ptr(O1, mirror_offset, O1); | 775 __ ld_ptr(O1, mirror_offset, O1); |
774 // where the mirror handle body is allocated: | 776 // where the mirror handle body is allocated: |
775 #ifdef ASSERT | 777 #ifdef ASSERT |
776 if (!PrintSignatureHandlers) // do not dirty the output with this | 778 if (!PrintSignatureHandlers) // do not dirty the output with this |
1045 // a new interpretState object and the method expression stack. | 1047 // a new interpretState object and the method expression stack. |
1046 | 1048 |
1047 assert_different_registers(state, prev_state); | 1049 assert_different_registers(state, prev_state); |
1048 assert_different_registers(prev_state, G3_scratch); | 1050 assert_different_registers(prev_state, G3_scratch); |
1049 const Register Gtmp = G3_scratch; | 1051 const Register Gtmp = G3_scratch; |
1050 const Address constants (G5_method, 0, in_bytes(methodOopDesc::constants_offset())); | 1052 const Address constMethod (G5_method, 0, in_bytes(methodOopDesc::const_offset())); |
1051 const Address access_flags (G5_method, 0, in_bytes(methodOopDesc::access_flags_offset())); | 1053 const Address access_flags (G5_method, 0, in_bytes(methodOopDesc::access_flags_offset())); |
1052 const Address size_of_parameters(G5_method, 0, in_bytes(methodOopDesc::size_of_parameters_offset())); | 1054 const Address size_of_parameters(G5_method, 0, in_bytes(methodOopDesc::size_of_parameters_offset())); |
1053 const Address max_stack (G5_method, 0, in_bytes(methodOopDesc::max_stack_offset())); | 1055 const Address max_stack (G5_method, 0, in_bytes(methodOopDesc::max_stack_offset())); |
1054 const Address size_of_locals (G5_method, 0, in_bytes(methodOopDesc::size_of_locals_offset())); | 1056 const Address size_of_locals (G5_method, 0, in_bytes(methodOopDesc::size_of_locals_offset())); |
1055 | 1057 |
1153 __ st_ptr(G5_method, XXX_STATE(_method)); | 1155 __ st_ptr(G5_method, XXX_STATE(_method)); |
1154 | 1156 |
1155 __ set((int) BytecodeInterpreter::method_entry, O1); | 1157 __ set((int) BytecodeInterpreter::method_entry, O1); |
1156 __ st(O1, XXX_STATE(_msg)); | 1158 __ st(O1, XXX_STATE(_msg)); |
1157 | 1159 |
1158 __ ld_ptr(constants, O3); | 1160 __ ld_ptr(constMethod, O3); |
1161 __ ld_ptr(O3, in_bytes(constMethodOopDesc::constants_offset()), O3); | |
1159 __ ld_ptr(O3, constantPoolOopDesc::cache_offset_in_bytes(), O2); | 1162 __ ld_ptr(O3, constantPoolOopDesc::cache_offset_in_bytes(), O2); |
1160 __ st_ptr(O2, XXX_STATE(_constants)); | 1163 __ st_ptr(O2, XXX_STATE(_constants)); |
1161 | 1164 |
1162 __ st_ptr(G0, XXX_STATE(_result._to_call._callee)); | 1165 __ st_ptr(G0, XXX_STATE(_result._to_call._callee)); |
1163 | 1166 |
1176 const int mirror_offset = in_bytes(Klass::java_mirror_offset()); | 1179 const int mirror_offset = in_bytes(Klass::java_mirror_offset()); |
1177 __ delayed()->btst(JVM_ACC_STATIC, O1); | 1180 __ delayed()->btst(JVM_ACC_STATIC, O1); |
1178 __ ld_ptr(XXX_STATE(_locals), O1); | 1181 __ ld_ptr(XXX_STATE(_locals), O1); |
1179 __ br( Assembler::zero, true, Assembler::pt, got_obj); | 1182 __ br( Assembler::zero, true, Assembler::pt, got_obj); |
1180 __ delayed()->ld_ptr(O1, 0, O1); // get receiver for not-static case | 1183 __ delayed()->ld_ptr(O1, 0, O1); // get receiver for not-static case |
1181 __ ld_ptr(constants, O1); | 1184 __ ld_ptr(constMethod, O1); |
1185 __ ld_ptr( O1, in_bytes(constMethodOopDesc::constants_offset()), O1); | |
1182 __ ld_ptr( O1, constantPoolOopDesc::pool_holder_offset_in_bytes(), O1); | 1186 __ ld_ptr( O1, constantPoolOopDesc::pool_holder_offset_in_bytes(), O1); |
1183 // lock the mirror, not the klassOop | 1187 // lock the mirror, not the klassOop |
1184 __ ld_ptr( O1, mirror_offset, O1); | 1188 __ ld_ptr( O1, mirror_offset, O1); |
1185 | 1189 |
1186 __ bind(got_obj); | 1190 __ bind(got_obj); |
1534 | 1538 |
1535 // the following temporary registers are used during frame creation | 1539 // the following temporary registers are used during frame creation |
1536 const Register Gtmp1 = G3_scratch; | 1540 const Register Gtmp1 = G3_scratch; |
1537 // const Register Lmirror = L1; // native mirror (native calls only) | 1541 // const Register Lmirror = L1; // native mirror (native calls only) |
1538 | 1542 |
1539 const Address constants (G5_method, 0, in_bytes(methodOopDesc::constants_offset())); | 1543 const Address constMethod (G5_method, 0, in_bytes(methodOopDesc::const_offset())); |
1540 const Address access_flags (G5_method, 0, in_bytes(methodOopDesc::access_flags_offset())); | 1544 const Address access_flags (G5_method, 0, in_bytes(methodOopDesc::access_flags_offset())); |
1541 const Address size_of_parameters(G5_method, 0, in_bytes(methodOopDesc::size_of_parameters_offset())); | 1545 const Address size_of_parameters(G5_method, 0, in_bytes(methodOopDesc::size_of_parameters_offset())); |
1542 const Address max_stack (G5_method, 0, in_bytes(methodOopDesc::max_stack_offset())); | 1546 const Address max_stack (G5_method, 0, in_bytes(methodOopDesc::max_stack_offset())); |
1543 const Address size_of_locals (G5_method, 0, in_bytes(methodOopDesc::size_of_locals_offset())); | 1547 const Address size_of_locals (G5_method, 0, in_bytes(methodOopDesc::size_of_locals_offset())); |
1544 | 1548 |