[VM interpreter] Isolate may be NULL in thread.

This fixes a crash in StackFrameIterator when using interpreter.
Prevent timeout in thread test when using interpreter.
Adjust kernel status file for known issue.

Change-Id: I9e28675a3532153df24456e65407a8ce73503928
Reviewed-on: https://dart-review.googlesource.com/71222
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Régis Crelier <regis@google.com>
diff --git a/runtime/vm/interpreter.h b/runtime/vm/interpreter.h
index 2005f9a..d832205 100644
--- a/runtime/vm/interpreter.h
+++ b/runtime/vm/interpreter.h
@@ -53,9 +53,8 @@
   uword stack_limit() const { return stack_limit_; }
 
   // Returns true if the interpreter's stack contains the given frame.
-  // TODO(regis): Once the interpreter shares the native stack, we may rely on
-  // a new thread vm_tag to identify an interpreter frame and we will not need
-  // this HasFrame() method.
+  // TODO(regis): We should rely on a new thread vm_tag to identify an
+  // interpreter frame and not need this HasFrame() method.
   bool HasFrame(uword frame) const {
     return frame >= stack_base() && frame <= get_fp();
   }
diff --git a/runtime/vm/stack_frame.cc b/runtime/vm/stack_frame.cc
index ee2f77c..8535bcd 100644
--- a/runtime/vm/stack_frame.cc
+++ b/runtime/vm/stack_frame.cc
@@ -578,9 +578,10 @@
 #if defined(DART_USE_INTERPRETER)
 void StackFrameIterator::FrameSetIterator::CheckIfInterpreted(
     uword exit_marker) {
-  // TODO(regis): Once the interpreter shares the native stack, we may rely on
-  // a new thread vm_tag to identify an interpreter frame.
-  Interpreter* interpreter = thread_->isolate()->interpreter();
+  // TODO(regis): We should rely on a new thread vm_tag to identify an
+  // interpreter frame and not need the HasFrame() method.
+  Isolate* isolate = thread_->isolate();
+  Interpreter* interpreter = isolate != NULL ? isolate->interpreter() : NULL;
   is_interpreted_ = (interpreter != NULL) && interpreter->HasFrame(exit_marker);
 }
 #endif
diff --git a/runtime/vm/thread_test.cc b/runtime/vm/thread_test.cc
index 92e04a1..07200fb 100644
--- a/runtime/vm/thread_test.cc
+++ b/runtime/vm/thread_test.cc
@@ -496,11 +496,11 @@
 // to get their verification done and exit. Use a specific UserTag
 // to enable the helpers to verify that the main thread is
 // successfully interrupted in the pure Dart loop.
-#if defined(USING_SIMULATOR)
+#if defined(USING_SIMULATOR) || defined(DART_USE_INTERPRETER)
   const intptr_t kLoopCount = 12345678;
 #else
   const intptr_t kLoopCount = 1234567890;
-#endif  // USING_SIMULATOR
+#endif  // defined(USING_SIMULATOR) || defined(DART_USE_INTERPRETER)
   char buffer[1024];
   Utils::SNPrint(buffer, sizeof(buffer),
                  "import 'dart:developer';\n"
diff --git a/tests/language_2/language_2_kernel.status b/tests/language_2/language_2_kernel.status
index a0a0476..18ddfd3 100644
--- a/tests/language_2/language_2_kernel.status
+++ b/tests/language_2/language_2_kernel.status
@@ -721,6 +721,7 @@
 const_dynamic_type_literal_test/02: Pass
 map_literal3_test/01: Pass
 map_literal3_test/02: Pass
+type_alias_equality_test/02: RuntimeError # Issue 31359
 vm/bool_check_stack_traces_test/01: RuntimeError # No support for line numbers in stacktraces
 vm/bool_check_stack_traces_test/none: RuntimeError # No support for line numbers in stacktraces
 vm/causal_async_exception_stack2_test: RuntimeError # No support for line numbers in stacktraces