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

Unified Diff: src/mark-compact.cc

Issue 1700: Do not shortcut cons string symbols during garbage collection.... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 12 years, 3 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 | « no previous file | src/objects.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/mark-compact.cc
===================================================================
--- src/mark-compact.cc (revision 249)
+++ src/mark-compact.cc (working copy)
@@ -221,15 +221,15 @@
inline HeapObject* ShortCircuitConsString(Object** p) {
- // Optimization: If the heap object pointed to by p is a cons string whose
- // right substring is Heap::empty_string, update it in place to its left
- // substring. Return the updated value.
+ // Optimization: If the heap object pointed to by p is a non-symbol
+ // cons string whose right substring is Heap::empty_string, update
+ // it in place to its left substring. Return the updated value.
//
// Here we assume that if we change *p, we replace it with a heap object
// (ie, the left substring of a cons string is always a heap object).
//
// The check performed is:
- // object->IsConsString() &&
+ // object->IsConsString() && !object->IsSymbol() &&
// (ConsString::cast(object)->second() == Heap::empty_string())
// except the maps for the object and its possible substrings might be
// marked.
@@ -237,7 +237,9 @@
MapWord map_word = object->map_word();
map_word.ClearMark();
InstanceType type = map_word.ToMap()->instance_type();
- if (type >= FIRST_NONSTRING_TYPE) return object;
+ if (type >= FIRST_NONSTRING_TYPE || (type & kIsSymbolMask) != 0) {
+ return object;
+ }
StringRepresentationTag rep =
static_cast<StringRepresentationTag>(type & kStringRepresentationMask);
« no previous file with comments | « no previous file | src/objects.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698