Index: src/isolate-inl.h |
diff --git a/src/isolate-inl.h b/src/isolate-inl.h |
index c6a47a3f9f1b18ce818ab7978dfea34cae66f147..5c71d9188ec51da408f25b1334e0272abc3359e4 100644 |
--- a/src/isolate-inl.h |
+++ b/src/isolate-inl.h |
@@ -100,6 +100,20 @@ Isolate::ExceptionScope::~ExceptionScope() { |
isolate_->set_pending_exception(*pending_exception_); |
} |
+SaveContext::SaveContext(Isolate* isolate) |
+ : isolate_(isolate), prev_(isolate->save_context()) { |
+ if (isolate->context() != NULL) { |
+ context_ = Handle<Context>(isolate->context()); |
+ } |
+ isolate->set_save_context(this); |
+ c_entry_fp_ = isolate->c_entry_fp(isolate->thread_local_top()); |
+} |
+ |
+SaveContext::~SaveContext() { |
+ isolate_->set_context(context_.is_null() ? NULL : *context_); |
+ isolate_->set_save_context(prev_); |
+} |
+ |
#define NATIVE_CONTEXT_FIELD_ACCESSOR(index, type, name) \ |
Handle<type> Isolate::name() { \ |
return Handle<type>(raw_native_context()->name(), this); \ |