From 3bc01748ef1c3e43361bdf520947a9d656658bf8 Mon Sep 17 00:00:00 2001 From: Razvan A Lupusoru Date: Thu, 6 Feb 2014 13:18:43 -0800 Subject: GenSpecialCase support for x86 Moved GenSpecialCase from being ARM specific to common code to allow it to be used by x86 quick as well. Change-Id: I728733e8f4c4da99af6091ef77e5c76ae0fee850 Signed-off-by: Razvan A Lupusoru --- compiler/dex/quick/codegen_util.cc | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) (limited to 'compiler/dex/quick/codegen_util.cc') diff --git a/compiler/dex/quick/codegen_util.cc b/compiler/dex/quick/codegen_util.cc index 05eb360a6b..c5dccda228 100644 --- a/compiler/dex/quick/codegen_util.cc +++ b/compiler/dex/quick/codegen_util.cc @@ -1017,19 +1017,13 @@ void Mir2Lir::Materialize() { /* Allocate Registers using simple local allocation scheme */ SimpleRegAlloc(); - /* - * Custom codegen for special cases. If for any reason the - * special codegen doesn't succeed, first_lir_insn_ will be - * set to NULL; - */ - // TODO: Clean up GenSpecial() and return true only if special implementation is emitted. - // Currently, GenSpecial() returns IsSpecial() but doesn't check after SpecialMIR2LIR(). + /* First try the custom light codegen for special cases. */ DCHECK(cu_->compiler_driver->GetMethodInlinerMap() != nullptr); - cu_->compiler_driver->GetMethodInlinerMap()->GetMethodInliner(cu_->dex_file) + bool special_worked = cu_->compiler_driver->GetMethodInlinerMap()->GetMethodInliner(cu_->dex_file) ->GenSpecial(this, cu_->method_idx); - /* Convert MIR to LIR, etc. */ - if (first_lir_insn_ == NULL) { + /* Take normal path for converting MIR to LIR only if the special codegen did not succeed. */ + if (special_worked == false) { MethodMIR2LIR(); } -- cgit v1.2.3-59-g8ed1b