Commit Graph

46313 Commits

Author SHA1 Message Date
Gabor Krizsanits
6ad20c15c2 Bug 1110105 - Get rid of -Promise from wantGlobalProperties. r=bholley 2014-12-15 11:34:16 +01:00
Jacek Caban
68983f1752 Bug 1102804 - Fixed -Wparentheses warnings found in mingw build (js part). r=jorendorff 2014-12-14 14:33:38 +01:00
Boris Zbarsky
3575ee7fc8 Bug 1111162. When inlining IsObject(), if our type info says we have an object, just output a constant true instead of doing a dynamic check. r=jandem 2014-12-13 22:05:46 -05:00
Boris Zbarsky
ab48daab66 Bug 1111166. Don't emit a movq from a register to itself when unboxing things on x86-64. r=sunfish 2014-12-13 22:05:46 -05:00
Boris Zbarsky
ed0bafb429 Bug 924059. Give ArrayIterator and its prototype different JSClasses so we can't confuse them for each other. r=waldo 2014-12-13 22:05:46 -05:00
Boris Zbarsky
3ff9b53921 Bug 1111159. Inline the IsArrayIterator and IsStringIterator intrinsics in Ion code to speed up for-of loops. r=jandem,waldo 2014-12-13 22:05:46 -05:00
Jan de Mooij
e3fed7fd0a Bug 1111218 - Fold congruent type barriers. r=bhackett 2014-12-13 22:39:44 +01:00
Ehsan Akhgari
b48a4d79a0 Bug 1109702 - Fix more bad implicit constructors in js; r=Waldo 2014-12-13 10:22:19 -05:00
Tooru Fujisawa
b84290ea20 Bug 1101265 - Simplify parsing empty arrow function parameter. r=Waldo 2014-12-13 15:51:12 +09:00
Chris Peterson
b95584c341 Bug 1083467 - Part 2: Increment expected JSErr_Limit to 369 to fix Xdr static assertion! 2014-12-12 22:36:29 -08:00
Chris Peterson
44241f0152 Bug 1103859 - Fix some -Wunused-variable warnings in jsapi-tests by replacing MOZ_ASSERTs with MOZ_RELEASE_ASSERTs; mark jsapi-tests as FAIL_ON_WARNINGS (for clang). r=jorendorff 2014-11-23 23:16:16 -08:00
Chris Peterson
c8f21ad041 Bug 1083467 - Log console warnings for JavaScript 1.6's deprecated for-each-in loops. r=jorendorff 2014-11-25 23:17:21 -08:00
Botond Ballo
79d427447d Bug 1073081 - Fix -Waddress warnings about Nuwa functions. r=khuey
--HG--
extra : source : 8cd5108862aaf2c579a76ac6e9c08eb69fa5f3ff
2014-11-26 19:20:03 -05:00
Boris Zbarsky
0ee3824cbd Bug 1110871. Ion-compile JSOP_SYMBOL. r=jandem 2014-12-12 20:52:40 -05:00
Tooru Fujisawa
6c1d0796bd Bug 1105608 - Throw SyntaxError for export-from. r=jorendorff 2014-12-13 10:41:41 +09:00
Wes Kocher
fb2134a71e Backed out changeset 0064d8949f0c (bug 1102541) for build bustage on a CLOSED TREE 2014-12-12 12:39:07 -08:00
Brian Hackett
bb6c2b0ce1 Bug 1107226 - Share prototype objects for typed object arrays with the same element type, r=nmatsakis. 2014-12-12 13:36:56 -07:00
Nick Fitzgerald
eebd54a651 Bug 1102541 - Add JS::ubi::RootList::addRoot; r=shu 2014-12-11 13:55:49 -08:00
Jason Orendorff
cb8eb384ad Bug 1090636, part 15 - Optimize away the HasOwnProperty call in SetPropertyByDefining, in the common case. No change in behavior, theoretically. r=efaust.
--HG--
extra : rebase_source : 98930753e4c19c0db6db8912178d27b0fa5fea2e
2014-11-12 11:46:38 -06:00
Jason Orendorff
d3db32c5ca Bug 1090636, part 14 - Rewrite SetPropertyHelper. r=efaust.
With this patch:

*   SetPropertyHelper no longer calls lookupProperty hooks, which is nice
    since there's no such thing in ES6.

*   As SetPropertyHelper walks the prototype chain, as soon as it reaches a
    non-native object, it calls that object's set hook, passing the original
    receiver, and returns.

    This means Proxy set traps will now be called per spec when triggered via
    the prototype chain from a native object.

    It also means that legacy scripted indirect proxies (Proxy.create) will
    now sometimes have their set trap called when it wouldn't have been called
    before. This seems to be confined to fuzztests in practice, since it only
    matters when the proxy is used as the prototype of an ordinary object.
    But it could cause trouble.

    The same situation affects other proxies too: BaseProxyHandler::set() and
    its overrides will all be called in new situations. It's inevitable though;
    Reflect.set was going to enable all these situations anyway.

--HG--
extra : rebase_source : 01bb32b4950ea14922f135bf785aea7d298c8dfb
2014-11-07 13:45:23 -06:00
Jason Orendorff
937173980c Bug 1090636, part 13 - Reimplement the mHasPrototype part of Proxy::set as a call to BaseProxyHandler::set. r=bholley.
--HG--
extra : rebase_source : 2813538fe67f8ba94b36f7dd24d3ff897e9b84bf
2014-10-15 11:07:41 -05:00
Jason Orendorff
85533ec3ba Bug 1090636, part 12 - Move NativeSet. No change in behavior. r=efaust.
--HG--
extra : rebase_source : 0b78614bc37c7d90132c8e3bb4bb3cafcfde079b
2014-10-29 13:26:57 -05:00
Jason Orendorff
fbcc475221 Bug 1090636, part 11 - Pass pobj (the object that contains the element) to SetDenseOrTypedArrayElement rather than obj. Reflect.set could trigger the bug being fixed here, so we leave a sleeper test for it. r=efaust.
--HG--
extra : rebase_source : 712fb4a4ffd98c0c3e6ba10b3c7dd7bfe8d497f5
2014-10-29 13:04:48 -05:00
Jason Orendorff
d97018a75e Bug 1090636, part 10 - Refactor SetExistingProperty. No change in behavior. r=efaust.
At this point, SetPropertyHelper has been factored into five parts:
  SetPropertyByDefining
  SetNonexistentProperty
  SetDenseOrTypedArrayElement
  SetExistingProperty
  SetPropertyHelper

each with a comment on top and a reasonably clear responsibility. The longest is less than 100 lines, including comments.

--HG--
extra : rebase_source : 4d32ae23b5cdbaa357c205766894dfaa2184c755
2014-10-29 12:47:58 -05:00
Jason Orendorff
df0035f99e Bug 1090636, part 9 - Move SetDenseOrTypedArrayElement above SetExistingProperty. No change in behavior. r=efaust.
--HG--
extra : rebase_source : ef3261205f73b1984a798d68b661aee662ad5a66
2014-10-29 12:36:10 -05:00
Jason Orendorff
34de921348 Bug 1090636, part 8 - Factor out SetDenseOrTypedArrayElement from SetExistingProperty. No change in behavior. r=efaust.
--HG--
extra : rebase_source : ca88c753431c65130ea9bad71fd36a8c88a747d4
2014-10-29 12:29:28 -05:00
Jason Orendorff
face3cfda8 Bug 1090636, part 7 - Assigning to an array element via a proxy should trigger the "shadowing" code. r=efaust.
--HG--
extra : rebase_source : 8cdde27dfe42ef2ade0220b7930de66d0249db92
2014-10-29 11:06:41 -05:00
Jason Orendorff
170defaf2b Bug 1090636, part 6 - Change DefineNativeProperty to support redefining array elements. r=efaust.
As it stands, this code is relatively obscure, so the fact that it's amazingly busted is of little consequence. But once we implement ES6 assignment, this code will be fairly easy to trigger when assigning to any Proxy whose target is an Array.

--HG--
extra : rebase_source : f939b92b42f0470fb0309097fb82f46383a61b25
extra : source : 1ecbc62d82a38e6e36e6ede090d711f3b3ad13ba
2014-11-10 21:11:20 -06:00
Jason Orendorff
2b6589290c Bug 1090636, part 5 - In SetExistingProperty, correctly handle assigning to array.length. r=efaust.
This one is a little complicated. There is some code in SetExistingProperty that is supposed to determine whether or not we should shadow a property that wasn't found on the receiver. This code does not work correctly for array.length properties. (array.length is a data property, so of course it should be shadowed -- but it is non-shadowable() because hasSlot() is false.)

Having fixed that bug, the call to SetArrayLength is only necessary in the non-shadowing case. (In fact, it would be unnecessary altogether but for Parallel JS.) This in turn makes 'attrs' unnecessary, so delete that.

This is a behavior change (a bug fix) in the case of proxies, as the test illustrates.

--HG--
extra : rebase_source : c968a95baf41944ca82a16d40af51a1512ad0938
extra : source : f322eac33cfa1b54486d1d73f62658019774e373
2014-10-29 01:22:28 -05:00
Jason Orendorff
05a72dc6f3 Bug 1090636, part 4 - Update SetPropertyByDefining to implement ES6 draft rev 28 section 9.1.9 steps 5.c-f. r=efaust.
--HG--
extra : rebase_source : c0444b48a571a4c58dc2aef64d8c2fbb6ddc93b5
extra : source : b5a38a0df65d6f7ffeb60344df6155f2aae19bcb
2014-10-29 17:16:45 -05:00
Jason Orendorff
b90a5eb389 Bug 1090636, part 3 - Shadow an existing property even if pobj == obj. r=efaust.
--HG--
extra : rebase_source : 798fff4a674af97ced2f8972ac65bb5761ac4f27
extra : source : 6425c066275186a8b072e7fa2235af6a9b1b202e
2014-10-29 00:13:12 -05:00
Jason Orendorff
76e08c36f5 Bug 1090636, part 2 - Move SetExistingProperty above SetPropertyHelper. No change in behavior. r=efaust.
--HG--
extra : rebase_source : 69f6d18d98d066adfb2742dd5f4411a2a5b3b7a5
extra : source : db5a8d2f9a23ec92e03d9ec5c5ed609179c32abe
2014-10-28 23:50:39 -05:00
Jason Orendorff
d1b04c9362 Bug 1090636, part 1 - Factor out SetExistingProperty from SetPropertyHelper. No change in behavior. r=efaust.
--HG--
extra : rebase_source : 375efc7d9b4b07544f48b53ca5d9031ea4dda2c1
extra : source : 388e4a23e7fb0be8a7f7561e7043531c7132e6f0
2014-10-28 23:48:47 -05:00
Ehsan Akhgari
09a262787c Bug 649012 - Fail mochitest-plains which use flaky timeouts (setTimeout(x) for x > 0); r=ted
We are white-listing the existing set of tests that use setTimeout
like this.  Hopefully these tests will be investigated and fixed
in the future, so that we can narrow down the white-list.

This check is only turned on for mochitest-plain for now.
2014-12-11 13:34:40 -05:00
Brian Hackett
500b00a58c Bug 1107145 - Allow typed objects with the same prototype to have different descriptors, r=nmatsakis. 2014-12-12 10:24:41 -07:00
Nathan Froyd
941541fed4 Backout bbcf9c812bb5:388e4a23e7fb (bug 1090636), for bustage on a CLOSED TREE 2014-12-12 11:49:15 -05:00
Jason Orendorff
8a476b9eb4 Bug 1090636, part 15 - Optimize away the HasOwnProperty call in SetPropertyByDefining, in the common case. No change in behavior, theoretically. r=efaust.
--HG--
extra : rebase_source : 6c8840025cabcd9041bfe4c05c50925c28229f4f
2014-11-12 11:46:38 -06:00
Jason Orendorff
3be561fab8 Bug 1090636, part 14 - Rewrite SetPropertyHelper. r=efaust.
With this patch:

*   SetPropertyHelper no longer calls lookupProperty hooks, which is nice
    since there's no such thing in ES6.

*   As SetPropertyHelper walks the prototype chain, as soon as it reaches a
    non-native object, it calls that object's set hook, passing the original
    receiver, and returns.

    This means Proxy set traps will now be called per spec when triggered via
    the prototype chain from a native object.

    It also means that legacy scripted indirect proxies (Proxy.create) will
    now sometimes have their set trap called when it wouldn't have been called
    before. This seems to be confined to fuzztests in practice, since it only
    matters when the proxy is used as the prototype of an ordinary object.
    But it could cause trouble.

    The same situation affects other proxies too: BaseProxyHandler::set() and
    its overrides will all be called in new situations. It's inevitable though;
    Reflect.set was going to enable all these situations anyway.

--HG--
extra : rebase_source : afd950d3593f5c6dc2c24c8aec92567d9c1269d2
2014-11-07 13:45:23 -06:00
Jason Orendorff
6a47357145 Bug 1090636, part 13 - Reimplement the mHasPrototype part of Proxy::set as a call to BaseProxyHandler::set. r=bholley.
--HG--
extra : rebase_source : edc9dd5f8a45e5112af13073b41e6f6879c6f2ce
2014-10-15 11:07:41 -05:00
Jason Orendorff
1b77b4caf6 Bug 1090636, part 12 - Move NativeSet. No change in behavior. r=efaust.
--HG--
extra : rebase_source : b4adc226db90d3a5fbd16d4b63ea4bc00d02697c
2014-10-29 13:26:57 -05:00
Jason Orendorff
8e59f6a745 Bug 1090636, part 11 - Pass pobj (the object that contains the element) to SetDenseOrTypedArrayElement rather than obj. Reflect.set could trigger the bug being fixed here, so we leave a sleeper test for it. r=efaust.
--HG--
extra : rebase_source : 18e873daea8da331e5c8861e537ed2ba17944b06
2014-10-29 13:04:48 -05:00
Jason Orendorff
ff7b46cfec Bug 1090636, part 10 - Refactor SetExistingProperty. No change in behavior. r=efaust.
At this point, SetPropertyHelper has been factored into five parts:
  SetPropertyByDefining
  SetNonexistentProperty
  SetDenseOrTypedArrayElement
  SetExistingProperty
  SetPropertyHelper

each with a comment on top and a reasonably clear responsibility. The longest is less than 100 lines, including comments.

--HG--
extra : rebase_source : 590d09b7da81417f44580b06b5d5b4e634b641fa
2014-10-29 12:47:58 -05:00
Jason Orendorff
b3413c1d32 Bug 1090636, part 9 - Move SetDenseOrTypedArrayElement above SetExistingProperty. No change in behavior. r=efaust.
--HG--
extra : rebase_source : cc4b742f509392984a82d48d022252291f4182fd
2014-10-29 12:36:10 -05:00
Jason Orendorff
ddeec566f8 Bug 1090636, part 8 - Factor out SetDenseOrTypedArrayElement from SetExistingProperty. No change in behavior. r=efaust.
--HG--
extra : rebase_source : a81ae31c30c8d0206b7e18f79afeb1c6eee8b201
2014-10-29 12:29:28 -05:00
Jason Orendorff
497606c43f Bug 1090636, part 7 - Assigning to an array element via a proxy should trigger the "shadowing" code. r=efaust.
--HG--
extra : rebase_source : b1ae5853de1dc4d100c5f9b7d45e1d2272b512f7
2014-10-29 11:06:41 -05:00
Jason Orendorff
be3715678c Bug 1090636, part 6 - Change DefineNativeProperty to support redefining array elements. r=efaust.
As it stands, this code is relatively obscure, so the fact that it's amazingly busted is of little consequence. But once we implement ES6 assignment, this code will be fairly easy to trigger when assigning to any Proxy whose target is an Array.

--HG--
extra : rebase_source : 1e2741d096f5ac72ae8305aa548747242b44ace7
2014-11-10 21:11:20 -06:00
Jason Orendorff
a21c6c0962 Bug 1090636, part 5 - In SetExistingProperty, correctly handle assigning to array.length. r=efaust.
This one is a little complicated. There is some code in SetExistingProperty that is supposed to determine whether or not we should shadow a property that wasn't found on the receiver. This code does not work correctly for array.length properties. (array.length is a data property, so of course it should be shadowed -- but it is non-shadowable() because hasSlot() is false.)

Having fixed that bug, the call to SetArrayLength is only necessary in the non-shadowing case. (In fact, it would be unnecessary altogether but for Parallel JS.) This in turn makes 'attrs' unnecessary, so delete that.

This is a behavior change (a bug fix) in the case of proxies, as the test illustrates.

--HG--
extra : rebase_source : 18704b24f65bd3336d5c2b2f3e7366b01e7fcec0
2014-10-29 01:22:28 -05:00
Jason Orendorff
85f2f96108 Bug 1090636, part 4 - Update SetPropertyByDefining to implement ES6 draft rev 28 section 9.1.9 steps 5.c-f. r=efaust.
--HG--
extra : rebase_source : 558852c474d603299c47b630bd73b1ae951c6928
2014-10-29 17:16:45 -05:00
Jason Orendorff
b96102579f Bug 1090636, part 3 - Shadow an existing property even if pobj == obj. r=efaust.
--HG--
extra : rebase_source : 2b41d716df229233ff5bcaff8c7fcdf3926f3ab9
2014-10-29 00:13:12 -05:00
Jason Orendorff
a3ec29f5e2 Bug 1090636, part 2 - Move SetExistingProperty above SetPropertyHelper. No change in behavior. r=efaust.
--HG--
extra : rebase_source : 3e8a5f35bbdda14233bb6df1e919abeb4a0f0624
2014-10-28 23:50:39 -05:00