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

Unified Diff: src/objects.cc

Issue 1490193002: Add ExternalStringResourceBase::IsCompressible (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 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 side-by-side diff with in-line comments
Download patch
« src/factory.cc ('K') | « src/factory.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/objects.cc
diff --git a/src/objects.cc b/src/objects.cc
index 732477cd81ff9852091de87e7a262a58e2bcecfc..db7c09138c43967e9ce9fb78d2bb52156482a1b4 100644
--- a/src/objects.cc
+++ b/src/objects.cc
@@ -1687,7 +1687,7 @@ bool String::MakeExternal(v8::String::ExternalStringResource* resource) {
// 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) {
+ if (size < ExternalString::kSize || resource->isCompressible()) {
Yang 2015/12/17 11:41:53 Is this necessary? For source strings, we always c
hajimehoshi 2016/01/05 08:07:44 I meant compressible string should use short_*_map
new_map = is_internalized
? (is_one_byte
? heap->short_external_internalized_string_with_one_byte_data_map()
@@ -1753,7 +1753,7 @@ bool String::MakeExternal(v8::String::ExternalOneByteStringResource* resource) {
// 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) {
+ if (size < ExternalString::kSize || resource->isCompressible()) {
new_map = is_internalized
? heap->short_external_one_byte_internalized_string_map()
: heap->short_external_one_byte_string_map();
« src/factory.cc ('K') | « src/factory.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698