Revision: 19511
Author:   [email protected]
Date:     Thu Feb 20 16:11:48 2014 UTC
Log:      Don't turn objects with empty-string properties into fast-mode.

[email protected]

Review URL: https://codereview.chromium.org/165743003
http://code.google.com/p/v8/source/detail?r=19511

Added:
 /branches/bleeding_edge/test/mjsunit/regress/regress-fast-empty-string.js
Modified:
 /branches/bleeding_edge/src/objects.cc

=======================================
--- /dev/null
+++ /branches/bleeding_edge/test/mjsunit/regress/regress-fast-empty-string.js Thu Feb 20 16:11:48 2014 UTC
@@ -0,0 +1,13 @@
+// Copyright 2014 the V8 project authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+var o = {};
+o[""] = 1;
+var x = {__proto__:o};
+for (i = 0; i < 3; i++) {
+  o[""];
+}
+for (i = 0; i < 3; i++) {
+  assertEquals(undefined, o.x);
+}
=======================================
--- /branches/bleeding_edge/src/objects.cc      Thu Feb 20 12:40:34 2014 UTC
+++ /branches/bleeding_edge/src/objects.cc      Thu Feb 20 16:11:48 2014 UTC
@@ -15710,6 +15710,7 @@
         // instance descriptor.
         MaybeObject* maybe_key = heap->InternalizeString(String::cast(k));
         if (!maybe_key->To(&key)) return maybe_key;
+        if (key->Equals(heap->empty_string())) return this;
       }

       PropertyDetails details = DetailsAt(i);

--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
--- You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to