Tue, 16 Jun 2020 18:24:46 +0800
#13346 Backport of #10019 SP must be decremented first.
Reviewed-by: aoqi
src/cpu/mips/vm/templateInterpreter_mips_64.cpp | file | annotate | diff | comparison | revisions |
1.1 --- a/src/cpu/mips/vm/templateInterpreter_mips_64.cpp Thu Apr 23 18:09:19 2020 +0800 1.2 +++ b/src/cpu/mips/vm/templateInterpreter_mips_64.cpp Tue Jun 16 18:24:46 2020 +0800 1.3 @@ -1,6 +1,6 @@ 1.4 /* 1.5 * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. 1.6 - * Copyright (c) 2015, 2019, Loongson Technology. All rights reserved. 1.7 + * Copyright (c) 2015, 2020, Loongson Technology. All rights reserved. 1.8 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 1.9 * 1.10 * This code is free software; you can redistribute it and/or modify it 1.11 @@ -569,11 +569,16 @@ 1.12 // initialize fixed part of activation frame 1.13 // sender's sp in Rsender 1.14 int i = 0; 1.15 - __ sd(RA, SP, (-1) * wordSize); // save return address 1.16 - __ sd(FP, SP, (-2) * wordSize); // save sender's fp 1.17 - __ daddiu(FP, SP, (-2) * wordSize); 1.18 + int frame_size = 9; 1.19 +#ifndef CORE 1.20 + ++frame_size; 1.21 +#endif 1.22 + __ daddiu(SP, SP, (-frame_size) * wordSize); 1.23 + __ sd(RA, SP, (frame_size - 1) * wordSize); // save return address 1.24 + __ sd(FP, SP, (frame_size - 2) * wordSize); // save sender's fp 1.25 + __ daddiu(FP, SP, (frame_size - 2) * wordSize); 1.26 __ sd(Rsender, FP, (-++i) * wordSize); // save sender's sp 1.27 - __ sd(R0, FP,(-++i)*wordSize); //save last_sp as null 1.28 + __ sd(R0, FP,(-++i) * wordSize); //save last_sp as null 1.29 __ sd(LVP, FP, (-++i) * wordSize); // save locals offset 1.30 __ ld(BCP, Rmethod, in_bytes(Method::const_offset())); // get constMethodOop 1.31 __ daddiu(BCP, BCP, in_bytes(ConstMethod::codes_offset())); // get codebase 1.32 @@ -601,8 +606,8 @@ 1.33 } else { 1.34 __ sd(BCP, FP, (-++i) * wordSize); // set bcp 1.35 } 1.36 - __ daddiu(SP, FP, (-++i) * wordSize); 1.37 - __ sd(SP, FP, (-i) * wordSize); // reserve word for pointer to expression stack bottom 1.38 + __ sd(SP, FP, (-++i) * wordSize); // reserve word for pointer to expression stack bottom 1.39 + assert(i + 2 == frame_size, "i + 2 should be equal to frame_size"); 1.40 } 1.41 1.42 // End of helpers