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

Side by Side Diff: src/api.cc

Issue 296133013: Revert "Make v8::TryCatch able to consume natively thrown exceptions (again)." (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 | « no previous file | src/isolate.h » ('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 "api.h" 5 #include "api.h"
6 6
7 #include <string.h> // For memcpy, strlen. 7 #include <string.h> // For memcpy, strlen.
8 #ifdef V8_USE_ADDRESS_SANITIZER 8 #ifdef V8_USE_ADDRESS_SANITIZER
9 #include <sanitizer/asan_interface.h> 9 #include <sanitizer/asan_interface.h>
10 #endif // V8_USE_ADDRESS_SANITIZER 10 #endif // V8_USE_ADDRESS_SANITIZER
(...skipping 1812 matching lines...) Expand 10 before | Expand all | Expand 10 after
1823 // for reuse. capture_message_ needs to be disabled so that DoThrow() 1823 // for reuse. capture_message_ needs to be disabled so that DoThrow()
1824 // does not create a new message. 1824 // does not create a new message.
1825 isolate_->thread_local_top()->rethrowing_message_ = true; 1825 isolate_->thread_local_top()->rethrowing_message_ = true;
1826 isolate_->RestorePendingMessageFromTryCatch(this); 1826 isolate_->RestorePendingMessageFromTryCatch(this);
1827 } 1827 }
1828 isolate_->UnregisterTryCatchHandler(this); 1828 isolate_->UnregisterTryCatchHandler(this);
1829 v8::internal::SimulatorStack::UnregisterCTryCatch(); 1829 v8::internal::SimulatorStack::UnregisterCTryCatch();
1830 reinterpret_cast<Isolate*>(isolate_)->ThrowException(exc); 1830 reinterpret_cast<Isolate*>(isolate_)->ThrowException(exc);
1831 ASSERT(!isolate_->thread_local_top()->rethrowing_message_); 1831 ASSERT(!isolate_->thread_local_top()->rethrowing_message_);
1832 } else { 1832 } else {
1833 if (HasCaught() && isolate_->has_scheduled_exception()) {
1834 // If an exception was caught but is still scheduled because no API call
1835 // promoted it, then it is canceled to prevent it from being propagated.
1836 // Note that this will not cancel termination exceptions.
1837 isolate_->CancelScheduledExceptionFromTryCatch(this);
1838 }
1839 isolate_->UnregisterTryCatchHandler(this); 1833 isolate_->UnregisterTryCatchHandler(this);
1840 v8::internal::SimulatorStack::UnregisterCTryCatch(); 1834 v8::internal::SimulatorStack::UnregisterCTryCatch();
1841 } 1835 }
1842 } 1836 }
1843 1837
1844 1838
1845 bool v8::TryCatch::HasCaught() const { 1839 bool v8::TryCatch::HasCaught() const {
1846 return !reinterpret_cast<i::Object*>(exception_)->IsTheHole(); 1840 return !reinterpret_cast<i::Object*>(exception_)->IsTheHole();
1847 } 1841 }
1848 1842
(...skipping 5716 matching lines...) Expand 10 before | Expand all | Expand 10 after
7565 Isolate* isolate = reinterpret_cast<Isolate*>(info.GetIsolate()); 7559 Isolate* isolate = reinterpret_cast<Isolate*>(info.GetIsolate());
7566 Address callback_address = 7560 Address callback_address =
7567 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); 7561 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback));
7568 VMState<EXTERNAL> state(isolate); 7562 VMState<EXTERNAL> state(isolate);
7569 ExternalCallbackScope call_scope(isolate, callback_address); 7563 ExternalCallbackScope call_scope(isolate, callback_address);
7570 callback(info); 7564 callback(info);
7571 } 7565 }
7572 7566
7573 7567
7574 } } // namespace v8::internal 7568 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | src/isolate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698