Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(495)

Unified Diff: test/mjsunit/arguments.js

Issue 1194023004: Let AddDictionaryElement / AddFastElement purely add, move transition heuristics to AddDataElement (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Add test Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/objects.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/mjsunit/arguments.js
diff --git a/test/mjsunit/arguments.js b/test/mjsunit/arguments.js
index 56c1d7224df5f6b0763a8ecda64c485cead0e8da..26eb38912a0e552dc6d61243ccb8b3480ae892ed 100644
--- a/test/mjsunit/arguments.js
+++ b/test/mjsunit/arguments.js
@@ -25,6 +25,8 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+// Flags: --allow-natives-syntax
+
function argc0() {
return arguments.length;
}
@@ -188,3 +190,17 @@ function arg_set(x) { return (arguments[x] = 117); }
assertEquals(undefined, arg_get(0xFFFFFFFF));
assertEquals(true, arg_del(0xFFFFFFFF));
assertEquals(117, arg_set(0xFFFFFFFF));
+
+(function() {
+ function f(a) { return arguments; }
+ var a = f(1,2,3);
+ // Turn arguments into slow.
+ assertTrue(%HasSloppyArgumentsElements(a));
+ a[10000] = 1;
+ assertTrue(%HasSloppyArgumentsElements(a));
+ // Make it fast again by adding values.
+ for (var i = 0; i < 1000; i++) {
+ a[i] = 1.5;
+ }
+ assertTrue(%HasSloppyArgumentsElements(a));
+})();
« no previous file with comments | « src/objects.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698