hotspot/src/cpu/x86/vm/templateInterpreter_x86_64.cpp
changeset 12937 0032fb2caff6
parent 12739 09f26b73ae66
child 13391 30245956af37
equal deleted inserted replaced
12929:99204ff08403 12937:0032fb2caff6
     1 /*
     1 /*
     2  * Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved.
     2  * Copyright (c) 2003, 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.
   520     __ movl(rax, access_flags);
   520     __ movl(rax, access_flags);
   521     __ testl(rax, JVM_ACC_STATIC);
   521     __ testl(rax, JVM_ACC_STATIC);
   522     // get receiver (assume this is frequent case)
   522     // get receiver (assume this is frequent case)
   523     __ movptr(rax, Address(r14, Interpreter::local_offset_in_bytes(0)));
   523     __ movptr(rax, Address(r14, Interpreter::local_offset_in_bytes(0)));
   524     __ jcc(Assembler::zero, done);
   524     __ jcc(Assembler::zero, done);
   525     __ movptr(rax, Address(rbx, methodOopDesc::constants_offset()));
   525     __ movptr(rax, Address(rbx, methodOopDesc::const_offset()));
       
   526     __ movptr(rax, Address(rax, constMethodOopDesc::constants_offset()));
   526     __ movptr(rax, Address(rax,
   527     __ movptr(rax, Address(rax,
   527                            constantPoolOopDesc::pool_holder_offset_in_bytes()));
   528                            constantPoolOopDesc::pool_holder_offset_in_bytes()));
   528     __ movptr(rax, Address(rax, mirror_offset));
   529     __ movptr(rax, Address(rax, mirror_offset));
   529 
   530 
   530 #ifdef ASSERT
   531 #ifdef ASSERT
   577     __ push(rdx);      // set the mdp (method data pointer)
   578     __ push(rdx);      // set the mdp (method data pointer)
   578   } else {
   579   } else {
   579     __ push(0);
   580     __ push(0);
   580   }
   581   }
   581 
   582 
   582   __ movptr(rdx, Address(rbx, methodOopDesc::constants_offset()));
   583   __ movptr(rdx, Address(rbx, methodOopDesc::const_offset()));
       
   584   __ movptr(rdx, Address(rdx, constMethodOopDesc::constants_offset()));
   583   __ movptr(rdx, Address(rdx, constantPoolOopDesc::cache_offset_in_bytes()));
   585   __ movptr(rdx, Address(rdx, constantPoolOopDesc::cache_offset_in_bytes()));
   584   __ push(rdx); // set constant pool cache
   586   __ push(rdx); // set constant pool cache
   585   __ push(r14); // set locals pointer
   587   __ push(r14); // set locals pointer
   586   if (native_call) {
   588   if (native_call) {
   587     __ push(0); // no bcp
   589     __ push(0); // no bcp
   627 
   629 
   628     // check if local 0 != NULL and read field
   630     // check if local 0 != NULL and read field
   629     __ testptr(rax, rax);
   631     __ testptr(rax, rax);
   630     __ jcc(Assembler::zero, slow_path);
   632     __ jcc(Assembler::zero, slow_path);
   631 
   633 
   632     __ movptr(rdi, Address(rbx, methodOopDesc::constants_offset()));
       
   633     // read first instruction word and extract bytecode @ 1 and index @ 2
   634     // read first instruction word and extract bytecode @ 1 and index @ 2
   634     __ movptr(rdx, Address(rbx, methodOopDesc::const_offset()));
   635     __ movptr(rdx, Address(rbx, methodOopDesc::const_offset()));
       
   636     __ movptr(rdi, Address(rdx, constMethodOopDesc::constants_offset()));
   635     __ movl(rdx, Address(rdx, constMethodOopDesc::codes_offset()));
   637     __ movl(rdx, Address(rdx, constMethodOopDesc::codes_offset()));
   636     // Shift codes right to get the index on the right.
   638     // Shift codes right to get the index on the right.
   637     // The bytecode fetched looks like <index><0xb4><0x2a>
   639     // The bytecode fetched looks like <index><0xb4><0x2a>
   638     __ shrl(rdx, 2 * BitsPerByte);
   640     __ shrl(rdx, 2 * BitsPerByte);
   639     __ shll(rdx, exact_log2(in_words(ConstantPoolCacheEntry::size())));
   641     __ shll(rdx, exact_log2(in_words(ConstantPoolCacheEntry::size())));
  1018     const int mirror_offset = in_bytes(Klass::java_mirror_offset());
  1020     const int mirror_offset = in_bytes(Klass::java_mirror_offset());
  1019     __ movl(t, Address(method, methodOopDesc::access_flags_offset()));
  1021     __ movl(t, Address(method, methodOopDesc::access_flags_offset()));
  1020     __ testl(t, JVM_ACC_STATIC);
  1022     __ testl(t, JVM_ACC_STATIC);
  1021     __ jcc(Assembler::zero, L);
  1023     __ jcc(Assembler::zero, L);
  1022     // get mirror
  1024     // get mirror
  1023     __ movptr(t, Address(method, methodOopDesc::constants_offset()));
  1025     __ movptr(t, Address(method, methodOopDesc::const_offset()));
       
  1026     __ movptr(t, Address(t, constMethodOopDesc::constants_offset()));
  1024     __ movptr(t, Address(t, constantPoolOopDesc::pool_holder_offset_in_bytes()));
  1027     __ movptr(t, Address(t, constantPoolOopDesc::pool_holder_offset_in_bytes()));
  1025     __ movptr(t, Address(t, mirror_offset));
  1028     __ movptr(t, Address(t, mirror_offset));
  1026     // copy mirror into activation frame
  1029     // copy mirror into activation frame
  1027     __ movptr(Address(rbp, frame::interpreter_frame_oop_temp_offset * wordSize),
  1030     __ movptr(Address(rbp, frame::interpreter_frame_oop_temp_offset * wordSize),
  1028             t);
  1031             t);