Bug 118067 - [GTK] Use the GCActivityCallback
Summary: [GTK] Use the GCActivityCallback
Status: RESOLVED DUPLICATE of bug 151391
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-06-26 09:49 PDT by Sergio Villar Senin
Modified: 2015-12-31 16:21 PST (History)
16 users (show)

See Also:


Attachments
implement gtk GCActivityCallback (5.33 KB, application/octet-stream)
2013-07-19 20:15 PDT, Peng Xinchao
no flags Details
implement gtk GCActivityCallback (4.35 KB, patch)
2013-07-19 20:19 PDT, Peng Xinchao
no flags Details | Formatted Diff | Diff
add changLog (4.89 KB, application/octet-stream)
2013-07-19 20:24 PDT, Peng Xinchao
no flags Details
Path (4.35 KB, application/octet-stream)
2013-07-19 20:26 PDT, Peng Xinchao
no flags Details
Patch (4.35 KB, patch)
2013-07-19 20:28 PDT, Peng Xinchao
no flags Details | Formatted Diff | Diff
accept these suggestiones of Sergio Villar Senin . (4.63 KB, application/octet-stream)
2013-08-08 19:49 PDT, Peng Xinchao
xinchao.peng: review+
xinchao.peng: commit-queue+
Details
accept these suggestiones of Sergio Villar Senin . (4.63 KB, application/octet-stream)
2013-08-08 20:01 PDT, Peng Xinchao
no flags Details
implement gtk GCActivityCallback (4.57 KB, patch)
2013-09-11 22:11 PDT, Peng Xinchao
no flags Details | Formatted Diff | Diff
Patch (6.49 KB, patch)
2013-12-11 20:30 PST, Peng Xinchao
no flags Details | Formatted Diff | Diff
Patch (6.49 KB, patch)
2013-12-11 20:33 PST, Peng Xinchao
no flags Details | Formatted Diff | Diff
Patch (6.12 KB, patch)
2013-12-18 00:40 PST, Peng Xinchao
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Sergio Villar Senin 2013-06-26 09:49:48 PDT
Looks like it will help by improving the efficiency of use of the JSC heap.

See Qt's implementation in bug 103996 & bug 103998
EFL implementation in bug 95923
Comment 1 Peng Xinchao 2013-07-19 20:15:43 PDT
Created attachment 207172 [details]
implement gtk GCActivityCallback

Additional GCs can be triggered by platform timer. It has sort of compaction effect not to make JSC heap grow fast so that memory usage becomes lower than usual
Comment 2 Peng Xinchao 2013-07-19 20:19:24 PDT
Created attachment 207173 [details]
implement gtk GCActivityCallback

Additional GCs can be triggered by platform timer. It has sort of compaction effect not to make JSC heap grow fast so that memory usage becomes lower than usual
Comment 3 Peng Xinchao 2013-07-19 20:24:24 PDT
Created attachment 207174 [details]
add changLog
Comment 4 Peng Xinchao 2013-07-19 20:26:20 PDT
Created attachment 207175 [details]
Path
Comment 5 Peng Xinchao 2013-07-19 20:28:36 PDT
Created attachment 207176 [details]
Patch
Comment 6 Zan Dobersek 2013-08-08 06:06:04 PDT
The patch looks about right after a quick glance at it, but is still missing the changelog and the r? flag so someone can actually do a proper review. There's also some styling issues present.

It also needs to apply to the tree so the EWSs can process it.
Comment 7 Sergio Villar Senin 2013-08-08 09:01:20 PDT
Comment on attachment 207176 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=207176&action=review

Apart from the inline comments, remember that you have to add a proper ChangeLog with the description of the changes (maybe this helps http://trac.webkit.org/wiki/CodeReview)

> runtime/GCActivityCallback.h:72
> +    }

You don't need this if you aren't doing anything different from the #else following this code.

> runtime/GCActivityCallback.h:117
> +#endif

At least cancelTimer(), scheduleTimer() and m_delay are shared with the other ports. There should be a better way to write this.

> runtime/GCActivityCallback.cpp:44
> +#include <gdk/gdk.h>

Why gdk?

> runtime/GCActivityCallback.cpp:87
> +}

Isn't this exactly the same as Qt? Couldn't we do "#elif PLATFORM(QT) || PLATFORM(GTK)" ?

> runtime/GCActivityCallback.cpp:168
> +    

Check the indentation and remove the extra lines at the end of the function.

> runtime/GCActivityCallback.cpp:174
> +	stop();

Check indentation. Also the implementation is exactly the same as EFL, we might think about sharing it.

> runtime/GCActivityCallback.cpp:179
> +

Extra line.

> runtime/GCActivityCallback.cpp:181
> +		return;

Indentation.

> runtime/GCActivityCallback.cpp:202
> +		   return;

Indentation. Also any reason why we could not share EFL's code?. Actually, I don't know exactly about the details but looks like the EFL code might be shared among ports (not sure about the ASSERT though)

> heap/HeapTimer.cpp:44
> +#include <gdk/gdk.h>

Again why gdk?
Comment 8 Peng Xinchao 2013-08-08 19:49:44 PDT
Created attachment 208390 [details]
accept these suggestiones of Sergio Villar Senin .

accept these suggestiones of Sergio Villar Senin .
Comment 9 Peng Xinchao 2013-08-08 20:01:05 PDT
Created attachment 208391 [details]
accept these suggestiones of Sergio Villar Senin .
Comment 10 Peng Xinchao 2013-08-08 20:04:58 PDT
(In reply to comment #7)
> (From update of attachment 207176 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=207176&action=review
> 
> Apart from the inline comments, remember that you have to add a proper ChangeLog with the description of the changes (maybe this helps http://trac.webkit.org/wiki/CodeReview)
> 
> > runtime/GCActivityCallback.h:72
> > +    }
> 
> You don't need this if you aren't doing anything different from the #else following this code.
> 
> > runtime/GCActivityCallback.h:117
> > +#endif
> 
> At least cancelTimer(), scheduleTimer() and m_delay are shared with the other ports. There should be a better way to write this.
> 
> > runtime/GCActivityCallback.cpp:44
> > +#include <gdk/gdk.h>
> 
> Why gdk?
> 
> > runtime/GCActivityCallback.cpp:87
> > +}
> 
> Isn't this exactly the same as Qt? Couldn't we do "#elif PLATFORM(QT) || PLATFORM(GTK)" ?
> 
> > runtime/GCActivityCallback.cpp:168
> > +    
> 
> Check the indentation and remove the extra lines at the end of the function.
> 
> > runtime/GCActivityCallback.cpp:174
> > +	stop();
> 
> Check indentation. Also the implementation is exactly the same as EFL, we might think about sharing it.
> 
> > runtime/GCActivityCallback.cpp:179
> > +
> 
> Extra line.
> 
> > runtime/GCActivityCallback.cpp:181
> > +		return;
> 
> Indentation.
> 
> > runtime/GCActivityCallback.cpp:202
> > +		   return;
> 
> Indentation. Also any reason why we could not share EFL's code?. Actually, I don't know exactly about the details but looks like the EFL code might be shared among ports (not sure about the ASSERT though)
> 
> > heap/HeapTimer.cpp:44
> > +#include <gdk/gdk.h>
> 
> Again why gdk?

I motify codes ,but Why  my new patch  do not display normal?
Comment 11 Peng Xinchao 2013-09-11 22:11:40 PDT
Created attachment 211397 [details]
implement gtk GCActivityCallback
Comment 12 Peng Xinchao 2013-12-10 19:24:39 PST
In pressure test, i happened the crash :
 i feel odd ,please check .

(gdb) bt full
#0  0xb6158870 in JSC::ExecutableBase::clearCode() () from ../../../SymbolFiles/mtd_exe/Webkit/libjavascriptcoregtk-3.0.so.0
No symbol table info available.
#1  0xb6159440 in JSC::FunctionExecutable::clearCode() () from ../../../SymbolFiles/mtd_exe/Webkit/libjavascriptcoregtk-3.0.so.0
No symbol table info available.
#2  0xb6159468 in JSC::FunctionExecutable::clearCodeIfNotCompiling() () from ../../../SymbolFiles/mtd_exe/Webkit/libjavascriptcoregtk-3.0.so.0
No symbol table info available.
#3  0xb603ebf4 in JSC::Heap::deleteAllCompiledCode() () from ../../../SymbolFiles/mtd_exe/Webkit/libjavascriptcoregtk-3.0.so.0
No symbol table info available.
#4  0xb603f59c in JSC::Heap::collect(JSC::Heap::SweepToggle) () from ../../../SymbolFiles/mtd_exe/Webkit/libjavascriptcoregtk-3.0.so.0
No symbol table info available.
#5  0xb61623e0 in JSC::DefaultGCActivityCallback::doWork() () from ../../../SymbolFiles/mtd_exe/Webkit/libjavascriptcoregtk-3.0.so.0
No symbol table info available.
#6  0xa6f39a40 in g_timeout_dispatch () from ../../../SymbolFiles/mtd_cmmlib/Runtime/lib/libglib-2.0.so.0
No symbol table info available.
#7  0xa6f38cd4 in g_main_context_dispatch () from ../../../SymbolFiles/mtd_cmmlib/Runtime/lib/libglib-2.0.so.0
No symbol table info available.
#8  0xa6f3904c in g_main_context_iterate () from ../../../SymbolFiles/mtd_cmmlib/Runtime/lib/libglib-2.0.so.0
No symbol table info available.
#9  0xa6f39510 in g_main_loop_run () from ../../../SymbolFiles/mtd_cmmlib/Runtime/lib/libglib-2.0.so.0
No symbol table info available.
#10 0xb5878c94 in WebCore::RunLoop::run() () from ../../../SymbolFiles/mtd_exe/Webkit/libwebkit2gtk-3.0.so.0
No symbol table info available.
#11 0xb4292b0c in WebProcessMainGtk () from ../../../SymbolFiles/mtd_exe/Webkit/libwebkit2gtk-3.0.so.0
No symbol table info available.
#12 0x00008cc4 in main ()
Comment 13 Peng Xinchao 2013-12-11 20:30:37 PST
Created attachment 219037 [details]
Patch
Comment 14 Peng Xinchao 2013-12-11 20:33:02 PST
Created attachment 219038 [details]
Patch
Comment 15 EFL EWS Bot 2013-12-11 20:41:19 PST
Comment on attachment 219038 [details]
Patch

Attachment 219038 [details] did not pass efl-ews (efl):
Output: http://webkit-queues.appspot.com/results/47618165
Comment 16 Build Bot 2013-12-11 21:04:09 PST
Comment on attachment 219038 [details]
Patch

Attachment 219038 [details] did not pass mac-wk2-ews (mac-wk2):
Output: http://webkit-queues.appspot.com/results/48118141
Comment 17 Build Bot 2013-12-11 21:16:50 PST
Comment on attachment 219038 [details]
Patch

Attachment 219038 [details] did not pass win-ews (win):
Output: http://webkit-queues.appspot.com/results/48148157
Comment 18 EFL EWS Bot 2013-12-11 21:33:27 PST
Comment on attachment 219038 [details]
Patch

Attachment 219038 [details] did not pass efl-wk2-ews (efl-wk2):
Output: http://webkit-queues.appspot.com/results/47318184
Comment 19 Build Bot 2013-12-11 21:43:15 PST
Comment on attachment 219038 [details]
Patch

Attachment 219038 [details] did not pass mac-ews (mac):
Output: http://webkit-queues.appspot.com/results/45068194
Comment 20 Build Bot 2013-12-11 22:28:07 PST
Comment on attachment 219038 [details]
Patch

Attachment 219038 [details] did not pass mac-ews (mac):
Output: http://webkit-queues.appspot.com/results/48088158
Comment 21 Sergio Villar Senin 2013-12-12 01:49:58 PST
(In reply to comment #14)
> Created an attachment (id=219038) [details]
> Patch

../../Source/JavaScriptCore/runtime/GCActivityCallback.cpp:51:33: error: missing ')' in expression
 #if USE(CF) || PLATFORM(EFL) || (PLATFORM(GTK)

You have to remove that extra parenthesis
Comment 22 kov's GTK+ EWS bot 2013-12-12 10:30:18 PST
Comment on attachment 219038 [details]
Patch

Attachment 219038 [details] did not pass gtk-ews (gtk):
Output: http://webkit-queues.appspot.com/results/48228016
Comment 23 Peng Xinchao 2013-12-18 00:40:38 PST
Created attachment 219511 [details]
Patch
Comment 24 Michael Catanzaro 2015-12-31 16:20:31 PST
Comment on attachment 219511 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=219511&action=review

Looks like we wound up duplicating work due to not landing this patch. Another implementation of this landed in r192773. Oh well....

> Source/JavaScriptCore/heap/HeapTimer.cpp:173
> +    ASSERT(m_mainLoop);

I don't think these assertions are useful; they're never going to fail. (Note that GLib crashes if memory allocation fails.)
Comment 25 Michael Catanzaro 2015-12-31 16:21:00 PST

*** This bug has been marked as a duplicate of bug 151391 ***