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

Unified Diff: runtime/vm/parser.h

Issue 2901103004: Experimental code to detect transitive closure of parser code which causes new-space allocations
Patch Set: Created 3 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 | « runtime/vm/object.cc ('k') | runtime/vm/parser.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/parser.h
diff --git a/runtime/vm/parser.h b/runtime/vm/parser.h
index c7f766efe829abc6ed46fa580f9fdca96c627e1c..983715fc9e03d4708cc1abba5b6b1b0a2ba76d51 100644
--- a/runtime/vm/parser.h
+++ b/runtime/vm/parser.h
@@ -261,6 +261,23 @@ class ParsedFunction : public ZoneAllocated {
DISALLOW_COPY_AND_ASSIGN(ParsedFunction);
};
+class EnterParserScope : public StackResource {
+ public:
+ explicit EnterParserScope(Thread* thread);
+ virtual ~EnterParserScope();
+
+ private:
+ bool old_;
+};
+
+class LeaveParserScope : public StackResource {
+ public:
+ explicit LeaveParserScope(Thread* thread);
+ virtual ~LeaveParserScope();
+
+ private:
+ bool old_;
+};
class Parser : public ValueObject {
public:
@@ -949,6 +966,8 @@ class Parser : public ValueObject {
Thread* thread_; // Cached current thread.
Isolate* isolate_; // Cached current isolate.
+ EnterParserScope enter_parser_scope_;
+
// It is Heap::kNew for mutator thread and Heap::kOld for other threads (e.g.
// background compiler).
Heap::Space allocation_space_;
« no previous file with comments | « runtime/vm/object.cc ('k') | runtime/vm/parser.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698