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

Unified Diff: src/mips64/lithium-codegen-mips64.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/mips/lithium-mips.cc ('k') | src/mips64/lithium-mips64.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/mips64/lithium-codegen-mips64.cc
diff --git a/src/mips64/lithium-codegen-mips64.cc b/src/mips64/lithium-codegen-mips64.cc
index d6039f71126f28c82d2ccde87cb45664a6a228a2..c7dd637c24a4e708b9178a5bb85f5d54a5dd032b 100644
--- a/src/mips64/lithium-codegen-mips64.cc
+++ b/src/mips64/lithium-codegen-mips64.cc
@@ -3334,6 +3334,23 @@ void LCodeGen::DoLoadKeyedFixedArray(LLoadKeyed* instr) {
__ LoadRoot(scratch, Heap::kTheHoleValueRootIndex);
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_ELEMENTS);
+ Label done;
+ __ LoadRoot(scratch, Heap::kTheHoleValueRootIndex);
+ __ Branch(&done, ne, result, Operand(scratch));
+ 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);
+ // The comparison only needs LS bits of value, which is a smi.
+ __ ld(result, FieldMemOperand(result, Cell::kValueOffset));
+ DeoptimizeIf(ne, instr, Deoptimizer::kHole, result,
+ Operand(Smi::FromInt(Isolate::kArrayProtectorValid)));
+ }
+ __ LoadRoot(result, Heap::kUndefinedValueRootIndex);
+ __ bind(&done);
}
}
« no previous file with comments | « src/mips/lithium-mips.cc ('k') | src/mips64/lithium-mips64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698