Skip to content

Commit

Permalink
Revert of Execute end of scope tasks in isolate's MicrotasksCompleted…
Browse files Browse the repository at this point in the history
…Callback. (patchset Pissandshittium#2 id:20001 of https://codereview.chromium.org/1733083002/ )

Reason for revert:
Causing compile breakage on https://build.chromium.org/p/chromium.webkit/builders/WebKit%20Mac%20Builder

bad build:
https://build.chromium.org/p/chromium.webkit/builders/WebKit%20Mac%20Builder/builds/151129

FAILED: /b/build/goma/gomacc ../../third_party/llvm-build/Release+Asserts/bin/clang++ -MMD -MF obj/third_party/WebKit/Source/bindings/core/v8/webcore_generated.V8PerIsolateData.o.d -DV8_DEPRECATION_WARNINGS -DCLD_VERSION=2 -D__ASSERT_MACROS_DEFINE_VERSIONS_WITHOUT_UNDERSCORE=0 -DCHROMIUM_BUILD -DCR_CLANG_REVISION=261368-1 -DUSE_LIBJPEG_TURBO=1 -DENABLE_WEBRTC=1 -DENABLE_MEDIA_ROUTER=1 -DENABLE_PEPPER_CDMS -DENABLE_CONFIGURATION_POLICY -DENABLE_NOTIFICATIONS -DENABLE_TOPCHROME_MD=1 -DFIELDTRIAL_TESTING_ENABLED -DENABLE_TASK_MANAGER=1 -DENABLE_EXTENSIONS=1 -DENABLE_PDF=1 -DENABLE_PLUGIN_INSTALLATION=1 -DENABLE_PLUGINS=1 -DENABLE_SESSION_SERVICE=1 -DENABLE_THEMES=1 -DENABLE_AUTOFILL_DIALOG=1 -DENABLE_PRINTING=1 -DENABLE_BASIC_PRINTING=1 -DENABLE_PRINT_PREVIEW=1 -DENABLE_SPELLCHECK=1 -DUSE_BROWSER_SPELLCHECKER=1 -DENABLE_CAPTIVE_PORTAL_DETECTION=1 -DENABLE_APP_LIST=1 -DENABLE_SETTINGS_APP=1 -DENABLE_SUPERVISED_USERS=1 -DENABLE_SERVICE_DISCOVERY=1 -DV8_USE_EXTERNAL_STARTUP_DATA -DFULL_SAFE_BROWSING -DSAFE_BROWSING_CSD -DSAFE_BROWSING_DB_LOCAL -DMOJO_USE_SYSTEM_IMPL -DBLINK_IMPLEMENTATION=1 -DINSIDE_BLINK -DENABLE_LAYOUT_UNIT_IN_INLINE_BOXES=0 -DWTF_USE_CONCATENATED_IMPULSE_RESPONSES=1 -DENABLE_INPUT_MULTIPLE_FIELDS_UI=1 -DWTF_USE_ICCJPEG=1 -DWTF_USE_QCMSLIB=1 -DENABLE_OILPAN=1 -DU_USING_ICU_NAMESPACE=0 -DU_ENABLE_DYLOAD=0 -DU_STATIC_IMPLEMENTATION -DSK_SUPPORT_GPU=1 -DSK_IGNORE_LINEONLY_AA_CONVEX_PATH_OPTS -DCHROME_PNG_WRITE_SUPPORT -DPNG_USER_CONFIG -DLIBXML_STATIC -DLIBXSLT_STATIC -DUSE_LIBPCI=1 -DUSE_OPENSSL=1 -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -DNDEBUG -DNVALGRIND -DDYNAMIC_ANNOTATIONS_ENABLED=0 -D_FORTIFY_SOURCE=2 -Igen -I../../third_party/WebKit/Source -Igen/blink -I../.. -I../../skia/config -I../../third_party/khronos -I../../gpu -Igen/angle -I../../third_party/angle/include -I../../third_party/WebKit -I../../third_party/ots/include -I../../third_party/zlib -I../../third_party/icu/source/i18n -I../../third_party/icu/source/common -I../../third_party/skia/include/core -I../../third_party/skia/include/effects -I../../third_party/skia/include/pdf -I../../third_party/skia/include/gpu -I../../third_party/skia/include/lazy -I../../third_party/skia/include/pathops -I../../third_party/skia/include/pipe -I../../third_party/skia/include/ports -I../../third_party/skia/include/utils -I../../third_party/skia/include/utils/mac -I../../skia/ext -I../../third_party/iccjpeg -I../../third_party/libpng -I../../third_party/libwebp -I../../third_party/libxml/mac/include -I../../third_party/libxml/src/include -I../../third_party/libxslt -I../../third_party/npapi -I../../third_party/npapi/bindings -I../../third_party/qcms/src -I../../third_party/snappy/mac -I../../third_party/snappy/src -I../../v8/include -isysroot /Applications/Xcode7.0.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk -O2 -gdwarf-2 -fvisibility=hidden -Werror -mmacosx-version-min=10.6 -arch x86_64 -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wno-selector-type-mismatch -Wpartial-availability -Wheader-hygiene -Wno-char-subscripts -Wno-unneeded-internal-declaration -Wno-covered-switch-default -Wstring-conversion -Wno-c++11-narrowing -Wno-deprecated-register -Wno-inconsistent-missing-override -Wno-shift-negative-value -Wglobal-constructors -Wexit-time-destructors -std=c++11 -stdlib=libc++ -fno-rtti -fno-exceptions -fvisibility-inlines-hidden -fno-threadsafe-statics -Xclang -load -Xclang /b/build/slave/webkit-mac-latest-rel/build/src/third_party/llvm-build/Release+Asserts/lib/libFindBadConstructs.dylib -Xclang -add-plugin -Xclang find-bad-constructs -Xclang -plugin-arg-find-bad-constructs -Xclang check-templates -Xclang -plugin-arg-find-bad-constructs -Xclang follow-macro-expansion -fcolor-diagnostics -fno-strict-aliasing -Xclang -load -Xclang /b/build/slave/webkit-mac-latest-rel/build/src/third_party/llvm-build/Release+Asserts/lib/libBlinkGCPlugin.dylib -Xclang -add-plugin -Xclang blink-gc-plugin -Xclang -plugin-arg-blink-gc-plugin -Xclang enable-oilpan -Xclang -plugin-arg-blink-gc-plugin -Xclang warn-raw-ptr -include ../../third_party/WebKit/Source/build/mac/Prefix.h -c ../../third_party/WebKit/Source/bindings/core/v8/V8PerIsolateData.cpp -o obj/third_party/WebKit/Source/bindings/core/v8/webcore_generated.V8PerIsolateData.o
../../third_party/WebKit/Source/bindings/core/v8/V8PerIsolateData.cpp:166:16: error: no member named 'AddMicrotasksCompletedCallback' in 'v8::Isolate'; did you mean 'AddCallCompletedCallback'?
    isolate()->AddMicrotasksCompletedCallback(&microtasksCompletedCallback);
               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
               AddCallCompletedCallback
../../v8/include/v8.h:5842:8: note: 'AddCallCompletedCallback' declared here
  void AddCallCompletedCallback(CallCompletedCallback callback);
       ^
../../third_party/WebKit/Source/bindings/core/v8/V8PerIsolateData.cpp:227:14: error: no member named 'RemoveMicrotasksCompletedCallback' in 'v8::Isolate'; did you mean 'RemoveCallCompletedCallback'?
    isolate->RemoveMicrotasksCompletedCallback(&microtasksCompletedCallback);
             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
             RemoveCallCompletedCallback
../../v8/include/v8.h:5850:8: note: 'RemoveCallCompletedCallback' declared here
  void RemoveCallCompletedCallback(CallCompletedCallback callback);
       ^
2 errors generated.
ninja: build stopped: subcommand failed.

Original issue's description:
> Execute end of scope tasks in isolate's MicrotasksCompletedCallback.
>
> This removes additional responsibility from V8RecursionScope and Microtask
> and will allow to move microtasks management to V8.
>
> BUG=585949
> TEST=all green
>
> Committed: https://crrev.com/91394c00cf9ee2f0328538a190e0417a0eb857b3
> Cr-Commit-Position: refs/heads/master@{#377953}

TBR=jochen@chromium.org,adamk@chromium.org,dgozman@chromium.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=585949

Review URL: https://codereview.chromium.org/1745543002

Cr-Commit-Position: refs/heads/master@{#377966}
  • Loading branch information
jwd authored and Commit bot committed Feb 26, 2016
1 parent c672f32 commit 60c10a4
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,6 @@ static void beforeCallEnteredCallback(v8::Isolate* isolate)
RELEASE_ASSERT(!ScriptForbiddenScope::isScriptForbidden());
}

static void microtasksCompletedCallback(v8::Isolate* isolate)
{
V8PerIsolateData::from(isolate)->runEndOfScopeTasks();
}

#if ENABLE(ASSERT)
static void assertV8RecursionScope(v8::Isolate* isolate)
{
Expand Down Expand Up @@ -163,7 +158,6 @@ V8PerIsolateData::V8PerIsolateData()
isolate()->AddCallCompletedCallback(&assertV8RecursionScope);
#endif
isolate()->AddBeforeCallEnteredCallback(&beforeCallEnteredCallback);
isolate()->AddMicrotasksCompletedCallback(&microtasksCompletedCallback);
if (isMainThread())
mainThreadPerIsolateData = this;
isolate()->SetUseCounterCallback(&useCounterCallback);
Expand Down Expand Up @@ -224,7 +218,6 @@ void V8PerIsolateData::destroy(v8::Isolate* isolate)
isolate->RemoveCallCompletedCallback(&assertV8RecursionScope);
#endif
isolate->RemoveBeforeCallEnteredCallback(&beforeCallEnteredCallback);
isolate->RemoveMicrotasksCompletedCallback(&microtasksCompletedCallback);
V8PerIsolateData* data = from(isolate);

// Clear everything before exiting the Isolate.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ namespace blink {
void V8RecursionScope::didLeaveScriptContext()
{
Microtask::performCheckpoint(m_isolate);
V8PerIsolateData::from(m_isolate)->runEndOfScopeTasks();
}

} // namespace blink
12 changes: 11 additions & 1 deletion third_party/WebKit/Source/core/dom/Microtask.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
#include "core/dom/Microtask.h"

#include "bindings/core/v8/V8PerIsolateData.h"
#include "bindings/core/v8/V8RecursionScope.h"
#include "platform/ScriptForbiddenScope.h"
#include "platform/Task.h"
#include "public/platform/WebTaskRunner.h"
Expand All @@ -45,10 +46,19 @@ void Microtask::performCheckpoint(v8::Isolate* isolate)
if (isolateData->recursionLevel() || isolateData->performingMicrotaskCheckpoint() || isolateData->destructionPending() || ScriptForbiddenScope::isScriptForbidden())
return;
isolateData->setPerformingMicrotaskCheckpoint(true);
isolate->RunMicrotasks();
{
// Ensure that end-of-task-or-microtask actions are performed.
V8RecursionScope recursionScope(isolate);
isolate->RunMicrotasks();
}
isolateData->setPerformingMicrotaskCheckpoint(false);
}

bool Microtask::performingCheckpoint(v8::Isolate* isolate)
{
return V8PerIsolateData::from(isolate)->performingMicrotaskCheckpoint();
}

static void microtaskFunctionCallback(void* data)
{
OwnPtr<WebTaskRunner::Task> task = adoptPtr(static_cast<WebTaskRunner::Task*>(data));
Expand Down
1 change: 1 addition & 0 deletions third_party/WebKit/Source/core/dom/Microtask.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ class CORE_EXPORT Microtask {
STATIC_ONLY(Microtask);
public:
static void performCheckpoint(v8::Isolate*);
static bool performingCheckpoint(v8::Isolate*);

// TODO(jochen): Make all microtasks pass in the ScriptState they want to be
// executed in. Until then, all microtasks have to keep track of their
Expand Down
5 changes: 4 additions & 1 deletion third_party/WebKit/Source/core/inspector/ThreadDebugger.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,10 @@ bool ThreadDebugger::formatAccessorsAsProperties(v8::Local<v8::Value> value)

bool ThreadDebugger::hasRecursionLevel()
{
return !!V8RecursionScope::recursionLevel(m_isolate);
int recursionLevel = V8RecursionScope::recursionLevel(m_isolate);
if (!recursionLevel)
return false;
return recursionLevel > 1 || !Microtask::performingCheckpoint(m_isolate);
}

} // namespace blink

0 comments on commit 60c10a4

Please sign in to comment.