| OLD | NEW |
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef VM_ISOLATE_H_ | 5 #ifndef VM_ISOLATE_H_ |
| 6 #define VM_ISOLATE_H_ | 6 #define VM_ISOLATE_H_ |
| 7 | 7 |
| 8 #include "include/dart_api.h" | 8 #include "include/dart_api.h" |
| 9 #include "platform/assert.h" | 9 #include "platform/assert.h" |
| 10 #include "platform/thread.h" | 10 #include "platform/thread.h" |
| (...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 219 return reinterpret_cast<uword>(&stack_limit_); | 219 return reinterpret_cast<uword>(&stack_limit_); |
| 220 } | 220 } |
| 221 | 221 |
| 222 // The current stack limit. This may be overwritten with a special | 222 // The current stack limit. This may be overwritten with a special |
| 223 // value to trigger interrupts. | 223 // value to trigger interrupts. |
| 224 uword stack_limit() const { return stack_limit_; } | 224 uword stack_limit() const { return stack_limit_; } |
| 225 | 225 |
| 226 // The true stack limit for this isolate. | 226 // The true stack limit for this isolate. |
| 227 uword saved_stack_limit() const { return saved_stack_limit_; } | 227 uword saved_stack_limit() const { return saved_stack_limit_; } |
| 228 | 228 |
| 229 // Stack overflow flags |
| 230 enum { |
| 231 kOsrRequest = 0x1, // Current stack overflow caused by OSR request. |
| 232 }; |
| 233 |
| 234 uword stack_overflow_flags_address() const { |
| 235 return reinterpret_cast<uword>(&stack_overflow_flags_); |
| 236 } |
| 237 |
| 238 int32_t IncrementAndGetStackOverflowCount() { |
| 239 return ++stack_overflow_count_; |
| 240 } |
| 241 |
| 242 // Retrieves and clears the stack overflow flags. These are set by |
| 243 // the generated code before the slow path runtime routine for a |
| 244 // stack overflow is called. |
| 245 uword GetAndClearStackOverflowFlags(); |
| 246 |
| 229 // Retrieve the stack address bounds. | 247 // Retrieve the stack address bounds. |
| 230 bool GetStackBounds(uword* lower, uword* upper); | 248 bool GetStackBounds(uword* lower, uword* upper); |
| 231 | 249 |
| 232 static uword GetSpecifiedStackSize(); | 250 static uword GetSpecifiedStackSize(); |
| 233 | 251 |
| 234 static const intptr_t kStackSizeBuffer = (4 * KB * kWordSize); | 252 static const intptr_t kStackSizeBuffer = (4 * KB * kWordSize); |
| 235 | 253 |
| 254 // Interrupt bits. |
| 236 enum { | 255 enum { |
| 237 kApiInterrupt = 0x1, // An interrupt from Dart_InterruptIsolate. | 256 kApiInterrupt = 0x1, // An interrupt from Dart_InterruptIsolate. |
| 238 kMessageInterrupt = 0x2, // An interrupt to process an out of band message. | 257 kMessageInterrupt = 0x2, // An interrupt to process an out of band message. |
| 239 kStoreBufferInterrupt = 0x4, // An interrupt to process the store buffer. | 258 kStoreBufferInterrupt = 0x4, // An interrupt to process the store buffer. |
| 240 kVmStatusInterrupt = 0x8, // An interrupt to process a status request. | 259 kVmStatusInterrupt = 0x8, // An interrupt to process a status request. |
| 241 | 260 |
| 242 kInterruptsMask = | 261 kInterruptsMask = |
| 243 kApiInterrupt | | 262 kApiInterrupt | |
| 244 kMessageInterrupt | | 263 kMessageInterrupt | |
| 245 kStoreBufferInterrupt | | 264 kStoreBufferInterrupt | |
| (...skipping 257 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 503 Debugger* debugger_; | 522 Debugger* debugger_; |
| 504 bool single_step_; | 523 bool single_step_; |
| 505 Random random_; | 524 Random random_; |
| 506 Simulator* simulator_; | 525 Simulator* simulator_; |
| 507 LongJumpScope* long_jump_base_; | 526 LongJumpScope* long_jump_base_; |
| 508 TimerList timer_list_; | 527 TimerList timer_list_; |
| 509 intptr_t deopt_id_; | 528 intptr_t deopt_id_; |
| 510 Mutex* mutex_; // protects stack_limit_ and saved_stack_limit_. | 529 Mutex* mutex_; // protects stack_limit_ and saved_stack_limit_. |
| 511 uword stack_limit_; | 530 uword stack_limit_; |
| 512 uword saved_stack_limit_; | 531 uword saved_stack_limit_; |
| 532 uword stack_overflow_flags_; |
| 533 int32_t stack_overflow_count_; |
| 513 MessageHandler* message_handler_; | 534 MessageHandler* message_handler_; |
| 514 IsolateSpawnState* spawn_state_; | 535 IsolateSpawnState* spawn_state_; |
| 515 bool is_runnable_; | 536 bool is_runnable_; |
| 516 Dart_GcPrologueCallback gc_prologue_callback_; | 537 Dart_GcPrologueCallback gc_prologue_callback_; |
| 517 Dart_GcEpilogueCallback gc_epilogue_callback_; | 538 Dart_GcEpilogueCallback gc_epilogue_callback_; |
| 518 intptr_t defer_finalization_count_; | 539 intptr_t defer_finalization_count_; |
| 519 DeoptContext* deopt_context_; | 540 DeoptContext* deopt_context_; |
| 520 | 541 |
| 521 // Status support. | 542 // Status support. |
| 522 char* stacktrace_; | 543 char* stacktrace_; |
| (...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 667 char* script_url_; | 688 char* script_url_; |
| 668 char* library_url_; | 689 char* library_url_; |
| 669 char* class_name_; | 690 char* class_name_; |
| 670 char* function_name_; | 691 char* function_name_; |
| 671 char* exception_callback_name_; | 692 char* exception_callback_name_; |
| 672 }; | 693 }; |
| 673 | 694 |
| 674 } // namespace dart | 695 } // namespace dart |
| 675 | 696 |
| 676 #endif // VM_ISOLATE_H_ | 697 #endif // VM_ISOLATE_H_ |
| OLD | NEW |