Reviewers: Yang,

Message:
PTAL

Description:
Fix delta computation in DoDeferredInstanceOfKnownGlobal() for ARM.

BUG=v8:2314

[email protected]


Please review this at https://chromiumcodereview.appspot.com/10908195/

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

Affected files:
  M src/arm/lithium-codegen-arm.cc
  M test/mjsunit/mjsunit.status


Index: src/arm/lithium-codegen-arm.cc
diff --git a/src/arm/lithium-codegen-arm.cc b/src/arm/lithium-codegen-arm.cc
index 4be6d264a8f69d16cebe90c1a986703e2ccb0615..a068d3ffad87ed3de39c86e4a06a957970171cf2 100644
--- a/src/arm/lithium-codegen-arm.cc
+++ b/src/arm/lithium-codegen-arm.cc
@@ -2472,12 +2472,17 @@ void LCodeGen::DoDeferredInstanceOfKnownGlobal(LInstanceOfKnownGlobal* instr,
   Register temp = ToRegister(instr->TempAt(0));
   ASSERT(temp.is(r4));
   __ LoadHeapObject(InstanceofStub::right(), instr->function());
-  static const int kAdditionalDelta = 4;
+  static const int kAdditionalDelta = 5;
int delta = masm_->InstructionsGeneratedSince(map_check) + kAdditionalDelta;
   Label before_push_delta;
   __ bind(&before_push_delta);
   __ BlockConstPoolFor(kAdditionalDelta);
   __ mov(temp, Operand(delta * kPointerSize));
+ // The mov above can generate one or two instructions. The delta was computed + // for two instructions, so we need to pad here in case of one instruction.
+  if (masm_->InstructionsGeneratedSince(&before_push_delta) != 2) {
+    __ nop();
+  }
   __ StoreToSafepointRegisterSlot(temp, temp);
   CallCodeGeneric(stub.GetCode(),
                   RelocInfo::CODE_TARGET,
Index: test/mjsunit/mjsunit.status
diff --git a/test/mjsunit/mjsunit.status b/test/mjsunit/mjsunit.status
index b63406ddc2ab49012b792c226c5b4e5cd3efb359..8edc744d276672fa53c7e3071b20a469cac09ba7 100644
--- a/test/mjsunit/mjsunit.status
+++ b/test/mjsunit/mjsunit.status
@@ -87,8 +87,7 @@ array-splice: PASS || TIMEOUT
 # Long running test.
 string-indexof-2: PASS || TIMEOUT
 # BUG(2314): Crankshaft generates incorrect (crashing) code on ARM
-# mirror-object: PASS || TIMEOUT
-mirror-object: SKIP
+mirror-object: PASS || TIMEOUT

 # BUG(3251035): Timeouts in long looping crankshaft optimization
 # tests. Skipping because having them timeout takes too long on the


--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev

Reply via email to