Revert of Allow loading holes from holey smi arrays (patchset #2 id:20001 of https...
authorverwaest <verwaest@chromium.org>
Fri, 8 May 2015 07:28:55 +0000 (00:28 -0700)
committerCommit bot <commit-bot@chromium.org>
Fri, 8 May 2015 07:28:57 +0000 (07:28 +0000)
Reason for revert:
Shouldn't unconditionally load holes since it tanks performance. I'll change it in a follow-up to only do it if the IC ever saw it happen.

Original issue's description:
> Allow loading holes from holey smi arrays
>
> BUG=
>
> Committed: https://crrev.com/eab5bb5390fab79d063f29398377c6d181963dde
> Cr-Commit-Position: refs/heads/master@{#28298}

TBR=mvstanton@chromium.org
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=

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

Cr-Commit-Position: refs/heads/master@{#28309}

src/arm/lithium-codegen-arm.cc
src/arm64/lithium-codegen-arm64.cc
src/hydrogen.cc
src/ia32/lithium-codegen-ia32.cc
src/mips/lithium-codegen-mips.cc
src/mips64/lithium-codegen-mips64.cc
src/ppc/lithium-codegen-ppc.cc
src/x64/lithium-codegen-x64.cc
src/x87/lithium-codegen-x87.cc

index b9c7328aeedeead9a1f487d827d180fda21d6d73..e91fddfdd318cee3307b53338cbe218c40575144 100644 (file)
@@ -3349,8 +3349,7 @@ void LCodeGen::DoLoadKeyedFixedArray(LLoadKeyed* instr) {
       DeoptimizeIf(eq, instr, Deoptimizer::kHole);
     }
   } else if (instr->hydrogen()->hole_mode() == CONVERT_HOLE_TO_UNDEFINED) {
-    DCHECK(instr->hydrogen()->elements_kind() == FAST_HOLEY_SMI_ELEMENTS ||
-           instr->hydrogen()->elements_kind() == FAST_HOLEY_ELEMENTS);
+    DCHECK(instr->hydrogen()->elements_kind() == FAST_HOLEY_ELEMENTS);
     Label done;
     __ LoadRoot(scratch, Heap::kTheHoleValueRootIndex);
     __ cmp(result, scratch);
index e17570bd2178eb43bcbe0964a9c2f4941b753f8f..c2a2ff364cc5bc80b1e29c0645a1383bbd68b067 100644 (file)
@@ -3629,8 +3629,7 @@ void LCodeGen::DoLoadKeyedFixed(LLoadKeyedFixed* instr) {
                        Deoptimizer::kHole);
     }
   } else if (instr->hydrogen()->hole_mode() == CONVERT_HOLE_TO_UNDEFINED) {
-    DCHECK(instr->hydrogen()->elements_kind() == FAST_HOLEY_SMI_ELEMENTS ||
-           instr->hydrogen()->elements_kind() == FAST_HOLEY_ELEMENTS);
+    DCHECK(instr->hydrogen()->elements_kind() == FAST_HOLEY_ELEMENTS);
     Label done;
     __ CompareRoot(result, Heap::kTheHoleValueRootIndex);
     __ B(ne, &done);
index 77890f6fbf8f3aca926641450cbe885d14277ecd..2ac3d520dbfbbba913f20e1e3e729223caf54de0 100644 (file)
@@ -7098,13 +7098,11 @@ LoadKeyedHoleMode HOptimizedGraphBuilder::BuildKeyedHoleMode(Handle<Map> map) {
   // Loads from a "stock" fast holey array can convert the hole to undefined
   // with impunity.
   LoadKeyedHoleMode load_mode = NEVER_RETURN_HOLE;
-  bool holey_smi_elements =
-      *map == isolate()->get_initial_js_array_map(FAST_HOLEY_SMI_ELEMENTS);
   bool holey_double_elements =
       *map == isolate()->get_initial_js_array_map(FAST_HOLEY_DOUBLE_ELEMENTS);
   bool holey_elements =
       *map == isolate()->get_initial_js_array_map(FAST_HOLEY_ELEMENTS);
-  if ((holey_smi_elements || holey_double_elements || holey_elements) &&
+  if ((holey_double_elements || holey_elements) &&
       isolate()->IsFastArrayConstructorPrototypeChainIntact()) {
     load_mode =
         holey_double_elements ? ALLOW_RETURN_HOLE : CONVERT_HOLE_TO_UNDEFINED;
index 4ff65fbb9eeeb85c907a5eb768faee380773c8b2..3f1bab73eefc75fdd9867240b01493b038153136 100644 (file)
@@ -3186,8 +3186,7 @@ void LCodeGen::DoLoadKeyedFixedArray(LLoadKeyed* instr) {
       DeoptimizeIf(equal, instr, Deoptimizer::kHole);
     }
   } else if (instr->hydrogen()->hole_mode() == CONVERT_HOLE_TO_UNDEFINED) {
-    DCHECK(instr->hydrogen()->elements_kind() == FAST_HOLEY_SMI_ELEMENTS ||
-           instr->hydrogen()->elements_kind() == FAST_HOLEY_ELEMENTS);
+    DCHECK(instr->hydrogen()->elements_kind() == FAST_HOLEY_ELEMENTS);
     Label done;
     __ cmp(result, factory()->the_hole_value());
     __ j(not_equal, &done);
index 4378418182522e51d9d4a7325644b43ae5ba1e5b..b173e30a2bc6075fa376b8182fd6aaac71c4d555 100644 (file)
@@ -3286,8 +3286,7 @@ void LCodeGen::DoLoadKeyedFixedArray(LLoadKeyed* instr) {
       DeoptimizeIf(eq, instr, Deoptimizer::kHole, result, Operand(scratch));
     }
   } else if (instr->hydrogen()->hole_mode() == CONVERT_HOLE_TO_UNDEFINED) {
-    DCHECK(instr->hydrogen()->elements_kind() == FAST_HOLEY_SMI_ELEMENTS ||
-           instr->hydrogen()->elements_kind() == FAST_HOLEY_ELEMENTS);
+    DCHECK(instr->hydrogen()->elements_kind() == FAST_HOLEY_ELEMENTS);
     Label done;
     __ LoadRoot(scratch, Heap::kTheHoleValueRootIndex);
     __ Branch(&done, ne, result, Operand(scratch));
index 0373312403548a87ec72225946b2d6489dce4e93..223370f7113b74c49e89e64573456c6ad3bbd239 100644 (file)
@@ -3335,8 +3335,7 @@ void LCodeGen::DoLoadKeyedFixedArray(LLoadKeyed* instr) {
       DeoptimizeIf(eq, instr, Deoptimizer::kHole, result, Operand(scratch));
     }
   } else if (instr->hydrogen()->hole_mode() == CONVERT_HOLE_TO_UNDEFINED) {
-    DCHECK(instr->hydrogen()->elements_kind() == FAST_HOLEY_SMI_ELEMENTS ||
-           instr->hydrogen()->elements_kind() == FAST_HOLEY_ELEMENTS);
+    DCHECK(instr->hydrogen()->elements_kind() == FAST_HOLEY_ELEMENTS);
     Label done;
     __ LoadRoot(scratch, Heap::kTheHoleValueRootIndex);
     __ Branch(&done, ne, result, Operand(scratch));
index 443d8e706be47813f0b1210ee12accfa3661bb96..2977da5ebc79a8d9fd04b5e1f55363ff8faeda6d 100644 (file)
@@ -3494,8 +3494,7 @@ void LCodeGen::DoLoadKeyedFixedArray(LLoadKeyed* instr) {
       DeoptimizeIf(eq, instr, Deoptimizer::kHole);
     }
   } else if (instr->hydrogen()->hole_mode() == CONVERT_HOLE_TO_UNDEFINED) {
-    DCHECK(instr->hydrogen()->elements_kind() == FAST_HOLEY_SMI_ELEMENTS ||
-           instr->hydrogen()->elements_kind() == FAST_HOLEY_ELEMENTS);
+    DCHECK(instr->hydrogen()->elements_kind() == FAST_HOLEY_ELEMENTS);
     Label done;
     __ LoadRoot(scratch, Heap::kTheHoleValueRootIndex);
     __ cmp(result, scratch);
index e030826292ac1b60f1f9b360d045164bab5b1215..eb8274bfd89bc46d84ef1f6793ecf7be86cd2879 100644 (file)
@@ -3264,8 +3264,7 @@ void LCodeGen::DoLoadKeyedFixedArray(LLoadKeyed* instr) {
       DeoptimizeIf(equal, instr, Deoptimizer::kHole);
     }
   } else if (hinstr->hole_mode() == CONVERT_HOLE_TO_UNDEFINED) {
-    DCHECK(hinstr->elements_kind() == FAST_HOLEY_SMI_ELEMENTS ||
-           hinstr->elements_kind() == FAST_HOLEY_ELEMENTS);
+    DCHECK(hinstr->elements_kind() == FAST_HOLEY_ELEMENTS);
     Label done;
     __ CompareRoot(result, Heap::kTheHoleValueRootIndex);
     __ j(not_equal, &done);
index b5dc1425f9ef59775a316d570e93b2be31c16e92..a81fd70862a6409caab953099b2d33873f75dac8 100644 (file)
@@ -3453,8 +3453,7 @@ void LCodeGen::DoLoadKeyedFixedArray(LLoadKeyed* instr) {
       DeoptimizeIf(equal, instr, Deoptimizer::kHole);
     }
   } else if (instr->hydrogen()->hole_mode() == CONVERT_HOLE_TO_UNDEFINED) {
-    DCHECK(instr->hydrogen()->elements_kind() == FAST_HOLEY_SMI_ELEMENTS ||
-           instr->hydrogen()->elements_kind() == FAST_HOLEY_ELEMENTS);
+    DCHECK(instr->hydrogen()->elements_kind() == FAST_HOLEY_ELEMENTS);
     Label done;
     __ cmp(result, factory()->the_hole_value());
     __ j(not_equal, &done);