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

Unified Diff: src/ia32/lithium-codegen-ia32.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/hydrogen-instructions.cc ('k') | src/ia32/lithium-ia32.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/ia32/lithium-codegen-ia32.cc
diff --git a/src/ia32/lithium-codegen-ia32.cc b/src/ia32/lithium-codegen-ia32.cc
index 12aacbc5034efe4282241d4db4ea572331a993b9..5af19d01ef4d5592c2498c92001d805b1e68ac59 100644
--- a/src/ia32/lithium-codegen-ia32.cc
+++ b/src/ia32/lithium-codegen-ia32.cc
@@ -3185,6 +3185,22 @@ void LCodeGen::DoLoadKeyedFixedArray(LLoadKeyed* instr) {
__ cmp(result, factory()->the_hole_value());
DeoptimizeIf(equal, instr, Deoptimizer::kHole);
}
+ } else if (instr->hydrogen()->hole_mode() == CONVERT_HOLE_TO_UNDEFINED) {
+ DCHECK(instr->hydrogen()->elements_kind() == FAST_HOLEY_ELEMENTS);
+ Label done;
+ __ cmp(result, factory()->the_hole_value());
+ __ 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.
+ __ mov(result, isolate()->factory()->array_protector());
+ __ cmp(FieldOperand(result, PropertyCell::kValueOffset),
+ Immediate(Smi::FromInt(Isolate::kArrayProtectorValid)));
+ DeoptimizeIf(not_equal, instr, Deoptimizer::kHole);
+ }
+ __ mov(result, isolate()->factory()->undefined_value());
+ __ bind(&done);
}
}
« no previous file with comments | « src/hydrogen-instructions.cc ('k') | src/ia32/lithium-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698