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

Unified Diff: src/runtime.cc

Issue 14710015: Prevent flushing of code that was set with %SetCode. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 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/objects-visiting-inl.h ('k') | src/v8natives.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/runtime.cc
diff --git a/src/runtime.cc b/src/runtime.cc
index 792a14296c4964fce21b15df2855055db6d0d6b8..774e961d5b4529f0c90a2aee9436a18e18bbd309 100644
--- a/src/runtime.cc
+++ b/src/runtime.cc
@@ -2498,6 +2498,13 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_SetCode) {
return Failure::Exception();
}
+ // Mark both, the source and the target, as un-flushable because the
+ // shared unoptimized code makes them impossible to enqueue in a list.
+ ASSERT(target_shared->code()->gc_metadata() == NULL);
+ ASSERT(source_shared->code()->gc_metadata() == NULL);
+ target_shared->set_dont_flush(true);
+ source_shared->set_dont_flush(true);
+
// Set the code, scope info, formal parameter count, and the length
// of the target shared function info. Set the source code of the
// target function to undefined. SetCode is only used for built-in
« no previous file with comments | « src/objects-visiting-inl.h ('k') | src/v8natives.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698