From 36fea8dd490ab6439f391b8cd7f366c59f026fd2 Mon Sep 17 00:00:00 2001 From: Andreas Gampe Date: Mon, 10 Mar 2014 13:37:40 -0700 Subject: Fixing structure of native frame for Generic JNI This changes the layout of the callee-save frame used in generic JNI to be consistent with the JNI compiler, that is, the SIRT is inline (above the method reference). Now the location of the "this" object is consistent. Change-Id: Ibad0882680712cb640b4c70ada0229ef7cf4e62c --- compiler/common_compiler_test.h | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'compiler/common_compiler_test.h') diff --git a/compiler/common_compiler_test.h b/compiler/common_compiler_test.h index def7b681dc..d28b0fedac 100644 --- a/compiler/common_compiler_test.h +++ b/compiler/common_compiler_test.h @@ -219,8 +219,15 @@ class CommonCompilerTest : public CommonRuntimeTest { } else { const void* method_code = GetQuickGenericJniTrampoline(); mirror::ArtMethod* callee_save_method = runtime_->GetCalleeSaveMethod(Runtime::kRefsAndArgs); + + // Compute Sirt size, as Sirt goes into frame + MethodHelper mh(method); + uint32_t sirt_refs = mh.GetNumberOfReferenceArgsWithoutReceiver() + 1; + uint32_t sirt_size = StackIndirectReferenceTable::SizeOf(sirt_refs); + OatFile::OatMethod oat_method = CreateOatMethod(method_code, - callee_save_method->GetFrameSizeInBytes(), + callee_save_method->GetFrameSizeInBytes() + + sirt_size, callee_save_method->GetCoreSpillMask(), callee_save_method->GetFpSpillMask(), nullptr, -- cgit v1.2.3-59-g8ed1b