Last Comment Bug 554691 - js_RegisterCloseableIterator uses a runtime-wide lock
: js_RegisterCloseableIterator uses a runtime-wide lock
Product: Core
Classification: Components
Component: JavaScript Engine (show other bugs)
: Trunk
: x86 Mac OS X
-- normal (vote)
: mozilla11
Assigned To: Tom Schuster [:evilpie]
: Jason Orendorff [:jorendorff]
Depends on: 554866
  Show dependency treegraph
Reported: 2010-03-24 11:24 PDT by Andreas Gal :gal
Modified: 2011-11-28 05:19 PST (History)
7 users (show)
See Also:
Crash Signature:
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---

rm (711 bytes, patch)
2011-11-24 13:02 PST, Tom Schuster [:evilpie]
Ms2ger: review+
Details | Diff | Splinter Review

Description User image Andreas Gal :gal 2010-03-24 11:24:57 PDT
This hits every for-in loop, and is horribly slow. This should be per-thread.

ok = rt->gcIteratorTable.append(obj);
Comment 1 User image Robert Sayre 2010-03-24 11:37:38 PDT
iirc this is because workers can migrate from thread to thread. ack!
Comment 2 User image Mike Shaver (:shaver -- probably not reading bugmail closely) 2010-03-24 11:42:26 PDT
When that happens, they can move their iterators into an expensive runtime thing and flag them so that we remove from the expensive runtime thing later.

(Are threads really that expensive that we can't have one per worker?  I guess it's a lot of non-pageable memory on some systems.)
Comment 3 User image Brendan Eich [:brendan] 2010-03-24 12:05:01 PDT
I think we can get rid of this table altogether with some work on iteration. Don't panic!

Comment 4 User image Igor Bukanov 2010-03-25 01:33:22 PDT
(In reply to comment #1)
> iirc this is because workers can migrate from thread to thread. ack!

Yes, this is indeed the case. I should have filed a bug to support migration of JSThread to another native thread long time ago. But it is better late than never, bug 554866.
Comment 5 User image Tom Schuster [:evilpie] 2011-11-24 13:00:52 PST
Okay this function was removed, but not the definition in jsgc.h oO
Comment 6 User image Tom Schuster [:evilpie] 2011-11-24 13:02:43 PST
Created attachment 576822 [details] [diff] [review]
Comment 7 User image :Ms2ger (⌚ UTC+1/+2) 2011-11-24 13:05:42 PST
Comment on attachment 576822 [details] [diff] [review]

I bet nobody will mind... rs=me
Comment 9 User image Marco Bonardo [::mak] 2011-11-28 05:19:53 PST

Note You need to log in before you can comment on or make changes to this bug.