OLD | NEW |
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 #ifndef V8_ISOLATE_H_ | 5 #ifndef V8_ISOLATE_H_ |
6 #define V8_ISOLATE_H_ | 6 #define V8_ISOLATE_H_ |
7 | 7 |
8 #include "../include/v8-debug.h" | 8 #include "../include/v8-debug.h" |
9 #include "allocation.h" | 9 #include "allocation.h" |
10 #include "assert-scope.h" | 10 #include "assert-scope.h" |
(...skipping 645 matching lines...) Loading... |
656 | 656 |
657 // This method is called by the api after operations that may throw | 657 // This method is called by the api after operations that may throw |
658 // exceptions. If an exception was thrown and not handled by an external | 658 // exceptions. If an exception was thrown and not handled by an external |
659 // handler the exception is scheduled to be rethrown when we return to running | 659 // handler the exception is scheduled to be rethrown when we return to running |
660 // JavaScript code. If an exception is scheduled true is returned. | 660 // JavaScript code. If an exception is scheduled true is returned. |
661 bool OptionalRescheduleException(bool is_bottom_call); | 661 bool OptionalRescheduleException(bool is_bottom_call); |
662 | 662 |
663 class ExceptionScope { | 663 class ExceptionScope { |
664 public: | 664 public: |
665 explicit ExceptionScope(Isolate* isolate) : | 665 explicit ExceptionScope(Isolate* isolate) : |
666 // Scope currently can only be used for regular exceptions, not | 666 // Scope currently can only be used for regular exceptions, |
667 // failures like OOM or termination exception. | 667 // not termination exception. |
668 isolate_(isolate), | 668 isolate_(isolate), |
669 pending_exception_(isolate_->pending_exception(), isolate_), | 669 pending_exception_(isolate_->pending_exception(), isolate_), |
670 catcher_(isolate_->catcher()) | 670 catcher_(isolate_->catcher()) |
671 { } | 671 { } |
672 | 672 |
673 ~ExceptionScope() { | 673 ~ExceptionScope() { |
674 isolate_->set_catcher(catcher_); | 674 isolate_->set_catcher(catcher_); |
675 isolate_->set_pending_exception(*pending_exception_); | 675 isolate_->set_pending_exception(*pending_exception_); |
676 } | 676 } |
677 | 677 |
(...skipping 813 matching lines...) Loading... |
1491 } | 1491 } |
1492 | 1492 |
1493 EmbeddedVector<char, 128> filename_; | 1493 EmbeddedVector<char, 128> filename_; |
1494 FILE* file_; | 1494 FILE* file_; |
1495 int scope_depth_; | 1495 int scope_depth_; |
1496 }; | 1496 }; |
1497 | 1497 |
1498 } } // namespace v8::internal | 1498 } } // namespace v8::internal |
1499 | 1499 |
1500 #endif // V8_ISOLATE_H_ | 1500 #endif // V8_ISOLATE_H_ |
OLD | NEW |