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

Unified Diff: runtime/vm/object.cc

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 | « no previous file | runtime/vm/parser.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/object.cc
diff --git a/runtime/vm/object.cc b/runtime/vm/object.cc
index 2c6422e7d0e5d68d8799ed3ba5034b6b3bc99174..546148d2668fed3a0ed6b203503f0ffa94db40fd 100644
--- a/runtime/vm/object.cc
+++ b/runtime/vm/object.cc
@@ -1907,6 +1907,7 @@ RawObject* Object::Allocate(intptr_t cls_id, intptr_t size, Heap::Space space) {
Isolate* isolate = thread->isolate();
// New space allocation allowed only in mutator thread (Dart thread);
ASSERT(thread->IsMutatorThread() || (space != Heap::kNew));
+ RELEASE_ASSERT(!thread->IsInsideParser() || (space != Heap::kNew));
ASSERT(thread->no_callback_scope_depth() == 0);
Heap* heap = isolate->heap();
@@ -3092,6 +3093,7 @@ RawFunction* Function::EvaluateHelper(const Class& cls,
const String& expr,
const Array& param_names,
bool is_static) {
+ LeaveParserScope _(Thread::Current());
const String& func_src =
String::Handle(BuildClosureSource(param_names, expr));
Script& script = Script::Handle();
« no previous file with comments | « no previous file | runtime/vm/parser.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698