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

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: REBASE and fix arm64 compilation. 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
« no previous file with comments | « src/mips64/lithium-mips64.cc ('k') | src/x64/lithium-x64.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/x64/lithium-codegen-x64.cc
diff --git a/src/x64/lithium-codegen-x64.cc b/src/x64/lithium-codegen-x64.cc
index fc2b4ec5f6e247347efc5a0552f6c7f8b9aeb78f..7c1668f1fa11a0334beb6891e91582a365ab7615 100644
--- a/src/x64/lithium-codegen-x64.cc
+++ b/src/x64/lithium-codegen-x64.cc
@@ -3263,6 +3263,22 @@ 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) Isolate::kArrayProtectorValid. Otherwise
+ // it needs to bail out.
+ __ LoadRoot(result, Heap::kArrayProtectorRootIndex);
+ __ Cmp(FieldOperand(result, Cell::kValueOffset),
+ Smi::FromInt(Isolate::kArrayProtectorValid));
+ DeoptimizeIf(not_equal, instr, Deoptimizer::kHole);
+ }
+ __ Move(result, isolate()->factory()->undefined_value());
+ __ bind(&done);
}
}
« no previous file with comments | « src/mips64/lithium-mips64.cc ('k') | src/x64/lithium-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698