Reviewers: Paul Lind, kisg, kilvadyb, danno, ulan, Rodolph Perfetta,

Message:
PTAL.

Description:
MIPS: Allow function inlining with context change.

Port r17019 (cd4b69cd)

BUG=

Please review this at https://codereview.chromium.org/25622003/

SVN Base: https://v8.googlecode.com/svn/branches/bleeding_edge

Affected files (+8, -4 lines):
  M src/hydrogen.cc
  M src/mips/lithium-codegen-mips.cc


Index: src/hydrogen.cc
diff --git a/src/hydrogen.cc b/src/hydrogen.cc
index ef07d96a9c655119cc1e37cc512f685bf2bd82e5..3049dfe10456673db6cbc196855d3a815bd00915 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.
Index: src/mips/lithium-codegen-mips.cc
diff --git a/src/mips/lithium-codegen-mips.cc b/src/mips/lithium-codegen-mips.cc index 227f5f8a2bacfbf671104abdfb08155eae326150..38b0ff5274d4c44cda241072aa8e7a7ab05a54be 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<Object>::cast(constant->handle(isolate())));
   } else {
     UNREACHABLE();
   }


--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
--- You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to