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

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: 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/ia32/lithium-codegen-ia32.cc
diff --git a/src/ia32/lithium-codegen-ia32.cc b/src/ia32/lithium-codegen-ia32.cc
index 564ef0046ab5fed77d89fbfd7b7597d284721cf7..37f8bccd1d7d0ccaa996d425e68521a7fd5675d0 100644
--- a/src/ia32/lithium-codegen-ia32.cc
+++ b/src/ia32/lithium-codegen-ia32.cc
@@ -3184,6 +3184,21 @@ 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) 1. Otherwise it needs to bail out.
+ __ mov(result, isolate()->factory()->array_protector());
Jakob Kummerow 2015/04/23 13:40:00 You can collapse this into one instruction: __ cm
mvstanton 2015/04/27 07:57:12 Actually I can't do that for a PropertyCell, just
+ __ cmp(FieldOperand(result, Cell::kValueOffset),
+ Immediate(Smi::FromInt(1)));
Jakob Kummerow 2015/04/23 13:40:00 Please factor out the magic 0/1 constants as "stat
mvstanton 2015/04/27 07:57:12 Done.
+ DeoptimizeIf(not_equal, instr, Deoptimizer::kHole);
+ }
+ __ mov(result, isolate()->factory()->undefined_value());
+ __ bind(&done);
}
}

Powered by Google App Engine
This is Rietveld 408576698