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

Unified Diff: src/crankshaft/ppc/lithium-codegen-ppc.cc

Issue 2640793004: Revert remove dead hole check logic (Closed)
Patch Set: Revert "[crankshaft] Fix mips/mips64 build: remove unused variable" and "[crankshaft] Remove dead Variable hole-checking code" Created 3 years, 11 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/crankshaft/mips64/lithium-mips64.cc ('k') | src/crankshaft/ppc/lithium-ppc.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/crankshaft/ppc/lithium-codegen-ppc.cc
diff --git a/src/crankshaft/ppc/lithium-codegen-ppc.cc b/src/crankshaft/ppc/lithium-codegen-ppc.cc
index ddacd2badf15026fd85c6fb9ce88781bd882522a..ad3ef5d1baa906d97ca413544d22ed9a37917cc7 100644
--- a/src/crankshaft/ppc/lithium-codegen-ppc.cc
+++ b/src/crankshaft/ppc/lithium-codegen-ppc.cc
@@ -2674,6 +2674,26 @@ void LCodeGen::DoLoadContextSlot(LLoadContextSlot* instr) {
Register context = ToRegister(instr->context());
Register result = ToRegister(instr->result());
__ LoadP(result, ContextMemOperand(context, instr->slot_index()));
+ if (instr->hydrogen()->RequiresHoleCheck()) {
+ __ LoadRoot(ip, Heap::kTheHoleValueRootIndex);
+ if (instr->hydrogen()->DeoptimizesOnHole()) {
+ __ cmp(result, ip);
+ DeoptimizeIf(eq, instr, DeoptimizeReason::kHole);
+ } else {
+ if (CpuFeatures::IsSupported(ISELECT)) {
+ Register scratch = scratch0();
+ __ mov(scratch, Operand(factory()->undefined_value()));
+ __ cmp(result, ip);
+ __ isel(eq, result, scratch, result);
+ } else {
+ Label skip;
+ __ cmp(result, ip);
+ __ bne(&skip);
+ __ mov(result, Operand(factory()->undefined_value()));
+ __ bind(&skip);
+ }
+ }
+ }
}
@@ -2683,6 +2703,19 @@ void LCodeGen::DoStoreContextSlot(LStoreContextSlot* instr) {
Register scratch = scratch0();
MemOperand target = ContextMemOperand(context, instr->slot_index());
+ Label skip_assignment;
+
+ if (instr->hydrogen()->RequiresHoleCheck()) {
+ __ LoadP(scratch, target);
+ __ LoadRoot(ip, Heap::kTheHoleValueRootIndex);
+ __ cmp(scratch, ip);
+ if (instr->hydrogen()->DeoptimizesOnHole()) {
+ DeoptimizeIf(eq, instr, DeoptimizeReason::kHole);
+ } else {
+ __ bne(&skip_assignment);
+ }
+ }
+
__ StoreP(value, target, r0);
if (instr->hydrogen()->NeedsWriteBarrier()) {
SmiCheck check_needed = instr->hydrogen()->value()->type().IsHeapObject()
@@ -2692,6 +2725,8 @@ void LCodeGen::DoStoreContextSlot(LStoreContextSlot* instr) {
GetLinkRegisterState(), kSaveFPRegs,
EMIT_REMEMBERED_SET, check_needed);
}
+
+ __ bind(&skip_assignment);
}
« no previous file with comments | « src/crankshaft/mips64/lithium-mips64.cc ('k') | src/crankshaft/ppc/lithium-ppc.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698