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

Unified Diff: src/bootstrapper.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 | « no previous file | src/factory.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/bootstrapper.cc
diff --git a/src/bootstrapper.cc b/src/bootstrapper.cc
index 328ff63cd9d9059d22394e56a56e9a52eeb18ff4..863d1387291fb135b312370f0d873fea28e6e84e 100644
--- a/src/bootstrapper.cc
+++ b/src/bootstrapper.cc
@@ -36,12 +36,10 @@ Handle<String> Bootstrapper::SourceLookup(int index) {
Vector<const char> source = Source::GetScriptSource(index);
NativesExternalStringResource* resource =
new NativesExternalStringResource(source.start(), source.length());
- // We do not expect this to throw an exception. Change this if it does.
- Handle<String> source_code = isolate_->factory()
- ->NewExternalStringFromOneByte(resource)
- .ToHandleChecked();
+ Handle<ExternalOneByteString> source_code =
+ isolate_->factory()->NewNativeSourceString(resource);
// Mark this external string with a special map.
- source_code->set_map(isolate_->heap()->native_source_string_map());
+ DCHECK(source_code->is_short());
Source::GetSourceCache(heap)->set(index, *source_code);
}
Handle<Object> cached_source(Source::GetSourceCache(heap)->get(index),
« no previous file with comments | « no previous file | src/factory.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698