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

Unified Diff: vm/snapshot.h

Issue 11293163: Throw illegal argument exception when (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/runtime/
Patch Set: Created 8 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
« vm/base_isolate.h ('K') | « vm/exceptions.cc ('k') | vm/snapshot.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: vm/snapshot.h
===================================================================
--- vm/snapshot.h (revision 14802)
+++ vm/snapshot.h (working copy)
@@ -482,6 +482,29 @@
ObjectStore* object_store() const { return object_store_; }
private:
+ class NoGCDuringSnapshotWriteScope : public ValueObject {
+ public:
+#if defined(DEBUG)
+ NoGCDuringSnapshotWriteScope() {
+ Isolate::Current()->IncrementNoGCScopeDepth();
+ }
+ ~NoGCDuringSnapshotWriteScope() {
+ Isolate::Current()->DecrementNoGCScopeDepth();
+ }
+ void Reset() const {
+ Isolate::Current()->ResetNoGCScopeDepth();
+ }
+#else // defined(DEBUG)
+ NoGCDuringSnapshotWriteScope() {}
+ ~NoGCDuringSnapshotWriteScope() {}
+ void Reset() const {}
+#endif // defined(DEBUG)
+ private:
+ DISALLOW_COPY_AND_ASSIGN(NoGCDuringSnapshotWriteScope);
+ };
+ void ThrowIllegalArgException(const NoGCDuringSnapshotWriteScope& no_gc,
+ const char* msg);
+
Snapshot::Kind kind_;
ObjectStore* object_store_; // Object store for common classes.
ClassTable* class_table_; // Class table for the class index to class lookup.
« vm/base_isolate.h ('K') | « vm/exceptions.cc ('k') | vm/snapshot.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698