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

192 Коммитов

Автор SHA1 Сообщение Дата
Mike Hommey 117e48720c Bug 1489363 - Replace some string.Assign* with AssignLiteral. r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D5224

--HG--
extra : moz-landing-system : lando
2018-09-07 22:12:01 +00:00
Jeff Walden 64fceacad0 Bug 1486577 - Don't #include "js/CompilationAndEvaluation.h" in jsapi.h, minimizing the scope of that header and reducing translation-unit size of anything that needs JSAPI but doesn't need to compile/evaluate JavaScript. r=jandem
--HG--
extra : rebase_source : cd9a8becc15477bc5e24408159d4f061ec81c8b2
2018-08-24 22:51:49 -05:00
Jeff Walden 4bdf4a3614 Bug 1486577 - Don't #include js/SourceBufferHolder.h in jsapi.h, and instead require users to do so -- a minor translation-unit size improvement for anyone who never has to use SourceBufferHolder other than by reference. r=jandem
--HG--
extra : rebase_source : df47aba0c7dac3fe80ab6ea1b9a34c7acc54850d
2018-08-24 21:01:58 -05:00
Jan de Mooij 51c1609621 Bug 1479363 part 6 - Use JSAutoRealm instead of JSAutoRealmAllowCCW in js/xpconnect/loader. r=kmag 2018-08-02 08:49:10 +02:00
Jan de Mooij 80adc67aba Bug 1478955 part 1 - Rename JSAutoRealm to JSAutoRealmAllowCCW. r=luke 2018-07-28 12:12:26 +02:00
Andrea Marchesini 4e97b69ebf Bug 1476306 - Moving NullPrincipal/ContentPrincipal/SystemPrincipal under mozilla namespace - part 3 - ContentPrincipal, r=ckerschb 2018-07-17 21:38:48 +02:00
Andrea Marchesini 58f78c6f5d Bug 1476306 - Moving NullPrincipal/ContentPrincipal/SystemPrincipal under mozilla namespace - part 2 - SystemPrincipal, r=ckerschb 2018-07-17 21:38:19 +02:00
imjching 3dcc4fd573 Bug 1416066 - Use XPConnect compilation scope for some non-cached local scripts with codebase principal when preload cache is enabled. r=kmag
When we use the preload cache for some non-cached local scripts in loadSubScript,
we will keep the global that the script was compiled for alive, resulting in a
leak.

We will compile these chrome:// and resource:// scripts with codebase principal in
the XPConnect compilation scope when using mozJSSubScriptLoader to load scripts
synchronously. When the script is evaluated, it will be cloned into the target
scope to be executed. By compiling the script in a different scope, we can avoid
keeping the global that the script was compiled for originally alive.

MozReview-Commit-ID: HYSTvmPCbyR

--HG--
extra : rebase_source : 1ee540e08b9eda9046539f6f20f596732a651034
2018-07-03 21:26:04 -04:00
imjching 0c7582c716 Bug 1416066 - Enable caching for scripts with codebase URLs of about:home, about:newtab, and about:welcome. r=kmag
MozReview-Commit-ID: HC3cNVxWLe6

--HG--
extra : rebase_source : eab95e34618bf1ac856b44db89800b615c6503b8
2018-07-03 21:24:52 -04:00
Jan de Mooij b6f0af2059 Bug 1472973 part 6 - Use JS::GetNonCCWObjectGlobal in subscript loader. r=bz 2018-07-06 18:16:24 +02:00
Jan de Mooij 80e44e8003 Bug 1461292 part 1 - Rename JSAutoCompartment to JSAutoRealm. r=bz,luke 2018-05-16 10:53:16 +02:00
Jason Orendorff e7c94fff59 Bug 1439063 - Part 1: Move several public headers from js/src to js/public. r=jandem.
js/src/jsalloc.h -> js/public/AllocPolicy.h
jsalloc.cpp -> js/src/util/AllocPolicy.cpp
jsbytecode.h -> merge into js/public/TypeDecls.h
jsprf.h -> js/public/Printf.h
jsprf.cpp -> js/src/util/Printf.cpp
jsprototypes.h -> public/ProtoKey.h
jswrapper.h -> js/Wrapper.h

--HG--
rename : js/src/jsalloc.h => js/public/AllocPolicy.h
rename : js/src/jsprf.h => js/public/Printf.h
rename : js/src/jsprototypes.h => js/public/ProtoKey.h
rename : js/src/jswrapper.h => js/public/Wrapper.h
rename : js/src/jsalloc.cpp => js/src/util/AllocPolicy.cpp
rename : js/src/jsprf.cpp => js/src/util/Printf.cpp
extra : rebase_source : 98b16d94c469202eab0303a8da844f1d0b6aa809
extra : amend_source : e0b16c1077226d6fe240f4d7096537f93b43f2b8
extra : histedit_source : d94e0ba7904a7d66742c7fac43f638aaec4fa4e5
2018-02-21 10:30:19 -06:00
Andrea Marchesini c6da271117 Bug 1425458 - Resource timing entries Workers - part 0 - NS_NewChannel, r=smaug
* * *
Bug 1425458 - Resource timing entries Workers - part 10 - Correct parameters in NS_NewChannel in nsDataObj.cpp, r=me
2018-01-24 17:17:31 +01:00
Brindusan Cristian 368c3d5b6b Backed out 12 changesets (bug 1425458) for mochitest failures on WorkerPrivate.cpp on a CLOSED TREE
Backed out changeset 11997de13778 (bug 1425458)
Backed out changeset 100b9d4f36bc (bug 1425458)
Backed out changeset a29e9dbb8c42 (bug 1425458)
Backed out changeset b96d58fd945c (bug 1425458)
Backed out changeset f140da44ba68 (bug 1425458)
Backed out changeset af56400233d9 (bug 1425458)
Backed out changeset 7034af4332e4 (bug 1425458)
Backed out changeset f70500179140 (bug 1425458)
Backed out changeset 793bbfc23257 (bug 1425458)
Backed out changeset 2efb375a8ffc (bug 1425458)
Backed out changeset 07e781e37451 (bug 1425458)
Backed out changeset e875f3702a5f (bug 1425458)
2018-01-24 20:47:48 +02:00
Andrea Marchesini 6480b95ba3 Bug 1425458 - Resource timing entries Workers - part 0 - NS_NewChannel, r=smaug 2018-01-24 17:17:31 +01:00
Chris Peterson 37efe4d0e6 Bug 1428535 - Add missing override specifiers to overridden virtual functions. r=froydnj
MozReview-Commit-ID: DCPTnyBooIe

--HG--
extra : rebase_source : cfec2d96faeb11656d86d760a34e0a04cacddb13
extra : intermediate-source : 6176724d63788b0fe8caa3f91607c2d93dbaa7ec
extra : source : eebbb0600447f9b64aae3bcd47b4be66c02a51ea
2017-11-05 19:37:28 -08:00
Eric Rahm 07c97a5afe Bug 1423773 - Part 1: Remove usage of nsStringGlue.h. r=glandium
This removes an unnecessary level of indirection by replacing all
nsStringGlue.h instances with just nsString.h.

--HG--
extra : rebase_source : 340989240af4018f3ebfd92826ae11b0cb46d019
2017-12-06 16:52:51 -08:00
Jan de Mooij 2e7986aee1 Bug 1417844 part 3 - Remove JSVersion from subscript cache path. r=kmag 2017-11-17 12:13:15 +01:00
Jan de Mooij 7f30bf48a7 Bug 1417844 part 2 - Remove JSVersion from CompileOptions, CompartmentBehaviors, scripts. r=evilpie 2017-11-17 12:12:39 +01:00
Nicholas Nethercote 3842370ed8 Bug 1405541 (attempt 2) - Split AUTO_PROFILER_LABEL_DYNAMIC into three macros. r=mstange.
It's easy to mess up the scoping so that (a) the label is pushed and then
immediately popped, and/or (b) the string doesn't live long enough. It's also
easy to do a utf16-to-utf8 conversion unnecessarily when the profiler is
inactive. This patch splits that macro into three new ones that are harder to
mess up.

- AUTO_PROFILER_LABEL_DYNAMIC_CSTR: same as current.
- AUTO_PROFILER_LABEL_DYNAMIC_NSCSTRING: for nsCStrings.
- AUTO_PROFILER_LABEL_DYNAMIC_LOSSY_NSSTRING: for nsStrings.

--HG--
extra : rebase_source : 3e2bbec4737b696e1c86579ae54be4cb3186c100
2017-10-13 16:12:57 +11:00
Chris Peterson 45aa2a8e8e Bug 870698 - Part 2: Replace Append("") with AppendLiteral(""). r=erahm
MozReview-Commit-ID: CrkIP4iHP1U

--HG--
extra : rebase_source : 5dc4e91a3f1860773c199f1abf3f66479218834a
extra : intermediate-source : ba51cc79847f2b43ba616f4a5d2bbc6958ca9f6d
extra : source : 1fda2fa990cc918c748ffa14fcc5dbe13fe3bdc3
2017-09-03 22:14:11 -07:00
Chris Peterson 9f4c1f5278 Bug 870698 - Part 1: Replace Assign("") with AssignLiteral(""). r=erahm
MozReview-Commit-ID: A0u9PP49OW3

--HG--
extra : rebase_source : 7d5286959f510eb4b7df1b7e32d5b9b58719c48b
extra : intermediate-source : f552b4a78236c42bc09030b3eb008725a3edb9c8
extra : source : 26ac4a1014f6661a70e3bf9f552407e12c2c3981
2017-09-03 22:12:56 -07:00
Nicholas Nethercote e3c9cbb969 Bug 1401813 - Rename Null[C]String() as Void[C]String(). r=erahm.
XPCOM's string API doesn't have the notion of a "null string". But it does have
the notion of a "void string" (or "voided string"), and that's what these
functions are returning. So the names should reflect that.

--HG--
extra : rebase_source : 4e3f982e0873877174a08a25413595ff66f7d20e
2017-09-22 14:35:46 +10:00
Ted Campbell 9b5f5a54bb Bug 1398601 - Fix wunused-variable errors when MOZ_DIAGNOSTIC_ASSERT isn't available. a=RyanVM
MozReview-Commit-ID: 1kvKcQBqog9
2017-09-14 06:35:00 -04:00
Ted Campbell 8b2e8b3fe5 Bug 1398601 - Fix subscript loader when using JSM global sharing r=kmag
When using the subscript loader with JSM global sharing, it was possible
that subscript would pollute the global of all JSMs in the sharing.

MozReview-Commit-ID: 1ah5JUAZwBA

--HG--
extra : rebase_source : 45a3974cb80ede0cb3beea92f895679c5ea7aa4b
2017-09-10 14:23:32 -04:00
Ted Campbell 0388c3314f Bug 1398601 - Add global/non-syntactic prefix to subscript loader cache r=kmag
We want to be able to store scripts compiled with or without
non-syntactic support in cache when we toggle JSM global sharing. In
current code this script is cloned on execution, but with JSM global
sharing we have would hit assertions.

MozReview-Commit-ID: 2pVTTxLpx6S

--HG--
extra : rebase_source : b123de20f216161c408bba75c8c0fd81be0508df
2017-09-12 18:05:08 -04:00
Phil Ringnalda 606b8426bb Backed out 5 changesets (bug 1398601) for unexpected crashtest assertions
Backed out changeset b728872f4d9a (bug 1398601)
Backed out changeset 05957a92b1a5 (bug 1398601)
Backed out changeset f5c26c3407c0 (bug 1398601)
Backed out changeset eddc38b0afd0 (bug 1398601)
Backed out changeset 776a65d43a5e (bug 1398601)

MozReview-Commit-ID: 9lfUtdlZy7F
2017-09-12 20:11:49 -07:00
Ted Campbell 7845fe7c7a Bug 1398601 - Fix subscript loader when using JSM global sharing r=kmag
When using the subscript loader with JSM global sharing, it was possible
that subscript would pollute the global of all JSMs in the sharing.

MozReview-Commit-ID: 1ah5JUAZwBA

--HG--
extra : rebase_source : 202904e30b582c788ec440c406607ba98b8836e6
2017-09-10 14:23:32 -04:00
Ted Campbell eb7051b3b5 Bug 1398601 - Add global/non-syntactic prefix to subscript loader cache r=kmag
We want to be able to store scripts compiled with or without
non-syntactic support in cache when we toggle JSM global sharing. In
current code this script is cloned on execution, but with JSM global
sharing we have would hit assertions.

MozReview-Commit-ID: 2pVTTxLpx6S

--HG--
extra : rebase_source : 5913a43a2dfddf74187f08ab9c53babe377bd706
2017-09-12 18:05:08 -04:00
Phil Ringnalda 7f896e1985 Backed out 4 changesets (bug 1398601) for Windows Marionette crashes @ ExecuteInExtensibleLexicalEnvironment
Backed out changeset 7aac2595bc17 (bug 1398601)
Backed out changeset 7a4bb5a1848a (bug 1398601)
Backed out changeset dd4af7998505 (bug 1398601)
Backed out changeset e9816be61b49 (bug 1398601)

MozReview-Commit-ID: LLJ99dkRQEg
2017-09-11 20:20:16 -07:00
Ted Campbell ff55566d27 Bug 1398601 - Fix subscript loader when using JSM global sharing r=kmag
When using the subscript loader with JSM global sharing, it was possible
that subscript would pollute the global of all JSMs in the sharing.

MozReview-Commit-ID: 1ah5JUAZwBA

--HG--
extra : rebase_source : 5fecf7dc61019431d67bcee4199e40a8278c8c64
2017-09-10 14:23:32 -04:00
Andrew McCreight 1f0b9dc34f Bug 1186409 - Use a single global for all JSMs. r=kmag
This patch adds a preference jsloader.shareGlobal that makes it so
that JSMs share a single global, in order to reduce memory usage. The
pref is disabled by default, and will be enabled in a later bug. Each
JSM gets its own NonSyntacticVariablesObject (NSVO), which is used for
top level variable bindings and as the value of |this| within the JSM.

For the module loader, the main change is setting up the shared
global, and the NSVO for each JSM. A number of files are blacklisted
from the shared global, because they do things to the global that
would interfer with other JSMs. This is detailed in
mozJSComponentLoader::ReuseGlobal().

MozReview-Commit-ID: 3qVAc1c5aMI

--HG--
extra : rebase_source : fe7e2672be8d09d6b7cec25e08cd464ff3cd6573
2017-07-18 14:47:27 -07:00
Kris Maglione c5a2868365 Bug 1394467: Remove unused procompileScript method. r=mccr8
MozReview-Commit-ID: 6s2Nqtcd9uS

--HG--
extra : rebase_source : ec4f96e7281e3f72be01aeb8faa1c9b34a61f534
2017-08-28 09:21:46 -07:00
Masatoshi Kimura 43dd1b22af Bug 1390106 - Stop using versioned scripts in js/xpconnect. r=mccr8
MozReview-Commit-ID: LP7bXQd7ahD

--HG--
extra : rebase_source : b0d3b9052d333698dbb1e6e6a0da9556fe60a91b
2017-08-14 20:45:14 +09:00
Andrew McCreight 19c035f60e Bug 1379023, part 4 - Remove mSystemPrincipal fields from mozJSSubScriptLoader and mozJSComponentLoader. r=mrbkap
The lone remaining use is trivial.

MozReview-Commit-ID: Gx0K69ArMJ2

--HG--
extra : rebase_source : ff48484246aeed32f7fa7c03573ba994b097967e
2017-07-07 11:29:48 -07:00
Andrew McCreight 93029d4038 Bug 1379023, part 3 - Make WriteCachedScript assert about the system principal not require the argument. r=mrbkap
MozReview-Commit-ID: FRgjZ32ULqj

--HG--
extra : rebase_source : be20c846efd3a5d5ba52ca1f614a0b40775d5e01
2017-07-07 11:27:53 -07:00
Andrew McCreight ef5af5fdf2 Bug 1379023, part 2 - Remove unused systemPrincipal argument to ReadCachedScript. r=mrbkap
MozReview-Commit-ID: D59LfiHXbXJ

--HG--
extra : rebase_source : 1f09e37f2c6ba7b2b0fa15fcacb932e3f9f8f7ab
2017-07-07 11:14:04 -07:00
Andrew McCreight 6ff67aafc2 Bug 1379023, part 1 - Directly compute if we're compiling in a content compartment in DoLoadSubScriptWithOptions. r=mrbkap
The existing code uses various intermediate objects, but the only
thing they are used for now is to figure out if the compartment we're
in has the system principal or not, so just compute that directly.

MozReview-Commit-ID: FMoWfAX8rGW

--HG--
extra : rebase_source : 385ab0e10a0c719155c48e3822e7844434f417f8
2017-07-06 16:30:44 -07:00
Bill McCloskey f115503a0b Bug 1372405 - Provide names for all runnables in the tree (r=froydnj)
MozReview-Commit-ID: DKR6ROiHRS7
2017-06-26 14:19:58 -07:00
Nicholas Nethercote 58786e1ea7 Bug 1375392 - Tweak the PROFILER_LABEL* macros. r=mstange.
This patch makes the following changes to the macros.

- Removes PROFILER_LABEL_FUNC. It's only suitable for use in functions outside
  classes, due to PROFILER_FUNCTION_NAME not getting class names, and it was
  mostly misused.

- Removes PROFILER_FUNCTION_NAME. It's no longer used, and __func__ is
  universally available now anyway.

- Combines the first two string literal arguments of PROFILER_LABEL and
  PROFILER_LABEL_DYNAMIC into a single argument. There was no good reason for
  them to be separate, and it forced a '::' in the label, which isn't always
  appropriate. Also, the meaning of the "name_space" argument was interpreted
  in an interesting variety of ways.

- Adds an "AUTO_" prefix to PROFILER_LABEL and PROFILER_LABEL_DYNAMIC, to make
  it clearer they construct RAII objects rather than just being function calls.
  (I myself have screwed up the scoping because of this in the past.)

- Fills in the 'js::ProfileEntry::Category::' qualifier within the macro, so
  the caller doesn't need to. This makes a *lot* more of the uses fit onto a
  single line.

The patch also makes the following changes to the macro uses (beyond those
required by the changes described above).

- Fixes a bunch of labels that had gotten out of sync with the name of the
  class and/or function that encloses them.

- Removes a useless PROFILER_LABEL use within a trivial scope in
  EventStateManager::DispatchMouseOrPointerEvent(). It clearly wasn't serving
  any useful purpose. It also serves as extra evidence that the AUTO_ prefix is
  a good idea.

- Tweaks DecodePool::SyncRunIf{Preferred,Possible} so that the labelling is
  done within them, instead of at their callsites, because that's a more
  standard way of doing things.

--HG--
extra : rebase_source : 318d1bc6fc1425a94aacbf489dd46e4f83211de4
2017-06-22 17:08:53 +10:00
Carsten "Tomcat" Book 8a1350b5a6 Backed out changeset 4f6302a98ae4 (bug 1372405)
--HG--
extra : rebase_source : 41632f3158e88e692809731394a683d065a73dfb
2017-06-21 13:59:26 +02:00
Bill McCloskey 6b3e84ed5f Bug 1372405 - Provide names for all runnables in the tree (r=froydnj)
MozReview-Commit-ID: DKR6ROiHRS7
2017-06-20 21:44:11 -07:00
Carsten "Tomcat" Book ea1b86680c Backed out changeset 9846de3bd954 (bug 1372405)
--HG--
extra : rebase_source : 5d4a48e8ec394c329994689d938d2a6e9b2752b0
2017-06-20 08:27:02 +02:00
Bill McCloskey 4592152411 Bug 1372405 - Provide names for all runnables in the tree (r=froydnj)
MozReview-Commit-ID: DKR6ROiHRS7
2017-06-19 22:25:47 -07:00
Alex Gaynor 45abd268c3 Bug 1221148 - Allow passing blob:// URIs to mozIJSSubScriptLoader; r=smaug
This is useful for legacy addons as we increasingly lockdown filesystem access
in content processes.

MozReview-Commit-ID: AZbsSFpbIvt

--HG--
extra : rebase_source : 56dfe91ac9fbeb0bd48dc8a2f87ed6038e7521cc
2017-06-07 11:00:24 -04:00
Kris Maglione 9c02fdf113 Bug 1363301: Always provide live wrappers for ScriptSourceObjects. r=shu,bholley
MozReview-Commit-ID: LTNN66FywU4

--HG--
extra : rebase_source : 6fc6bd6077229fe511b02116b9e3f9eb1c99f2fa
2017-06-14 15:38:59 -07:00
Florian Quèze a5e2cbd774 Bug 1373047 - mozJSSubScriptLoader::LoadSubScript should add a pseudo stack frame showing which script is loaded, r=mstange. 2017-06-15 00:58:25 +02:00
Andrew McCreight df181e287e Bug 989373, part 5 - Eliminate |function| from subscript loader. r=kmag
Thanks to the previous patch, we never set any of the function
arguments, so they can be removed, and various code for running
functions can be deleted.

MozReview-Commit-ID: BTIIyDtBPMR

--HG--
extra : rebase_source : 944adf3ac8f1579639e631a478fc286e980972ab
2017-05-17 09:21:54 -07:00
Andrew McCreight 87bdd721ca Bug 989373, part 4 - Remove reuse global flag from subscript loader. r=kmag
FindTargetObject in DoLoadSubScriptWithOptions will always return a
global object, so the boolean values we pass around to determine if a
global was being reused will always be false. The next patch will
eliminate the various |function| arguments that are now unused.

MozReview-Commit-ID: GvPNFGluRub

--HG--
extra : rebase_source : 76a67f5523153a37942c2730388e62125ecf4390
2017-05-15 15:04:45 -07:00
Andrew McCreight 21f4802365 Bug 1365417 - mozJSComponentLoader::FindTargetObject() is infallible. r=kmag
MozReview-Commit-ID: Iw4ke16CTKg

--HG--
extra : rebase_source : b2c6f5b0dec1849e1bd814ecdcde78b376ffb8ca
2017-05-16 14:27:50 -07:00