From a98c889313467abbdf0f864b178c32c03bb82ca8 Mon Sep 17 00:00:00 2001 From: Benedikt Meurer Date: Wed, 21 Feb 2018 13:24:02 +0100 Subject: [PATCH] [turbofan] We don't need write barriers for immortal immovable maps. WriteBarrierKindFor would always return kMapWriteBarrier in SimplifiedLowering even if the map that's to be stored is part of the immortal immovable roots which don't need write barriers ever. Bug: v8:7310 Change-Id: I0a87a1c3ddd7f71ccf8ebacba8409067dc00cd1c Reviewed-on: https://chromium-review.googlesource.com/928564 Commit-Queue: Sigurd Schneider Commit-Queue: Benedikt Meurer Reviewed-by: Sigurd Schneider Cr-Commit-Position: refs/heads/master@{#51431} --- src/compiler/simplified-lowering.cc | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/compiler/simplified-lowering.cc b/src/compiler/simplified-lowering.cc index 994026bf3a..31770836f5 100644 --- a/src/compiler/simplified-lowering.cc +++ b/src/compiler/simplified-lowering.cc @@ -1237,12 +1237,16 @@ class RepresentationSelector { MachineRepresentation field_representation, int field_offset, Type* field_type, MachineRepresentation value_representation, Node* value) { - if (base_taggedness == kTaggedBase && - field_offset == HeapObject::kMapOffset) { - return kMapWriteBarrier; + WriteBarrierKind write_barrier_kind = + WriteBarrierKindFor(base_taggedness, field_representation, field_type, + value_representation, value); + if (write_barrier_kind != kNoWriteBarrier) { + if (base_taggedness == kTaggedBase && + field_offset == HeapObject::kMapOffset) { + write_barrier_kind = kMapWriteBarrier; + } } - return WriteBarrierKindFor(base_taggedness, field_representation, - field_type, value_representation, value); + return write_barrier_kind; } Graph* graph() const { return jsgraph_->graph(); }