Last Comment Bug 554691 - js_RegisterCloseableIterator uses a runtime-wide lock
: js_RegisterCloseableIterator uses a runtime-wide lock
Status: RESOLVED FIXED
:
Product: Core
Classification: Components
Component: JavaScript Engine (show other bugs)
: Trunk
: x86 Mac OS X
: -- normal (vote)
: mozilla11
Assigned To: AWAY Tom Schuster [:evilpie]
:
:
Mentors:
Depends on: 554866
Blocks:
  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:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


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

Description 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.

JS_LOCK_GC(rt);
ok = rt->gcIteratorTable.append(obj);
JS_UNLOCK_GC(rt);
Comment 1 Robert Sayre 2010-03-24 11:37:38 PDT
iirc this is because workers can migrate from thread to thread. ack!
Comment 2 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 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!

/be
Comment 4 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 AWAY 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 AWAY Tom Schuster [:evilpie] 2011-11-24 13:02:43 PST
Created attachment 576822 [details] [diff] [review]
rm
Comment 7 :Ms2ger (⌚ UTC+1/+2) 2011-11-24 13:05:42 PST
Comment on attachment 576822 [details] [diff] [review]
rm

I bet nobody will mind... rs=me
Comment 8 AWAY Tom Schuster [:evilpie] 2011-11-26 09:57:20 PST
http://hg.mozilla.org/integration/mozilla-inbound/rev/05453377527a
Comment 9 Marco Bonardo [::mak] 2011-11-28 05:19:53 PST
https://hg.mozilla.org/mozilla-central/rev/05453377527a

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