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 "src/allocation.h" | 9 #include "src/allocation.h" |
10 #include "src/assert-scope.h" | 10 #include "src/assert-scope.h" |
(...skipping 682 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
693 static int ArchiveSpacePerThread() { return sizeof(ThreadLocalTop); } | 693 static int ArchiveSpacePerThread() { return sizeof(ThreadLocalTop); } |
694 void FreeThreadResources() { thread_local_top_.Free(); } | 694 void FreeThreadResources() { thread_local_top_.Free(); } |
695 | 695 |
696 // This method is called by the api after operations that may throw | 696 // This method is called by the api after operations that may throw |
697 // exceptions. If an exception was thrown and not handled by an external | 697 // exceptions. If an exception was thrown and not handled by an external |
698 // handler the exception is scheduled to be rethrown when we return to running | 698 // handler the exception is scheduled to be rethrown when we return to running |
699 // JavaScript code. If an exception is scheduled true is returned. | 699 // JavaScript code. If an exception is scheduled true is returned. |
700 bool OptionalRescheduleException(bool is_bottom_call); | 700 bool OptionalRescheduleException(bool is_bottom_call); |
701 | 701 |
702 // Push and pop a promise and the current try-catch handler. | 702 // Push and pop a promise and the current try-catch handler. |
703 void PushPromise(Handle<JSObject> promise); | 703 void PushPromise(Handle<Object> promise); |
704 void PopPromise(); | 704 void PopPromise(); |
705 Handle<Object> GetPromiseOnStackOnThrow(); | 705 Handle<Object> GetPromiseOnStackOnThrow(); |
706 | 706 |
707 class ExceptionScope { | 707 class ExceptionScope { |
708 public: | 708 public: |
709 explicit ExceptionScope(Isolate* isolate) : | 709 explicit ExceptionScope(Isolate* isolate) : |
710 // Scope currently can only be used for regular exceptions, | 710 // Scope currently can only be used for regular exceptions, |
711 // not termination exception. | 711 // not termination exception. |
712 isolate_(isolate), | 712 isolate_(isolate), |
713 pending_exception_(isolate_->pending_exception(), isolate_), | 713 pending_exception_(isolate_->pending_exception(), isolate_), |
(...skipping 623 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1337 #undef FIELD_ACCESSOR | 1337 #undef FIELD_ACCESSOR |
1338 #undef THREAD_LOCAL_TOP_ACCESSOR | 1338 #undef THREAD_LOCAL_TOP_ACCESSOR |
1339 | 1339 |
1340 | 1340 |
1341 class PromiseOnStack { | 1341 class PromiseOnStack { |
1342 public: | 1342 public: |
1343 PromiseOnStack(StackHandler* handler, Handle<JSObject> promise, | 1343 PromiseOnStack(StackHandler* handler, Handle<JSObject> promise, |
1344 PromiseOnStack* prev) | 1344 PromiseOnStack* prev) |
1345 : handler_(handler), promise_(promise), prev_(prev) {} | 1345 : handler_(handler), promise_(promise), prev_(prev) {} |
1346 StackHandler* handler() { return handler_; } | 1346 StackHandler* handler() { return handler_; } |
1347 Handle<JSObject> promise() { return promise_; } | 1347 Handle<Object> promise() { return promise_; } |
1348 PromiseOnStack* prev() { return prev_; } | 1348 PromiseOnStack* prev() { return prev_; } |
1349 | 1349 |
1350 private: | 1350 private: |
1351 StackHandler* handler_; | 1351 StackHandler* handler_; |
1352 Handle<JSObject> promise_; | 1352 Handle<Object> promise_; |
1353 PromiseOnStack* prev_; | 1353 PromiseOnStack* prev_; |
1354 }; | 1354 }; |
1355 | 1355 |
1356 | 1356 |
1357 // If the GCC version is 4.1.x or 4.2.x an additional field is added to the | 1357 // If the GCC version is 4.1.x or 4.2.x an additional field is added to the |
1358 // class as a work around for a bug in the generated code found with these | 1358 // class as a work around for a bug in the generated code found with these |
1359 // versions of GCC. See V8 issue 122 for details. | 1359 // versions of GCC. See V8 issue 122 for details. |
1360 class SaveContext BASE_EMBEDDED { | 1360 class SaveContext BASE_EMBEDDED { |
1361 public: | 1361 public: |
1362 inline explicit SaveContext(Isolate* isolate); | 1362 inline explicit SaveContext(Isolate* isolate); |
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1536 } | 1536 } |
1537 | 1537 |
1538 EmbeddedVector<char, 128> filename_; | 1538 EmbeddedVector<char, 128> filename_; |
1539 FILE* file_; | 1539 FILE* file_; |
1540 int scope_depth_; | 1540 int scope_depth_; |
1541 }; | 1541 }; |
1542 | 1542 |
1543 } } // namespace v8::internal | 1543 } } // namespace v8::internal |
1544 | 1544 |
1545 #endif // V8_ISOLATE_H_ | 1545 #endif // V8_ISOLATE_H_ |
OLD | NEW |