JSC::SourceProvider provides an ID to identify scripts. This ID is simply this cast to an intptr_t. If SourceProvider is freed another one can be allocated in the same location and cause the same ID to be reported to the Debugger. I am able to get the same SourceProvider ID on apple.com by reloading a few times. The IDs a reused during the same page load, so it can really confuse the Inspector given that we use these IDs to identify scripts (especially scripts without URLs.) Either someone needs to retain the SourceProvider (maybe ScriptDebugListener::Script?) so the ID can't be reused or SourceProvider needs a new thread safe unique ID assigned when SourceProvider is created. <rdar://problem/12517297>
Retaining SourceProvider will eat more memory since ScriptDebugListener::Script already duplicates the data provided by SourceProvider. Unless we make ScriptDebugListener::Script be a shell for SourceProvider.
We could also have JSC provide a UUID instead of a pointer.
Yeah, that was option two I mentioned in the description: "or SourceProvider needs a new thread safe unique ID assigned when SourceProvider is created."
I am positive this is a regression. I'm seeing the error all the time now when I didn't at all in Safari 6.
(In reply to comment #4) > I am positive this is a regression. I'm seeing the error all the time now when I didn't at all in Safari 6. What do you mean by thread safe? Same source on different threads needs to provide different ID?
(In reply to comment #5) > (In reply to comment #4) > > I am positive this is a regression. I'm seeing the error all the time now when I didn't at all in Safari 6. > > What do you mean by thread safe? Same source on different threads needs to provide different ID? Same source on different threads should get the same ID. I just meant something more than a global counter.
(In reply to comment #6) > (In reply to comment #5) > > (In reply to comment #4) > > > I am positive this is a regression. I'm seeing the error all the time now when I didn't at all in Safari 6. > > > > What do you mean by thread safe? Same source on different threads needs to provide different ID? > > Same source on different threads should get the same ID. I just meant something more than a global counter. Why would a global counter be insufficient? 2^31 (or 2^63) ids should be more than enough.
If there isn't an issue with two threads grabbing the same ID, then nothing.
Created attachment 190388 [details] Patch
Committed r144122: <http://trac.webkit.org/changeset/144122>
Broke windows build: http://build.webkit.org/builders/Apple%20Win%20Release%20%28Build%29/builds/44992/steps/compile-webkit/logs/stdio