| 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 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 162 #define RETURN_FAILURE_ON_EXCEPTION(isolate, call) \ | 162 #define RETURN_FAILURE_ON_EXCEPTION(isolate, call) \ |
| 163 RETURN_ON_EXCEPTION_VALUE(isolate, call, isolate->heap()->exception()) | 163 RETURN_ON_EXCEPTION_VALUE(isolate, call, isolate->heap()->exception()) |
| 164 | 164 |
| 165 #define RETURN_ON_EXCEPTION(isolate, call, T) \ | 165 #define RETURN_ON_EXCEPTION(isolate, call, T) \ |
| 166 RETURN_ON_EXCEPTION_VALUE(isolate, call, MaybeHandle<T>()) | 166 RETURN_ON_EXCEPTION_VALUE(isolate, call, MaybeHandle<T>()) |
| 167 | 167 |
| 168 | 168 |
| 169 #define FOR_EACH_ISOLATE_ADDRESS_NAME(C) \ | 169 #define FOR_EACH_ISOLATE_ADDRESS_NAME(C) \ |
| 170 C(Handler, handler) \ | 170 C(Handler, handler) \ |
| 171 C(CEntryFP, c_entry_fp) \ | 171 C(CEntryFP, c_entry_fp) \ |
| 172 C(CFunction, c_function) \ |
| 172 C(Context, context) \ | 173 C(Context, context) \ |
| 173 C(PendingException, pending_exception) \ | 174 C(PendingException, pending_exception) \ |
| 174 C(ExternalCaughtException, external_caught_exception) \ | 175 C(ExternalCaughtException, external_caught_exception) \ |
| 175 C(JSEntrySP, js_entry_sp) | 176 C(JSEntrySP, js_entry_sp) |
| 176 | 177 |
| 177 | 178 |
| 178 // Platform-independent, reliable thread identifier. | 179 // Platform-independent, reliable thread identifier. |
| 179 class ThreadId { | 180 class ThreadId { |
| 180 public: | 181 public: |
| 181 // Creates an invalid ThreadId. | 182 // Creates an invalid ThreadId. |
| (...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 281 // invariants that hold about pending_exception. We may want to | 282 // invariants that hold about pending_exception. We may want to |
| 282 // unify them later. | 283 // unify them later. |
| 283 Object* scheduled_exception_; | 284 Object* scheduled_exception_; |
| 284 bool external_caught_exception_; | 285 bool external_caught_exception_; |
| 285 SaveContext* save_context_; | 286 SaveContext* save_context_; |
| 286 v8::TryCatch* catcher_; | 287 v8::TryCatch* catcher_; |
| 287 | 288 |
| 288 // Stack. | 289 // Stack. |
| 289 Address c_entry_fp_; // the frame pointer of the top c entry frame | 290 Address c_entry_fp_; // the frame pointer of the top c entry frame |
| 290 Address handler_; // try-blocks are chained through the stack | 291 Address handler_; // try-blocks are chained through the stack |
| 292 Address c_function_; // C function that was called at c entry. |
| 291 | 293 |
| 292 // Throwing an exception may cause a Promise rejection. For this purpose | 294 // Throwing an exception may cause a Promise rejection. For this purpose |
| 293 // we keep track of a stack of nested promises and the corresponding | 295 // we keep track of a stack of nested promises and the corresponding |
| 294 // try-catch handlers. | 296 // try-catch handlers. |
| 295 PromiseOnStack* promise_on_stack_; | 297 PromiseOnStack* promise_on_stack_; |
| 296 | 298 |
| 297 #ifdef USE_SIMULATOR | 299 #ifdef USE_SIMULATOR |
| 298 Simulator* simulator_; | 300 Simulator* simulator_; |
| 299 #endif | 301 #endif |
| 300 | 302 |
| (...skipping 344 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 645 } | 647 } |
| 646 | 648 |
| 647 // Serializer. | 649 // Serializer. |
| 648 void PushToPartialSnapshotCache(Object* obj); | 650 void PushToPartialSnapshotCache(Object* obj); |
| 649 | 651 |
| 650 // JS execution stack (see frames.h). | 652 // JS execution stack (see frames.h). |
| 651 static Address c_entry_fp(ThreadLocalTop* thread) { | 653 static Address c_entry_fp(ThreadLocalTop* thread) { |
| 652 return thread->c_entry_fp_; | 654 return thread->c_entry_fp_; |
| 653 } | 655 } |
| 654 static Address handler(ThreadLocalTop* thread) { return thread->handler_; } | 656 static Address handler(ThreadLocalTop* thread) { return thread->handler_; } |
| 657 Address c_function() { return thread_local_top_.c_function_; } |
| 655 | 658 |
| 656 inline Address* c_entry_fp_address() { | 659 inline Address* c_entry_fp_address() { |
| 657 return &thread_local_top_.c_entry_fp_; | 660 return &thread_local_top_.c_entry_fp_; |
| 658 } | 661 } |
| 659 inline Address* handler_address() { return &thread_local_top_.handler_; } | 662 inline Address* handler_address() { return &thread_local_top_.handler_; } |
| 663 inline Address* c_function_address() { |
| 664 return &thread_local_top_.c_function_; |
| 665 } |
| 660 | 666 |
| 661 // Bottom JS entry. | 667 // Bottom JS entry. |
| 662 Address js_entry_sp() { | 668 Address js_entry_sp() { |
| 663 return thread_local_top_.js_entry_sp_; | 669 return thread_local_top_.js_entry_sp_; |
| 664 } | 670 } |
| 665 inline Address* js_entry_sp_address() { | 671 inline Address* js_entry_sp_address() { |
| 666 return &thread_local_top_.js_entry_sp_; | 672 return &thread_local_top_.js_entry_sp_; |
| 667 } | 673 } |
| 668 | 674 |
| 669 // Generated code scratch locations. | 675 // Generated code scratch locations. |
| (...skipping 875 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1545 } | 1551 } |
| 1546 | 1552 |
| 1547 EmbeddedVector<char, 128> filename_; | 1553 EmbeddedVector<char, 128> filename_; |
| 1548 FILE* file_; | 1554 FILE* file_; |
| 1549 int scope_depth_; | 1555 int scope_depth_; |
| 1550 }; | 1556 }; |
| 1551 | 1557 |
| 1552 } } // namespace v8::internal | 1558 } } // namespace v8::internal |
| 1553 | 1559 |
| 1554 #endif // V8_ISOLATE_H_ | 1560 #endif // V8_ISOLATE_H_ |
| OLD | NEW |