Mercurial > hg > truffle
comparison src/cpu/ppc/vm/cppInterpreter_ppc.cpp @ 17917:63c5920a038d
8042309: Some bugfixes for the ppc64 port.
Reviewed-by: kvn
author | goetz |
---|---|
date | Fri, 02 May 2014 14:53:06 +0200 |
parents | fd1b9f02cc91 |
children | 0bf37f737702 |
comparison
equal
deleted
inserted
replaced
17916:34862ced4a87 | 17917:63c5920a038d |
---|---|
1 | |
1 /* | 2 /* |
2 * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. | 3 * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. |
3 * Copyright 2012, 2013 SAP AG. All rights reserved. | 4 * Copyright 2012, 2013 SAP AG. All rights reserved. |
4 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. | 5 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
5 * | 6 * |
401 const Register page_size = R28_tmp8; | 402 const Register page_size = R28_tmp8; |
402 | 403 |
403 BLOCK_COMMENT("compute_interpreter_state {"); | 404 BLOCK_COMMENT("compute_interpreter_state {"); |
404 | 405 |
405 // access_flags = method->access_flags(); | 406 // access_flags = method->access_flags(); |
406 // TODO: PPC port: assert(4 == methodOopDesc::sz_access_flags(), "unexpected field size"); | 407 // TODO: PPC port: assert(4 == sizeof(AccessFlags), "unexpected field size"); |
407 __ lwa(access_flags, method_(access_flags)); | 408 __ lwa(access_flags, method_(access_flags)); |
408 | 409 |
409 // parameter_count = method->constMethod->size_of_parameters(); | 410 // parameter_count = method->constMethod->size_of_parameters(); |
410 // TODO: PPC port: assert(2 == ConstMethod::sz_size_of_parameters(), "unexpected field size"); | 411 // TODO: PPC port: assert(2 == ConstMethod::sz_size_of_parameters(), "unexpected field size"); |
411 __ ld(max_stack, in_bytes(Method::const_offset()), R19_method); // Max_stack holds constMethod for a while. | 412 __ ld(max_stack, in_bytes(Method::const_offset()), R19_method); // Max_stack holds constMethod for a while. |
1053 // access_flags = method->access_flags(); | 1054 // access_flags = method->access_flags(); |
1054 // Load access flags. | 1055 // Load access flags. |
1055 assert(access_flags->is_nonvolatile(), | 1056 assert(access_flags->is_nonvolatile(), |
1056 "access_flags must be in a non-volatile register"); | 1057 "access_flags must be in a non-volatile register"); |
1057 // Type check. | 1058 // Type check. |
1058 // TODO: PPC port: assert(4 == methodOopDesc::sz_access_flags(), "unexpected field size"); | 1059 // TODO: PPC port: assert(4 == sizeof(AccessFlags), "unexpected field size"); |
1059 __ lwz(access_flags, method_(access_flags)); | 1060 __ lwz(access_flags, method_(access_flags)); |
1060 | 1061 |
1061 // We don't want to reload R19_method and access_flags after calls | 1062 // We don't want to reload R19_method and access_flags after calls |
1062 // to some helper functions. | 1063 // to some helper functions. |
1063 assert(R19_method->is_nonvolatile(), "R19_method must be a non-volatile register"); | 1064 assert(R19_method->is_nonvolatile(), "R19_method must be a non-volatile register"); |
1836 const Register pending_exception = R21_tmp1; | 1837 const Register pending_exception = R21_tmp1; |
1837 | 1838 |
1838 // Interpreter state fields. | 1839 // Interpreter state fields. |
1839 const Register msg = R24_tmp4; | 1840 const Register msg = R24_tmp4; |
1840 | 1841 |
1841 // MethodOop fields. | 1842 // Method fields. |
1842 const Register parameter_count = R25_tmp5; | 1843 const Register parameter_count = R25_tmp5; |
1843 const Register result_index = R26_tmp6; | 1844 const Register result_index = R26_tmp6; |
1844 | 1845 |
1845 const Register dummy = R28_tmp8; | 1846 const Register dummy = R28_tmp8; |
1846 | 1847 |
2021 __ lhz(parameter_count, in_bytes(ConstMethod::size_of_parameters_offset()), parameter_count); | 2022 __ lhz(parameter_count, in_bytes(ConstMethod::size_of_parameters_offset()), parameter_count); |
2022 __ sldi(parameter_count, parameter_count, Interpreter::logStackElementSize); | 2023 __ sldi(parameter_count, parameter_count, Interpreter::logStackElementSize); |
2023 __ add(R17_tos, R17_tos, parameter_count); | 2024 __ add(R17_tos, R17_tos, parameter_count); |
2024 | 2025 |
2025 // Result stub address array index | 2026 // Result stub address array index |
2026 // TODO: PPC port: assert(4 == methodOopDesc::sz_result_index(), "unexpected field size"); | 2027 // TODO: PPC port: assert(4 == sizeof(AccessFlags), "unexpected field size"); |
2027 __ lwa(result_index, method_(result_index)); | 2028 __ lwa(result_index, method_(result_index)); |
2028 | 2029 |
2029 __ li(msg, BytecodeInterpreter::method_resume); | 2030 __ li(msg, BytecodeInterpreter::method_resume); |
2030 | 2031 |
2031 // | 2032 // |
2707 | 2708 |
2708 // Load address of temporary osr buffer to arg1. | 2709 // Load address of temporary osr buffer to arg1. |
2709 __ ld(R3_ARG1, state_(_result._osr._osr_buf)); | 2710 __ ld(R3_ARG1, state_(_result._osr._osr_buf)); |
2710 __ mtctr(R12_scratch2); | 2711 __ mtctr(R12_scratch2); |
2711 | 2712 |
2712 // Load method oop, gc may move it during execution of osr'd method. | 2713 // Load method, gc may move it during execution of osr'd method. |
2713 __ ld(R22_tmp2, state_(_method)); | 2714 __ ld(R22_tmp2, state_(_method)); |
2714 // Load message 'call_method'. | 2715 // Load message 'call_method'. |
2715 __ li(R23_tmp3, BytecodeInterpreter::call_method); | 2716 __ li(R23_tmp3, BytecodeInterpreter::call_method); |
2716 | 2717 |
2717 { | 2718 { |