Changeset 196644 in webkit
- Timestamp:
- Feb 16, 2016 11:28:09 AM (8 years ago)
- Location:
- trunk
- Files:
-
- 1 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r196643 r196644 1 2016-02-16 Keith Miller <keith_miller@apple.com> 2 3 ClonedArguments should not materialize its special properties unless they are being changed or deleted 4 https://bugs.webkit.org/show_bug.cgi?id=154128 5 6 Reviewed by Filip Pizlo. 7 8 Have argumnets-strict-mode test the speed of spreading the arguments object. 9 10 * js/regress/script-tests/arguments-strict-mode.js: 11 (foo): 12 1 13 2016-02-16 Ryan Haddad <ryanhaddad@apple.com> 2 14 -
trunk/LayoutTests/js/regress/script-tests/arguments-strict-mode.js
r181993 r196644 1 1 function foo() { 2 2 "use strict"; 3 return arguments[0]; 3 return [...arguments]; 4 4 5 } 5 6 6 7 noInline(foo); 7 8 8 for (var i = 0; i < 1000000; ++i) {9 for (var i = 0; i < 200000; ++i) { 9 10 var result = foo(i); 10 if (result != i)11 if (result[0] != i) 11 12 throw "Error: bad result: " + result; 12 13 } -
trunk/Source/JavaScriptCore/ChangeLog
r196642 r196644 1 2016-02-16 Keith Miller <keith_miller@apple.com> 2 3 ClonedArguments should not materialize its special properties unless they are being changed or deleted 4 https://bugs.webkit.org/show_bug.cgi?id=154128 5 6 Reviewed by Filip Pizlo. 7 8 Before we would materialize ClonedArguments whenever they were being accessed. 9 However this would cause the IC to miss every time as the structure for 10 the arguments object would change as we went to IC it. Thus on the next 11 function call we would miss the cache since the new arguments object 12 would not have materialized the value. 13 14 * runtime/ClonedArguments.cpp: 15 (JSC::ClonedArguments::getOwnPropertySlot): 16 * tests/stress/cloned-arguments-modification.js: Added. 17 (foo): 18 1 19 2016-02-16 Filip Pizlo <fpizlo@apple.com> 2 20 -
trunk/Source/JavaScriptCore/runtime/ClonedArguments.cpp
r188585 r196644 133 133 ClonedArguments* thisObject = jsCast<ClonedArguments*>(object); 134 134 VM& vm = exec->vm(); 135 136 if (ident == vm.propertyNames->callee 137 || ident == vm.propertyNames->caller 138 || ident == vm.propertyNames->iteratorSymbol) 139 thisObject->materializeSpecialsIfNecessary(exec); 140 141 if (Base::getOwnPropertySlot(thisObject, exec, ident, slot)) 142 return true; 143 144 return false; 135 136 if (!thisObject->specialsMaterialized()) { 137 FunctionExecutable* executable = jsCast<FunctionExecutable*>(thisObject->m_callee->executable()); 138 bool isStrictMode = executable->isStrictMode(); 139 140 if (isStrictMode) { 141 if (ident == vm.propertyNames->callee) { 142 slot.setGetterSlot(thisObject, DontDelete | DontEnum | Accessor, thisObject->globalObject()->throwTypeErrorGetterSetter(vm)); 143 return true; 144 } 145 if (ident == vm.propertyNames->caller) { 146 slot.setGetterSlot(thisObject, DontDelete | DontEnum | Accessor, thisObject->globalObject()->throwTypeErrorGetterSetter(vm)); 147 return true; 148 } 149 150 } else if (ident == vm.propertyNames->callee) { 151 slot.setValue(thisObject, 0, thisObject->m_callee.get()); 152 return true; 153 } 154 155 if (ident == vm.propertyNames->iteratorSymbol) { 156 slot.setValue(thisObject, DontEnum, thisObject->globalObject()->arrayProtoValuesFunction()); 157 return true; 158 } 159 } 160 161 return Base::getOwnPropertySlot(thisObject, exec, ident, slot); 145 162 } 146 163
Note: See TracChangeset
for help on using the changeset viewer.