Chromium Code Reviews| 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 16 matching lines...) Expand all Loading... | |
| 27 class CodeIndexTable; | 27 class CodeIndexTable; |
| 28 class Debugger; | 28 class Debugger; |
| 29 class DeoptContext; | 29 class DeoptContext; |
| 30 class Field; | 30 class Field; |
| 31 class Function; | 31 class Function; |
| 32 class HandleScope; | 32 class HandleScope; |
| 33 class HandleVisitor; | 33 class HandleVisitor; |
| 34 class Heap; | 34 class Heap; |
| 35 class ICData; | 35 class ICData; |
| 36 class Instance; | 36 class Instance; |
| 37 class IsolateProfilerData; | |
| 37 class LongJump; | 38 class LongJump; |
| 38 class MessageHandler; | 39 class MessageHandler; |
| 39 class Mutex; | 40 class Mutex; |
| 40 class Object; | 41 class Object; |
| 41 class ObjectPointerVisitor; | 42 class ObjectPointerVisitor; |
| 42 class ObjectStore; | 43 class ObjectStore; |
| 43 class RawInstance; | 44 class RawInstance; |
| 44 class RawArray; | 45 class RawArray; |
| 45 class RawContext; | 46 class RawContext; |
| 46 class RawDouble; | 47 class RawDouble; |
| 47 class RawMint; | 48 class RawMint; |
| 48 class RawObject; | 49 class RawObject; |
| 49 class RawInteger; | 50 class RawInteger; |
| 50 class RawError; | 51 class RawError; |
| 51 class RawFloat32x4; | 52 class RawFloat32x4; |
| 52 class RawInt32x4; | 53 class RawInt32x4; |
| 54 class SampleBuffer; | |
| 53 class Simulator; | 55 class Simulator; |
| 54 class StackResource; | 56 class StackResource; |
| 55 class StackZone; | 57 class StackZone; |
| 56 class StubCode; | 58 class StubCode; |
| 57 class TypeArguments; | 59 class TypeArguments; |
| 58 class TypeParameter; | 60 class TypeParameter; |
| 59 class ObjectHistogram; | 61 class ObjectHistogram; |
| 60 class ObjectIdRing; | 62 class ObjectIdRing; |
| 61 | 63 |
| 62 | 64 |
| (...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 196 return reinterpret_cast<uword>(&stack_limit_); | 198 return reinterpret_cast<uword>(&stack_limit_); |
| 197 } | 199 } |
| 198 | 200 |
| 199 // The current stack limit. This may be overwritten with a special | 201 // The current stack limit. This may be overwritten with a special |
| 200 // value to trigger interrupts. | 202 // value to trigger interrupts. |
| 201 uword stack_limit() const { return stack_limit_; } | 203 uword stack_limit() const { return stack_limit_; } |
| 202 | 204 |
| 203 // The true stack limit for this isolate. | 205 // The true stack limit for this isolate. |
| 204 uword saved_stack_limit() const { return saved_stack_limit_; } | 206 uword saved_stack_limit() const { return saved_stack_limit_; } |
| 205 | 207 |
| 208 // Retrieve the stack address bounds. | |
| 209 bool GetStackBounds(uintptr_t* lower, uintptr_t* upper); | |
| 210 | |
| 206 static uword GetSpecifiedStackSize(); | 211 static uword GetSpecifiedStackSize(); |
| 207 | 212 |
| 208 static const intptr_t kStackSizeBuffer = (4 * KB * kWordSize); | 213 static const intptr_t kStackSizeBuffer = (4 * KB * kWordSize); |
| 209 | 214 |
| 210 enum { | 215 enum { |
| 211 kApiInterrupt = 0x1, // An interrupt from Dart_InterruptIsolate. | 216 kApiInterrupt = 0x1, // An interrupt from Dart_InterruptIsolate. |
| 212 kMessageInterrupt = 0x2, // An interrupt to process an out of band message. | 217 kMessageInterrupt = 0x2, // An interrupt to process an out of band message. |
| 213 kStoreBufferInterrupt = 0x4, // An interrupt to process the store buffer. | 218 kStoreBufferInterrupt = 0x4, // An interrupt to process the store buffer. |
| 214 kVmStatusInterrupt = 0x8, // An interrupt to process a status request. | 219 kVmStatusInterrupt = 0x8, // An interrupt to process a status request. |
| 215 | 220 |
| (...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 376 intptr_t UnblockClassFinalization() { | 381 intptr_t UnblockClassFinalization() { |
| 377 ASSERT(defer_finalization_count_ > 0); | 382 ASSERT(defer_finalization_count_ > 0); |
| 378 return defer_finalization_count_--; | 383 return defer_finalization_count_--; |
| 379 } | 384 } |
| 380 | 385 |
| 381 bool AllowClassFinalization() { | 386 bool AllowClassFinalization() { |
| 382 ASSERT(defer_finalization_count_ >= 0); | 387 ASSERT(defer_finalization_count_ >= 0); |
| 383 return defer_finalization_count_ == 0; | 388 return defer_finalization_count_ == 0; |
| 384 } | 389 } |
| 385 | 390 |
| 391 Mutex* profiler_data_mutex() const { | |
| 392 ASSERT(profiler_data_mutex_ != NULL); | |
| 393 return profiler_data_mutex_; | |
| 394 } | |
| 395 | |
| 396 void set_profiler_data(IsolateProfilerData* profiler_data) { | |
| 397 profiler_data_ = profiler_data; | |
| 398 } | |
| 399 | |
| 400 IsolateProfilerData* profiler_data() { | |
| 401 return profiler_data_; | |
| 402 } | |
| 403 | |
| 386 private: | 404 private: |
| 387 Isolate(); | 405 Isolate(); |
| 388 | 406 |
| 389 void BuildName(const char* name_prefix); | 407 void BuildName(const char* name_prefix); |
| 390 void PrintInvokedFunctions(); | 408 void PrintInvokedFunctions(); |
| 391 | 409 |
| 392 static bool FetchStacktrace(); | 410 static bool FetchStacktrace(); |
| 393 static bool FetchStackFrameDetails(); | 411 static bool FetchStackFrameDetails(); |
| 394 char* GetStatusDetails(); | 412 char* GetStatusDetails(); |
| 395 char* GetStatusStacktrace(); | 413 char* GetStatusStacktrace(); |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 434 DeoptContext* deopt_context_; | 452 DeoptContext* deopt_context_; |
| 435 | 453 |
| 436 // Status support. | 454 // Status support. |
| 437 char* stacktrace_; | 455 char* stacktrace_; |
| 438 intptr_t stack_frame_index_; | 456 intptr_t stack_frame_index_; |
| 439 ObjectHistogram* object_histogram_; | 457 ObjectHistogram* object_histogram_; |
| 440 | 458 |
| 441 // Ring buffer of objects assigned an id. | 459 // Ring buffer of objects assigned an id. |
| 442 ObjectIdRing* object_id_ring_; | 460 ObjectIdRing* object_id_ring_; |
| 443 | 461 |
| 462 IsolateProfilerData* profiler_data_; | |
| 463 Mutex* profiler_data_mutex_; | |
|
siva
2013/11/11 03:51:54
can the mutex be a value object instead?
Cutch
2013/11/18 20:48:54
Done.
| |
| 464 | |
| 444 // Reusable handles support. | 465 // Reusable handles support. |
| 445 #define REUSABLE_HANDLE_FIELDS(object) \ | 466 #define REUSABLE_HANDLE_FIELDS(object) \ |
| 446 object* object##_handle_; \ | 467 object* object##_handle_; \ |
| 447 | 468 |
| 448 REUSABLE_HANDLE_LIST(REUSABLE_HANDLE_FIELDS) | 469 REUSABLE_HANDLE_LIST(REUSABLE_HANDLE_FIELDS) |
| 449 #undef REUSABLE_HANDLE_FIELDS | 470 #undef REUSABLE_HANDLE_FIELDS |
| 450 VMHandles reusable_handles_; | 471 VMHandles reusable_handles_; |
| 451 | 472 |
| 452 static Dart_IsolateCreateCallback create_callback_; | 473 static Dart_IsolateCreateCallback create_callback_; |
| 453 static Dart_IsolateInterruptCallback interrupt_callback_; | 474 static Dart_IsolateInterruptCallback interrupt_callback_; |
| (...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 552 Isolate* isolate_; | 573 Isolate* isolate_; |
| 553 char* script_url_; | 574 char* script_url_; |
| 554 char* library_url_; | 575 char* library_url_; |
| 555 char* function_name_; | 576 char* function_name_; |
| 556 char* exception_callback_name_; | 577 char* exception_callback_name_; |
| 557 }; | 578 }; |
| 558 | 579 |
| 559 } // namespace dart | 580 } // namespace dart |
| 560 | 581 |
| 561 #endif // VM_ISOLATE_H_ | 582 #endif // VM_ISOLATE_H_ |
| OLD | NEW |