Commit Graph

37168 Commits

Author SHA1 Message Date
Gabor Krizsanits
fcfb9db7e7 Bug 1110105 - Get rid of -Promise from wantGlobalProperties. r=bholley 2014-12-15 11:34:16 +01:00
Jacek Caban
e65ae9cf95 Bug 1102804 - Fixed -Wparentheses warnings found in mingw build (js part). r=jorendorff 2014-12-14 14:33:38 +01:00
Boris Zbarsky
7a5e7de4de 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
a08f0cc456 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
a522e1acdf 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
a3cef658dd 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
aa1fdd5e65 Bug 1111218 - Fold congruent type barriers. r=bhackett 2014-12-13 22:39:44 +01:00
Ehsan Akhgari
aaa561e1e2 Bug 1109702 - Fix more bad implicit constructors in js; r=Waldo 2014-12-13 10:22:19 -05:00
Tooru Fujisawa
3b04a893ea Bug 1101265 - Simplify parsing empty arrow function parameter. r=Waldo 2014-12-13 15:51:12 +09:00
Chris Peterson
fec35502e3 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
506d15c930 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
ab8bf200bd 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
df0906463c Bug 1073081 - Fix -Waddress warnings about Nuwa functions. r=khuey
--HG--
extra : source : 8cd5108862aaf2c579a76ac6e9c08eb69fa5f3ff
2014-11-26 19:20:03 -05:00
Boris Zbarsky
9ec987ec9b Bug 1110871. Ion-compile JSOP_SYMBOL. r=jandem 2014-12-12 20:52:40 -05:00
Tooru Fujisawa
679ffa6df7 Bug 1105608 - Throw SyntaxError for export-from. r=jorendorff 2014-12-13 10:41:41 +09:00
Wes Kocher
0c01880302 Backed out changeset 0064d8949f0c (bug 1102541) for build bustage on a CLOSED TREE 2014-12-12 12:39:07 -08:00
Brian Hackett
10f374dc94 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
68b43cce6e Bug 1102541 - Add JS::ubi::RootList::addRoot; r=shu 2014-12-11 13:55:49 -08:00
Jason Orendorff
fc69af0b0a 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
55739e8296 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
09c6927395 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
8330fe19f3 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
016176d8a4 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
107dfd9df6 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
931fbe95cd 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
cea6ca0988 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
d4168cbeaf 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
fd06efb881 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
7ae9cc2401 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
69bbdf683d 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
ba16aad3ce 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
57c348aa32 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
8eb0ee7f7c 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
309b4049b4 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
bf71fbac2b 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
c29dfb3e4e Backout bbcf9c812bb5:388e4a23e7fb (bug 1090636), for bustage on a CLOSED TREE 2014-12-12 11:49:15 -05:00
Jason Orendorff
b588dd6463 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
3b44177fda 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
d03740a232 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
4731f5a218 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
706e8865d5 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
8098f30554 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
0f8841030f 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
6a5ffd5a07 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
64c5ff9453 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
603582fa9e 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
e7ca584779 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
b773e07dfe 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
d6aa3d9c3f 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
f1b75869de 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