| Index: runtime/vm/runtime_entry.cc
|
| diff --git a/runtime/vm/runtime_entry.cc b/runtime/vm/runtime_entry.cc
|
| index 6a74969c65c8c5a2f77d613d95db1a0fdd9f2632..a13eb71ee4e68810e7d666ed19153d6ef7c58da1 100644
|
| --- a/runtime/vm/runtime_entry.cc
|
| +++ b/runtime/vm/runtime_entry.cc
|
| @@ -14,6 +14,7 @@
|
| #include "vm/deopt_instructions.h"
|
| #include "vm/exceptions.h"
|
| #include "vm/flags.h"
|
| +#include "vm/kernel_isolate.h"
|
| #include "vm/message.h"
|
| #include "vm/message_handler.h"
|
| #include "vm/object_store.h"
|
| @@ -1629,18 +1630,28 @@ DEFINE_RUNTIME_ENTRY(StackOverflow, 0) {
|
| isolate->reload_every_n_stack_overflow_checks();
|
| if ((FLAG_deoptimize_every > 0) || (FLAG_stacktrace_every > 0) ||
|
| (isolate_reload_every > 0)) {
|
| - // TODO(turnidge): To make --deoptimize_every and
|
| - // --stacktrace-every faster we could move this increment/test to
|
| - // the generated code.
|
| - int32_t count = thread->IncrementAndGetStackOverflowCount();
|
| - if (FLAG_deoptimize_every > 0 && (count % FLAG_deoptimize_every) == 0) {
|
| - do_deopt = true;
|
| - }
|
| - if (FLAG_stacktrace_every > 0 && (count % FLAG_stacktrace_every) == 0) {
|
| - do_stacktrace = true;
|
| - }
|
| - if ((isolate_reload_every > 0) && (count % isolate_reload_every) == 0) {
|
| - do_reload = isolate->CanReload();
|
| +#if defined(DART_PRECOMPILED_RUNTIME)
|
| + const bool is_kernel_isolate = false;
|
| +#else
|
| + // Certain flags should not effect the kernel isolate itself. They might be
|
| + // used by tests via the "VMOptions=--..." annotation to test VM
|
| + // functionality in the main isolate.
|
| + const bool is_kernel_isolate = KernelIsolate::IsKernelIsolate(isolate);
|
| +#endif // !defined(DART_PRECOMPILED_RUNTIME)
|
| + if (!is_kernel_isolate) {
|
| + // TODO(turnidge): To make --deoptimize_every and
|
| + // --stacktrace-every faster we could move this increment/test to
|
| + // the generated code.
|
| + int32_t count = thread->IncrementAndGetStackOverflowCount();
|
| + if (FLAG_deoptimize_every > 0 && (count % FLAG_deoptimize_every) == 0) {
|
| + do_deopt = true;
|
| + }
|
| + if (FLAG_stacktrace_every > 0 && (count % FLAG_stacktrace_every) == 0) {
|
| + do_stacktrace = true;
|
| + }
|
| + if ((isolate_reload_every > 0) && (count % isolate_reload_every) == 0) {
|
| + do_reload = isolate->CanReload();
|
| + }
|
| }
|
| }
|
| if ((FLAG_deoptimize_filter != NULL) || (FLAG_stacktrace_filter != NULL) ||
|
|
|