Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1522)

Unified Diff: src/x64/lithium-codegen-x64.cc

Issue 1100083002: Don't MISS if you read the hole from certain FastHoley arrays. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: With ports and test. Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: src/x64/lithium-codegen-x64.cc
diff --git a/src/x64/lithium-codegen-x64.cc b/src/x64/lithium-codegen-x64.cc
index 49814a37c24a4aef51caee7cadfeb8435534aa20..02c89b1c3dce5f8eda0ba4d20bf66eebbca7761f 100644
--- a/src/x64/lithium-codegen-x64.cc
+++ b/src/x64/lithium-codegen-x64.cc
@@ -3262,6 +3262,20 @@ void LCodeGen::DoLoadKeyedFixedArray(LLoadKeyed* instr) {
__ CompareRoot(result, Heap::kTheHoleValueRootIndex);
DeoptimizeIf(equal, instr, Deoptimizer::kHole);
}
+ } else if (hinstr->hole_mode() == CONVERT_HOLE_TO_UNDEFINED) {
+ DCHECK(hinstr->elements_kind() == FAST_HOLEY_ELEMENTS);
+ Label done;
+ __ CompareRoot(result, Heap::kTheHoleValueRootIndex);
+ __ j(not_equal, &done);
+ if (info()->IsStub()) {
+ // A stub can safely convert the hole to undefined only if the array
+ // protector cell contains (Smi) 1. Otherwise it needs to bail out.
+ __ LoadRoot(result, Heap::kArrayProtectorRootIndex);
+ __ Cmp(FieldOperand(result, Cell::kValueOffset), Smi::FromInt(1));
+ DeoptimizeIf(not_equal, instr, Deoptimizer::kHole);
+ }
+ __ Move(result, isolate()->factory()->undefined_value());
+ __ bind(&done);
}
}

Powered by Google App Engine
This is Rietveld 408576698