| Index: src/crankshaft/x64/lithium-codegen-x64.cc
|
| diff --git a/src/crankshaft/x64/lithium-codegen-x64.cc b/src/crankshaft/x64/lithium-codegen-x64.cc
|
| index 4b36f96d20158f386788f7802cbc8ad96215ea78..f09af7136ece42cf3932406bf0a773856fe31871 100644
|
| --- a/src/crankshaft/x64/lithium-codegen-x64.cc
|
| +++ b/src/crankshaft/x64/lithium-codegen-x64.cc
|
| @@ -2505,15 +2505,37 @@ void LCodeGen::DoLoadContextSlot(LLoadContextSlot* instr) {
|
| Register context = ToRegister(instr->context());
|
| Register result = ToRegister(instr->result());
|
| __ movp(result, ContextOperand(context, instr->slot_index()));
|
| + if (instr->hydrogen()->RequiresHoleCheck()) {
|
| + __ CompareRoot(result, Heap::kTheHoleValueRootIndex);
|
| + if (instr->hydrogen()->DeoptimizesOnHole()) {
|
| + DeoptimizeIf(equal, instr, DeoptimizeReason::kHole);
|
| + } else {
|
| + Label is_not_hole;
|
| + __ j(not_equal, &is_not_hole, Label::kNear);
|
| + __ LoadRoot(result, Heap::kUndefinedValueRootIndex);
|
| + __ bind(&is_not_hole);
|
| + }
|
| + }
|
| }
|
|
|
|
|
| void LCodeGen::DoStoreContextSlot(LStoreContextSlot* instr) {
|
| Register context = ToRegister(instr->context());
|
| Register value = ToRegister(instr->value());
|
| +
|
| Operand target = ContextOperand(context, instr->slot_index());
|
|
|
| + Label skip_assignment;
|
| + if (instr->hydrogen()->RequiresHoleCheck()) {
|
| + __ CompareRoot(target, Heap::kTheHoleValueRootIndex);
|
| + if (instr->hydrogen()->DeoptimizesOnHole()) {
|
| + DeoptimizeIf(equal, instr, DeoptimizeReason::kHole);
|
| + } else {
|
| + __ j(not_equal, &skip_assignment);
|
| + }
|
| + }
|
| __ movp(target, value);
|
| +
|
| if (instr->hydrogen()->NeedsWriteBarrier()) {
|
| SmiCheck check_needed =
|
| instr->hydrogen()->value()->type().IsHeapObject()
|
| @@ -2528,6 +2550,8 @@ void LCodeGen::DoStoreContextSlot(LStoreContextSlot* instr) {
|
| EMIT_REMEMBERED_SET,
|
| check_needed);
|
| }
|
| +
|
| + __ bind(&skip_assignment);
|
| }
|
|
|
|
|
|
|