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

Unified Diff: runtime/vm/code_generator.cc

Issue 1934733002: Don’t cache constants in initializer expressions (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 8 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.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/code_generator.cc
diff --git a/runtime/vm/code_generator.cc b/runtime/vm/code_generator.cc
index 97b8fc8d4fb261d3bf108ce08a83026ffe89a385..a8e3965c76762ebc18d75782a9aa637e204f2e7f 100644
--- a/runtime/vm/code_generator.cc
+++ b/runtime/vm/code_generator.cc
@@ -1282,6 +1282,14 @@ DEFINE_RUNTIME_ENTRY(StackOverflow, 0) {
if (FLAG_support_debugger && do_stacktrace) {
String& var_name = String::Handle();
Instance& var_value = Instance::Handle();
+ // Collecting the stack trace and accessing local variables
+ // of frames may trigger parsing of functions to compute
+ // variable descriptors of functions. Parsing may trigger
+ // code execution, e.g. to compute compile-time constants. Thus,
+ // disable FLAG_stacktrace_every during trace collection to prevent
+ // recursive stack trace collection.
+ intptr_t saved_stacktrace_very = FLAG_stacktrace_every;
rmacnak 2016/04/29 21:01:21 saved_stacktrace_every
hausner 2016/04/29 22:11:21 :-) Thanks
+ FLAG_stacktrace_every = 0;
DebuggerStackTrace* stack = isolate->debugger()->StackTrace();
intptr_t num_frames = stack->Length();
for (intptr_t i = 0; i < num_frames; i++) {
@@ -1294,6 +1302,7 @@ DEFINE_RUNTIME_ENTRY(StackOverflow, 0) {
frame->VariableAt(v, &var_name, &unused, &unused, &var_value);
}
}
+ FLAG_stacktrace_every = saved_stacktrace_very;
}
const Error& error = Error::Handle(thread->HandleInterrupts());
« no previous file with comments | « no previous file | runtime/vm/parser.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698