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

Unified Diff: runtime/vm/object.cc

Issue 70183010: Fixes a couple problems with GC of unoptimized code. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 1 month 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
Index: runtime/vm/object.cc
===================================================================
--- runtime/vm/object.cc (revision 30197)
+++ runtime/vm/object.cc (working copy)
@@ -4111,6 +4111,7 @@
void Function::DetachCode() const {
// Set unoptimized code as non-entrant, and set code and unoptimized code
// to null.
+ ASSERT(!HasOptimizedCode());
CodePatcher::PatchEntry(Code::Handle(unoptimized_code()));
StorePointer(&raw_ptr()->code_, Code::null());
StorePointer(&raw_ptr()->unoptimized_code_, Code::null());
@@ -4118,6 +4119,10 @@
void Function::ReattachCode(const Code& code) const {
+ ASSERT(CurrentCode() == Code::null());
+ ASSERT(unoptimized_code() == Code::null());
+ ASSERT(!code.IsNull());
+ ASSERT(!code.is_optimized());
StorePointer(&raw_ptr()->code_, code.raw());
StorePointer(&raw_ptr()->unoptimized_code_, code.raw());
CodePatcher::RestoreEntry(code);
« runtime/vm/gc_marker.cc ('K') | « runtime/vm/object.h ('k') | runtime/vm/pages.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698