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

Unified Diff: src/objects.cc

Issue 329393005: Allow all Names to be fast property names (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 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.h ('k') | test/mjsunit/fast-non-keyed.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/objects.cc
diff --git a/src/objects.cc b/src/objects.cc
index bdfa23cde59d32626192b08ec182f5e2784550e6..d2873b11c918f5b26a0639625fa2ef8cc60783b5 100644
--- a/src/objects.cc
+++ b/src/objects.cc
@@ -1807,11 +1807,7 @@ MaybeHandle<Map> Map::CopyWithField(Handle<Map> map,
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();
@@ -8463,30 +8459,6 @@ bool DescriptorArray::IsEqualTo(DescriptorArray* other) {
#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;
« no previous file with comments | « src/objects.h ('k') | test/mjsunit/fast-non-keyed.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698