Revision: 21834
Author:   jkumme...@chromium.org
Date:     Fri Jun 13 09:59:39 2014 UTC
Log:      Allow all Names to be fast property names

R=verwa...@chromium.org

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

Modified:
 /branches/bleeding_edge/src/ic.cc
 /branches/bleeding_edge/src/objects.cc
 /branches/bleeding_edge/src/objects.h
 /branches/bleeding_edge/test/mjsunit/fast-non-keyed.js

=======================================
--- /branches/bleeding_edge/src/ic.cc   Thu Jun 12 09:58:10 2014 UTC
+++ /branches/bleeding_edge/src/ic.cc   Fri Jun 13 09:59:39 2014 UTC
@@ -1326,8 +1326,7 @@
       TRACE_IC("StoreIC", name);
     } else if (can_store) {
       UpdateCaches(&lookup, receiver, name, value);
-    } else if (!name->IsCacheable(isolate()) ||
-               lookup.IsNormal() ||
+    } else if (lookup.IsNormal() ||
                (lookup.IsField() && lookup.CanHoldValue(value))) {
       Handle<Code> stub = generic_stub();
       set_target(*stub);
=======================================
--- /branches/bleeding_edge/src/objects.cc      Thu Jun 12 16:41:56 2014 UTC
+++ /branches/bleeding_edge/src/objects.cc      Fri Jun 13 09:59:39 2014 UTC
@@ -1802,11 +1802,7 @@
     return MaybeHandle<Map>();
   }

-  // Normalize the object if the name is an actual name (not the
-  // hidden strings) and is not a real identifier.
-  // Normalize the object if it will have too many fast properties.
   Isolate* isolate = map->GetIsolate();
-  if (!name->IsCacheable(isolate)) return MaybeHandle<Map>();

   // Compute the new index for new field.
   int index = map->NextFreePropertyIndex();
@@ -8403,30 +8399,6 @@
 #endif


-static bool IsIdentifier(UnicodeCache* cache, Name* name) {
-  // Checks whether the buffer contains an identifier (no escape).
-  if (!name->IsString()) return false;
-  String* string = String::cast(name);
-  if (string->length() == 0) return true;
-  ConsStringIteratorOp op;
-  StringCharacterStream stream(string, &op);
-  if (!cache->IsIdentifierStart(stream.GetNext())) {
-    return false;
-  }
-  while (stream.HasMore()) {
-    if (!cache->IsIdentifierPart(stream.GetNext())) {
-      return false;
-    }
-  }
-  return true;
-}
-
-
-bool Name::IsCacheable(Isolate* isolate) {
-  return IsSymbol() || IsIdentifier(isolate->unicode_cache(), this);
-}
-
-
 bool String::LooksValid() {
   if (!GetIsolate()->heap()->Contains(this)) return false;
   return true;
=======================================
--- /branches/bleeding_edge/src/objects.h       Thu Jun 12 15:08:33 2014 UTC
+++ /branches/bleeding_edge/src/objects.h       Fri Jun 13 09:59:39 2014 UTC
@@ -8928,8 +8928,6 @@
   // Casting.
   static inline Name* cast(Object* obj);

-  bool IsCacheable(Isolate* isolate);
-
   DECLARE_PRINTER(Name)

   // Layout description.
=======================================
--- /branches/bleeding_edge/test/mjsunit/fast-non-keyed.js Thu Jun 7 20:12:50 2012 UTC +++ /branches/bleeding_edge/test/mjsunit/fast-non-keyed.js Fri Jun 13 09:59:39 2014 UTC
@@ -108,6 +108,6 @@
 AddProps3(obj3);
 assertTrue(%HasFastProperties(obj3));

-var bad_name = {};
-bad_name[".foo"] = 0;
-assertFalse(%HasFastProperties(bad_name));
+var funny_name = {};
+funny_name[".foo"] = 0;
+assertTrue(%HasFastProperties(funny_name));

--
--
v8-dev mailing list
v8-dev@googlegroups.com
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 v8-dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to