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

Unified Diff: src/crankshaft/s390/lithium-codegen-s390.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/ppc/lithium-ppc.cc ('k') | src/crankshaft/s390/lithium-s390.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/crankshaft/s390/lithium-codegen-s390.cc
diff --git a/src/crankshaft/s390/lithium-codegen-s390.cc b/src/crankshaft/s390/lithium-codegen-s390.cc
index bbc8f839451389c73bc629f623f4447938815768..7b287c9844ef899f292e1588948440efcfe38a8e 100644
--- a/src/crankshaft/s390/lithium-codegen-s390.cc
+++ b/src/crankshaft/s390/lithium-codegen-s390.cc
@@ -2634,6 +2634,17 @@ 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()) {
+ __ CompareRoot(result, Heap::kTheHoleValueRootIndex);
+ if (instr->hydrogen()->DeoptimizesOnHole()) {
+ DeoptimizeIf(eq, instr, DeoptimizeReason::kHole);
+ } else {
+ Label skip;
+ __ bne(&skip, Label::kNear);
+ __ mov(result, Operand(factory()->undefined_value()));
+ __ bind(&skip);
+ }
+ }
}
void LCodeGen::DoStoreContextSlot(LStoreContextSlot* instr) {
@@ -2642,6 +2653,18 @@ 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);
+ __ CompareRoot(scratch, Heap::kTheHoleValueRootIndex);
+ if (instr->hydrogen()->DeoptimizesOnHole()) {
+ DeoptimizeIf(eq, instr, DeoptimizeReason::kHole);
+ } else {
+ __ bne(&skip_assignment);
+ }
+ }
+
__ StoreP(value, target);
if (instr->hydrogen()->NeedsWriteBarrier()) {
SmiCheck check_needed = instr->hydrogen()->value()->type().IsHeapObject()
@@ -2651,6 +2674,8 @@ void LCodeGen::DoStoreContextSlot(LStoreContextSlot* instr) {
GetLinkRegisterState(), kSaveFPRegs,
EMIT_REMEMBERED_SET, check_needed);
}
+
+ __ bind(&skip_assignment);
}
void LCodeGen::DoLoadNamedField(LLoadNamedField* instr) {
« no previous file with comments | « src/crankshaft/ppc/lithium-ppc.cc ('k') | src/crankshaft/s390/lithium-s390.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698