binding: Fixes the fallback mechanism of Document's named properties.
The old implementation only works for
a) there is a hidden prototype, and documentWrapper->GetPrototype()
actually returns itself, or
b) fallbacked attributes are data-type properties.
Since we made attributes be accessor-type properties _and_ removed
the hidden prototype, the old implementation no longer works.
Fixed the issue using V8's GetRealNamedPropertyInPrototypeChain().
354e3ac...
by
Sigbjorn Finne <email address hidden>
Lock CrossThreadPersistentRegion until end of weak processing.
Allocating & releasing a CrossThread(Weak)Persistent is something that
all threads are currently allowed, even those not attached to Oilpan and
having no heap of their own. It is however not safe for the set of
CrossThreadPersistents to be altered while a garbage collection is
underway.
Not just while the set of registered persistents are being marked and
traced, but up until and including the processing of weak (persistent)
references that happen after marking. If not, a thread would be able to
release a CrossThreadWeakPersistent node which the weak processing separately
maintains a pointer to, clearing & freeing its allocation. Which would
cause havoc, hence we impose a lock on CrossThreadPersistentRegion while
the marking and global weak processing is being performed -- any thread
attempting to create or free cross-thread persistents will be locked out
for the duration.
Following r396432, the use of CrossThreadPersistents from non-attached threads
has been reduced greatly and is slight.
da0e944...
by
Sigbjorn Finne <email address hidden>
Move MainThreadTaskRunner off Oilpan heap to simplify posting.
Having the Document's MainThreadTaskRunner on the Oilpan heap
is preferable for three reasons:
- Correctly accounts for the MainThreadTaskRunner::m_context
back reference, by having it be traced Member<>.
- The MainThreadTaskRunner must not perform tasks when
it (and the Document) is in the process of being swept.
By having the posted tasks keep a weak persistent reference
to MainThreadTaskRunner, the Oilpan GC will ensure that
the weak references will be cleared once MainThreadTaskRunner
has been deemed garbage.
- Similarly for the timer-initiated running of a
MainThreadTaskRunner's pending tasks. The Timer<> abstraction
takes care of not firing a timer if its owner is an
Oilpan heap object that's about to be swept.
But it is not without downsides:
- A CrossThreadWeakPersistent<> has to be created for every
task closure posted to the main thread, and copying that
persistent reference around while creating the closure,
something that is not without overhead.
- Threads not attached to Oilpan needing to post tasks to
the main thread will have to create these persistents also.
Having that happen when a GC is in progress is hard to support,
as it risks introducing and removing persistent heap references
in ways that interfere with the GC processing the heap.
The latter point is sufficient reason not to require the
allocation of CrossThreadWeakPersistent<>s when posting main
thread tasks, hence MainThreadTaskRunner is moved off the
Oilpan heap. By doing so, the benefits above that the Oilpan GC
infrastructure provided "for free" have to be taken care of
manually. C'est la vie.
46829e2...
by
"<email address hidden>" <email address hidden>
Guard against invalid glyph shaping results
HarfBuzz can fail to shape all glyphs and will return a shape result
shorter than the text length along with debug warnings:
[ERROR:HarfBuzzShaper.cpp(375)] HarfBuzz returned empty glyph buffer after shaping.
[ERROR:HarfBuzzShaper.cpp(672)] Shape result extraction failed.
This patch fixes an SVG crash on the U+180E Mongolian vowel separator
by ensuring CachingWordShaper::individualCharacterRanges returns a
vector as long as the text run length. A DCHECK and test have been added
to protect against this crash in the future.