Commit Graph

61975 Commits

Author SHA1 Message Date
Jan de Mooij
9ca8ef689e Bug 1425626 - Properly allow overrecursion in bug1416727.js jit-test. r=me 2018-03-10 12:27:27 +01:00
Noemi Erli
78a06363c0 Merge inbound to mozilla-central. a=merge 2018-03-10 11:58:34 +02:00
Jim Blandy
e7011b7542 Bug 1438121: Final Part 6: Omitted doc fix requested in review. DONTBUILD r=fitzgen
MozReview-Commit-ID: FXQM85VAnfA
2018-03-09 11:40:46 -08:00
Jim Blandy
5c516c2087 Bug 1438121: Final Part 5: Remove meaningless 'const' this qualifier from LiveSavedFrameCache::FramePtr::SetHasCachedMatcher::match. r=fitzgen
MozReview-Commit-ID: kfcTilDEwK
2018-03-02 23:39:15 -08:00
Jim Blandy
f9d83b4adf Bug 1438121: Final Part 4: Doc fixes for LiveSavedFrameCache. DONTBUILD r=fitzgen
MozReview-Commit-ID: 5672uZ4pC2E
2018-03-01 23:22:02 -08:00
Jim Blandy
8ee7594cd8 Bug 1438121: Final Part 3: Make LiveSavedFrameCache::find pop invalid entries as part of the search. r=fitzgen
Rather than searching from the beginning (old end) of the cache,
LiveSameFrameCache::find can search from the young end of the cache, popping
invalid stack entries as it goes.

This means that the number of entries searched is related to the number of
cached frames popped since the last stack capture, not the total number of
entries in the cache.

This also removes the need for iterators, iterator arithmetic, or any random
access to the stack; the function simply uses the vector's 'back', 'popBack',
'empty', and 'clear' methods.

MozReview-Commit-ID: DCFt0uhiqql
2018-03-01 23:14:45 -08:00
Ted Campbell
533e391c26 Bug 1408673 - Update EnvironmentObject comments for Gecko r=kmag
MozReview-Commit-ID: AIt3eQ33k7m
2018-03-09 14:32:41 -05:00
Jim Blandy
9b7ee6ff6a Bug 1438121: Final Part 2: Fix interaction between async parents and the LiveSavedFrameCache in SavedStacks::insertFrames. r=fitzgen
When capturing frames in an activation that had both 1) an async parent stack
established by AutoSetAsyncStackForNewCalls and 2) SavedFrames cached in the
activation's LiveSavedFramesCache, SavedStacks::insertFrames would supplant the
SavedFrame chain from the cache with the async parent stack, causing frames to
be dropped.

The code also looked for frames in the wrong activation's LiveSavedFramesCache.

The code assumed that only the parent of a frame whose hasCachedSavedFrame flag
is set could be retrieved from the cache; this was pessimistic, as we can
compare the cached and actual pc's, and potentially provide cache hits for the
youngest frame with a flag set.

MozReview-Commit-ID: 8tXTI43pjYr
2018-02-24 15:39:43 -08:00
Jim Blandy
0aada49f77 Bug 1438121: Final Part 1: Change JS::CopyAsyncStack's maxFrameCount to be a Maybe, and use that type throughout. r=tromey
I botched another patch in this series because I was confused about when zero
meant "no limit" and when it actually just meant zero, so I figured I'd fix this.

MozReview-Commit-ID: 5vgzKGSKL8F
2018-03-06 21:52:31 -08:00
Ciure Andrei
8f785ed451 Backed out 3 changesets (bug 1435360) for Android XPCShel failures a=backout on a CLOSED TREE
Backed out changeset e2a6bd47f697 (bug 1435360)
Backed out changeset 8cdf945be534 (bug 1435360)
Backed out changeset a463d224c412 (bug 1435360)
2018-03-10 02:35:41 +02:00
Ciure Andrei
acdb6f7537 Backed out 2 changesets (bug 1439026) for webreftest css/CSS2/borders/border-top-width-080.xht failures a=backout on a CLOSED TREE
Backed out changeset 7e197166f04e (bug 1439026)
Backed out changeset 39d03fed10fb (bug 1439026)
2018-03-10 02:31:43 +02:00
Jason Orendorff
c31d6f8574 Bug 1439026 - Part 4: jsbool* -> builtin/Boolean*. r=jandem. 2018-02-24 10:31:29 -06:00
Jason Orendorff
8aacb4a261 Bug 1439026 - Part 3: jsarray* -> builtin/Array*. r=jandem. 2018-02-24 10:26:24 -06:00
Luke Wagner
02b723635d Bug 1435360 - Baldr: jit::EnsureAsyncInterrupt() shouldn't cause JSRuntime failure if there is no async interrupt support on CLOSED TREE (r=me) 2018-03-09 14:56:44 -06:00
Aaron Klotz
80667757cd Bug 1444494: Initialize DllServices in XPCShell; r=jimm 2018-03-09 12:56:33 -07:00
Benjamin Bouvier
0e588134c2 Bug 1442656: Implement wasm testing functionalty for two-tiered compilation; r=luke 2018-03-09 16:13:23 +01:00
Dorel Luca
b6bf33a37c Merge mozilla-central to mozilla-inbound. a=merge 2018-03-09 12:01:54 +02:00
Csoregi Natalia
ce741e1fa8 Merge mozilla-central to autoland. a=merge CLOSED TREE 2018-03-09 02:19:49 +02:00
Nicolas B. Pierron
8dc9ad49be Bug 1444081 - Shutdown the Parent JSRuntime instead of leaking it. r=fitzgen 2018-03-08 17:28:37 +00:00
Jason Orendorff
8470fb40b8 Bug 1439026 - Part 2: Move the most basic text-processing routines to util/Text.cpp. r=jandem.
Many operations on strings are also moved from builtin/String.cpp to vm/StringType.cpp.
2018-02-24 07:33:57 -06:00
Jason Orendorff
914b318dd5 Bug 1439026 - Part 1: Rename jsstr* -> builtin/String*. r=jandem.
Also:
vm/StringBuffer.h -> util/
vm/Unicode* -> util/
vm/make_unicode.py -> util/
vm/String* -> vm/StringType*
2018-02-24 08:55:13 -06:00
Dragan Mladjenovic
a7038afdbd Bug 1443727 : [MIPS] Fix miscellaneous build warnings r=bbouvier 2018-03-06 23:13:00 +02:00
Jan de Mooij
95bd7d2f40 Bug 1425580 part 19 - Remove LNode::numSuccessors_. r=nbp 2018-03-08 11:10:51 +01:00
Jan de Mooij
8f25cdf5c6 Bug 1425580 part 18 - Assert LIR instructions are non-virtual. r=nbp 2018-03-08 11:10:50 +01:00
Jan de Mooij
a5f8f24229 Bug 1425580 part 17 - Devirtualize LNode::op. r=nbp 2018-03-08 11:10:50 +01:00
Jan de Mooij
a79ec4f619 Bug 1425580 part 16 - Devirtualize LInstruction::getOperand. r=nbp 2018-03-08 11:10:50 +01:00
Jan de Mooij
6770985831 Bug 1425580 part 15 - Move virtual LNode::getOperand to LInstruction, devirtualize LPhi::getOperand. r=nbp 2018-03-08 11:10:50 +01:00
Jim Blandy
13633b577b Bug 1443592: Part 7: Use jit::CommonFrameLayout to store the hasCachedSavedFrame flag for Baseline frames. r=jandem
A jit::BaselineFrame is followed in memory by a jit::JitFrameLayout; as the
stack grows downwards, the JitFrameLayout is pushed first, "followed" by the
BaselineFrame at lower addresses, and finally by locals and the operand stack.

A BaselineFrame* points, naturally, at the BaselineFrame structure, but we use
the address of the JitFrameLayout as the address for a physical Ion frame -
actually, a pointer to its base class, jit::CommonFrameLayout. This means that,
if OSR replaces a BaselineFrame with an Ion frame, then walking the stack with a
FrameIter will see an Ion frame where a BaselineFrame used to appear, and the
LiveSavedFrameCache::FramePtr we'll construct from that FrameIter will be
different.

If the LiveSavedFrameCache wants to assert that frames with their bits set
indeed appear in the cache, then we'd better clear the flag whenever we OSR the
frame. But this is a pity; it's still the same frame, representing the same
function activation.

Meanwhile, both BaselineFrame and CommonFrameLayout have their own
hasCachedSavedFrame flags, which is confusing.

This patch changes FramePtr to use a jit::CommonFrameLayout* for both Baseline
frames and physical Ion frames, so OSR does not change the frame's address, and
use CommonFrameLayout's hasCachedSavedFrame flag for both types, so that OSR
need not take any explicit steps to propagate the cached flag to the new frame.

MozReview-Commit-ID: rOMjUXlwIQ
2018-03-06 14:55:28 -08:00
Jim Blandy
5acf8b9995 Bug 1443592: Part 6: Remove hasCachedSavedFrame accessors from AbstractFramePtr. r=fitzgen
Some variants of AbstractFramePtr have a cached saved frame flag, and others
don't, but the whole point of LiveSavedFrameCache::FramePtr is that it
represents a frame that does have a flag.

Rather than one variant of FramePtr that is an AbstractFramePtr (restricted to
certain variants), flatten out the two enums into one, and make FramePtr the
sole authority on which sorts of frames we have, and how to access their flags.

This means there is no need for hasCachedSavedFrame accessors on
AbstractFramePtr, just on the individual concrete frame types.

MozReview-Commit-ID: BRVdfqOqBsG
2018-03-06 13:51:13 -08:00
Jim Blandy
b69234f990 Bug 1443592: Part 5: Move LiveSavedFrameCache::getFramePtr to FramePtr::create. r=fitzgen
MozReview-Commit-ID: EZHdkBeMGnm
2018-03-06 13:33:52 -08:00
Jim Blandy
1521c66405 Bug 1443592: Part 4: Enable saved frame caching for wasm debug frames. r=jandem
MozReview-Commit-ID: 623CUCku6S1
2018-03-06 13:13:39 -08:00
Jim Blandy
05c5824b2b Bug 1443592: Part 3: Change LiveSavedFrameCache::find to take a FramePtr, not a FrameIter. r=fitzgen
This obviates dynamic checks in find about the state of the iterator, since
they're covered by the fact that we were able to obtain a FramePtr at all.

This does mean that we have to pass the pc separately. But that's symmetrical
with the insert method, so it's okay.

MozReview-Commit-ID: FgsDjHB2il4
2018-03-06 11:42:36 -08:00
Jim Blandy
7de98c7812 Bug 1443592: Part 2: Move hasCachedSavedFrame flag access from FrameIter to LiveSavedFrameCache::FramePtr. r=fitzgen
Instead of using FrameIter::hasCachedSavedFrame, the code should instead try to
construct a FramePtr via LiveSavedFrameCache::getFramePtr, which returns a
Maybe<FramePtr>. If that is Some, then we know the frame at hand actually has a
flag, and we can test and set it.

Since the existing FrameIter::hasCachedSavedFrame screens out all wasm frames,
we change LiveSavedFrameCache::getFramePtr to do the same. However, the existing
behavior was incorrect, since wasm::DebugFrame does carry the flag; we'll fix
that in a later patch.

FrameIter::hasCachedSavedFrame asserted that jsJitFrame().isIonScripted(); this
is tested by isPhysicalIonFrame(), so that case is already covered.

MozReview-Commit-ID: 92wCc71s4nU
2018-03-06 11:28:53 -08:00
Jim Blandy
ccc4039f15 Bug 1443592: Part 1: Introduce opaque LiveSavedFrameCache::Key type for cache keys. r=fitzgen
By design, the LiveSavedFrameCache holds the addresses of both live and dead
stack frames. This change wraps those addresses in an opaque type that can only
be compared for equality with other such values, and provides no interface to
retrieve the underlying pointer, ensuring statically that we will not
accidentally use a cache key to access memory.

MozReview-Commit-ID: 9Wom5gFVQls
2018-03-05 18:03:56 -08:00
Matt Brubeck
f7df02b409 Bug 1444097 - Clean up env_logger dependencies. r=ted
For the "js" crate, disable the "regex" feature to reduce binary size.

For the "u2fhid" crate, it's used only in examples. Make it a dev-dependency
so it won't be part of the Firefox build.

MozReview-Commit-ID: DY9indMqrRw
2018-03-08 07:35:11 -08:00
Jan de Mooij
7ca818aeb5 Bug 1441012 - Don't attempt to inline scripts we know Ion cannot compile. r=nbp 2018-03-07 16:51:45 +01:00
Jason Orendorff
95136da395 Bug 1443147 - Fix PosixNSPR build after bug 1441454. r=sfink 2018-03-05 17:10:05 -06:00
Philip Chimento
cdf8a0e12b Bug 1430438 - Allow reference counted data in JS_NewArrayBufferWithContents(). r=sfink 2018-02-22 21:03:00 -08:00
Jim Blandy
1d92fb0d5a Bug 1438121: Part 13: Make LiveSavedFrameCache::Entry's members const. r=fitzgen
MozReview-Commit-ID: GbJhE9nylaa
2018-03-02 23:56:26 -08:00
Kannan Vijayan
699e30a488 Bug 1411415 - r=bz r=fitzgen 2018-03-05 19:27:02 -05:00
Jim Blandy
cc0ebcd312 Bug 1438121: Part 3: Add shell tests for implicit async stacks. r=fitzgen
MozReview-Commit-ID: BfPPrvEGSgg
2018-02-25 16:22:32 -08:00
Jim Blandy
81228ebf9c Bug 1438121: Part 2: Define the 'bindToAsyncStack' JS shell testing function. r=fitzgen
See JS_FN documentation for details.

MozReview-Commit-ID: 6WUaGfdwogX
2018-02-25 15:43:20 -08:00
Jim Blandy
2fd83833e8 Bug 1438121: Part 1: Add job dispatch primitive to shell. r=fitzgen
See JS_FN documentation for details.

MozReview-Commit-ID: 8ZLyOX85qqh
2018-02-25 14:06:05 -08:00
Jim Blandy
23c971ab10 Bug 1438121: Part 5: Don't propagate the 'hasCachedSavedFrame_' bit from the RematerializedFrame to the BaselineFrame. r=fitzgen
When capturing the JavaScript stack as a chain of SavedFrames, the
hasCachedSavedFrame flag on a frame indicates that the frame has an entry in
the LiveSavedFrameCache, which may hand us the SavedFrame for a previously
captured remainder of the stack, letting us stop the stack walk early.

The LiveSavedFrameCache uses AbstractFramePtr and jit::CommonFrameLayout* values
as keys. A RematerializedFrame uses an AbstractFramePtr as its key, but the
BaselineFrame we build from it has a jit::CommonFrameLayout* as its key; the two
keys are unequal. It's valuable to be able to assert that, if a frame has its
hasCachedSavedFrame flag set, then it must have an entry in the cache; to allow
that, converting a RematerializedFrame to a BaselineFrame must clear the flag,
since the BaselineFrame's key is not present.

We could instead fix up the cache entry's key, and carry over the flag, but it's
simpler to just let the cache get repopulated as needed.

MozReview-Commit-ID: 612daDJ1R4w
2018-02-23 22:28:56 -08:00
Jim Blandy
da632e8986 Bug 1438121: Part 12: Make LiveSavedFrameCache::getFramePtr's parameter const. r=fitzgen
MozReview-Commit-ID: K4JAFidKNzJ
2018-03-02 00:05:27 -08:00
Jim Blandy
b992092e47 Bug 1438121: Part 8: AutoSetAsyncStackForNewCalls doc fix. DONTBUILD r=fitzgen
MozReview-Commit-ID: JwIM2EAmPZY
2018-02-25 23:33:54 -08:00
Jim Blandy
2c417c22a9 Bug 1438121: Part 6: Improve comments for js::LiveSavedFrameCache. DONTBUILD r=fitzgen
MozReview-Commit-ID: C4W5cgwdNtv
2018-02-24 13:57:41 -08:00
Cosmin Sabou
0a2e53e2e7 Backed out 4 changesets (bug 1437167) for build bustages on nsUpdateDriver.cpp and WindowsMessageLoop.cpp on a CLOSED TREE.
Backed out changeset b98740e7c639 (bug 1437167)
Backed out changeset 4476e8f51fa6 (bug 1437167)
Backed out changeset c79dc40faa41 (bug 1437167)
Backed out changeset b608d2dcbb86 (bug 1437167)
2018-03-06 00:09:46 +02:00
Jim Blandy
32dcf742da Bug 1437733: Merge JSFunction::u::wasm with other members. r=bbouvier
In JSFunction, u.wasm.native_ member must have the same type and offset as
u.native.func_. This is better accomplished by simply using func_ for both.

Further, u.wasm.jitEntry_ must alias u.native.extra.asmJSFuncIndex_. This is
better accomplished simply by making them both members of the same union.

This leaves u.wasm empty, so it can be deleted. Two static assertions about
member offsets can be removed.

MozReview-Commit-ID: 8ukNaFysWvD
2018-02-12 17:55:22 -08:00
Emilio Cobos Álvarez
4f45a851fa Bug 1444679: Remove WrappedJSIdentity. r=bholley
Seemed to only be used for the method that was removed in the previous patch.

MozReview-Commit-ID: 1cKpVBlxa7r
2018-03-11 03:13:47 +01:00