Граф коммитов

441 Коммитов

Автор SHA1 Сообщение Дата
Jeff Walden c7bc4f2846 Bug 1663365 - Don't include "js/friend/ErrorMessages.h" in jsfriendapi.h. r=arai
Differential Revision: https://phabricator.services.mozilla.com/D95208
2020-10-30 06:33:56 +00:00
Ricky Stewart 02a7b4ebdf Bug 1654103: Standardize on Black for Python code in `mozilla-central`.
Allow-list all Python code in tree for use with the black linter, and re-format all code in-tree accordingly.

To produce this patch I did all of the following:

1. Make changes to tools/lint/black.yml to remove include: stanza and update list of source extensions.

2. Run ./mach lint --linter black --fix

3. Make some ad-hoc manual updates to python/mozbuild/mozbuild/test/configure/test_configure.py -- it has some hard-coded line numbers that the reformat breaks.

4. Make some ad-hoc manual updates to `testing/marionette/client/setup.py`, `testing/marionette/harness/setup.py`, and `testing/firefox-ui/harness/setup.py`, which have hard-coded regexes that break after the reformat.

5. Add a set of exclusions to black.yml. These will be deleted in a follow-up bug (1672023).

# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D94045
2020-10-26 18:34:53 +00:00
Bogdan Tara da1098d4aa Backed out 10 changesets (bug 1654103, bug 1672023, bug 1518999) for PanZoomControllerTest.touchEventForResult gv-junit failures CLOSED TREE
Backed out changeset ff3fb0b4a512 (bug 1672023)
Backed out changeset e7834b600201 (bug 1654103)
Backed out changeset 807893ca8069 (bug 1518999)
Backed out changeset 13e6b92440e9 (bug 1518999)
Backed out changeset 8b2ac5a6c98a (bug 1518999)
Backed out changeset 575748295752 (bug 1518999)
Backed out changeset 65f07ce7b39b (bug 1518999)
Backed out changeset 4bb80556158d (bug 1518999)
Backed out changeset 8ac8461d7bd7 (bug 1518999)
Backed out changeset e8ba13ee17f5 (bug 1518999)
2020-10-24 03:36:18 +03:00
Ricky Stewart c0cea3b0fa Bug 1654103: Standardize on Black for Python code in `mozilla-central`. r=remote-protocol-reviewers,marionette-reviewers,webdriver-reviewers,perftest-reviewers,devtools-backward-compat-reviewers,jgilbert,preferences-reviewers,sylvestre,maja_zf,webcompat-reviewers,denschub,ntim,whimboo,sparky
Allow-list all Python code in tree for use with the black linter, and re-format all code in-tree accordingly.

To produce this patch I did all of the following:

1. Make changes to tools/lint/black.yml to remove include: stanza and update list of source extensions.

2. Run ./mach lint --linter black --fix

3. Make some ad-hoc manual updates to python/mozbuild/mozbuild/test/configure/test_configure.py -- it has some hard-coded line numbers that the reformat breaks.

4. Make some ad-hoc manual updates to `testing/marionette/client/setup.py`, `testing/marionette/harness/setup.py`, and `testing/firefox-ui/harness/setup.py`, which have hard-coded regexes that break after the reformat.

5. Add a set of exclusions to black.yml. These will be deleted in a follow-up bug (1672023).

# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D94045
2020-10-23 20:40:42 +00:00
Dorel Luca 1ff59cb7a3 Backed out changeset 7558c8821a07 (bug 1654103) for multiple failures. CLOSED TREE 2020-10-22 03:51:06 +03:00
Ricky Stewart 50762dacab Bug 1654103: Standardize on Black for Python code in `mozilla-central`. r=remote-protocol-reviewers,marionette-reviewers,webdriver-reviewers,perftest-reviewers,devtools-backward-compat-reviewers,jgilbert,preferences-reviewers,sylvestre,maja_zf,webcompat-reviewers,denschub,ntim,whimboo,sparky
Allow-list all Python code in tree for use with the black linter, and re-format all code in-tree accordingly.

To produce this patch I did all of the following:

1. Make changes to tools/lint/black.yml to remove include: stanza and update list of source extensions.

2. Run ./mach lint --linter black --fix

3. Make some ad-hoc manual updates to python/mozbuild/mozbuild/test/configure/test_configure.py -- it has some hard-coded line numbers that the reformat breaks.

4. Add a set of exclusions to black.yml. These will be deleted in a follow-up bug (1672023).

# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D94045
2020-10-21 21:27:27 +00:00
Denis Palmeiro 71434198b6 Bug 1664475: Add telemetry probes to collect data for script delazification, xdr encoding time, bytecode caching time, and baseline compilation time. r=nbp,Dexter,sefeng,smaug
Differential Revision: https://phabricator.services.mozilla.com/D90798
2020-10-08 13:46:29 +00:00
Gerald Squelart ee701f64d7 Bug 1667915 - Separate marker category from marker options - r=gregtatum
The `category.WithOptions(...)` syntax was a bit strange and difficult to explain.

Now the category and options are separate parameters. Default options can be specified with `MarkerOptions{}` or just `{}`.

As a special case, defaulted-NoPayload functions don't need `<>`, and defaulted-NoPayload functions and macros don't even need `{}` for default options, e.g.:
`profiler_add_marker("name", OTHER); PROFILER_MARKER_UNTYPED("name", OTHER);`

Differential Revision: https://phabricator.services.mozilla.com/D91680
2020-10-01 11:02:23 +00:00
Bogdan Tara ababae891b Backed out 2 changesets (bug 1667915) for platform related bustage CLOSED TREE
Backed out changeset e7a0788a1741 (bug 1667915)
Backed out changeset d34505b2d81b (bug 1667915)
2020-10-01 12:34:39 +03:00
Gerald Squelart e07ae06a1d Bug 1667915 - Separate marker category from marker options - r=gregtatum
The `category.WithOptions(...)` syntax was a bit strange and difficult to explain.

Now the category and options are separate parameters. Default options can be specified with `MarkerOptions{}` or just `{}`.

As a special case, defaulted-NoPayload functions don't need `<>`, and defaulted-NoPayload functions and macros don't even need `{}` for default options, e.g.:
`profiler_add_marker("name", OTHER); PROFILER_MARKER_UNTYPED("name", OTHER);`

Differential Revision: https://phabricator.services.mozilla.com/D91680
2020-10-01 01:44:47 +00:00
Christoph Kerschbaumer 359ca7017e Bug 1666419: Assert IsSafeToRunScript. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D91391
2020-09-28 06:29:44 +00:00
Simon Giesecke de7bab0f06 Bug 1650145 - Replace all value uses of Empty[C]String by 0-length _ns literals. r=froydnj,geckoview-reviewers,agi
Differential Revision: https://phabricator.services.mozilla.com/D82325
2020-09-23 15:17:15 +00:00
Denis Palmeiro 27ec435b3b Bug 1665724: Clear mRunnable of request if user goes OOM while trying to off-thread compile. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D90645
2020-09-18 10:31:45 +00:00
Denis Palmeiro 63cdb2b343 Bug 1652126: Obtain an OffThreadToken immediately so parse tasks can be canceled anytime, and clean up dangling Runnables during cancellation. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D89465
2020-09-11 15:28:04 +00:00
Gerald Squelart a087b2df35 Bug 1663554 - Convert AUTO_PROFILER_TEXT_MARKER_... to new AUTO_PROFILER_MARKER_TEXT - r=gregtatum
The name `AUTO_PROFILER_MARKER_TEXT` is more consistent with the equivalent non-`AUTO` macro, and similarly arguments have been re-ordered to be the same, i.e.: Name, category&options, text.

The different macros with different argument sets can now be collapsed into one macro, and the optional arguments (timing, inner window id, backtrace) can easily be added to the `MarkerOptions` where needed.

As a bonus, a specific start time can optionally be provided at construction time.

Differential Revision: https://phabricator.services.mozilla.com/D89588
2020-09-11 00:42:51 +00:00
Sylvestre Ledru c320561565 Bug 1519636 - Reformat recent changes to the Google coding style r=andi
# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D89392
2020-09-08 04:32:00 +00:00
Denis Palmeiro ab8287fd08 Bug 1663051 - Do not process off thread requests that are already pending in a list r=smaug
Check if the off thread compilation request is already in a list before calling ProcessRequest.  See https://bugzilla.mozilla.org/show_bug.cgi?id=1663051#c0 for a more detailed description of the problem.

Differential Revision: https://phabricator.services.mozilla.com/D89257
2020-09-06 16:58:37 +00:00
Nathan Froyd cfb8fb313f Bug 1662251 - stop assigning from NS_Convert* values, mostly; r=sg
This patch was generated by running:

```
perl -p -i \
     -e 's/^(\s+)([a-zA-Z0-9.]+) = NS_ConvertUTF8toUTF16\((.*)\);/\1CopyUTF8toUTF16(\3, \2);/;' \
     -e 's/^(\s+)([a-zA-Z0-9.]+) = NS_ConvertUTF16toUTF8\((.*)\);/\1CopyUTF16toUTF8(\3, \2);/;' \
     $FILE
```

against every .cpp and .h in mozilla-central, and then fixing up the
inevitable errors that happen as a result of matching C++ expressions with
regexes.  The errors fell into three categories:

1. Calling the convert functions with `std::string::c_str()`; these were
   changed to simply pass the string instead, relying on implicit conversion
   to `mozilla::Span`.
2. Calling the convert functions with raw pointers, which is not permitted
   with the copy functions; these were changed to invoke `MakeStringSpan` first.
3. Other miscellaneous errors resulting from over-eager regexes and/or the
   replacement not being type-aware.  These changes were reverted.

Differential Revision: https://phabricator.services.mozilla.com/D88903
2020-09-02 09:54:37 +00:00
Denis Palmeiro b53dc3619e Bug 1662435 - Assert request is not already in another list before appending to bytecode cache queue. r=smaug
Add a safety check before appending a request to the bytecode cache queue to see if it already exists in another list.

Differential Revision: https://phabricator.services.mozilla.com/D88984
2020-09-01 17:14:32 +00:00
Jon Coppeard 7252dcb2ac Bug 1656248 - Associate the JS script with the loader script for scripts loaded from the bytecode cache like we do for compiled scripts r=smaug
The problem is that ResolveModuleSpecifier is being passed a null script and is falling back to using the document base URL to resolve the module import (which is the correct thing to do in some cases). This is happening because the referring JS script was not assoicated with a loader script when it was loaded since it came from the bytecode cache and the logic to do that is missing on this path.

Differential Revision: https://phabricator.services.mozilla.com/D86352
2020-08-24 19:33:53 +00:00
Honza Bambas 3135c5c5f9 Bug 1657961 - MOZ_LOG `NotifyOffThreadScriptLoadCompletedRunnable` dispatch and run spanning the JS helper thread off-main-thread parsing, r=froydnj
Depends on D86738

Differential Revision: https://phabricator.services.mozilla.com/D86739
2020-08-13 14:41:16 +00:00
Steven MacLeod b329c4ff4c Bug 1646547 - fix ScriptLoader::ReadyToExecuteParserBlockingScripts stopping at OOP ancestors. r=kmag
`ReadyToExecuteParserBlockingScripts` was walking the ancestor chain but
would stop if it hit an OOP ancestor. With this change we walk the
`WindowContext` tree instead, so that we may skip over OOP ancestors
and continue checking all in process ancestors.

Differential Revision: https://phabricator.services.mozilla.com/D86436
2020-08-09 23:50:35 +00:00
Simon Giesecke 1e02318b49 Bug 1653335 - Replace MakeSpan uses by constructor calls. r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D83817
2020-08-07 07:49:47 +00:00
Jon Coppeard 5c7acba387 Bug 1657066 - Dynamic module import doesn't handle uncatchable exceptions r=jandem
Previously this used |cx->isExceptionPending()| to determine whether the import had succeeded, which doesn't work if there was an uncatchable exception.  The patch changes this to pass an explicit status.

Differential Revision: https://phabricator.services.mozilla.com/D85856
2020-08-05 08:38:36 +00:00
Sylvestre Ledru 843f943758 Bug 1519636 - Reformat recent changes to the Google coding style r=andi
# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D85678
2020-08-02 15:29:15 +00:00
Nathan Froyd e3ebda1914 Bug 1223932 - delete guard object uses from the tree; r=jwalden
CLOSED TREE

We don't need these macros anymore, for two reasons:

1. We have static analysis to provide the same sort of checks via `MOZ_RAII`
   and friends.
2. clang now warns for the "temporary that should have been a declaration" case.

The extra requirements on class construction also show up during debug tests
as performance problems.

This change was automated by using the following sed script:

```
# Remove declarations in classes.
/MOZ_DECL_USE_GUARD_OBJECT_NOTIFIER/d
/MOZ_GUARD_OBJECT_NOTIFIER_INIT/d

# Remove individual macros, carefully.
{
  # We don't have to worry about substrings here because the closing
  # parenthesis "anchors" the match.
  s/MOZ_GUARD_OBJECT_NOTIFIER_PARAM)/)/g;
  s/MOZ_GUARD_OBJECT_NOTIFIER_PARAM_TO_PARENT)/)/g;
  s/MOZ_GUARD_OBJECT_NOTIFIER_PARAM_IN_IMPL)/)/g;
  s/MOZ_GUARD_OBJECT_NOTIFIER_ONLY_PARAM_IN_IMPL)/)/g;

  # Remove the longer identifier first.
  s/MOZ_GUARD_OBJECT_NOTIFIER_ONLY_PARAM_TO_PARENT//g;
  s/MOZ_GUARD_OBJECT_NOTIFIER_ONLY_PARAM//g;
}

# Remove the actual include.
\@# *include "mozilla/GuardObjects.h"@d
```

and running:

```
find . -name \*.cpp -o -name \*.h | grep -v 'GuardObjects.h' |xargs sed -i -f script 2>/dev/null
mach clang-format
```

Differential Revision: https://phabricator.services.mozilla.com/D85168
2020-07-30 14:22:38 +00:00
Mihai Alexandru Michis a911a108d0 Backed out changeset ac9c811bc427 (bug 1223932) for causing spidermonkey rust failures.
CLOSED TREE
2020-07-30 18:23:21 +03:00
Nathan Froyd bec9f9b93a Bug 1223932 - delete guard object uses from the tree; r=jwalden
We don't need these macros anymore, for two reasons:

1. We have static analysis to provide the same sort of checks via `MOZ_RAII`
   and friends.
2. clang now warns for the "temporary that should have been a declaration" case.

The extra requirements on class construction also show up during debug tests
as performance problems.

This change was automated by using the following sed script:

```
# Remove declarations in classes.
/MOZ_DECL_USE_GUARD_OBJECT_NOTIFIER/d
/MOZ_GUARD_OBJECT_NOTIFIER_INIT/d

# Remove individual macros, carefully.
{
  # We don't have to worry about substrings here because the closing
  # parenthesis "anchors" the match.
  s/MOZ_GUARD_OBJECT_NOTIFIER_PARAM)/)/g;
  s/MOZ_GUARD_OBJECT_NOTIFIER_PARAM_TO_PARENT)/)/g;
  s/MOZ_GUARD_OBJECT_NOTIFIER_PARAM_IN_IMPL)/)/g;
  s/MOZ_GUARD_OBJECT_NOTIFIER_ONLY_PARAM_IN_IMPL)/)/g;

  # Remove the longer identifier first.
  s/MOZ_GUARD_OBJECT_NOTIFIER_ONLY_PARAM_TO_PARENT//g;
  s/MOZ_GUARD_OBJECT_NOTIFIER_ONLY_PARAM//g;
}

# Remove the actual include.
\@# *include "mozilla/GuardObjects.h"@d
```

and running:

```
find . -name \*.cpp -o -name \*.h | grep -v 'GuardObjects.h' |xargs sed -i -f script 2>/dev/null
mach clang-format
```

Differential Revision: https://phabricator.services.mozilla.com/D85168
2020-07-30 14:22:38 +00:00
Frederik Braun a7153982e8 Bug 1366973: Rename security flags to not contain DATA anymore r=geckoview-reviewers,ckerschb,snorp
Differential Revision: https://phabricator.services.mozilla.com/D83490
2020-07-15 11:20:45 +00:00
Logan Smyth 8ae3774a1c Bug 780269 - Pass (X-)SourceMap header to SpiderMonkey for workers. r=perry
Differential Revision: https://phabricator.services.mozilla.com/D70293
2020-07-07 21:19:58 +00:00
Simon Giesecke 9364b353d4 Bug 1648010 - Remove NS_NAMED_LITERAL_CSTRING and NS_NAMED_LITERAL_STRING macros. r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D80631
2020-07-01 08:42:31 +00:00
Simon Giesecke e3c223da3e Bug 1648010 - Fix uses of NS_LITERAL_STRING with C string literals. r=geckoview-reviewers,agi,froydnj
Differential Revision: https://phabricator.services.mozilla.com/D80861
2020-07-01 08:34:12 +00:00
Simon Giesecke cd8b8939b9 Bug 1648010 - Replace uses of NS_LITERAL_STRING/NS_LITERAL_CSTRING macros by _ns literals. r=geckoview-reviewers,jgilbert,agi,hsivonen,froydnj
Differential Revision: https://phabricator.services.mozilla.com/D80860
2020-07-01 08:29:29 +00:00
Kris Maglione 6aa06b33a7 Bug 1645510: Part 2 - Avoid using the unprivileged junk scope where possible. r=bholley
Differential Revision: https://phabricator.services.mozilla.com/D79720
2020-06-27 03:06:28 +00:00
Denis Palmeiro c15f4faafe Bug 1646793 - Cancel all preload requests when the ScriptLoader is destroyed r=smaug
Cancel all preload requests when the ScriptLoader is destroyed.

Differential Revision: https://phabricator.services.mozilla.com/D80218
2020-06-22 02:12:56 +00:00
Emilio Cobos Álvarez 6bb08bd490 Bug 1646056 - Use const references as keys instead of raw pointers for PreloadHashKey. r=mayhemer
Feels a bit more natural for the callers this way. This should have no
behavior change.

Differential Revision: https://phabricator.services.mozilla.com/D79831
2020-06-18 14:06:34 +00:00
Emilio Cobos Álvarez 939c7c466b Bug 1642591 - Don't make referrer policy a cache miss for sub-resource {pre,}loads. r=mayhemer,tnikkel
For preload we're already effectively not using it, I think, due to
bug 1642325.

For images, this matches the spec, see earlier comments in this bug and
https://bugzilla.mozilla.org/show_bug.cgi?id=1174921#c17.  I think it
makes sense for other sub-resources to align as well.

Differential Revision: https://phabricator.services.mozilla.com/D79812
2020-06-18 14:06:20 +00:00
Ted Campbell 8898cf7914 Bug 1642708 - Remove code guarded by JS_BUILD_BINAST r=arai
Also remove js/src/frontend/BinAST* sources.

Differential Revision: https://phabricator.services.mozilla.com/D77945
2020-06-17 14:26:09 +00:00
Csoregi Natalia e722c196bc Backed out 5 changesets (bug 1642708) for build bustages. CLOSED TREE
Backed out changeset d307b00c7e1b (bug 1642708)
Backed out changeset d210a60ad435 (bug 1642708)
Backed out changeset bcc2728b5ca5 (bug 1642708)
Backed out changeset 1c245d4e8244 (bug 1642708)
Backed out changeset ad613fa94a83 (bug 1642708)
2020-06-17 16:51:16 +03:00
Ted Campbell 0d2aa310b5 Bug 1642708 - Remove code guarded by JS_BUILD_BINAST r=arai
Also remove js/src/frontend/BinAST* sources.

Differential Revision: https://phabricator.services.mozilla.com/D77945
2020-06-12 14:25:50 +00:00
Jon Coppeard b2762155a5 Bug 1566307 - Improve the error generated when resolution of a module specifier fails r=hsivonen
This combines the two places where an error was generated for this into one and adds localiation for the message. The message is improved as requested in the bug.

Differential Revision: https://phabricator.services.mozilla.com/D79862
2020-06-16 18:40:17 +00:00
Denis Palmeiro 522b733636 Bug 1606652 - Speculatively off thread parse external scripts as soon as they are fetched. r=smaug
The changes proposed here will speculatively parse all external scripts off thread as soon as they are fetched, except for async, link preload, and non parser inserted scripts.  This should save us some time since currently all scripts are parsed right before execution or while they are blocking the dom parser.

Differential Revision: https://phabricator.services.mozilla.com/D76644
2020-06-10 00:45:26 +00:00
Logan Smyth cc02094920 Bug 1643540 - Split scriptElement type into three types for clarity. r=jlast,smaug
The lack of specificity for script intro type has lead the debugger to need
to make use of 'source.introductionType' and 'source.element' in order to
determine whether a given script was injected, or inline or fetched, which
is entirely unnecessary of the loader itself clearly tells us what type
of script we are working with. It also allows us to cleanly handle the case
of XUL, which previously was "scriptElement" but has no ".element" passed
in, so we were unable to know whether a given source was inline or not.

Differential Revision: https://phabricator.services.mozilla.com/D78435
2020-06-05 18:22:50 +00:00
Honza Bambas 5a9a3de14a Bug 1639901 - Set `PerformanceResourceTiming.initiatorType` to "link" on channel initiated by `<link rel=preload>` tags, r=hsivonen
Differential Revision: https://phabricator.services.mozilla.com/D76485
2020-06-01 13:21:14 +00:00
Emilio Cobos Álvarez 54fd961a29 Bug 1641245 - Make string comparators not virtual. r=froydnj,necko-reviewers,geckoview-reviewers,jgilbert,agi,valentin
There's no use case for stateful comparators, so they can be just plain
function pointers.

This is used in some hot places like CSS selector matching.

Differential Revision: https://phabricator.services.mozilla.com/D77084
2020-05-27 18:11:12 +00:00
Honza Bambas 07f63ad409 Bug 1637039 - Notify script preload when the loading channel synchronously fails to open, remove a used script preload from Document, r=hsivonen
Differential Revision: https://phabricator.services.mozilla.com/D76364
2020-05-25 18:39:11 +00:00
Denis Palmeiro 4479f6b01c Bug 1637802 - Replace ScriptEvaluation profiler marker with compilation & execution markers for bytecode, module, binast, and text sources. r=smaug
Replace ScriptEvaluation profiler marker with compilation & execution markers for bytecode, module, binast, and text sources.

Differential Revision: https://phabricator.services.mozilla.com/D75223
2020-05-23 18:22:49 +00:00
Denis Palmeiro c626a5ea13 Bug 1637886 - Check for valid JSScript* before getting private value r=smaug
Missing check to see if the JSScript coming from exec.GetScript() is valid.

Differential Revision: https://phabricator.services.mozilla.com/D75320
2020-05-14 17:22:52 +00:00
Philip Chimento f93330de3e Bug 1629293 - Expose js::ErrorReport in public API. r=evilpie
Renames it to JS::ErrorReportBuilder, since it is used to 'build' a
JSErrorReport object.

Differential Revision: https://phabricator.services.mozilla.com/D73521
2020-05-14 04:44:15 +00:00
Tom Schuster d76da80aa0 Bug 1636624 - Mitigate leaks involving exceptions with CreateSciptError. r=mccr8
Doing this kind of censoring in "CreateScriptError" turns out to be more effort
than I thought. We don't have a JSContext to create Rooted instances.
This still catches all the relevant places where we are creating script-errors without inner-window-ids.

Differential Revision: https://phabricator.services.mozilla.com/D75152
2020-05-13 17:53:57 +00:00