Mercurial > hg > graal-jvmci-8
comparison src/cpu/x86/vm/templateInterpreter_x86_64.cpp @ 6275:957c266d8bc5
Merge with http://hg.openjdk.java.net/hsx/hsx24/hotspot/
author | Doug Simon <doug.simon@oracle.com> |
---|---|
date | Tue, 21 Aug 2012 10:39:19 +0200 |
parents | 120820e30baa 1d7922586cf6 |
children | e522a00b91aa |
comparison
equal
deleted
inserted
replaced
5891:fd8832ae511d | 6275:957c266d8bc5 |
---|---|
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. |
551 __ movl(rax, access_flags); | 551 __ movl(rax, access_flags); |
552 __ testl(rax, JVM_ACC_STATIC); | 552 __ testl(rax, JVM_ACC_STATIC); |
553 // get receiver (assume this is frequent case) | 553 // get receiver (assume this is frequent case) |
554 __ movptr(rax, Address(r14, Interpreter::local_offset_in_bytes(0))); | 554 __ movptr(rax, Address(r14, Interpreter::local_offset_in_bytes(0))); |
555 __ jcc(Assembler::zero, done); | 555 __ jcc(Assembler::zero, done); |
556 __ movptr(rax, Address(rbx, methodOopDesc::constants_offset())); | 556 __ movptr(rax, Address(rbx, methodOopDesc::const_offset())); |
557 __ movptr(rax, Address(rax, constMethodOopDesc::constants_offset())); | |
557 __ movptr(rax, Address(rax, | 558 __ movptr(rax, Address(rax, |
558 constantPoolOopDesc::pool_holder_offset_in_bytes())); | 559 constantPoolOopDesc::pool_holder_offset_in_bytes())); |
559 __ movptr(rax, Address(rax, mirror_offset)); | 560 __ movptr(rax, Address(rax, mirror_offset)); |
560 | 561 |
561 #ifdef ASSERT | 562 #ifdef ASSERT |
608 __ push(rdx); // set the mdp (method data pointer) | 609 __ push(rdx); // set the mdp (method data pointer) |
609 } else { | 610 } else { |
610 __ push(0); | 611 __ push(0); |
611 } | 612 } |
612 | 613 |
613 __ movptr(rdx, Address(rbx, methodOopDesc::constants_offset())); | 614 __ movptr(rdx, Address(rbx, methodOopDesc::const_offset())); |
615 __ movptr(rdx, Address(rdx, constMethodOopDesc::constants_offset())); | |
614 __ movptr(rdx, Address(rdx, constantPoolOopDesc::cache_offset_in_bytes())); | 616 __ movptr(rdx, Address(rdx, constantPoolOopDesc::cache_offset_in_bytes())); |
615 __ push(rdx); // set constant pool cache | 617 __ push(rdx); // set constant pool cache |
616 __ push(r14); // set locals pointer | 618 __ push(r14); // set locals pointer |
617 if (native_call) { | 619 if (native_call) { |
618 __ push(0); // no bcp | 620 __ push(0); // no bcp |
658 | 660 |
659 // check if local 0 != NULL and read field | 661 // check if local 0 != NULL and read field |
660 __ testptr(rax, rax); | 662 __ testptr(rax, rax); |
661 __ jcc(Assembler::zero, slow_path); | 663 __ jcc(Assembler::zero, slow_path); |
662 | 664 |
663 __ movptr(rdi, Address(rbx, methodOopDesc::constants_offset())); | |
664 // read first instruction word and extract bytecode @ 1 and index @ 2 | 665 // read first instruction word and extract bytecode @ 1 and index @ 2 |
665 __ movptr(rdx, Address(rbx, methodOopDesc::const_offset())); | 666 __ movptr(rdx, Address(rbx, methodOopDesc::const_offset())); |
667 __ movptr(rdi, Address(rdx, constMethodOopDesc::constants_offset())); | |
666 __ movl(rdx, Address(rdx, constMethodOopDesc::codes_offset())); | 668 __ movl(rdx, Address(rdx, constMethodOopDesc::codes_offset())); |
667 // Shift codes right to get the index on the right. | 669 // Shift codes right to get the index on the right. |
668 // The bytecode fetched looks like <index><0xb4><0x2a> | 670 // The bytecode fetched looks like <index><0xb4><0x2a> |
669 __ shrl(rdx, 2 * BitsPerByte); | 671 __ shrl(rdx, 2 * BitsPerByte); |
670 __ shll(rdx, exact_log2(in_words(ConstantPoolCacheEntry::size()))); | 672 __ shll(rdx, exact_log2(in_words(ConstantPoolCacheEntry::size()))); |
710 const Address field_address(rax, rcx, Address::times_1); | 712 const Address field_address(rax, rcx, Address::times_1); |
711 | 713 |
712 // Need to differentiate between igetfield, agetfield, bgetfield etc. | 714 // Need to differentiate between igetfield, agetfield, bgetfield etc. |
713 // because they are different sizes. | 715 // because they are different sizes. |
714 // Use the type from the constant pool cache | 716 // Use the type from the constant pool cache |
715 __ shrl(rdx, ConstantPoolCacheEntry::tosBits); | 717 __ shrl(rdx, ConstantPoolCacheEntry::tos_state_shift); |
716 // Make sure we don't need to mask edx for tosBits after the above shift | 718 // Make sure we don't need to mask edx after the above shift |
717 ConstantPoolCacheEntry::verify_tosBits(); | 719 ConstantPoolCacheEntry::verify_tos_state_shift(); |
718 | 720 |
719 __ cmpl(rdx, atos); | 721 __ cmpl(rdx, atos); |
720 __ jcc(Assembler::notEqual, notObj); | 722 __ jcc(Assembler::notEqual, notObj); |
721 // atos | 723 // atos |
722 __ load_heap_oop(rax, field_address); | 724 __ load_heap_oop(rax, field_address); |
1049 const int mirror_offset = in_bytes(Klass::java_mirror_offset()); | 1051 const int mirror_offset = in_bytes(Klass::java_mirror_offset()); |
1050 __ movl(t, Address(method, methodOopDesc::access_flags_offset())); | 1052 __ movl(t, Address(method, methodOopDesc::access_flags_offset())); |
1051 __ testl(t, JVM_ACC_STATIC); | 1053 __ testl(t, JVM_ACC_STATIC); |
1052 __ jcc(Assembler::zero, L); | 1054 __ jcc(Assembler::zero, L); |
1053 // get mirror | 1055 // get mirror |
1054 __ movptr(t, Address(method, methodOopDesc::constants_offset())); | 1056 __ movptr(t, Address(method, methodOopDesc::const_offset())); |
1057 __ movptr(t, Address(t, constMethodOopDesc::constants_offset())); | |
1055 __ movptr(t, Address(t, constantPoolOopDesc::pool_holder_offset_in_bytes())); | 1058 __ movptr(t, Address(t, constantPoolOopDesc::pool_holder_offset_in_bytes())); |
1056 __ movptr(t, Address(t, mirror_offset)); | 1059 __ movptr(t, Address(t, mirror_offset)); |
1057 // copy mirror into activation frame | 1060 // copy mirror into activation frame |
1058 __ movptr(Address(rbp, frame::interpreter_frame_oop_temp_offset * wordSize), | 1061 __ movptr(Address(rbp, frame::interpreter_frame_oop_temp_offset * wordSize), |
1059 t); | 1062 t); |
1550 address entry_point = NULL; | 1553 address entry_point = NULL; |
1551 | 1554 |
1552 switch (kind) { | 1555 switch (kind) { |
1553 case Interpreter::zerolocals : break; | 1556 case Interpreter::zerolocals : break; |
1554 case Interpreter::zerolocals_synchronized: synchronized = true; break; | 1557 case Interpreter::zerolocals_synchronized: synchronized = true; break; |
1555 case Interpreter::native : entry_point = ((InterpreterGenerator*) this)->generate_native_entry(false); break; | 1558 case Interpreter::native : entry_point = ((InterpreterGenerator*)this)->generate_native_entry(false); break; |
1556 case Interpreter::native_synchronized : entry_point = ((InterpreterGenerator*) this)->generate_native_entry(true); break; | 1559 case Interpreter::native_synchronized : entry_point = ((InterpreterGenerator*)this)->generate_native_entry(true); break; |
1557 case Interpreter::empty : entry_point = ((InterpreterGenerator*) this)->generate_empty_entry(); break; | 1560 case Interpreter::empty : entry_point = ((InterpreterGenerator*)this)->generate_empty_entry(); break; |
1558 case Interpreter::accessor : entry_point = ((InterpreterGenerator*) this)->generate_accessor_entry(); break; | 1561 case Interpreter::accessor : entry_point = ((InterpreterGenerator*)this)->generate_accessor_entry(); break; |
1559 case Interpreter::abstract : entry_point = ((InterpreterGenerator*) this)->generate_abstract_entry(); break; | 1562 case Interpreter::abstract : entry_point = ((InterpreterGenerator*)this)->generate_abstract_entry(); break; |
1560 case Interpreter::method_handle : entry_point = ((InterpreterGenerator*) this)->generate_method_handle_entry();break; | |
1561 | 1563 |
1562 case Interpreter::java_lang_math_sin : // fall thru | 1564 case Interpreter::java_lang_math_sin : // fall thru |
1563 case Interpreter::java_lang_math_cos : // fall thru | 1565 case Interpreter::java_lang_math_cos : // fall thru |
1564 case Interpreter::java_lang_math_tan : // fall thru | 1566 case Interpreter::java_lang_math_tan : // fall thru |
1565 case Interpreter::java_lang_math_abs : // fall thru | 1567 case Interpreter::java_lang_math_abs : // fall thru |
1566 case Interpreter::java_lang_math_log : // fall thru | 1568 case Interpreter::java_lang_math_log : // fall thru |
1567 case Interpreter::java_lang_math_log10 : // fall thru | 1569 case Interpreter::java_lang_math_log10 : // fall thru |
1568 case Interpreter::java_lang_math_sqrt : entry_point = ((InterpreterGenerator*) this)->generate_math_entry(kind); break; | 1570 case Interpreter::java_lang_math_sqrt : // fall thru |
1571 case Interpreter::java_lang_math_pow : // fall thru | |
1572 case Interpreter::java_lang_math_exp : entry_point = ((InterpreterGenerator*)this)->generate_math_entry(kind); break; | |
1569 case Interpreter::java_lang_ref_reference_get | 1573 case Interpreter::java_lang_ref_reference_get |
1570 : entry_point = ((InterpreterGenerator*)this)->generate_Reference_get_entry(); break; | 1574 : entry_point = ((InterpreterGenerator*)this)->generate_Reference_get_entry(); break; |
1571 default : ShouldNotReachHere(); break; | 1575 default: |
1576 fatal(err_msg("unexpected method kind: %d", kind)); | |
1577 break; | |
1572 } | 1578 } |
1573 | 1579 |
1574 if (entry_point) { | 1580 if (entry_point) { |
1575 return entry_point; | 1581 return entry_point; |
1576 } | 1582 } |
1587 case Interpreter::java_lang_math_cos : // fall thru | 1593 case Interpreter::java_lang_math_cos : // fall thru |
1588 case Interpreter::java_lang_math_tan : // fall thru | 1594 case Interpreter::java_lang_math_tan : // fall thru |
1589 case Interpreter::java_lang_math_abs : // fall thru | 1595 case Interpreter::java_lang_math_abs : // fall thru |
1590 case Interpreter::java_lang_math_log : // fall thru | 1596 case Interpreter::java_lang_math_log : // fall thru |
1591 case Interpreter::java_lang_math_log10 : // fall thru | 1597 case Interpreter::java_lang_math_log10 : // fall thru |
1592 case Interpreter::java_lang_math_sqrt : | 1598 case Interpreter::java_lang_math_sqrt : // fall thru |
1599 case Interpreter::java_lang_math_pow : // fall thru | |
1600 case Interpreter::java_lang_math_exp : | |
1593 return false; | 1601 return false; |
1594 default: | 1602 default: |
1595 return true; | 1603 return true; |
1596 } | 1604 } |
1597 } | 1605 } |