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

Unified Diff: runtime/vm/heap.cc

Issue 12578009: - Canonicalize types, type_arguments only when the object is marked as being from the core librarie… (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 9 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 | « runtime/vm/heap.h ('k') | runtime/vm/object.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/heap.cc
===================================================================
--- runtime/vm/heap.cc (revision 20419)
+++ runtime/vm/heap.cc (working copy)
@@ -201,11 +201,16 @@
}
-void Heap::EnableGrowthControl() {
- old_space_->EnableGrowthControl();
+void Heap::SetGrowthControlState(bool state) {
+ old_space_->SetGrowthControlState(state);
}
+bool Heap::GrowthControlState() {
+ return old_space_->GrowthControlState();
+}
+
+
void Heap::WriteProtect(bool read_only) {
read_only_ = read_only;
new_space_->WriteProtect(read_only);
@@ -482,4 +487,18 @@
}
#endif // defined(DEBUG)
+
+NoHeapGrowthControlScope::NoHeapGrowthControlScope()
+ : StackResource(Isolate::Current()) {
+ Heap* heap = reinterpret_cast<Isolate*>(isolate())->heap();
+ current_growth_controller_state_ = heap->GrowthControlState();
+ heap->DisableGrowthControl();
+}
+
+
+NoHeapGrowthControlScope::~NoHeapGrowthControlScope() {
+ Heap* heap = reinterpret_cast<Isolate*>(isolate())->heap();
+ heap->SetGrowthControlState(current_growth_controller_state_);
+}
+
} // namespace dart
« no previous file with comments | « runtime/vm/heap.h ('k') | runtime/vm/object.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698