Commit Graph

76 Commits

Author SHA1 Message Date
Bobby Holley
c466facab9 Bug 774607 - Remove use of JS_{Is,Make}SystemObject from Gecko. r=bz
We currently set this for system globals and anything whose parent
chain leads to a system global. Maybe this was relevant before, but
with CPG this is just equivalent to asking whether the object is in
a system compartment. And the only place where we _check_ this bit
is immediately after checking for a system compartment, in
WrapperFactory. So AFAICT this can go away entirely.
2012-09-05 11:32:07 -07:00
Randell Jesup
eedf93a21d Bug 773151: Convert nsCAutoString->nsAutoCString CLOSED TREE r=bsmedberg 2012-09-01 22:35:17 -04:00
Luke Wagner
a688f5b795 Bug 749371 - Break JS_ClearScope into two not-as-bad functions (r=mrbkap) 2012-08-23 11:23:28 -07:00
Matt Brubeck
5e47d4412f Back out 670c8a2695b3 (bug 771354), 134557d57e6e 4ad52e488977 (bug 774607), and...
036eb8c2a08a d4d36e3b948f 35334e820632 6bd07fd5147d d49e7c0d762c 407f19deb14c d84551808abb (bug 774633)
on a CLOSED TREE
2012-08-23 21:34:27 -07:00
Luke Wagner
94264a0bc8 Bug 625199 - s/JSAutoEnterCompartment/JSAutoCompartment/ and make it infallible (r=bholley)
--HG--
extra : rebase_source : 12acf2288285f5caefd7fecea8207de3a47eab5b
2012-08-21 18:42:53 -07:00
Bobby Holley
a2d7eabc5a Bug 774607 - Remove use of JS_{Is,Make}SystemObject from Gecko. r=bz
We currently set this for system globals and anything whose parent
chain leads to a system global. Maybe this was relevant before, but
with CPG this is just equivalent to asking whether the object is in
a system compartment. And the only place where we _check_ this bit
is immediately after checking for a system compartment, in
WrapperFactory. So AFAICT this can go away entirely.
2012-08-23 16:44:53 -07:00
Ehsan Akhgari
0fd9123eac Bug 579517 - Part 1: Automated conversion of NSPR numeric types to stdint types in Gecko; r=bsmedberg
This patch was generated by a script.  Here's the source of the script for
future reference:

function convert() {
echo "Converting $1 to $2..."
find . ! -wholename "*nsprpub*" \
       ! -wholename "*security/nss*" \
       ! -wholename "*/.hg*" \
       ! -wholename "obj-ff-dbg*" \
       ! -name nsXPCOMCID.h \
       ! -name prtypes.h \
         -type f \
      \( -iname "*.cpp" \
         -o -iname "*.h" \
         -o -iname "*.c" \
         -o -iname "*.cc" \
         -o -iname "*.idl" \
         -o -iname "*.ipdl" \
         -o -iname "*.ipdlh" \
         -o -iname "*.mm" \) | \
    xargs -n 1 sed -i -e "s/\b$1\b/$2/g"
}

convert PRInt8 int8_t
convert PRUint8 uint8_t
convert PRInt16 int16_t
convert PRUint16 uint16_t
convert PRInt32 int32_t
convert PRUint32 uint32_t
convert PRInt64 int64_t
convert PRUint64 uint64_t

convert PRIntn int
convert PRUintn unsigned

convert PRSize size_t

convert PROffset32 int32_t
convert PROffset64 int64_t

convert PRPtrdiff ptrdiff_t

convert PRFloat64 double
2012-08-22 11:56:38 -04:00
Honza Bambas
541453729c Bug 215450: Allow uploading of files greater than 2gb in size. Involves making input streams 64-bit capable. Significant work done by Makoto Kato, finished by Honza Bambas. r=hbambas,bsmedberg,jdrew,sicking 2012-08-10 22:44:11 -04:00
Eric Faust
17695b5079 Bug 775788 - Modify JSFunctionSpec to accept JSJitInfos. (r=luke) 2012-08-07 22:26:19 -07:00
Benjamin Peterson
b97eb065c8 Bug 779724 - Use finer-grain source controls in the browser. r=jorendorff, sr=jst 2012-08-07 10:39:47 -07:00
Jim Mathies
378c4cc0b3 Bug 780511 - Pipe additional debug output to the Windows debugger, r=neil. 2012-08-06 15:41:40 -05:00
Mike Hommey
6173fa297f Bug 774032 bonus - Use @DEPTH@ and @relativesrcdir@ in Makefile.in. r=ted 2012-08-04 20:26:44 +02:00
Aryeh Gregor
e806eeab4f Bug 777292 part 2 - Change all nsnull to nullptr 2012-07-30 17:20:58 +03:00
Bobby Holley
261a5477fd Bug 772288 - Waive Xray for target objects in Cu.import. r=mrbkap 2012-07-23 16:47:18 +02:00
Blake Kaplan
71e3941c1e Bug 769265 - Fix these calls. r=bent 2012-06-28 16:14:11 +02:00
Jason Orendorff
47aab0a000 Bug 753542 - Add prefs to enable/disable E4X (javascript.options.xml.content and .chrome). r=bsmedberg, sr=jst. 2012-06-06 21:52:14 -05:00
Geoff Lankow
00f3a215c9 Bug 749930 - Replace uses of nsILocalFile with nsIFile (compiled code only); r=bsmedberg 2012-06-06 14:08:30 +12:00
Jason Orendorff
9ec40fdc02 Bug 753885 - Part 2: Add JSOPTION_ALLOW_XML, making E4X support optional per-context. r=Waldo. 2012-05-30 15:05:59 -05:00
Jason Orendorff
80dda6d7a5 Bug 753885 - Part 1: Rename JSOPTION_XML to JSOPTION_MOAR_XML, and other cleanups. r=Waldo. 2012-05-30 15:05:58 -05:00
Nils Maier
35431284b1 Bug 754771 - Add identifying information to all system compartments. r=bz 2012-05-16 19:42:10 +02:00
Gervase Markham
ca171eec44 Bug 716478 - update licence to MPL 2. 2012-05-21 12:12:37 +01:00
Benjamin Smedberg
4f91700da9 Bug 734847 part 2 - treewide changes resulting from the default-infallibility of hashtables; either remove useless result checks, or use the fallible version of APIs, depending on context, r=jlebar
--HG--
extra : rebase_source : 844b008c5167e6ca39a7ba9eeec8b30672938704
2012-05-18 13:30:49 -04:00
Tom Schuster
fb630ae705 Bug 752226 - Remove any use of JSVAL_IS_OBJECT. r=luke,Ms2ger 2012-05-11 17:46:26 +02:00
Ed Morley
79899a6f75 Backout 9b0fcaacb788 & bf3fef257e68 (bug 752226) for mochitest-other orange 2012-05-11 18:25:52 +01:00
Tom Schuster
1941fb1bb4 Bug 752226 - Remove any use of JSVAL_IS_OBJECT. r=luke,Ms2ger
--HG--
extra : rebase_source : edf2077f8b8bad1970eab6ebe9996e761d4e596c
2012-05-11 17:46:26 +02:00
Bobby Holley
17aaa24bab Bug 749173 - Remove AutoPreserveCompartment. r=luke 2012-05-06 13:09:49 +02:00
Bobby Holley
c48d120359 Bug 747749 - Remove call to JS_SetGlobalObject in mozJSComponentLoader. r=luke 2012-04-26 20:40:11 +02:00
David Anderson
2b1abddde3 Remove simple JS_FrameIterator uses in xpconnect (bug 744617, r=bholley).
--HG--
extra : rebase_source : c206450cf46011543f58cded4c5aff2d49932afd
2012-04-16 12:25:28 -07:00
Makoto Kato
a41e6dd26b Bug 716333 - get rid of WithConversion (xpconnect part). r=bholley 2012-03-26 14:12:15 +09:00
Igor Bukanov
7296e0408c bug 737624 - memory-only encoding/decoding of scripts and functions. r=:luke
The patch shrinks the API presented in jsxdrapi.h down to 4 functions to
encode/decode scripts and interpreted functions to/from the memory. The
newly introduced implementation header vm/Xdr.h replaces the former
JSXDRState with the template class XDRState parametrized by the enum
type with two constants, XDR_ENCODE and XDR_DECODE. This way a compiler
can fully eliminate the former runtime checks for the decoding/encoding
mode. As a drawback this required to explicitly instantiate the xdr
implementation as I do not want to put all the xdr code to header files.

The memory-only XDR allows to avoid coping filename and to-be-atomized
chars to a temporary buffer as the code can just access the buffer
directly. Another change is that new XDRScript takes as a parameter its
parent script. This allowed to avoid keeping filename in XDRState and
simplify the filename management.

Another change is the removal of JS_HAS_HDR. As CloneScript uses XDR to
copy a script, JS_HAS_XDR cannot be disabled.

--HG--
rename : js/src/jsxdrapi.cpp => js/src/vm/Xdr.cpp
extra : rebase_source : f8f1536a86b7c3fe7296a16b6677bd21664af98a
2012-02-20 11:58:00 +01:00
Dão Gottwald
766a2b3244 Backed out changeset 30798fdc5bad 2012-03-24 12:33:30 +01:00
Igor Bukanov
f8a4496d31 bug 737624 - memory-only encoding/decoding of scripts and functions. r=:luke
The patch shrinks the API presented in jsxdrapi.h down to 4 functions to
encode/decode scripts and interpreted functions to/from the memory. The
newly introduced implementation header vm/Xdr.h replaces the former
JSXDRState with the template class XDRState parametrized by the enum
type with two constants, XDR_ENCODE and XDR_DECODE. This way a compiler
can fully eliminate the former runtime checks for the decoding/encoding
mode. As a drawback this required to explicitly instantiate the xdr
implementation as I do not want to put all the xdr code to header files.

The memory-only XDR allows to avoid coping filename and to-be-atomized
chars to a temporary buffer as the code can just access the buffer
directly. Another change is that new XDRScript takes as a parameter its
parent script. This allowed to avoid keeping filename in XDRState and
simplify the filename management.

Another change is the removal of JS_HAS_HDR. As CloneScript uses XDR to
copy a script, JS_HAS_XDR cannot be disabled.

--HG--
rename : js/src/jsxdrapi.cpp => js/src/vm/Xdr.cpp
2012-02-20 11:58:00 +01:00
Ms2ger
8775c56114 Backed out changeset f33e1e959036; r=bustage 2012-03-24 11:04:34 +01:00
Igor Bukanov
8e97874303 bug 737624 - memory-only encoding/decoding of scripts and functions. r=:luke
The patch shrinks the API presented in jsxdrapi.h down to 4 functions to
encode/decode scripts and interpreted functions to/from the memory. The
newly introduced implementation header vm/Xdr.h replaces the former
JSXDRState with the template class XDRState parametrized by the enum
type with two constants, XDR_ENCODE and XDR_DECODE. This way a compiler
can fully eliminate the former runtime checks for the decoding/encoding
mode. As a drawback this required to explicitly instantiate the xdr
implementation as I do not want to put all the xdr code to header files.

The memory-only XDR allows to avoid coping filename and to-be-atomized
chars to a temporary buffer as the code can just access the buffer
directly. Another change is that new XDRScript takes as a parameter its
parent script. This allowed to avoid keeping filename in XDRState and
simplify the filename management.

Another change is the removal of JS_HAS_HDR. As CloneScript uses XDR to
copy a script, JS_HAS_XDR cannot be disabled.

--HG--
rename : js/src/jsxdrapi.cpp => js/src/vm/Xdr.cpp
2012-02-20 11:58:00 +01:00
Igor Bukanov
fbeb82e29f bug 730221 - delegating serialization of script principals to the embedding. r=:luke,:bz
Currently to serialize principals stored in JSScript we have a rather complex
schema. First there is the transcode callback that the embedding must provide
to transcode principals using XDR API. Second we use rather complex glue code
to implement that callback in terms of writing/reading nsIObjectOutputStream/
nsIObjectInputStream. This glue code is duplicated in 3 places. All this can
be avoided if we simply delegate transcoding of principals to the caller. In
addition, at least in the case of the cached startup scripts we do not even
need to transcode the principals as the the cached scripts always have the
system principal so we can skip all the transcode complexity there.

The patch implemnts this idea. In particular, the code in JS engine
responsible for transcoding of principals is replaced by the single API
function JS_XDRSetPrincipals that the embedding can use to set principals for
decoded scripts and functions. Then the startup cache uses this to set the
principals for the decoded script to the system principals. The other two
places in nsJSContext::Serialize and  XBL_SerializeFunction that need to
serialize principals together with a function or script now uses common
utilities in nsXPConnect so the serialization complexity resides in the single
 place.
2012-02-13 14:10:04 +01:00
Igor Bukanov
30d3de8268 bug 728250 - remove JSPrincipals::codebase. r=:luke,:bz
In just 2 cases where JSPrincipals::codebase is used it can be reconstructed from the values stored in the associated nsJSPrincipal. In addition the patch makes nsJSprincipals to inherit both from nsIPrincipal and JSPrincipals allowing to use static_cast to convert between nsIPrincipal and JSPrincipals pointers and to drop many cases of manual JSPrincipal reference counting.
2012-03-09 10:48:50 +01:00
David Mandelin
68c407c176 Bug 733260 followup: use uint32_t for array and string lengths, r=luke
--HG--
extra : rebase_source : 1729b4b927fde0678872b9de62a7466381aa07c3
2012-03-06 15:52:55 -08:00
David Mandelin
5e02d0630c Bug 733260: remove typedef jsuint, r=luke
--HG--
extra : rebase_source : e8f576e1b5b189b47807c613c0cff79f5c8038e7
2012-03-05 18:43:45 -08:00
Bobby Holley
ccb745bc93 Bug 720580 - Stop passing aExtraPtr to InitClassesWithNewWrapedGlobal. r=mrbkap
We only ever pass null here anyway, and this whole infrastructure is going away real soon now.
2012-03-05 15:22:44 -08:00
Bobby Holley
2cb54e998b Bug 720580 - Remove unnecessary aIID parameter from nsIXPConnect::InitClassesWithNewWrappedGlobal. r=mrbkap 2012-03-05 15:22:44 -08:00
David Mandelin
0be0db4666 Bug 730511: remove obsolete typedefs intN, uintN, r=luke 2012-02-28 15:11:11 -08:00
Luke Wagner
e360e8fdf0 Bug 729584 - mozJSComponentLoader::ImportInto needs to wrap exceptions (r=bholley)
--HG--
extra : rebase_source : c5c575a789647348fcca5bf9ef5368873f0016f4
2012-02-23 13:50:01 -08:00
Marco Bonardo
3cb51695d8 Bug 722254 - Add an XPCOMUtils method to generate a singleton factory.
Use the new factory in Places js services, to ensure they can't be instanced multiple times.
r=bsmedberg
2012-02-07 10:17:42 +01:00
Igor Bukanov
08ee5eda35 bug 723021 - moving native stack limits into runtime. r=luke 2012-01-31 23:28:22 +01:00
Luke Wagner
deb78ef5af Bug 675078 - rm JSThreadData and JSThread (JSRuntime is now officially single-threaded) (r=igor,rs=mccr8)
--HG--
extra : rebase_source : f6d2c2c6083f4589691ede571159bfd7e7ef8701
2011-07-18 14:54:48 -07:00
Matt Brubeck
54f0eed49e Back out 79deba022227 (bug 675078) because of Win debug mochitest-other failures 2012-01-24 17:32:30 -08:00
Luke Wagner
411fc35146 Bug 675078 - rm JSThreadData and JSThread (JSRuntime is now officially single-threaded) (r=igor) 2011-07-18 14:54:48 -07:00
Ms2ger
2db789079c Bug 709086 - Don't use JS_GetParent in mozJSSubScriptLoader::LoadSubScript; r=jorendorff 2012-01-02 19:05:19 +01:00
Ms2ger
29d457f80c Bug 714057 - Remove uintn users from XPConnect; r=bholley+khuey 2012-01-02 19:05:19 +01:00
Ms2ger
51f59f0021 Bug 713645 - Remove superfluous inclusions of jscntxt.h; r=luke 2012-01-02 19:05:19 +01:00