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

Side by Side Diff: src/heap/spaces.cc

Issue 2549773002: Internalize strings in-place (Closed)
Patch Set: rebased Created 3 years, 11 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
« no previous file with comments | « src/heap/scavenger.cc ('k') | src/ia32/code-stubs-ia32.cc » ('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 2011 the V8 project authors. All rights reserved. 1 // Copyright 2011 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/heap/spaces.h" 5 #include "src/heap/spaces.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "src/base/bits.h" 9 #include "src/base/bits.h"
10 #include "src/base/platform/platform.h" 10 #include "src/base/platform/platform.h"
(...skipping 3138 matching lines...) Expand 10 before | Expand all | Expand 10 after
3149 CHECK(object->address() == page->area_start()); 3149 CHECK(object->address() == page->area_start());
3150 3150
3151 // The first word should be a map, and we expect all map pointers to be 3151 // The first word should be a map, and we expect all map pointers to be
3152 // in map space. 3152 // in map space.
3153 Map* map = object->map(); 3153 Map* map = object->map();
3154 CHECK(map->IsMap()); 3154 CHECK(map->IsMap());
3155 CHECK(heap()->map_space()->Contains(map)); 3155 CHECK(heap()->map_space()->Contains(map));
3156 3156
3157 // We have only code, sequential strings, external strings 3157 // We have only code, sequential strings, external strings
3158 // (sequential strings that have been morphed into external 3158 // (sequential strings that have been morphed into external
3159 // strings), fixed arrays, byte arrays, and constant pool arrays in the 3159 // strings), thin strings (sequential strings that have been
3160 // large object space. 3160 // morphed into thin strings), fixed arrays, byte arrays, and
3161 // constant pool arrays in the large object space.
3161 CHECK(object->IsAbstractCode() || object->IsSeqString() || 3162 CHECK(object->IsAbstractCode() || object->IsSeqString() ||
3162 object->IsExternalString() || object->IsFixedArray() || 3163 object->IsExternalString() || object->IsThinString() ||
3163 object->IsFixedDoubleArray() || object->IsByteArray()); 3164 object->IsFixedArray() || object->IsFixedDoubleArray() ||
3165 object->IsByteArray());
3164 3166
3165 // The object itself should look OK. 3167 // The object itself should look OK.
3166 object->ObjectVerify(); 3168 object->ObjectVerify();
3167 3169
3168 // Byte arrays and strings don't have interior pointers. 3170 // Byte arrays and strings don't have interior pointers.
3169 if (object->IsAbstractCode()) { 3171 if (object->IsAbstractCode()) {
3170 VerifyPointersVisitor code_visitor; 3172 VerifyPointersVisitor code_visitor;
3171 object->IterateBody(map->instance_type(), object->Size(), &code_visitor); 3173 object->IterateBody(map->instance_type(), object->Size(), &code_visitor);
3172 } else if (object->IsFixedArray()) { 3174 } else if (object->IsFixedArray()) {
3173 FixedArray* array = FixedArray::cast(object); 3175 FixedArray* array = FixedArray::cast(object);
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
3229 object->ShortPrint(); 3231 object->ShortPrint();
3230 PrintF("\n"); 3232 PrintF("\n");
3231 } 3233 }
3232 printf(" --------------------------------------\n"); 3234 printf(" --------------------------------------\n");
3233 printf(" Marked: %x, LiveCount: %x\n", mark_size, LiveBytes()); 3235 printf(" Marked: %x, LiveCount: %x\n", mark_size, LiveBytes());
3234 } 3236 }
3235 3237
3236 #endif // DEBUG 3238 #endif // DEBUG
3237 } // namespace internal 3239 } // namespace internal
3238 } // namespace v8 3240 } // namespace v8
OLDNEW
« no previous file with comments | « src/heap/scavenger.cc ('k') | src/ia32/code-stubs-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698