Re: [webkit-dev] JavascriptCore questions

2006-12-19 Thread Geoffrey Garen
Hi Ed. Interpreters, ExecStates, Binding - - ConvertValueToNPVariant() and convertValueToObjcValue(), which are used in the plugin interface binding code, both contain special logic that basically says if wrapping up a window object, store the RootObject

Re: [webkit-dev] Improving ability to filter the tags produced by editable webkit?

2006-12-21 Thread Geoffrey Garen
Dan, Do you really need to customize these things through the editing delegate, or do you just need WebKit to fix them in its own editing code? Most of your comments suggest that the latter is the case. Geoff On Dec 21, 2006, at 11:14 AM, Dan Wood wrote: Hi folks, I've been working

[webkit-dev] Red Alert!

2007-03-12 Thread Geoffrey Garen
The buildbot is red. 3 JavaScriptCore tests are failing, presumably due to the DST change. Kevin McCullough is working on this. 7 layout tests began failing with r20130 or r20131. 50-60 new leaks showed up with r20129, r20130, or r20131. These are the three check-ins in question: Changed

Re: [webkit-dev] New name for DumpRenderTree tool?

2007-05-07 Thread Geoffrey Garen
+1 On May 7, 2007, at 11:28 AM, Darin Adler wrote: I was thinking we should change the tool's name from DumpRenderTree to RunWebKitTest. What do you all think? -- Darin ___ webkit-dev mailing list webkit-dev@lists.webkit.org

Re: [webkit-dev] Regression fallout from change to make Frames start with an empty document

2007-05-12 Thread Geoffrey Garen
I believe we should add this one to the list: rdar://problem/ 5198885 Crash or ASSERT below FrameLoader::commitProvisionalLoad when navigating away from bookmarks view Geoff On May 12, 2007, at 1:14 AM, Maciej Stachowiak wrote: My change to make Frames start with an empty document instead

Re: [webkit-dev] How would one call a JavaScript function from C++ using WebKit?

2007-05-25 Thread Geoffrey Garen
Does anyone know what class/function I should use in WebKit to execute a JavaScript function from C++? KJS::JSObject::call invokes a function object as a function. You will need to retrieve the appendMessage function object from the global object in order to call it. If you're asking

Re: [webkit-dev] where is a documentation?

2007-07-05 Thread Geoffrey Garen
? Thanks, Oleg. Geoffrey Garen wrote: I'm investigating possibility to use WebKit as a embedded html renderer, but I've failed to find any documentation on API I could use for this :( http://developer.apple.com/documentation/Cocoa/Conceptual/DisplayWebContent/index.html#/ /apple_ref/doc/uid

Re: [webkit-dev] detect virus while download webkit source code

2007-07-17 Thread Geoffrey Garen
I believe that testcase tests for a security problem that can result from NULL characters. And it looks like your anti-virus software detected the same problem. Geoff On Jul 17, 2007, at 10:53 AM, Yuehfu Shih wrote: Hi, I am new to Webkit. I am downloading WebKit source code using

Re: [webkit-dev] Most methods in WebUIDelegate are not getting called

2007-07-27 Thread Geoffrey Garen
setContentRect: is only called when opening a new window through JavaScript, and only with Safari 2. In general, these methods are not notifications -- they are requests. So, for example, a user resize of the window may change the WebView's contentRect but, because the user -- not WebKit

Re: [webkit-dev] Issue with calling javascript function from a external thread

2007-08-10 Thread Geoffrey Garen
WebKit is not thread-safe. If you want to perform external processing on a secondary thread, that's OK, but any calls into the DOM will have to happen on the main thread. Geoff On Aug 10, 2007, at 3:00 AM, Julien Chaffraix wrote: Hi all, I am trying to make a wrapper in C++ for the Ivy

Re: [webkit-dev] Adding custom menu to debug menu

2007-09-07 Thread Geoffrey Garen
Hi Sajesh. The debug menu is a Safari feature, not a WebKit feature. You can add a menu to your app using Interface Builder. Geoff On Sep 7, 2007, at 3:29 PM, sajesh wrote: Hi All, I am new to web-kit, i am trying to customize the debug menu of web- kit to add my own custom menu for

Re: [webkit-dev] for review: RefPtr document

2007-10-09 Thread Geoffrey Garen
Having this document as a reference will be great! History Many objects in WebKit are reference counted. The pattern used is that classes have member functionsref and deref that increment and decrement the reference count. Each call to ref has to be matched by a call to deref. When the

Re: [webkit-dev] WTF license terms

2007-11-05 Thread Geoffrey Garen
Mainly I'd like to hear if any major contributors would have a problem with this move. I guess I'll sound like a bit of a shill here, but: I contributed to the WTF code and I wouldn't mind moving it to a BSD license. Cheers, Geoff ___ webkit-dev

Re: [webkit-dev] javascriptcore: explicitly call default getProperties function?

2008-02-26 Thread Geoffrey Garen
Hi Michael. One solution would be to maintain a hash or bitmap indicating which lazy properties you had allocated so far: JSValueRef GetProperty(JSContextRef ctx, JSObjectRef obj, JSStringRef prop, JSValueRef* exception) { if (!bitmapContains(prop)) { JSValueRef lazy_loaded =

Re: [webkit-dev] javascriptcore: explicitly call default getProperties function?

2008-02-27 Thread Geoffrey Garen
, Geoffrey Garen [EMAIL PROTECTED] wrote: Hi Michael. One solution would be to maintain a hash or bitmap indicating which lazy properties you had allocated so far: JSValueRef GetProperty(JSContextRef ctx, JSObjectRef obj, JSStringRef prop, JSValueRef* exception) { if (!bitmapContains(prop

Re: [webkit-dev] interested in js speed-up

2008-03-04 Thread Geoffrey Garen
Hi Akos. Any help speeding up JavaScriptCore is welcome. The current plan is: 1. Convert from an AST execution engine to a custom bytecode engine 2. Perform low-cost optimizations on the custom bytecode (e.g., simple type inference, peephole optimization, constant folding, copy propagation,

Re: [webkit-dev] interested in js speed-up

2008-03-12 Thread Geoffrey Garen
Hi Akos. Hi Geoff, thanks for the info. It seems to me that your answers cancelled my options. :) Optimizing the AST is not the best way to go since execution moves to bytecode. And designing a new bytecode is not an option anymore since you are already doing it. :) Sorry to spoil

Re: [webkit-dev] interested in js speed-up

2008-03-18 Thread Geoffrey Garen
let me ask one more question: when is this bytecode approach expected to get into the mainline of WebKit? I'm shooting for some time during this rapidly ending week :). Sorry -- before it gets into the mainline of WebKit, the bytecode engine will need more refinement and bug fixing. Maybe

Re: [webkit-dev] [ot?] JavaScript project pages at the WebKit web site

2008-04-02 Thread Geoffrey Garen
In seeing the last project listed, C Language Binding I was reminded of the JavaScript Core API that was released in Leopard. Is the list of projects at that site out-of-date relative to the latest releases of WebKit? Yes, it's a little out of date. Geoff

Re: [webkit-dev] Adding Javascript object to Webkit

2008-04-03 Thread Geoffrey Garen
Which binding should I use that would fit the architecture best? Must I understand JavaScriptCore/API in order to add the object? What is the life cycle of the Javascript objects? Yes, I think using the API in JavaScriptCore/API will give you the best results. It's also the easiest API to

Re: [webkit-dev] Re: Adding Javascript object to Webkit

2008-04-14 Thread Geoffrey Garen
Is there a way to set a timeout using this API or kill / interrupt a running wild script? No. Geoff ___ webkit-dev mailing list webkit-dev@lists.webkit.org http://lists.webkit.org/mailman/listinfo/webkit-dev

Re: [webkit-dev] click event on a tag without jscript

2008-05-26 Thread Geoffrey Garen
I want to know if it's possible to create a click event on a tag within a page without using javascript. I know the tag name. I assume you mean without using JavaScript or the mouse. Depending on the type of application you're writing, you could use the Objective-C API to the DOM.

Re: [webkit-dev] click event on a tag without jscript

2008-05-27 Thread Geoffrey Garen
Is there a way to get this Document object from a WebView object or a WebFrame object? No. The C++ components of WebCore are not API. Geoff ___ webkit-dev mailing list webkit-dev@lists.webkit.org

Re: [webkit-dev] JavaScriptCore directory reorganization

2008-06-13 Thread Geoffrey Garen
On Jun 12, 2008, at 11:25 PM, Maciej Stachowiak wrote: Now that SquirrelFish has landed, I'd like to take a look at reorganizing JavaScriptCore's files and directories a bit. JavaScriptCore has the following subdirectories: API/ VM/ docs/ icu/ kjs/ os-win32/ pcre/ profiler/ tests/

Re: [webkit-dev] JavaScriptCore directory reorganization

2008-06-13 Thread Geoffrey Garen
Do these also assume that we'd change the directory layout to match the SVN project folder layout? (That seems like a reasonably good starting point.) Yeah. Geoff ___ webkit-dev mailing list webkit-dev@lists.webkit.org

Re: [webkit-dev] renaming some things in JavaScriptCore

2008-06-13 Thread Geoffrey Garen
These look good to me. Cut down on confusing uses of Object and Imp. Should we add the JS prefix to these, too? Geoff ___ webkit-dev mailing list webkit-dev@lists.webkit.org http://lists.webkit.org/mailman/listinfo.cgi/webkit-dev

Re: [webkit-dev] renaming some things in JavaScriptCore

2008-06-16 Thread Geoffrey Garen
I like the idea. But I'm not crazy about the three WebKit namespaces being WTF, JSC, and WebCore. One of these things is not like the others! How about JSCore? We already use JS as an abbreviation for JavaScript all over the place, so JSCore seems like a natural shortening of

Re: [webkit-dev] JavaScriptCore directory rearrangement proposal

2008-06-16 Thread Geoffrey Garen
I'm not sure where to put these: ExecState.cpp (runtime or vm?) ExecState.h I like vm. Mostly, an ExecState represents the state of execution in the VM. The runtime relies on the ExecState, but I wouldn't say that the ExecState was a component of the runtime. completion.h

Re: [webkit-dev] Strange relation between script loading and call stack size

2008-07-09 Thread Geoffrey Garen
test.js I think you attached the wrong file. All I see is comments. Geoff ___ webkit-dev mailing list webkit-dev@lists.webkit.org http://lists.webkit.org/mailman/listinfo.cgi/webkit-dev

Re: [webkit-dev] Tracing the stack fragmentaion of webkit

2008-07-21 Thread Geoffrey Garen
I'm looking for a way to measure the stack usage of webkit especially then how the distribution of different size of allocated blocks. Is there any developed method yet ? Have looked at export MallocStackLogging=YES. Could I get a log to a text file where allocation and deallocation are

Re: [webkit-dev] Tracing the stack fragmentaion of webkit

2008-07-22 Thread Geoffrey Garen
With MallocStackLogging enabled, you can use the malloc_history tool. You can also use the ObjectAlloc Instrument in Instruments.app. Geoff ___ webkit-dev mailing list webkit-dev@lists.webkit.org http://lists.webkit.org/mailman/listinfo.cgi/webkit-dev

Re: [webkit-dev] Tracing the heap fragmentaion of webkit

2008-07-23 Thread Geoffrey Garen
You might also want to read http://trac.webkit.org/wiki/Memory%20Use, although that's mostly about the Mac and Windows ports. Yes, MallocStackLogging and Instruments are Mac OS X only. umdh.exe is Windows only. Geoff ___ webkit-dev mailing list

Re: [webkit-dev] Memory leaks in KJS

2008-09-04 Thread Geoffrey Garen
After rendering about 200 pages on my platform port of WebKit, I seem to be seeing some memory leaks involving the code in KJS, totalling 30-70MB. I have included a subgraph of the call graph for the leaking functions. I'm not familiar with the KJS code. Is it possible that circular

Re: [webkit-dev] setTimeout as browser speed throttle

2008-09-30 Thread Geoffrey Garen
Or there is option 3: 3) Restore the clamp for setTimeout and setInterval to 10ms for compatibility, and add a new setHighResTimer API that does not have any lower bound. I'd like to tweak this suggestion a bit: Let's make this new timer API object-oriented, so it can be both less

Re: [webkit-dev] JS binding wapper pointers: inline vs. separate hash table

2008-10-01 Thread Geoffrey Garen
In the Chrome tree, every object inheriting from RefCounted incurs an extra pointer in size, but this is clearly more than necessary since many RefCounted objects do not have bindings. If we believe that JS wrappers are relatively uncommon, we can store them in a Node's rare data

Re: [webkit-dev] JS binding wapper pointers: inline vs. separate hash table

2008-10-01 Thread Geoffrey Garen
If we believe that JS wrappers are relatively uncommon, we can store them in a Node's rare data structure, and bloat only those uncommon nodes that have JS wrappers. Depending on exactly how common they are, this could be more net memory use, if it causes Nodes to have a NodeRareData

Re: [webkit-dev] Enum naming style?

2008-10-01 Thread Geoffrey Garen
I would argue for enum Color { BrownColor }; I believe (based on recent patch reviews) that we have undocumented consensus that this style of first-letter-capitalized CamelCase is preferred for enums. I tend to agree with Peter that the Color suffix is unnecessary, but I'm not sure if

Re: [webkit-dev] Using Google-URL in WebKit

2008-10-02 Thread Geoffrey Garen
One thing I'd like to highlight: It is a requirement for Chromium to use consistent URL parsing throughout the entire application. Can you explain this requirement more? I think that's an important data point, since other WebKit ports, including the Mac port, use KURL in WebKit and a

Re: [webkit-dev] Using Google-URL in WebKit

2008-10-02 Thread Geoffrey Garen
KURL depends on WebCore types, and was found to have bugs, so Brett did a study of other URL parsers and wrote the Google URL library as a template library (and wrote GURL as an example class using it with std::string). This part I don't get. Brett found some bugs. Why didn't he fix them?

Re: [webkit-dev] High Resolution Timer API proposal(s)

2008-10-03 Thread Geoffrey Garen
Again, I'm wondering how many legitimate uses are there for short timeouts in background tabs/windows. In a background window: animation video audio work queues for database or other background processing something interesting the web hasn't invented yet To give you some context, Safari used

Re: [webkit-dev] Proposed Timer API

2008-10-03 Thread Geoffrey Garen
Hi Chris. I really like the idea of a Timer object. It would allow you to separate creation from starting, allows you to pause and add other API's to the interface. Can the constructor be used to simplify the creation: var t = new Timer(0, false, function() { ...}); which would start

Re: [webkit-dev] leak

2008-11-04 Thread Geoffrey Garen
I seen also this in cache : ~Cache(); // Not implemented to make sure nobody accidentally calls delete -- WebCore does not delete singletons. it's also to make shutdown faster ? this can create a big leak, no ? Destruction of items in the cache is not tied to the lifetime of the cache.

Re: [webkit-dev] Unforking Chromium: The Upstreaminess Dashboard

2008-11-19 Thread Geoffrey Garen
Thank you, Dimitri. I found http://build.chromium.org/merge/ very informative. Cheers, Geoff___ webkit-dev mailing list webkit-dev@lists.webkit.org http://lists.webkit.org/mailman/listinfo.cgi/webkit-dev

Re: [webkit-dev] Fwd: Using WebKit's markup as facility of Chrome's DOM serializer

2008-11-20 Thread Geoffrey Garen
Now should I file a new bug on https://bugs.webkit.org/ for improving markup, then write the patch and send to you (plus someone else I should involve) for review? Is that a right process? Yes, that's right. But you shouldn't target the patches at a specific person for review unless it's a

Re: [webkit-dev] Javascript - Protected Objects

2008-11-24 Thread Geoffrey Garen
Hi François. What are Protected Objects? Protected objects are objects that have no direct references from the stack or the JavaScript heap, but must not be destroyed by the garbage collector. Typically, they are objects that are referenced by non-GC heap-allocated storage, like the

Re: [webkit-dev] testing changes to UString/String

2009-01-12 Thread Geoffrey Garen
Hi Dave. We tend to write unit tests in HTML or JavaScript. If it's possible to trigger all of the relevant test conditions in HTML or JavaScript, I'd recommend that. The next best thing to do is to write a C++ test function, add it to WebKitTools/DumpRenderTree, and invoke it during

Re: [webkit-dev] anonymous functions have a read only .name property (should they?)

2009-01-13 Thread Geoffrey Garen
Line 43 of InternalFunction.cpp would be have the ReadOnly property removed. putDirect(globalData-propertyNames-name, jsString(globalData, name.ustring()), DontDelete | DontEnum); Currently, InternalFunction relies on the invariant that the name property is a string. If you made the

Re: [webkit-dev] Upstreaming IDL changes for the V8 bindings

2009-02-02 Thread Geoffrey Garen
I was about to upstream some patches that add #ifdefs to the WebCore IDL files. In many cases, the only delta is the removal of the Custom attribute. Eric Seidel pointed out that it might be better to rename those usages of Custom to JSCCustom to avoid #ifdefs. This change would avoid

Re: [webkit-dev] JSObjectSetProperty JSObjectHasProperty stuck in an infinite loop

2009-02-05 Thread Geoffrey Garen
Hi Laurent. The API shouldn't have any subtle dependency on kJSClassAttributeNoAutomaticPrototype. Please file a bug report @ bugs.webkit.or, and attach a source file that we can compile in order to reproduce this bug. Thanks, Geoff On Feb 4, 2009, at 1:55 PM, Laurent Calburtin wrote:

Re: [webkit-dev] JCS standalone

2009-02-20 Thread Geoffrey Garen
Hi. You can use 'make' or any of the platform-specific project files in the JavaScriptCore subdirectory. Geoff On Feb 19, 2009, at 11:52 PM, thouraya andolsi wrote: Hi all, How can i compile JSC standalone ? ( I would like to have just the jsc executable) I looked at

Re: [webkit-dev] about parse javascript function

2009-02-25 Thread Geoffrey Garen
I would like to know how to parse the js code through the function of webkit. Could you tell me the main functions and the files? JavaScriptCore/parser/Lexer.h JavaScriptCore/parser/Lexer.cpp JavaScriptCore/parser/Parser.h JavaScriptCore/parser/Parser.cpp Cheers, Geoff

Re: [webkit-dev] A question regarding to JavaScriptCore's C/C++ API.

2009-03-06 Thread Geoffrey Garen
Hi Zhe. I'm developing an application which uses webkit's JavaScriptCore and a customized global object (by providing a special class when creating the context). My customized global object provides some built-in properties that can be accessed by javascript code. Now, I want to

Re: [webkit-dev] Is it possible to get current source URL and line number from JavaScriptCore API?

2009-03-09 Thread Geoffrey Garen
I'm writing a C++ to JavaScript binding based on JavaScriptCore, and would like to know current source URL and line number information in the callback functions. However I didn't find any related API. It there any way to do it? No. Sounds like a reasonable feature request. Geoff

Re: [webkit-dev] Extending JS context for all WebFrames

2009-03-12 Thread Geoffrey Garen
Hi Ross. While I can grab the JSGlobalContext reference from a WebView's mainFrame, and subsequently use the public JS APIs to extend the underlying JS global object, I believe that subsequent WebView allocations will cause the underlying JSGlobalObject to be reinitialized forcing me to

Re: [webkit-dev] Extending JS context for all WebFrames

2009-03-12 Thread Geoffrey Garen
If I want ALL pages associated with all possible WebViews to have access to my external objects/properties, does this still not require me to reinitialize the global object (via the context reference) at each page load? Yes. What I’m trying to accomplish is to have my extended global

Re: [webkit-dev] A question regarding to JavaScriptCore's garbage collection mechanism.

2009-03-17 Thread Geoffrey Garen
This code was tested against webkit svn. Anyone can help me explain this behavior? Is it a bug of JavaScriptCore? Most likely, the conservative nature of the garbage collector prevents the function from being reclaimed in this case. You can step through JSC::Heap::collect() to see exactly

Re: [webkit-dev] constant pool space and jit

2009-03-26 Thread Geoffrey Garen
I was wondering whether it is possible to remove the constant pool area in jit. It is. RegisterFile contents right now: ... [ CallFrame ] [ Cleared const pool ] [ temporary SF registers ] ... (SF means SquirellFish) The constant pool is only used by interpreter, the jit simply clears

Re: [webkit-dev] [webkit-changes] [42699] trunk/WebCore

2009-04-21 Thread Geoffrey Garen
-EventListener* Node::getInlineEventListener(const AtomicString eventType) const +EventListener* Node::getAttributeEventListener(const AtomicString eventType) const I think that per our coding style guidelines, this function should be named attributeEventListener(): 6. Precede setters

Re: [webkit-dev] Nitro-Extreme branch

2009-05-05 Thread Geoffrey Garen
Right now, the branch is about even with trunk on SunSpider. Geoff On May 5, 2009, at 6:11 AM, Zoltan Herczeg wrote: Hi, we have noticed that there is a new SquirellFish branch, called Nitro-Extreme. You mentioned before (perhaps a year ago), that you plan to change the JSNumber format to

Re: [webkit-dev] YARR

2009-05-19 Thread Geoffrey Garen
1) Does it make sense to enable ENABLE_YARR by default and use it even when we have no JIT support. No. 2) Does the YARR JIT depend on the JSCore JIT, or is it a separate JIT. Not entirely. If so, does it work on the same platforms at the JSCore JIT? What problems are those? Geoff

Re: [webkit-dev] YARR

2009-05-19 Thread Geoffrey Garen
If so, does it work on the same platforms at the JSCore JIT? What problems are those? Oops! platforms Yes, it works on the same platforms as the JSCore JIT. Geoff ___ webkit-dev mailing list webkit-dev@lists.webkit.org

Re: [webkit-dev] arm jit

2009-06-09 Thread Geoffrey Garen
Hi Akos. Today, we realized that there is a new ARM JIT port for WebKit. (http://trac.webkit.org/changeset/44514 ) Congratulations on getting this working!, great job. Thanks. I cannot conceal how disappointed I am, as is the whole team at Szeged. I'm sorry to hear that. I understand

Re: [webkit-dev] arm jit

2009-06-10 Thread Geoffrey Garen
This expands out to 95 inline instructions on the MIPS for just the slow case alone, of which 3 are functions calls to other functions. So this probably requires thousands of clock cycles to execute. IMHO it doesn't make sense to inline op_call because: You've made some interesting

Re: [webkit-dev] arm jit

2009-06-10 Thread Geoffrey Garen
It could be worth trying a stub function that triggers the compilation of the function should it not be present, but i'm not sure what that would really save as we still need the arity checks inline A design that I like is a stub function that triggers compilation (so the caller can

Re: [webkit-dev] How to execute a JavaScript containing site with JSCore?

2009-06-11 Thread Geoffrey Garen
Hi Sebastian. JSEvaluateScript can only evaluate JavaScript; it can't parse HTML. Cheers, Geoff On Jun 10, 2009, at 10:05 PM, Sebastian Linke wrote: Hi, based on my experiences when I ran some javascript code on a webkit context, I was trying to do the same with normal html code. It may

Re: [webkit-dev] arm jit

2009-06-11 Thread Geoffrey Garen
Can the arity check be performed at compile time as in C++? C++ can perform arity checks at compile time because C++ uses early binding. JavaScript uses late binding. Geoff___ webkit-dev mailing list webkit-dev@lists.webkit.org

Re: [webkit-dev] arm jit

2009-06-11 Thread Geoffrey Garen
it looks we are in the way of the train. You have plans, we don't know about them, you have commit rights, we don't, so the tides are against us. If you're interested in review or commit rights, they're granted based on a track record of good work, good judgement, and good collaboration.

Re: [webkit-dev] Popup blocking feature

2009-06-12 Thread Geoffrey Garen
The Popup blocking feature, is that part of Webkit code space? It's mostly in WebCore (a component of WebKit). See DOMWindow::allowPopUp(). Geoff ___ webkit-dev mailing list webkit-dev@lists.webkit.org

Re: [webkit-dev] How to execute a JavaScript containing site with JSCore?

2009-06-15 Thread Geoffrey Garen
Is there a straigthforwarded way to collect all the relationships between the site's object and to get a js-context of it? What I want in the end is to get access on the `document`-element, e.g. to perform calls like `document.forms`. If you have a JSContextRef that corresponds to a

Re: [webkit-dev] Name of a JS function

2009-06-16 Thread Geoffrey Garen
Function objects have a property named name, and also a property named displayName. Geoff On Jun 16, 2009, at 3:55 AM, Zoltan Herczeg wrote: Hi, how can I extract the name of a JS function in JIT.cpp? Zoltan ___ webkit-dev mailing list

Re: [webkit-dev] MIPS port problem - cti_op_put_by_id slow case problem

2009-06-17 Thread Geoffrey Garen
If someone could be kind enough to explain how it works on other platforms, it would be very helpful. I'm not really interested in helping with the dubiously legal task of taking JavaScriptCore, which is an OpenSource library, and turning it into a closed, proprietary library.

Re: [webkit-dev] Coding convention of constants

2009-07-10 Thread Geoffrey Garen
Ditto. The last time I wondered about this, I grepped through the code and found [1] to be the most prevalent. So, in code reviews I have been recommending people do [1]. I think that's the nicest style (just like a variable, no special prefix). Let's go with that and update the coding

Re: [webkit-dev] ExecState::thisObject()

2009-07-13 Thread Geoffrey Garen
1. Is it correct for the ExecState to carry the thisValue? As Adam realized later (I think), ExecState carries the value for this inside the calling function. It does not carry the object whose property is being accessed. Geoff ___ webkit-dev

Re: [webkit-dev] ExecState::thisObject()

2009-07-13 Thread Geoffrey Garen
Our current thinking is to add a parameter to toJS() to receive the JSGlobalObject in which to create the wrapper. Seems logical. Once we do that, the question is how to find the proper JSGlobalObject at each call site. In most cases, you have another JSObject sitting around that is from

Re: [webkit-dev] ExecState::thisObject()

2009-07-13 Thread Geoffrey Garen
Is it definitely right for document.body to make a wrapper using prototypes from the document's host window, rather than from the accessing function's window? What do other browsers do? That's correct. Other browser's get this case right. Is there a particular security or other benefit

Re: [webkit-dev] ExecState::thisObject()

2009-07-13 Thread Geoffrey Garen
I'm first fixing JSCell::new subclasses to make sure they're always allocating in the correct heap. If we're to map from objects to the associated globalobject via the heap, we need to fix allocation first. I'm not sure what you guys have been meaning by the phrase correct heap. Barring

Re: [webkit-dev] ExecState::thisObject()

2009-07-13 Thread Geoffrey Garen
1. Pass a current global object through to all toJS calls (lots of callsites changed) 2. Store a current global object off of the ExecState (set by the JS engine before leaving into custom native code for property lookup or function execution). I discussed this a bit with Darin and Geoff, and

Re: [webkit-dev] ExecState::thisObject()

2009-07-13 Thread Geoffrey Garen
I discussed this a bit with Darin and Geoff, and we came to the conclusion that the correct fix is to have each JS DOMObject store a JSGlobalObject pointer and augment the toJS methods to pass a global object instead of an ExecState (close to you #1). You probably mean in addition to

Re: [webkit-dev] ExecState::thisObject()

2009-07-13 Thread Geoffrey Garen
I discussed this a bit with Darin and Geoff, and we came to the conclusion that the correct fix is to have each JS DOMObject store a JSGlobalObject pointer and augment the toJS methods to pass a global object instead of an ExecState (close to you #1). There are classes in JavaScriptCore

Re: [webkit-dev] ExecState::thisObject()

2009-07-13 Thread Geoffrey Garen
Is there a particular security or other benefit here, or do we just want to make this change to match other browsers? Our current behavior is buggy, unpredictable, and out of spec. This has led to security bugs in the past and will lead to security bugs in the future. I don't disagree with

Re: [webkit-dev] ExecState::thisObject()

2009-07-13 Thread Geoffrey Garen
I discussed this a bit with Darin and Geoff, and we came to the conclusion that the correct fix is to have each JS DOMObject store a JSGlobalObject pointer and augment the toJS methods to pass a global object instead of an ExecState (close to you #1). I would not advocate storing more

Re: [webkit-dev] ExecState::thisObject()

2009-07-13 Thread Geoffrey Garen
Which spec did you have in mind? I'd like to read it. Essentially, the ECMAScript spec requires this. In spec-land, these objects are all created at the beginning of time. The fact that we create them lazily is what leads to this bug. Depending on who touches them first, they end up with

Re: [webkit-dev] ExecState::thisObject()

2009-07-13 Thread Geoffrey Garen
Yep... My guess is that (a) is probably better, but you two are more expert on why we use lazy construction. Heh -- lazy construction in JSC is even older than I am! :) The goal is to reduce memory use and startup cost in cases where certain functions aren't used. I'm not sure how much of a

Re: [webkit-dev] ExecState::thisObject()

2009-07-13 Thread Geoffrey Garen
Consider this case, which does not involve a DOM object: frames[0].Array.prototype.push.__proto__ == Array.prototype.push.__proto__ Built-in classes work somewhat differently. I believe they use the calling function's global object (lexical global object) rather than having some notion

Re: [webkit-dev] ExecState::thisObject()

2009-07-14 Thread Geoffrey Garen
That's correct. Other browser's get this case right. Here are a couple test cases you might find interesting: http://webblaze.org/abarth/tests/protoconfused/test1.html http://webblaze.org/abarth/tests/protoconfused/test2.html I tried these tests, with mixed results: IE8: Exception thrown

Re: [webkit-dev] ExecState::thisObject()

2009-07-14 Thread Geoffrey Garen
Also, once we've established the model, we'll need to propose it to some standards body -- probably HTML5. I believe the correct spec to describe this behavior is WebIDL, which controls how the abstract DOM interfaces are realized in ECMAScript. Sounds good. Geoff

Re: [webkit-dev] JS: Getter/Setter callbacks at Property level

2009-07-20 Thread Geoffrey Garen
Hi Brian. I don't understand the distinction you're drawing between the property level and the object level. Can you explain what those mean and give an example of each? Thanks, Geoff On Jul 20, 2009, at 9:14 AM, Brian Barnes wrote: I was getting ready to try the first move from

Re: [webkit-dev] JS: Getter/Setter callbacks at Property level

2009-07-20 Thread Geoffrey Garen
(green) if (name == 'blue') return(blue) } And property level, we'd have 3 getters: void getMyObjectRed(...) { return(red); } void getMyObjectGreen(...) { return(green); } void getMyObjectBlue(...) { return(blue); } [] Brian Geoffrey Garen wrote: Hi Brian. I don't understand the distinction

Re: [webkit-dev] JS: Getter/Setter callbacks at Property level

2009-07-20 Thread Geoffrey Garen
I'm not sure you get exactly what I'm saying as you put class in places where I'd expect property. For instance: I looked briefly, and it seems like it would be relatively easy to add an API for adding C getters and setters to a class individually. So, that seems like a reasonable

Re: [webkit-dev] JS: Getter/Setter callbacks at Property level

2009-07-20 Thread Geoffrey Garen
How about separate call backs at the class level? That would solve my problem with minimal code movement. Something like: JSClassSetPropertyGetterSetter (ctx,class,red,myRedGetter,myRedSetter); Would that be more within the design? Yes. That's what I had in mind when I mentioned an API

Re: [webkit-dev] JS: Getter/Setter callbacks at Property level

2009-07-22 Thread Geoffrey Garen
Sure! Geoff On Jul 20, 2009, at 3:51 PM, Brian Barnes wrote: What should be my next step, here? Submit a bug for this? [] Brian On Jul 20, 2009, at 6:05 PM, Geoffrey Garen wrote: How about separate call backs at the class level? That would solve my problem with minimal code movement

Re: [webkit-dev] Proposal about integer types used in WebKit

2009-07-24 Thread Geoffrey Garen
Am I missing something? Is there some real benefit to using types like int32_t instead of int in some places in our code and not others? If so, what are these critical places and what makes them different from the rest of the code? In JavaScriptCore, some structures have integer members

Re: [webkit-dev] Proposal about integer types used in WebKit

2009-07-24 Thread Geoffrey Garen
In JavaScriptCore, some structures have integer members that must be 32bits in size, regardless of processor type. In those places, int32_t and uint32_t are useful. Less clear to me is whether clients of such structures should also use int32_t / uint32_t. For example: struct { int32_t i;

[webkit-dev] r45939 broke my workflow

2009-08-21 Thread Geoffrey Garen
Hi. r45939 broke my workflow. Here's the related bugzilla bug: https://bugs.webkit.org/show_bug.cgi?id=26999 . Old Roll out a patch workflow: cd JavaScriptCore svn-create-patch patch.txt svn-unapply patch.txt Old Roll in a patch workflow: cd JavaScriptCore svn-apply patch.txt These old

Re: [webkit-dev] I *HATE* CHANGELOGS!!!

2009-08-26 Thread Geoffrey Garen
Detailed descriptions, bug links, test instructions, and a link back to the entire original review history are all part of Chromium commits, yet we don't use ChangeLogs. I think discipline about what to include + tooling to support it are orthogonal to a project's use of a ChangeLog as

Re: [webkit-dev] Qtish API for JavaScriptCore

2009-08-27 Thread Geoffrey Garen
Hi Simon. What about functionality where the C API would slow down the C++ API but the internal JSC API is stable enough/good enough? If there are such areas, and they turn out to be substantial, we should look at speeding them up, for the benefit of all clients of the C API. I can

Re: [webkit-dev] New marking model for GC collected objects

2009-09-01 Thread Geoffrey Garen
Hi Zoltan. JSWrapperObject::markChildren is responsible for marking the internalValue of a DateInstance. Is that function not being called? Geoff On Sep 1, 2009, at 6:16 AM, Zoltan Herczeg wrote: Hi Oliver, it seems on ARM using WTF_USE_JSVALUE32, the internal value of a date object is

Re: [webkit-dev] unwritten rules of webkit style

2009-09-02 Thread Geoffrey Garen
Comments should look like sentences by beginning with a capital and ending with a period (punctation). I think this is a generally good recommendation, but sometimes a sentence fragment makes for a better comment, e.g.: if (x == y) // false for NaN Don't add explicit line breaks in the

Re: [webkit-dev] Back/forward cache for pages with unload handlers

2009-09-16 Thread Geoffrey Garen
Given some of our (Chromium-team) recent investigation into the contents of unload handlers, I'm not sure how much this move will help users, even if you don't revert it. Lots of unload handlers busy-wait while doing async XHR in order to try to guarantee delivery of tracking pings.

Re: [webkit-dev] Limiting slow unload handlers (Re: Back/forward cache for pages with unload handlers)

2009-09-16 Thread Geoffrey Garen
The better option, as Adam noted on the bug, is one in which the JS engine itself measures how much work has been performed. A count of instructions or function calls is a truer measure than the proposed count of time checks, but imposes costs on the JS engine that the V8 team have argued

  1   2   3   4   >