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

Unified Diff: src/factory.cc

Issue 1688043005: Fix SharedFunctionInfo::name flattening nosnap failures (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 10 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 | no next file » | 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 dea22df99608bdbb3391adebfbe87babeea7b8de..339b9ba1627c3270f72dc63bf67ac79ce4335592 100644
--- a/src/factory.cc
+++ b/src/factory.cc
@@ -2119,11 +2119,14 @@ Handle<JSMessageObject> Factory::NewJSMessageObject(
Handle<SharedFunctionInfo> Factory::NewSharedFunctionInfo(
Handle<String> name, MaybeHandle<Code> maybe_code, bool is_constructor) {
+ // Function names are assumed to be flat elsewhere. Must flatten before
+ // allocating SharedFunctionInfo to avoid GC seeing the uninitialized SFI.
+ name = String::Flatten(name, TENURED);
+
Handle<Map> map = shared_function_info_map();
Handle<SharedFunctionInfo> share = New<SharedFunctionInfo>(map, OLD_SPACE);
// Set pointer fields.
- name = String::Flatten(name, TENURED);
share->set_name(*name);
Handle<Code> code;
if (!maybe_code.ToHandle(&code)) {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698