comparison src/cpu/x86/vm/templateInterpreter_x86_32.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 6759698e3140
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.
564 const int mirror_offset = in_bytes(Klass::java_mirror_offset()); 564 const int mirror_offset = in_bytes(Klass::java_mirror_offset());
565 __ movl(rax, access_flags); 565 __ movl(rax, access_flags);
566 __ testl(rax, JVM_ACC_STATIC); 566 __ testl(rax, JVM_ACC_STATIC);
567 __ movptr(rax, Address(rdi, Interpreter::local_offset_in_bytes(0))); // get receiver (assume this is frequent case) 567 __ movptr(rax, Address(rdi, Interpreter::local_offset_in_bytes(0))); // get receiver (assume this is frequent case)
568 __ jcc(Assembler::zero, done); 568 __ jcc(Assembler::zero, done);
569 __ movptr(rax, Address(rbx, methodOopDesc::constants_offset())); 569 __ movptr(rax, Address(rbx, methodOopDesc::const_offset()));
570 __ movptr(rax, Address(rax, constMethodOopDesc::constants_offset()));
570 __ movptr(rax, Address(rax, constantPoolOopDesc::pool_holder_offset_in_bytes())); 571 __ movptr(rax, Address(rax, constantPoolOopDesc::pool_holder_offset_in_bytes()));
571 __ movptr(rax, Address(rax, mirror_offset)); 572 __ movptr(rax, Address(rax, mirror_offset));
572 __ bind(done); 573 __ bind(done);
573 } 574 }
574 // add space for monitor & lock 575 // add space for monitor & lock
604 __ push(rdx); // set the mdp (method data pointer) 605 __ push(rdx); // set the mdp (method data pointer)
605 } else { 606 } else {
606 __ push(0); 607 __ push(0);
607 } 608 }
608 609
609 __ movptr(rdx, Address(rbx, methodOopDesc::constants_offset())); 610 __ movptr(rdx, Address(rbx, methodOopDesc::const_offset()));
611 __ movptr(rdx, Address(rdx, constMethodOopDesc::constants_offset()));
610 __ movptr(rdx, Address(rdx, constantPoolOopDesc::cache_offset_in_bytes())); 612 __ movptr(rdx, Address(rdx, constantPoolOopDesc::cache_offset_in_bytes()));
611 __ push(rdx); // set constant pool cache 613 __ push(rdx); // set constant pool cache
612 __ push(rdi); // set locals pointer 614 __ push(rdi); // set locals pointer
613 if (native_call) { 615 if (native_call) {
614 __ push(0); // no bcp 616 __ push(0); // no bcp
659 661
660 // check if local 0 != NULL and read field 662 // check if local 0 != NULL and read field
661 __ testptr(rax, rax); 663 __ testptr(rax, rax);
662 __ jcc(Assembler::zero, slow_path); 664 __ jcc(Assembler::zero, slow_path);
663 665
664 __ movptr(rdi, Address(rbx, methodOopDesc::constants_offset()));
665 // read first instruction word and extract bytecode @ 1 and index @ 2 666 // read first instruction word and extract bytecode @ 1 and index @ 2
666 __ movptr(rdx, Address(rbx, methodOopDesc::const_offset())); 667 __ movptr(rdx, Address(rbx, methodOopDesc::const_offset()));
668 __ movptr(rdi, Address(rdx, constMethodOopDesc::constants_offset()));
667 __ movl(rdx, Address(rdx, constMethodOopDesc::codes_offset())); 669 __ movl(rdx, Address(rdx, constMethodOopDesc::codes_offset()));
668 // Shift codes right to get the index on the right. 670 // Shift codes right to get the index on the right.
669 // The bytecode fetched looks like <index><0xb4><0x2a> 671 // The bytecode fetched looks like <index><0xb4><0x2a>
670 __ shrl(rdx, 2*BitsPerByte); 672 __ shrl(rdx, 2*BitsPerByte);
671 __ shll(rdx, exact_log2(in_words(ConstantPoolCacheEntry::size()))); 673 __ shll(rdx, exact_log2(in_words(ConstantPoolCacheEntry::size())));
1024 const int mirror_offset = in_bytes(Klass::java_mirror_offset()); 1026 const int mirror_offset = in_bytes(Klass::java_mirror_offset());
1025 __ movl(t, Address(method, methodOopDesc::access_flags_offset())); 1027 __ movl(t, Address(method, methodOopDesc::access_flags_offset()));
1026 __ testl(t, JVM_ACC_STATIC); 1028 __ testl(t, JVM_ACC_STATIC);
1027 __ jcc(Assembler::zero, L); 1029 __ jcc(Assembler::zero, L);
1028 // get mirror 1030 // get mirror
1029 __ movptr(t, Address(method, methodOopDesc:: constants_offset())); 1031 __ movptr(t, Address(method, methodOopDesc:: const_offset()));
1032 __ movptr(t, Address(t, constMethodOopDesc::constants_offset()));
1030 __ movptr(t, Address(t, constantPoolOopDesc::pool_holder_offset_in_bytes())); 1033 __ movptr(t, Address(t, constantPoolOopDesc::pool_holder_offset_in_bytes()));
1031 __ movptr(t, Address(t, mirror_offset)); 1034 __ movptr(t, Address(t, mirror_offset));
1032 // copy mirror into activation frame 1035 // copy mirror into activation frame
1033 __ movptr(Address(rbp, frame::interpreter_frame_oop_temp_offset * wordSize), t); 1036 __ movptr(Address(rbp, frame::interpreter_frame_oop_temp_offset * wordSize), t);
1034 // pass handle to mirror 1037 // pass handle to mirror