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

Unified Diff: src/factory.cc

Issue 1990183002: [serializer] do not cache resource data pointer for native source. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 7 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
« no previous file with comments | « src/factory.h ('k') | src/heap/heap.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/factory.cc
diff --git a/src/factory.cc b/src/factory.cc
index 7d2dad06243c92581f59ee662f5bd56f687eaa36..480fcfbd4fd7fa03a7786f01df310ee0bfdb55a6 100644
--- a/src/factory.cc
+++ b/src/factory.cc
@@ -704,6 +704,21 @@ MaybeHandle<String> Factory::NewExternalStringFromTwoByte(
return external_string;
}
+Handle<ExternalOneByteString> Factory::NewNativeSourceString(
+ const ExternalOneByteString::Resource* resource) {
+ size_t length = resource->length();
+ DCHECK_LE(length, static_cast<size_t>(String::kMaxLength));
+
+ Handle<Map> map = native_source_string_map();
+ Handle<ExternalOneByteString> external_string =
+ New<ExternalOneByteString>(map, OLD_SPACE);
+ external_string->set_length(static_cast<int>(length));
+ external_string->set_hash_field(String::kEmptyHashField);
+ external_string->set_resource(resource);
+
+ return external_string;
+}
+
Handle<Symbol> Factory::NewSymbol() {
CALL_HEAP_FUNCTION(
« no previous file with comments | « src/factory.h ('k') | src/heap/heap.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698