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

Unified Diff: src/objects.cc

Issue 368223002: Turn old space cons strings into regular external strings (not short). (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
Index: src/objects.cc
diff --git a/src/objects.cc b/src/objects.cc
index c7e44e6c49fb37fdfd3fe208a53209010e944518..f0c0824342f990ffc4df20227e28304b1b9023b1 100644
--- a/src/objects.cc
+++ b/src/objects.cc
@@ -1067,18 +1067,13 @@ bool String::MakeExternal(v8::String::ExternalStringResource* resource) {
bool is_internalized = this->IsInternalizedString();
// Morph the string to an external string by replacing the map and
- // reinitializing the fields. This won't work if
- // - the space the existing string occupies is too small for a regular
- // external string.
- // - the existing string is in old pointer space and the backing store of
- // the external string is not aligned. The GC cannot deal with a field
- // containing a possibly unaligned address to outside of V8's heap.
- // In either case we resort to a short external string instead, omitting
+ // reinitializing the fields. This won't work if the space the existing
+ // string occupies is too small for a regular external string.
Hannes Payer (out of office) 2014/07/03 11:37:18 minus one blank before "external string"
+ // Instead, we resort to a short external string instead, omitting
Hannes Payer (out of office) 2014/07/03 11:37:18 drop the second instead
// the field caching the address of the backing store. When we encounter
// short external strings in generated code, we need to bailout to runtime.
Map* new_map;
- if (size < ExternalString::kSize ||
- heap->old_pointer_space()->Contains(this)) {
+ if (size < ExternalString::kSize) {
new_map = is_internalized
? (is_ascii
? heap->
@@ -1139,18 +1134,13 @@ bool String::MakeExternal(v8::String::ExternalAsciiStringResource* resource) {
bool is_internalized = this->IsInternalizedString();
// Morph the string to an external string by replacing the map and
- // reinitializing the fields. This won't work if
- // - the space the existing string occupies is too small for a regular
- // external string.
- // - the existing string is in old pointer space and the backing store of
- // the external string is not aligned. The GC cannot deal with a field
- // containing a possibly unaligned address to outside of V8's heap.
- // In either case we resort to a short external string instead, omitting
+ // reinitializing the fields. This won't work if the space the existing
+ // string occupies is too small for a regular external string.
Hannes Payer (out of office) 2014/07/03 11:37:18 same as above
+ // Instead, we resort to a short external string instead, omitting
// the field caching the address of the backing store. When we encounter
// short external strings in generated code, we need to bailout to runtime.
Map* new_map;
- if (size < ExternalString::kSize ||
- heap->old_pointer_space()->Contains(this)) {
+ if (size < ExternalString::kSize) {
new_map = is_internalized
? heap->short_external_ascii_internalized_string_map()
: heap->short_external_ascii_string_map();

Powered by Google App Engine
This is Rietveld 408576698