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

Side by Side Diff: src/profiler/heap-snapshot-generator.cc

Issue 2549773002: Internalize strings in-place (Closed)
Patch Set: forgot one Created 4 years 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
OLDNEW
1 // Copyright 2013 the V8 project authors. All rights reserved. 1 // Copyright 2013 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/profiler/heap-snapshot-generator.h" 5 #include "src/profiler/heap-snapshot-generator.h"
6 6
7 #include "src/code-stubs.h" 7 #include "src/code-stubs.h"
8 #include "src/conversions.h" 8 #include "src/conversions.h"
9 #include "src/debug/debug.h" 9 #include "src/debug/debug.h"
10 #include "src/objects-body-descriptors.h" 10 #include "src/objects-body-descriptors.h"
(...skipping 1150 matching lines...) Expand 10 before | Expand all | Expand 10 after
1161 if (string->IsConsString()) { 1161 if (string->IsConsString()) {
1162 ConsString* cs = ConsString::cast(string); 1162 ConsString* cs = ConsString::cast(string);
1163 SetInternalReference(cs, entry, "first", cs->first(), 1163 SetInternalReference(cs, entry, "first", cs->first(),
1164 ConsString::kFirstOffset); 1164 ConsString::kFirstOffset);
1165 SetInternalReference(cs, entry, "second", cs->second(), 1165 SetInternalReference(cs, entry, "second", cs->second(),
1166 ConsString::kSecondOffset); 1166 ConsString::kSecondOffset);
1167 } else if (string->IsSlicedString()) { 1167 } else if (string->IsSlicedString()) {
1168 SlicedString* ss = SlicedString::cast(string); 1168 SlicedString* ss = SlicedString::cast(string);
1169 SetInternalReference(ss, entry, "parent", ss->parent(), 1169 SetInternalReference(ss, entry, "parent", ss->parent(),
1170 SlicedString::kParentOffset); 1170 SlicedString::kParentOffset);
1171 } else if (string->IsThinString()) {
1172 ThinString* ts = ThinString::cast(string);
1173 SetInternaleReference(ts, entry, "actual", ts->actual(),
1174 ThinString::kActualOffset);
1171 } 1175 }
1172 } 1176 }
1173 1177
1174 1178
1175 void V8HeapExplorer::ExtractSymbolReferences(int entry, Symbol* symbol) { 1179 void V8HeapExplorer::ExtractSymbolReferences(int entry, Symbol* symbol) {
1176 SetInternalReference(symbol, entry, 1180 SetInternalReference(symbol, entry,
1177 "name", symbol->name(), 1181 "name", symbol->name(),
1178 Symbol::kNameOffset); 1182 Symbol::kNameOffset);
1179 } 1183 }
1180 1184
(...skipping 1933 matching lines...) Expand 10 before | Expand all | Expand 10 after
3114 for (int i = 1; i < sorted_strings.length(); ++i) { 3118 for (int i = 1; i < sorted_strings.length(); ++i) {
3115 writer_->AddCharacter(','); 3119 writer_->AddCharacter(',');
3116 SerializeString(sorted_strings[i]); 3120 SerializeString(sorted_strings[i]);
3117 if (writer_->aborted()) return; 3121 if (writer_->aborted()) return;
3118 } 3122 }
3119 } 3123 }
3120 3124
3121 3125
3122 } // namespace internal 3126 } // namespace internal
3123 } // namespace v8 3127 } // namespace v8
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698