From 73e80c3ae76fafdb53afe3a85306dcb491fb5b00 Mon Sep 17 00:00:00 2001 From: Nicolas Geoffray Date: Tue, 22 Jul 2014 17:47:56 +0100 Subject: Make unit test tell if a method is a leaf. The runtime is not initialized completely in gtests, so we cannot run code (such as explicit stack overflow checks) that look at tls values. Change-Id: I74a4449b01eb203f1b411dda700e9459878d0d55 --- compiler/optimizing/codegen_test.cc | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'compiler/optimizing/codegen_test.cc') diff --git a/compiler/optimizing/codegen_test.cc b/compiler/optimizing/codegen_test.cc index bfdc30f26b..d7ac10d164 100644 --- a/compiler/optimizing/codegen_test.cc +++ b/compiler/optimizing/codegen_test.cc @@ -76,19 +76,21 @@ static void TestCode(const uint16_t* data, bool has_result = false, int32_t expe InternalCodeAllocator allocator; CodeGenerator* codegen = CodeGenerator::Create(&arena, graph, kX86); - codegen->CompileBaseline(&allocator); + // We avoid doing a stack overflow check that requires the runtime being setup, + // by making sure the compiler knows the methods we are running are leaf methods. + codegen->CompileBaseline(&allocator, true); #if defined(__i386__) Run(allocator, *codegen, has_result, expected); #endif codegen = CodeGenerator::Create(&arena, graph, kArm); - codegen->CompileBaseline(&allocator); + codegen->CompileBaseline(&allocator, true); #if defined(__arm__) Run(allocator, *codegen, has_result, expected); #endif codegen = CodeGenerator::Create(&arena, graph, kX86_64); - codegen->CompileBaseline(&allocator); + codegen->CompileBaseline(&allocator, true); #if defined(__x86_64__) Run(allocator, *codegen, has_result, expected); #endif -- cgit v1.2.3-59-g8ed1b