Re: [webkit-dev] freeing static variables

2009-07-30 Thread Zoltan Herczeg
Hi,

any thoughts on this? I hope my qestion was clear :) I would like to pack
the static declarations into wrapper classes, so we can add platform
and/or compilation mode (debug/release) dependent functionality to all
static variables (i.e: freeing them on exit).

Zoltan

 Hi all,

 Valgrind reports a lot of memory leaks when QtLauncher quits, because many
 static local variables are not freed. I did a little research and realized
 there is no consistent way to define static variables in webkit:

 WebCore/css/CSSSelector.cpp: CSSSelector::extractPseudoType()
using a DEFINE_STATIC_LOCAL() macro

 WebCore/bindings/js/JSDOMWindowBase.cpp:
 JSDOMWindowBase::commonJSGlobalData()
static JSGlobalData* globalData;

 WebCore/platform/qt/CursorQt.cpp:
Cursors* Cursors::s_self = 0; (no static keyword)

 I belive it would be a good thing to define a template for static
 variables, which can (optionally) free static variables (enabled in debug
 mode, but sometimes it would be good to enable it in release mode as well)

 And I am wondering whether it would be worth to free (some) static
 variables if they are used in a given time period. This may help to reduce
 the memory consumption in the long run. This would be an optional feature,
 an extra flag (or timeout value) for the template, which can be enabled or
 disabled at compile time. If disabled, the value of this flag is not used
 at all.

 Regards
 Zoltan


___
webkit-dev mailing list
webkit-dev@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-dev


[webkit-dev] JavaScript code that access the DOM tree

2009-07-30 Thread Luka Napotnik
Hello.

I'm searching for the JavaScriptCore code that can access the DOM
tree. An example would be JavaScript code that changes the image
source of an IMG dom element. Any good pointer on this subject?

Greets,
Luka
___
webkit-dev mailing list
webkit-dev@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-dev


Re: [webkit-dev] freeing static variables

2009-07-30 Thread tonikitoo (Antonio Gomes)
Zoltan, I think it would be a great add from a embedder-dev point of view.

Particularly, such leaks have been faced here in a soon past, when we
were loading a webkit browser as a plugin, and not as an application
by itself. So, we the webkit plugin was unloaded, it used to left
behind lots of leaks affecting the (main)  loader application, and as
we you might imagine many of this leaks were from global vars
(including in dependency libs , e.g. fontconfig =/)

On Wed, Jul 29, 2009 at 4:05 AM, Zoltan Herczegzherc...@inf.u-szeged.hu wrote:
 Hi all,

 Valgrind reports a lot of memory leaks when QtLauncher quits, because many
 static local variables are not freed. I did a little research and realized
 there is no consistent way to define static variables in webkit:

 WebCore/css/CSSSelector.cpp: CSSSelector::extractPseudoType()
   using a DEFINE_STATIC_LOCAL() macro

 WebCore/bindings/js/JSDOMWindowBase.cpp:
 JSDOMWindowBase::commonJSGlobalData()
   static JSGlobalData* globalData;

 WebCore/platform/qt/CursorQt.cpp:
   Cursors* Cursors::s_self = 0; (no static keyword)

 I belive it would be a good thing to define a template for static
 variables, which can (optionally) free static variables (enabled in debug
 mode, but sometimes it would be good to enable it in release mode as well)

 And I am wondering whether it would be worth to free (some) static
 variables if they are used in a given time period. This may help to reduce
 the memory consumption in the long run. This would be an optional feature,
 an extra flag (or timeout value) for the template, which can be enabled or
 disabled at compile time. If disabled, the value of this flag is not used
 at all.

 Regards
 Zoltan


 ___
 webkit-dev mailing list
 webkit-dev@lists.webkit.org
 http://lists.webkit.org/mailman/listinfo.cgi/webkit-dev




-- 
--Antonio Gomes
___
webkit-dev mailing list
webkit-dev@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-dev


[webkit-dev] ajax problem when evaluating js

2009-07-30 Thread liseen
Hi, everyone

   I met a question about qtwebkit.

if the javascript disabled, then I evaluate some js contains ajax
request, I cann't get any return. why?
if qtwebkit enbaled javascipt, I got the return of ajax request.

can someone help me?
___
webkit-dev mailing list
webkit-dev@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-dev


Re: [webkit-dev] freeing static variables

2009-07-30 Thread Adam Treat
On Thursday 30 July 2009 02:55:18 am Zoltan Herczeg wrote:
 Hi,

 any thoughts on this? I hope my qestion was clear :) I would like to pack
 the static declarations into wrapper classes, so we can add platform
 and/or compilation mode (debug/release) dependent functionality to all
 static variables (i.e: freeing them on exit).

 Zoltan

I've tried this before and it didn't work out so well.  The order in which you 
free them becomes very important and error prone.  

And, of course, whatever solution you make has to be optional and easy to 
maintain as the default policy in WebKit is to not care - by design - about 
cleaning up after static globals on exit as that is left to the OS.

Another strategy for the embedded case where you want to free everything on 
exit is to create a custom memory handler that will do this for you.

Cheers,
Adam
___
webkit-dev mailing list
webkit-dev@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-dev


Re: [webkit-dev] JavaScript code that access the DOM tree

2009-07-30 Thread Adam Treat
On Thursday 30 July 2009 08:57:53 am Luka Napotnik wrote:
 Hello.

 I'm searching for the JavaScriptCore code that can access the DOM
 tree. An example would be JavaScript code that changes the image
 source of an IMG dom element. Any good pointer on this subject?

 Greets,
 Luka

This is not an appropriate topic for this mailing list as webkit-dev is for 
discussion related to the development of the WebKit rendering engine.  It is 
not for answering generic JavaScript questions.  Thanks!

Cheers,
Adam
___
webkit-dev mailing list
webkit-dev@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-dev


Re: [webkit-dev] ajax problem when evaluating js

2009-07-30 Thread Zoltan Horvath

liseen wrote at: 2009. 07. 30. 16.09.:
 Hi, everyone

I met a question about qtwebkit.

 if the javascript disabled, then I evaluate some js contains ajax
 request, I cann't get any return. why?
 if qtwebkit enbaled javascipt, I got the return of ajax request.

 can someone help me?

Hi,

ajax = synchronous JavaScript and XML

if your javascript execution is disabled ajax won't work.

Next time use webkit-help mail list, webkit-dev is for WebCore/JavaScriptCore 
development. Check: http://webkit.org/contact.html

Zoltan
___
webkit-dev mailing list
webkit-dev@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-dev


Re: [webkit-dev] error compiling webkit-git on 64-bit

2009-07-30 Thread Yusuke Sato
Hi,
I had the same problem with Ubuntu Hardy 64bit. I guess the easiest
way to work around the link error is to run the ./autogen.sh script
with --disable-jit (if you're not debugging JIT stuff, of course :-).

$ ./autogen.sh --disable-jit --enable-debug  make
$ ./Programs/GtkLauncher

When the --enable-debug option is specified (in other words, when
-DNDEBUG is not passed to GCC), the following JIT-related function in
JavaScriptCore/jit/JITStubs.cpp is defined and used,

asm volatile (
.globl  SYMBOL_STRING(ctiVMThrowTrampoline) \n
SYMBOL_STRING(ctiVMThrowTrampoline) : \n
movq %rsp, %rdi \n
call  SYMBOL_STRING(cti_vm_throw) \n
addq $0x48, %rsp \n
popq %rbx \n
popq %r15 \n
popq %r14 \n
popq %r13 \n
popq %r12 \n
popq %rbp \n
ret \n
);

but the call instruction in the function seems not to be PIC
compatible on x86_64. I'm not sure but maybe you could also fix the
link error by replacing the line with
call  SYMBOL_STRING(cti_vm_throw) @PLT\n
or something like that. If you can't use --disable-jit for some
reasons, please try this.

Thanks,
Yusuke


On Sat, Jul 11, 2009 at 8:19 PM, Luka Napotnikluka.napot...@gmail.com wrote:
 Hello.

 I have a problem compiling the latest GIT version of webkit. My system
 is ArchLinux 64-bit and gcc 4.4. My configure looks like this:

 ./configure --prefix=/usr --enable-debug --disable-optimizations

 When compiling webkit I got the following error:
 -
 /usr/bin/ld: ./.libs/libJavaScriptCore.a(libJavaScriptCore_la-JITStubs.o): 
 relocation R_X86_64_PC32 against symbol `cti_vm_throw' can not be used when 
 making a shared object; recompile with -fPIC
 /usr/bin/ld: final link failed: Bad value.
 -

 I've set the CFLAGS and CXXFLAGS environment variables to -fPIC and ran
 configure again but got the same error. Any ideas how to fix this?

 Greets,
 Luka

 ___
 webkit-dev mailing list
 webkit-dev@lists.webkit.org
 http://lists.webkit.org/mailman/listinfo.cgi/webkit-dev

___
webkit-dev mailing list
webkit-dev@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-dev