ARM: Allow function inlining with context change.
authorrodolph.perfetta@gmail.com <rodolph.perfetta@gmail.com@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Mon, 30 Sep 2013 15:08:20 +0000 (15:08 +0000)
committerrodolph.perfetta@gmail.com <rodolph.perfetta@gmail.com@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Mon, 30 Sep 2013 15:08:20 +0000 (15:08 +0000)
BUG=none
TEST=none
R=ulan@chromium.org

Review URL: https://codereview.chromium.org/25247002

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@17019 ce2b1a6d-e550-0410-aec6-3dcde31c8c00

src/arm/lithium-codegen-arm.cc
src/hydrogen.cc

index e7734c1..76c2ca7 100644 (file)
@@ -766,6 +766,10 @@ void LCodeGen::LoadContextFromDeferred(LOperand* context) {
     __ Move(cp, ToRegister(context));
   } else if (context->IsStackSlot()) {
     __ ldr(cp, ToMemOperand(context));
+  } else if (context->IsConstantOperand()) {
+    HConstant* constant =
+        chunk_->LookupConstant(LConstantOperand::cast(context));
+    __ LoadObject(cp, Handle<Object>::cast(constant->handle(isolate())));
   } else {
     UNREACHABLE();
   }
index 7fc2764..4d31a2f 100644 (file)
@@ -6383,7 +6383,7 @@ bool HOptimizedGraphBuilder::TryInline(CallKind call_kind,
     return false;
   }
 
-#if !V8_TARGET_ARCH_IA32
+#if !V8_TARGET_ARCH_IA32 && !V8_TARGET_ARCH_ARM
   // Target must be able to use caller's context.
   CompilationInfo* outer_info = current_info();
   if (target->context() != outer_info->closure()->context() ||
@@ -6532,8 +6532,8 @@ bool HOptimizedGraphBuilder::TryInline(CallKind call_kind,
                                      undefined,
                                      function_state()->inlining_kind(),
                                      undefined_receiver);
-#if V8_TARGET_ARCH_IA32
-  // IA32 only, overwrite the caller's context in the deoptimization
+#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.
   //
   // TODO(kmillikin): implement the same inlining on other platforms so we