| Index: src/runtime.cc
|
| diff --git a/src/runtime.cc b/src/runtime.cc
|
| index cfa427cbee30d16056b97d856775c840619ac536..8e2cc31f556b2dc617078244b6a8970e27271f55 100644
|
| --- a/src/runtime.cc
|
| +++ b/src/runtime.cc
|
| @@ -4175,6 +4175,11 @@ MUST_USE_RESULT static MaybeObject* StringReplaceGlobalRegExpWithEmptyString(
|
|
|
| Address end_of_string = answer->address() + string_size;
|
| Heap* heap = isolate->heap();
|
| +
|
| + // The trimming is performed on a newly allocated object, which is on a
|
| + // fresly allocated page or on an already swept page. Hence, the sweeper
|
| + // thread can not get confused with the filler creation. No synchronization
|
| + // needed.
|
| heap->CreateFillerObjectAt(end_of_string, delta);
|
| heap->AdjustLiveBytes(answer->address(), -delta, Heap::FROM_MUTATOR);
|
| return *answer;
|
|
|