WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
[patch]
Patch
bug-92856-20120801113635.patch (text/plain), 5.30 KB, created by
Ulan Degenbaev
on 2012-08-01 02:36:53 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Ulan Degenbaev
Created:
2012-08-01 02:36:53 PDT
Size:
5.30 KB
patch
obsolete
>Subversion Revision: 124188 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index 0ce218b02c3c2ca7b9a33d9b1c621cda851a1e71..18e7b8e29b5ee04589b905ed971262cb16b0da5f 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,26 @@ >+2012-08-01 Ulan Degenbaev <ulan@chromium.org> >+ >+ [chromium] Improve garbage collector hint if page uses Canvas contexts >+ https://bugs.webkit.org/show_bug.cgi?id=92856 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Request GC by sending context disposed and idle notification to V8 instead >+ of sending low memory notification. It is faster as it causes one GC >+ instead of seven GCs caused by low memory notification. >+ >+ * bindings/v8/V8Binding.cpp: >+ (WebCore::V8BindingPerIsolateData::V8BindingPerIsolateData): >+ * bindings/v8/V8Binding.h: >+ (V8BindingPerIsolateData): >+ (WebCore::V8BindingPerIsolateData::setGarbageCollectionHint): >+ (WebCore::V8BindingPerIsolateData::clearGarbageCollectionHint): >+ (WebCore::V8BindingPerIsolateData::isGarbageCollectionHint): >+ * bindings/v8/V8Proxy.cpp: >+ (WebCore::V8Proxy::hintForGCIfNecessary): >+ * bindings/v8/custom/V8HTMLCanvasElementCustom.cpp: >+ (WebCore::V8HTMLCanvasElement::getContextCallback): >+ > 2012-07-31 Raul Hudea <rhudea@adobe.com> > > Inspector crashes when trying to inspect a page with CSS region styling >diff --git a/Source/WebCore/bindings/v8/V8Binding.cpp b/Source/WebCore/bindings/v8/V8Binding.cpp >index b1142271b313765e2dc567e791088b6048d71d32..c5f7476db465e7debf6d946f6f328b2795e38eca 100644 >--- a/Source/WebCore/bindings/v8/V8Binding.cpp >+++ b/Source/WebCore/bindings/v8/V8Binding.cpp >@@ -60,7 +60,7 @@ V8BindingPerIsolateData::V8BindingPerIsolateData(v8::Isolate* isolate) > #ifndef NDEBUG > , m_internalScriptRecursionLevel(0) > #endif >- , m_lowMemoryNotificationHint(false) >+ , m_garbageCollectionHint(false) > { > } > >diff --git a/Source/WebCore/bindings/v8/V8Binding.h b/Source/WebCore/bindings/v8/V8Binding.h >index 25f5a54e10bbdab2efe359936924dfb7b3669de9..98fd6dea10acb980864f22c0b0726ade5f7c23fb 100644 >--- a/Source/WebCore/bindings/v8/V8Binding.h >+++ b/Source/WebCore/bindings/v8/V8Binding.h >@@ -220,13 +220,13 @@ namespace WebCore { > > void reportMemoryUsage(MemoryObjectInfo*) const; > >- // Gives the system a hint that we should send a low memory >- // notification upon the next close or navigation event, >- // because some expensive objects have been allocated that we >- // want to take every opportunity to collect. >- void setLowMemoryNotificationHint() { m_lowMemoryNotificationHint = true; } >- void clearLowMemoryNotificationHint() { m_lowMemoryNotificationHint = false; } >- bool isLowMemoryNotificationHint() const { return m_lowMemoryNotificationHint; } >+ // Gives the system a hint that we should request garbage collection >+ // upon the next close or navigation event, because some expensive >+ // objects have been allocated that we want to take every opportunity >+ // to collect. >+ void setGarbageCollectionHint() { m_garbageCollectionHint = true; } >+ void clearGarbageCollectionHint() { m_garbageCollectionHint = false; } >+ bool isGarbageCollectionHint() const { return m_garbageCollectionHint; } > > private: > explicit V8BindingPerIsolateData(v8::Isolate*); >@@ -257,7 +257,7 @@ namespace WebCore { > #endif > GCEventData m_gcEventData; > >- bool m_lowMemoryNotificationHint; >+ bool m_garbageCollectionHint; > }; > > class ConstructorMode { >diff --git a/Source/WebCore/bindings/v8/V8Proxy.cpp b/Source/WebCore/bindings/v8/V8Proxy.cpp >index 081f75f8132530486777f801d26ebc2354e95f62..60524e2a4c4e59e2ed6c43a51f33fc7cfede6d04 100644 >--- a/Source/WebCore/bindings/v8/V8Proxy.cpp >+++ b/Source/WebCore/bindings/v8/V8Proxy.cpp >@@ -562,9 +562,11 @@ void V8Proxy::resetIsolatedWorlds() > void V8Proxy::hintForGCIfNecessary() > { > V8BindingPerIsolateData* data = V8BindingPerIsolateData::current(); >- if (data->isLowMemoryNotificationHint()) { >- data->clearLowMemoryNotificationHint(); >- v8::V8::LowMemoryNotification(); >+ if (data->isGarbageCollectionHint()) { >+ const int longIdlePauseInMs = 1000; >+ data->clearGarbageCollectionHint(); >+ v8::V8::ContextDisposedNotification(); >+ v8::V8::IdleNotification(longIdlePauseInMs); > } > } > >diff --git a/Source/WebCore/bindings/v8/custom/V8HTMLCanvasElementCustom.cpp b/Source/WebCore/bindings/v8/custom/V8HTMLCanvasElementCustom.cpp >index 110ae9b8695b1b86db8382411954ca3658fb3e79..77b44abc0ff8293043eec9a1a23efb7e964d8a0f 100644 >--- a/Source/WebCore/bindings/v8/custom/V8HTMLCanvasElementCustom.cpp >+++ b/Source/WebCore/bindings/v8/custom/V8HTMLCanvasElementCustom.cpp >@@ -91,7 +91,7 @@ v8::Handle<v8::Value> V8HTMLCanvasElement::getContextCallback(const v8::Argument > // want to take an opportunity to get rid of them as soon as possible when we > // navigate away from pages using them. > V8BindingPerIsolateData* perIsolateData = V8BindingPerIsolateData::current(args.GetIsolate()); >- perIsolateData->setLowMemoryNotificationHint(); >+ perIsolateData->setGarbageCollectionHint(); > > if (result->is2d()) > return toV8(static_cast<CanvasRenderingContext2D*>(result), args.GetIsolate());
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 92856
:
155766
|
156006