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

Side by Side Diff: src/objects.cc

Issue 165743003: Don't turn objects with empty-string properties into fast-mode. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 10 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | test/mjsunit/regress/regress-fast-empty-string.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 the V8 project authors. All rights reserved. 1 // Copyright 2013 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 15692 matching lines...) Expand 10 before | Expand all | Expand 10 after
15703 if (IsKey(k)) { 15703 if (IsKey(k)) {
15704 Object* value = ValueAt(i); 15704 Object* value = ValueAt(i);
15705 Name* key; 15705 Name* key;
15706 if (k->IsSymbol()) { 15706 if (k->IsSymbol()) {
15707 key = Symbol::cast(k); 15707 key = Symbol::cast(k);
15708 } else { 15708 } else {
15709 // Ensure the key is a unique name before writing into the 15709 // Ensure the key is a unique name before writing into the
15710 // instance descriptor. 15710 // instance descriptor.
15711 MaybeObject* maybe_key = heap->InternalizeString(String::cast(k)); 15711 MaybeObject* maybe_key = heap->InternalizeString(String::cast(k));
15712 if (!maybe_key->To(&key)) return maybe_key; 15712 if (!maybe_key->To(&key)) return maybe_key;
15713 if (key->Equals(heap->empty_string())) return this;
15713 } 15714 }
15714 15715
15715 PropertyDetails details = DetailsAt(i); 15716 PropertyDetails details = DetailsAt(i);
15716 int enumeration_index = details.dictionary_index(); 15717 int enumeration_index = details.dictionary_index();
15717 PropertyType type = details.type(); 15718 PropertyType type = details.type();
15718 15719
15719 if (value->IsJSFunction()) { 15720 if (value->IsJSFunction()) {
15720 ConstantDescriptor d(key, value, details.attributes()); 15721 ConstantDescriptor d(key, value, details.attributes());
15721 descriptors->Set(enumeration_index - 1, &d, witness); 15722 descriptors->Set(enumeration_index - 1, &d, witness);
15722 } else if (type == NORMAL) { 15723 } else if (type == NORMAL) {
(...skipping 759 matching lines...) Expand 10 before | Expand all | Expand 10 after
16482 #define ERROR_MESSAGES_TEXTS(C, T) T, 16483 #define ERROR_MESSAGES_TEXTS(C, T) T,
16483 static const char* error_messages_[] = { 16484 static const char* error_messages_[] = {
16484 ERROR_MESSAGES_LIST(ERROR_MESSAGES_TEXTS) 16485 ERROR_MESSAGES_LIST(ERROR_MESSAGES_TEXTS)
16485 }; 16486 };
16486 #undef ERROR_MESSAGES_TEXTS 16487 #undef ERROR_MESSAGES_TEXTS
16487 return error_messages_[reason]; 16488 return error_messages_[reason];
16488 } 16489 }
16489 16490
16490 16491
16491 } } // namespace v8::internal 16492 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | test/mjsunit/regress/regress-fast-empty-string.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698