Index: src/mips64/code-stubs-mips64.cc |
diff --git a/src/mips64/code-stubs-mips64.cc b/src/mips64/code-stubs-mips64.cc |
index 390969d0701ea0ed18e29603a4936467b6fe1f29..b2b4aec4d1ef6b4f79601581e4dd2d66a10c146e 100644 |
--- a/src/mips64/code-stubs-mips64.cc |
+++ b/src/mips64/code-stubs-mips64.cc |
@@ -502,7 +502,7 @@ static void EmitCheckForInternalizedStringsOrObjects(MacroAssembler* masm, |
(lhs.is(a1) && rhs.is(a0))); |
// a2 is object type of rhs. |
- Label object_test, return_unequal, undetectable; |
+ Label object_test, return_equal, return_unequal, undetectable; |
STATIC_ASSERT(kInternalizedTag == 0 && kStringTag == 0); |
__ And(at, a2, Operand(kIsNotStringMask)); |
__ Branch(&object_test, ne, at, Operand(zero_reg)); |
@@ -542,6 +542,16 @@ static void EmitCheckForInternalizedStringsOrObjects(MacroAssembler* masm, |
__ bind(&undetectable); |
__ And(at, t1, Operand(1 << Map::kIsUndetectable)); |
__ Branch(&return_unequal, eq, at, Operand(zero_reg)); |
+ |
+ // If both sides are JSReceivers, then the result is false according to |
+ // the HTML specification, which says that only comparisons with null or |
+ // undefined are affected by special casing for document.all. |
+ __ GetInstanceType(a2, a2); |
+ __ Branch(&return_equal, eq, a2, Operand(ODDBALL_TYPE)); |
+ __ GetInstanceType(a3, a3); |
+ __ Branch(&return_unequal, ne, a3, Operand(ODDBALL_TYPE)); |
+ |
+ __ bind(&return_equal); |
__ Ret(USE_DELAY_SLOT); |
__ li(v0, Operand(EQUAL)); // In delay slot. |
} |