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

Unified Diff: runtime/vm/exceptions.cc

Issue 200693002: Set VMTag from stubs when transitioning between Dart and Native (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 9 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/dart_api_impl.cc ('k') | runtime/vm/isolate.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/exceptions.cc
diff --git a/runtime/vm/exceptions.cc b/runtime/vm/exceptions.cc
index 1d4994981cc288fee913adb7df1522706b5749a8..303bebd77ab8a951f58ab1c3025afc07ad396487 100644
--- a/runtime/vm/exceptions.cc
+++ b/runtime/vm/exceptions.cc
@@ -13,6 +13,7 @@
#include "vm/stack_frame.h"
#include "vm/stub_code.h"
#include "vm/symbols.h"
+#include "vm/tags.h"
// Allow the use of ASan (AddressSanitizer). This is needed as ASan needs to be
// told about areas where the VM does the equivalent of a long-jump.
@@ -273,6 +274,7 @@ static void JumpToExceptionHandler(uword program_counter,
NoGCScope no_gc;
RawObject* raw_exception = exception_object.raw();
RawObject* raw_stacktrace = stacktrace_object.raw();
+ Isolate* isolate = Isolate::Current();
#if defined(USING_SIMULATOR)
// Unwinding of the C++ frames and destroying of their stack resources is done
@@ -282,12 +284,13 @@ static void JumpToExceptionHandler(uword program_counter,
// Continue simulating at the given pc in the given frame after setting up the
// exception object in the kExceptionObjectReg register and the stacktrace
// object (may be raw null) in the kStackTraceObjectReg register.
+ isolate->set_vm_tag(VMTag::kScriptTagId);
Simulator::Current()->Longjmp(program_counter, stack_pointer, frame_pointer,
raw_exception, raw_stacktrace);
#else
// Prepare for unwinding frames by destroying all the stack resources
// in the previous frames.
- Isolate* isolate = Isolate::Current();
+
while (isolate->top_resource() != NULL &&
(reinterpret_cast<uword>(isolate->top_resource()) < stack_pointer)) {
isolate->top_resource()->~StackResource();
@@ -304,6 +307,7 @@ static void JumpToExceptionHandler(uword program_counter,
uword current_sp = reinterpret_cast<uword>(&program_counter) - 1024;
__asan_unpoison_memory_region(reinterpret_cast<void*>(current_sp),
stack_pointer - current_sp);
+ isolate->set_vm_tag(VMTag::kScriptTagId);
func(program_counter, stack_pointer, frame_pointer,
raw_exception, raw_stacktrace);
#endif
« no previous file with comments | « runtime/vm/dart_api_impl.cc ('k') | runtime/vm/isolate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698