| 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 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 276 // invariants that hold about pending_exception. We may want to | 277 // invariants that hold about pending_exception. We may want to |
| 277 // unify them later. | 278 // unify them later. |
| 278 Object* scheduled_exception_; | 279 Object* scheduled_exception_; |
| 279 bool external_caught_exception_; | 280 bool external_caught_exception_; |
| 280 SaveContext* save_context_; | 281 SaveContext* save_context_; |
| 281 v8::TryCatch* catcher_; | 282 v8::TryCatch* catcher_; |
| 282 | 283 |
| 283 // Stack. | 284 // Stack. |
| 284 Address c_entry_fp_; // the frame pointer of the top c entry frame | 285 Address c_entry_fp_; // the frame pointer of the top c entry frame |
| 285 Address handler_; // try-blocks are chained through the stack | 286 Address handler_; // try-blocks are chained through the stack |
| 287 Address c_function_; // C function that was called at c entry. |
| 286 | 288 |
| 287 // Throwing an exception may cause a Promise rejection. For this purpose | 289 // Throwing an exception may cause a Promise rejection. For this purpose |
| 288 // we keep track of a stack of nested promises and the corresponding | 290 // we keep track of a stack of nested promises and the corresponding |
| 289 // try-catch handlers. | 291 // try-catch handlers. |
| 290 PromiseOnStack* promise_on_stack_; | 292 PromiseOnStack* promise_on_stack_; |
| 291 | 293 |
| 292 #ifdef USE_SIMULATOR | 294 #ifdef USE_SIMULATOR |
| 293 Simulator* simulator_; | 295 Simulator* simulator_; |
| 294 #endif | 296 #endif |
| 295 | 297 |
| (...skipping 346 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 642 } | 644 } |
| 643 | 645 |
| 644 // Serializer. | 646 // Serializer. |
| 645 void PushToPartialSnapshotCache(Object* obj); | 647 void PushToPartialSnapshotCache(Object* obj); |
| 646 | 648 |
| 647 // JS execution stack (see frames.h). | 649 // JS execution stack (see frames.h). |
| 648 static Address c_entry_fp(ThreadLocalTop* thread) { | 650 static Address c_entry_fp(ThreadLocalTop* thread) { |
| 649 return thread->c_entry_fp_; | 651 return thread->c_entry_fp_; |
| 650 } | 652 } |
| 651 static Address handler(ThreadLocalTop* thread) { return thread->handler_; } | 653 static Address handler(ThreadLocalTop* thread) { return thread->handler_; } |
| 654 Address c_function() { return thread_local_top_.c_function_; } |
| 652 | 655 |
| 653 inline Address* c_entry_fp_address() { | 656 inline Address* c_entry_fp_address() { |
| 654 return &thread_local_top_.c_entry_fp_; | 657 return &thread_local_top_.c_entry_fp_; |
| 655 } | 658 } |
| 656 inline Address* handler_address() { return &thread_local_top_.handler_; } | 659 inline Address* handler_address() { return &thread_local_top_.handler_; } |
| 660 inline Address* c_function_address() { |
| 661 return &thread_local_top_.c_function_; |
| 662 } |
| 657 | 663 |
| 658 // Bottom JS entry. | 664 // Bottom JS entry. |
| 659 Address js_entry_sp() { | 665 Address js_entry_sp() { |
| 660 return thread_local_top_.js_entry_sp_; | 666 return thread_local_top_.js_entry_sp_; |
| 661 } | 667 } |
| 662 inline Address* js_entry_sp_address() { | 668 inline Address* js_entry_sp_address() { |
| 663 return &thread_local_top_.js_entry_sp_; | 669 return &thread_local_top_.js_entry_sp_; |
| 664 } | 670 } |
| 665 | 671 |
| 666 // Generated code scratch locations. | 672 // Generated code scratch locations. |
| (...skipping 885 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1552 } | 1558 } |
| 1553 | 1559 |
| 1554 EmbeddedVector<char, 128> filename_; | 1560 EmbeddedVector<char, 128> filename_; |
| 1555 FILE* file_; | 1561 FILE* file_; |
| 1556 int scope_depth_; | 1562 int scope_depth_; |
| 1557 }; | 1563 }; |
| 1558 | 1564 |
| 1559 } } // namespace v8::internal | 1565 } } // namespace v8::internal |
| 1560 | 1566 |
| 1561 #endif // V8_ISOLATE_H_ | 1567 #endif // V8_ISOLATE_H_ |
| OLD | NEW |