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( |