[vm/isolates] Clean up redundant SafepointOperationScope when installing allocation stub.

The SafepointOperationScope is provided by RunWithStoppedMutators.

Change-Id: Ib0f3a86de58b074a0b5b84b05631ecc59d62de36
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/153640
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Alexander Aprelev <aam@google.com>
This commit is contained in:
Alexander Aprelev 2020-07-08 19:47:36 +00:00 committed by commit-bot@chromium.org
parent 8e3b375123
commit 8b9f920c52
3 changed files with 4 additions and 4 deletions

View file

@ -659,7 +659,7 @@ CodePtr CompileParsedFunctionHelper::Compile(CompilationPipeline* pipeline) {
// those writes are observed atomically.
//
thread()->isolate_group()->RunWithStoppedMutators(
install_code_fun, install_code_fun, /*use_force_growth=*/true);
install_code_fun, /*use_force_growth=*/true);
}
if (!result->IsNull()) {
// Must be called outside of safepoint.

View file

@ -220,7 +220,7 @@ CodePtr StubCode::GetAllocationStubForClass(const Class& cls) {
}
};
auto bg_compiler_fun = [&]() {
ForceGrowthSafepointOperationScope safepoint_scope(thread);
ASSERT(Thread::Current()->IsAtSafepoint());
stub = cls.allocation_stub();
// Check if stub was already generated.
if (!stub.IsNull()) {

View file

@ -226,8 +226,8 @@ CodePtr TypeTestingStubGenerator::BuildCodeForType(const Type& type) {
// a) We allocate an instructions object, which might cause us to
// temporarily flip page protections from (RX -> RW -> RX).
//
thread->isolate_group()->RunWithStoppedMutators(
install_code_fun, install_code_fun, /*use_force_growth=*/true);
thread->isolate_group()->RunWithStoppedMutators(install_code_fun,
/*use_force_growth=*/true);
Code::NotifyCodeObservers(name, code, /*optimized=*/false);