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

Unified Diff: runtime/vm/dart_entry.cc

Issue 853633002: Suspend long jump scope when invoking Dart code. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 5 years, 11 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 | tests/language/language.status » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/dart_entry.cc
===================================================================
--- runtime/vm/dart_entry.cc (revision 42843)
+++ runtime/vm/dart_entry.cc (working copy)
@@ -54,6 +54,26 @@
};
+// Clears/restores Isolate::long_jump_base on construction/destruction.
+// Ensures that we do not attempt to long jump across Dart frames.
+class SuspendLongJumpScope : public StackResource {
+ public:
+ explicit SuspendLongJumpScope(Isolate* isolate)
+ : StackResource(isolate),
+ saved_long_jump_base_(isolate->long_jump_base()) {
+ isolate->set_long_jump_base(NULL);
+ }
+
+ ~SuspendLongJumpScope() {
+ ASSERT(isolate()->long_jump_base() == NULL);
+ isolate()->set_long_jump_base(saved_long_jump_base_);
+ }
+
+ private:
+ LongJumpScope* saved_long_jump_base_;
+};
+
+
RawObject* DartEntry::InvokeFunction(const Function& function,
const Array& arguments,
const Array& arguments_descriptor) {
@@ -75,6 +95,7 @@
ASSERT(!code.IsNull());
ASSERT(Isolate::Current()->no_callback_scope_depth() == 0);
ScopedIsolateStackLimits stack_limit(isolate);
+ SuspendLongJumpScope suspend_long_jump_scope(isolate);
#if defined(USING_SIMULATOR)
#if defined(ARCH_IS_64_BIT)
// TODO(zra): Change to intptr_t so we have only one case.
« no previous file with comments | « no previous file | tests/language/language.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698