From: jochen@chromium.org Date: Thu, 14 Aug 2014 08:40:11 +0000 (+0000) Subject: Revert 23058 - "Allow externalizing cons and sliced string." X-Git-Tag: upstream/4.7.83~7616 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=2de0692a6ef4782b7527d7f031c87b0aa4876a5d;p=platform%2Fupstream%2Fv8.git Revert 23058 - "Allow externalizing cons and sliced string." Reason for revert: broke inspector | Fulfill overdue TODO. | | R=mstarzinger@chromium.org | | Review URL: https://codereview.chromium.org/460643002 TBR=yangguo@chromium.org,mstarzinger@chromium.org BUG=403521 LOG=n Review URL: https://codereview.chromium.org/470913002 git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@23115 ce2b1a6d-e550-0410-aec6-3dcde31c8c00 --- diff --git a/src/api.cc b/src/api.cc index 6f6fb42..aaf6865 100644 --- a/src/api.cc +++ b/src/api.cc @@ -5551,6 +5551,11 @@ bool v8::String::CanMakeExternal() { i::Handle obj = Utils::OpenHandle(this); i::Isolate* isolate = obj->GetIsolate(); + // TODO(yangguo): Externalizing sliced/cons strings allocates. + // This rule can be removed when all code that can + // trigger an access check is handlified and therefore GC safe. + if (isolate->heap()->old_pointer_space()->Contains(*obj)) return false; + if (isolate->string_tracker()->IsFreshUnusedString(obj)) return false; int size = obj->Size(); // Byte size of the original string. if (size < i::ExternalString::kShortSize) return false;