Changeset 246620 in webkit
- Timestamp:
- Jun 19, 2019, 5:38:20 PM (7 years ago)
- Location:
- trunk
- Files:
-
- 4 edited
-
JSTests/ChangeLog (modified) (1 diff)
-
JSTests/test262/expectations.yaml (modified) (2 diffs)
-
Source/JavaScriptCore/ChangeLog (modified) (1 diff)
-
Source/JavaScriptCore/builtins/PromiseConstructor.js (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/JSTests/ChangeLog
r246589 r246620 1 2019-06-19 Alexey Shvayka <shvaikalesh@gmail.com> 2 3 Optimize `resolve` method lookup in Promise static methods 4 https://bugs.webkit.org/show_bug.cgi?id=198864 5 6 Reviewed by Yusuke Suzuki. 7 8 * test262/expectations.yaml: Mark 18 test cases as passing. 9 1 10 2019-06-19 Justin Michaud <justin_michaud@apple.com> 2 11 -
trunk/JSTests/test262/expectations.yaml
r246499 r246620 1096 1096 default: 'Test262Error: Expected SameValue(«undefined», «1») to be true' 1097 1097 strict mode: 'Test262Error: Expected SameValue(«undefined», «1») to be true' 1098 test/built-ins/Promise/all/invoke-resolve-get-error-close.js:1099 default: 'Test262Error: Expected SameValue(«1», «0») to be true'1100 strict mode: 'Test262Error: Expected SameValue(«1», «0») to be true'1101 test/built-ins/Promise/all/invoke-resolve-get-once-multiple-calls.js:1102 default: 'Test262Error: Got `resolve` only once for each iterated value Expected SameValue(«4», «1») to be true'1103 strict mode: 'Test262Error: Got `resolve` only once for each iterated value Expected SameValue(«4», «1») to be true'1104 test/built-ins/Promise/all/invoke-resolve-get-once-no-calls.js:1105 default: 'Test262Error: Got `resolve` only once for each iterated value Expected SameValue(«0», «1») to be true'1106 strict mode: 'Test262Error: Got `resolve` only once for each iterated value Expected SameValue(«0», «1») to be true'1107 1098 test/built-ins/Promise/all/resolve-element-function-nonconstructor.js: 1108 1099 default: 'Test262Error: Expected a TypeError to be thrown but no exception was thrown at all' 1109 1100 strict mode: 'Test262Error: Expected a TypeError to be thrown but no exception was thrown at all' 1110 test/built-ins/Promise/allSettled/invoke-resolve-get-error-close.js:1111 default: 'Test262Error: Expected SameValue(«1», «0») to be true'1112 strict mode: 'Test262Error: Expected SameValue(«1», «0») to be true'1113 test/built-ins/Promise/allSettled/invoke-resolve-get-once-multiple-calls.js:1114 default: 'Test262Error: Got `resolve` only once for each iterated value Expected SameValue(«4», «1») to be true'1115 strict mode: 'Test262Error: Got `resolve` only once for each iterated value Expected SameValue(«4», «1») to be true'1116 test/built-ins/Promise/allSettled/invoke-resolve-get-once-no-calls.js:1117 default: 'Test262Error: Got `resolve` only once for each iterated value Expected SameValue(«0», «1») to be true'1118 strict mode: 'Test262Error: Got `resolve` only once for each iterated value Expected SameValue(«0», «1») to be true'1119 1101 test/built-ins/Promise/allSettled/reject-element-function-nonconstructor.js: 1120 1102 default: 'Test262Error: Expected a TypeError to be thrown but no exception was thrown at all' … … 1129 1111 default: 'Test262Error: Expected SameValue(«[object Promise]», «[object Promise]») to be true' 1130 1112 strict mode: 'Test262Error: Expected SameValue(«[object Promise]», «[object Promise]») to be true' 1131 test/built-ins/Promise/race/invoke-resolve-get-error-close.js:1132 default: 'Test262Error: Expected SameValue(«1», «0») to be true'1133 strict mode: 'Test262Error: Expected SameValue(«1», «0») to be true'1134 test/built-ins/Promise/race/invoke-resolve-get-once-multiple-calls.js:1135 default: 'Test262Error: Got `resolve` only once for each iterated value Expected SameValue(«4», «1») to be true'1136 strict mode: 'Test262Error: Got `resolve` only once for each iterated value Expected SameValue(«4», «1») to be true'1137 test/built-ins/Promise/race/invoke-resolve-get-once-no-calls.js:1138 default: 'Test262Error: Got `resolve` only once for each iterated value Expected SameValue(«0», «1») to be true'1139 strict mode: 'Test262Error: Got `resolve` only once for each iterated value Expected SameValue(«0», «1») to be true'1140 1113 test/built-ins/Promise/reject-function-nonconstructor.js: 1141 1114 default: 'Test262Error: Expected a TypeError to be thrown but no exception was thrown at all' -
trunk/Source/JavaScriptCore/ChangeLog
r246610 r246620 1 2019-06-19 Alexey Shvayka <shvaikalesh@gmail.com> 2 3 Optimize `resolve` method lookup in Promise static methods 4 https://bugs.webkit.org/show_bug.cgi?id=198864 5 6 Reviewed by Yusuke Suzuki. 7 8 Lookup `resolve` method only once in Promise.{all,allSettled,race}. 9 (https://github.com/tc39/ecma262/pull/1506) 10 11 Already implemented in V8. 12 13 * builtins/PromiseConstructor.js: 14 1 15 2019-06-19 Tadeu Zagallo <tzagallo@apple.com> 2 16 -
trunk/Source/JavaScriptCore/builtins/PromiseConstructor.js
r245869 r246620 57 57 58 58 try { 59 var promiseResolve = this.resolve; 60 if (typeof promiseResolve !== "function") 61 @throwTypeError("Promise resolve is not a function"); 62 59 63 for (var value of iterable) { 60 64 @putByValDirect(values, index, @undefined); 61 var nextPromise = this.resolve(value);65 var nextPromise = promiseResolve.@call(this, value); 62 66 var resolveElement = newResolveElement(index); 63 67 ++remainingElementsCount; … … 137 141 138 142 try { 143 var promiseResolve = this.resolve; 144 if (typeof promiseResolve !== "function") 145 @throwTypeError("Promise resolve is not a function"); 146 139 147 for (var value of iterable) { 140 148 @putByValDirect(values, index, @undefined); 141 var nextPromise = this.resolve(value);149 var nextPromise = promiseResolve.@call(this, value); 142 150 var [resolveElement, rejectElement] = newResolveRejectElements(index); 143 151 ++remainingElementsCount; … … 166 174 167 175 try { 176 var promiseResolve = this.resolve; 177 if (typeof promiseResolve !== "function") 178 @throwTypeError("Promise resolve is not a function"); 179 168 180 for (var value of iterable) { 169 var nextPromise = this.resolve(value);181 var nextPromise = promiseResolve.@call(this, value); 170 182 nextPromise.then(promiseCapability.@resolve, promiseCapability.@reject); 171 183 }
Note:
See TracChangeset
for help on using the changeset viewer.