From 4b9a9f7af7db58cfa0d9fbb95ee5e5842503e526 Mon Sep 17 00:00:00 2001 From: "palfia@homejinni.com" Date: Wed, 2 Oct 2013 11:25:06 +0000 Subject: [PATCH] MIPS: Allow function inlining with context change. Port r17019 (cd4b69cd) BUG= R=jkummerow@chromium.org, plind44@gmail.com Review URL: https://codereview.chromium.org/25622003 git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@17070 ce2b1a6d-e550-0410-aec6-3dcde31c8c00 --- src/hydrogen.cc | 8 ++++---- src/mips/lithium-codegen-mips.cc | 4 ++++ 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/hydrogen.cc b/src/hydrogen.cc index ef07d96a9c..3049dfe104 100644 --- a/src/hydrogen.cc +++ b/src/hydrogen.cc @@ -6366,7 +6366,7 @@ bool HOptimizedGraphBuilder::TryInline(CallKind call_kind, return false; } -#if !V8_TARGET_ARCH_IA32 && !V8_TARGET_ARCH_ARM +#if !V8_TARGET_ARCH_IA32 && !V8_TARGET_ARCH_ARM && !V8_TARGET_ARCH_MIPS // Target must be able to use caller's context. CompilationInfo* outer_info = current_info(); if (target->context() != outer_info->closure()->context() || @@ -6515,9 +6515,9 @@ bool HOptimizedGraphBuilder::TryInline(CallKind call_kind, undefined, function_state()->inlining_kind(), undefined_receiver); -#if V8_TARGET_ARCH_IA32 || V8_TARGET_ARCH_ARM - // IA32 and ARM only, overwrite the caller's context in the deoptimization - // environment with the correct one. +#if V8_TARGET_ARCH_IA32 || V8_TARGET_ARCH_ARM || V8_TARGET_ARCH_MIPS + // IA32, ARM and MIPS only, overwrite the caller's context in the + // deoptimization environment with the correct one. // // TODO(kmillikin): implement the same inlining on other platforms so we // can remove the unsightly ifdefs in this function. diff --git a/src/mips/lithium-codegen-mips.cc b/src/mips/lithium-codegen-mips.cc index 227f5f8a2b..38b0ff5274 100644 --- a/src/mips/lithium-codegen-mips.cc +++ b/src/mips/lithium-codegen-mips.cc @@ -732,6 +732,10 @@ void LCodeGen::LoadContextFromDeferred(LOperand* context) { __ Move(cp, ToRegister(context)); } else if (context->IsStackSlot()) { __ lw(cp, ToMemOperand(context)); + } else if (context->IsConstantOperand()) { + HConstant* constant = + chunk_->LookupConstant(LConstantOperand::cast(context)); + __ LoadObject(cp, Handle::cast(constant->handle(isolate()))); } else { UNREACHABLE(); }