Commit 9966b73a authored by Michael Lippautz's avatar Michael Lippautz Committed by Commit Bot

[oilpan] Move incremental marking behind a build-time flag

Move Oilpan's incremental marking work behind a build-time flag
  enable_blink_heap_incremental_marking

Bug: chromium:757440
Change-Id: Id4adddcf0669dc165935eced90e8caefbb76a094
Reviewed-on: https://chromium-review.googlesource.com/822492
Commit-Queue: Michael Lippautz <mlippautz@chromium.org>
Reviewed-by: default avatarKentaro Hara <haraken@chromium.org>
Reviewed-by: default avatarDirk Pranke <dpranke@chromium.org>
Reviewed-by: default avatarJeremy Roman <jbroman@chromium.org>
Cr-Commit-Position: refs/heads/master@{#524051}
parent 03844521
...@@ -1481,6 +1481,7 @@ jumbo_component("platform") { ...@@ -1481,6 +1481,7 @@ jumbo_component("platform") {
"//services/service_manager/public/interfaces:interfaces_blink", "//services/service_manager/public/interfaces:interfaces_blink",
"//skia", "//skia",
"//third_party:jpeg", "//third_party:jpeg",
"//third_party/WebKit/Source/platform/heap",
"//third_party/WebKit/Source/platform/wtf", "//third_party/WebKit/Source/platform/wtf",
"//third_party/WebKit/common:blink_common", "//third_party/WebKit/common:blink_common",
"//third_party/WebKit/common:mojo_platform_bindings_blink", "//third_party/WebKit/common:mojo_platform_bindings_blink",
...@@ -1501,7 +1502,6 @@ jumbo_component("platform") { ...@@ -1501,7 +1502,6 @@ jumbo_component("platform") {
"//services/service_manager/public/cpp", "//services/service_manager/public/cpp",
"//third_party:freetype_harfbuzz", "//third_party:freetype_harfbuzz",
"//third_party/WebKit/Source/platform/blob", "//third_party/WebKit/Source/platform/blob",
"//third_party/WebKit/Source/platform/heap",
"//third_party/WebKit/Source/platform/instrumentation", "//third_party/WebKit/Source/platform/instrumentation",
"//third_party/WebKit/Source/platform/loader", "//third_party/WebKit/Source/platform/loader",
"//third_party/WebKit/Source/platform/media", "//third_party/WebKit/Source/platform/media",
...@@ -1912,6 +1912,10 @@ jumbo_source_set("blink_platform_unittests_sources") { ...@@ -1912,6 +1912,10 @@ jumbo_source_set("blink_platform_unittests_sources") {
"//third_party/WebKit/Source:config", "//third_party/WebKit/Source:config",
] ]
public_deps = [
"//third_party/WebKit/Source/platform/heap",
]
deps = [ deps = [
":platform", ":platform",
":test_support", ":test_support",
......
...@@ -2,13 +2,29 @@ ...@@ -2,13 +2,29 @@
# Use of this source code is governed by a BSD-style license that can be # Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file. # found in the LICENSE file.
import("//build/buildflag_header.gni")
import("//build/config/jumbo.gni") import("//build/config/jumbo.gni")
import("//testing/test.gni") import("//testing/test.gni")
declare_args() {
# Enables incremental marking in Oilpan.
enable_blink_heap_incremental_marking = false
}
buildflag_header("blink_heap_incremental_marking") {
header = "IncrementalMarking.h"
header_dir = "blink/platform/heap"
flags = [
"BLINK_HEAP_INCREMENTAL_MARKING=$enable_blink_heap_incremental_marking",
]
}
jumbo_source_set("heap") { jumbo_source_set("heap") {
# This target is a logical part of the platform and only the platform target # This target is a logical part of the platform and only the platform target
# should depend on it. # should depend on it.
visibility = [ "//third_party/WebKit/Source/platform" ] visibility = [ "//third_party/WebKit/Source/platform:*" ]
sources = [ sources = [
"BlinkGC.h", "BlinkGC.h",
...@@ -74,6 +90,7 @@ jumbo_source_set("heap") { ...@@ -74,6 +90,7 @@ jumbo_source_set("heap") {
] ]
public_deps = [ public_deps = [
":blink_heap_incremental_marking",
"//third_party/WebKit/public:blink_headers", "//third_party/WebKit/public:blink_headers",
] ]
} }
......
...@@ -5,13 +5,13 @@ ...@@ -5,13 +5,13 @@
#include "platform/heap/CallbackStack.h" #include "platform/heap/CallbackStack.h"
#include "platform/heap/GarbageCollected.h" #include "platform/heap/GarbageCollected.h"
#include "platform/heap/Heap.h" #include "platform/heap/Heap.h"
#include "platform/heap/IncrementalMarking.h"
#include "platform/heap/Member.h" #include "platform/heap/Member.h"
#include "platform/heap/ThreadState.h" #include "platform/heap/ThreadState.h"
#include "platform/heap/TraceTraits.h" #include "platform/heap/TraceTraits.h"
#include "testing/gtest/include/gtest/gtest.h" #include "testing/gtest/include/gtest/gtest.h"
// TODO(mlippautz): Replace with proper build flag. #if BUILDFLAG(BLINK_HEAP_INCREMENTAL_MARKING)
#if 0
namespace blink { namespace blink {
namespace incremental_marking_test { namespace incremental_marking_test {
...@@ -214,4 +214,4 @@ TEST(IncrementalMarkingTest, NoWriteBarrierOnMarkedMixinApplication) { ...@@ -214,4 +214,4 @@ TEST(IncrementalMarkingTest, NoWriteBarrierOnMarkedMixinApplication) {
} // namespace incremental_marking_test } // namespace incremental_marking_test
} // namespace blink } // namespace blink
#endif #endif // BUILDFLAG(BLINK_HEAP_INCREMENTAL_MARKING)
...@@ -7,6 +7,7 @@ ...@@ -7,6 +7,7 @@
#include "platform/heap/Heap.h" #include "platform/heap/Heap.h"
#include "platform/heap/HeapPage.h" #include "platform/heap/HeapPage.h"
#include "platform/heap/IncrementalMarking.h"
#include "platform/wtf/Allocator.h" #include "platform/wtf/Allocator.h"
#include "platform/wtf/HashFunctions.h" #include "platform/wtf/HashFunctions.h"
#include "platform/wtf/HashTraits.h" #include "platform/wtf/HashTraits.h"
...@@ -249,8 +250,7 @@ class Member : public MemberBase<T, TracenessMemberConfiguration::kTraced> { ...@@ -249,8 +250,7 @@ class Member : public MemberBase<T, TracenessMemberConfiguration::kTraced> {
protected: protected:
ALWAYS_INLINE void WriteBarrier(const T* value) const { ALWAYS_INLINE void WriteBarrier(const T* value) const {
// TODO(mlippautz): Replace with proper build flag. #if BUILDFLAG(BLINK_HEAP_INCREMENTAL_MARKING)
#if 0
if (value) { if (value) {
// The following method for retrieving a page works as allocation of // The following method for retrieving a page works as allocation of
// mixins on large object pages is prohibited. // mixins on large object pages is prohibited.
...@@ -260,7 +260,7 @@ class Member : public MemberBase<T, TracenessMemberConfiguration::kTraced> { ...@@ -260,7 +260,7 @@ class Member : public MemberBase<T, TracenessMemberConfiguration::kTraced> {
ThreadState::Current()->Heap().WriteBarrierInternal(page, value); ThreadState::Current()->Heap().WriteBarrierInternal(page, value);
} }
} }
#endif #endif // BUILDFLAG(BLINK_HEAP_INCREMENTAL_MARKING)
} }
}; };
......
...@@ -44,6 +44,7 @@ ...@@ -44,6 +44,7 @@
#include "platform/heap/Handle.h" #include "platform/heap/Handle.h"
#include "platform/heap/Heap.h" #include "platform/heap/Heap.h"
#include "platform/heap/HeapCompact.h" #include "platform/heap/HeapCompact.h"
#include "platform/heap/IncrementalMarking.h"
#include "platform/heap/PagePool.h" #include "platform/heap/PagePool.h"
#include "platform/heap/SafePoint.h" #include "platform/heap/SafePoint.h"
#include "platform/heap/Visitor.h" #include "platform/heap/Visitor.h"
...@@ -364,15 +365,14 @@ bool ThreadState::JudgeGCThreshold(size_t allocated_object_size_threshold, ...@@ -364,15 +365,14 @@ bool ThreadState::JudgeGCThreshold(size_t allocated_object_size_threshold,
} }
bool ThreadState::ShouldScheduleIncrementalMarking() const { bool ThreadState::ShouldScheduleIncrementalMarking() const {
// TODO(mlippautz): Replace with proper build flag. #if BUILDFLAG(BLINK_HEAP_INCREMENTAL_MARKING)
#if 0
// TODO(mlippautz): For now immediately schedule incremental marking if // TODO(mlippautz): For now immediately schedule incremental marking if
// the runtime flag is provided, basically exercising a stress test. // the runtime flag is provided, basically exercising a stress test.
return (GcState() == kNoGCScheduled || GcState() == kSweeping) && return (GcState() == kNoGCScheduled || GcState() == kSweeping) &&
RuntimeEnabledFeatures::HeapIncrementalMarkingEnabled(); RuntimeEnabledFeatures::HeapIncrementalMarkingEnabled();
#else #else
return false; return false;
#endif #endif // BUILDFLAG(BLINK_HEAP_INCREMENTAL_MARKING)
} }
bool ThreadState::ShouldScheduleIdleGC() { bool ThreadState::ShouldScheduleIdleGC() {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment