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

Side by Side Diff: src/isolate.cc

Issue 291123002: Ensure that interruptor callback registered through API is called outside of ExecutionAccess lock. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 7 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/execution.cc ('k') | test/cctest/test-api.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include <stdlib.h> 5 #include <stdlib.h>
6 6
7 #include "v8.h" 7 #include "v8.h"
8 8
9 #include "ast.h" 9 #include "ast.h"
10 #include "bootstrapper.h" 10 #include "bootstrapper.h"
(...skipping 824 matching lines...) Expand 10 before | Expand all | Expand 10 after
835 } 835 }
836 if (has_scheduled_exception() && 836 if (has_scheduled_exception() &&
837 scheduled_exception() == heap_.termination_exception()) { 837 scheduled_exception() == heap_.termination_exception()) {
838 thread_local_top()->external_caught_exception_ = false; 838 thread_local_top()->external_caught_exception_ = false;
839 clear_scheduled_exception(); 839 clear_scheduled_exception();
840 } 840 }
841 } 841 }
842 842
843 843
844 void Isolate::InvokeApiInterruptCallback() { 844 void Isolate::InvokeApiInterruptCallback() {
845 InterruptCallback callback = api_interrupt_callback_; 845 // Note: callback below should be called outside of execution access lock.
846 void* data = api_interrupt_callback_data_; 846 InterruptCallback callback = NULL;
847 api_interrupt_callback_ = NULL; 847 void* data = NULL;
848 api_interrupt_callback_data_ = NULL; 848 {
849 ExecutionAccess access(this);
850 callback = api_interrupt_callback_;
851 data = api_interrupt_callback_data_;
852 api_interrupt_callback_ = NULL;
853 api_interrupt_callback_data_ = NULL;
854 }
849 855
850 if (callback != NULL) { 856 if (callback != NULL) {
851 VMState<EXTERNAL> state(this); 857 VMState<EXTERNAL> state(this);
852 HandleScope handle_scope(this); 858 HandleScope handle_scope(this);
853 callback(reinterpret_cast<v8::Isolate*>(this), data); 859 callback(reinterpret_cast<v8::Isolate*>(this), data);
854 } 860 }
855 } 861 }
856 862
857 863
858 Object* Isolate::Throw(Object* exception, MessageLocation* location) { 864 Object* Isolate::Throw(Object* exception, MessageLocation* location) {
(...skipping 1436 matching lines...) Expand 10 before | Expand all | Expand 10 after
2295 Execution::Call(this, microtask, factory()->undefined_value(), 2301 Execution::Call(this, microtask, factory()->undefined_value(),
2296 0, NULL).Check(); 2302 0, NULL).Check();
2297 } 2303 }
2298 } 2304 }
2299 2305
2300 handle_scope_implementer()->DecrementCallDepth(); 2306 handle_scope_implementer()->DecrementCallDepth();
2301 } 2307 }
2302 2308
2303 2309
2304 } } // namespace v8::internal 2310 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/execution.cc ('k') | test/cctest/test-api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698