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 12 matching lines...) Expand all Loading... |
23 class AbstractType; | 23 class AbstractType; |
24 class ApiState; | 24 class ApiState; |
25 class Array; | 25 class Array; |
26 class Class; | 26 class Class; |
27 class CodeIndexTable; | 27 class CodeIndexTable; |
28 class Debugger; | 28 class Debugger; |
29 class DeoptContext; | 29 class DeoptContext; |
30 class Error; | 30 class Error; |
31 class Field; | 31 class Field; |
32 class Function; | 32 class Function; |
| 33 class GrowableObjectArray; |
33 class HandleScope; | 34 class HandleScope; |
34 class HandleVisitor; | 35 class HandleVisitor; |
35 class Heap; | 36 class Heap; |
36 class ICData; | 37 class ICData; |
37 class Instance; | 38 class Instance; |
38 class IsolateProfilerData; | 39 class IsolateProfilerData; |
39 class IsolateSpawnState; | 40 class IsolateSpawnState; |
40 class InterruptableThreadState; | 41 class InterruptableThreadState; |
41 class LongJumpScope; | 42 class LongJumpScope; |
42 class MessageHandler; | 43 class MessageHandler; |
43 class Mutex; | 44 class Mutex; |
44 class Object; | 45 class Object; |
| 46 class ObjectIdRing; |
45 class ObjectPointerVisitor; | 47 class ObjectPointerVisitor; |
46 class ObjectStore; | 48 class ObjectStore; |
47 class RawInstance; | 49 class RawInstance; |
48 class RawArray; | 50 class RawArray; |
49 class RawContext; | 51 class RawContext; |
50 class RawDouble; | 52 class RawDouble; |
| 53 class RawGrowableObjectArray; |
51 class RawMint; | 54 class RawMint; |
52 class RawObject; | 55 class RawObject; |
53 class RawInteger; | 56 class RawInteger; |
54 class RawError; | 57 class RawError; |
55 class RawFloat32x4; | 58 class RawFloat32x4; |
56 class RawInt32x4; | 59 class RawInt32x4; |
| 60 class RawUserTag; |
57 class SampleBuffer; | 61 class SampleBuffer; |
58 class Simulator; | 62 class Simulator; |
59 class StackResource; | 63 class StackResource; |
60 class StackZone; | 64 class StackZone; |
61 class StubCode; | 65 class StubCode; |
62 class TypeArguments; | 66 class TypeArguments; |
63 class TypeParameter; | 67 class TypeParameter; |
64 class ObjectIdRing; | 68 class UserTag; |
65 | 69 |
66 | 70 |
67 class IsolateVisitor { | 71 class IsolateVisitor { |
68 public: | 72 public: |
69 IsolateVisitor() {} | 73 IsolateVisitor() {} |
70 virtual ~IsolateVisitor() {} | 74 virtual ~IsolateVisitor() {} |
71 | 75 |
72 virtual void VisitIsolate(Isolate* isolate) = 0; | 76 virtual void VisitIsolate(Isolate* isolate) = 0; |
73 | 77 |
74 private: | 78 private: |
(...skipping 388 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
463 InterruptableThreadState* thread_state() const { | 467 InterruptableThreadState* thread_state() const { |
464 return thread_state_; | 468 return thread_state_; |
465 } | 469 } |
466 | 470 |
467 void ProfileInterrupt(); | 471 void ProfileInterrupt(); |
468 | 472 |
469 VMTagCounters* vm_tag_counters() { | 473 VMTagCounters* vm_tag_counters() { |
470 return &vm_tag_counters_; | 474 return &vm_tag_counters_; |
471 } | 475 } |
472 | 476 |
| 477 uword user_tag() const { |
| 478 return user_tag_; |
| 479 } |
| 480 |
| 481 RawGrowableObjectArray* tag_table() const { return tag_table_; } |
| 482 void set_tag_table(const GrowableObjectArray& value); |
| 483 |
| 484 RawUserTag* current_tag() const { return current_tag_; } |
| 485 void set_current_tag(const UserTag& tag); |
| 486 void clear_current_tag(); |
| 487 |
473 #if defined(DEBUG) | 488 #if defined(DEBUG) |
474 #define REUSABLE_HANDLE_SCOPE_ACCESSORS(object) \ | 489 #define REUSABLE_HANDLE_SCOPE_ACCESSORS(object) \ |
475 void set_reusable_##object##_handle_scope_active(bool value) { \ | 490 void set_reusable_##object##_handle_scope_active(bool value) { \ |
476 reusable_##object##_handle_scope_active_ = value; \ | 491 reusable_##object##_handle_scope_active_ = value; \ |
477 } \ | 492 } \ |
478 bool reusable_##object##_handle_scope_active() const { \ | 493 bool reusable_##object##_handle_scope_active() const { \ |
479 return reusable_##object##_handle_scope_active_; \ | 494 return reusable_##object##_handle_scope_active_; \ |
480 } | 495 } |
481 REUSABLE_HANDLE_LIST(REUSABLE_HANDLE_SCOPE_ACCESSORS) | 496 REUSABLE_HANDLE_LIST(REUSABLE_HANDLE_SCOPE_ACCESSORS) |
482 #undef REUSABLE_HANDLE_SCOPE_ACCESSORS | 497 #undef REUSABLE_HANDLE_SCOPE_ACCESSORS |
483 #endif // defined(DEBUG) | 498 #endif // defined(DEBUG) |
484 | 499 |
485 #define REUSABLE_HANDLE(object) \ | 500 #define REUSABLE_HANDLE(object) \ |
486 object& object##Handle() const { \ | 501 object& object##Handle() const { \ |
487 return *object##_handle_; \ | 502 return *object##_handle_; \ |
488 } | 503 } |
489 REUSABLE_HANDLE_LIST(REUSABLE_HANDLE) | 504 REUSABLE_HANDLE_LIST(REUSABLE_HANDLE) |
490 #undef REUSABLE_HANDLE | 505 #undef REUSABLE_HANDLE |
491 | 506 |
492 static void VisitIsolates(IsolateVisitor* visitor); | 507 static void VisitIsolates(IsolateVisitor* visitor); |
493 | 508 |
494 private: | 509 private: |
495 Isolate(); | 510 Isolate(); |
496 | 511 |
497 void BuildName(const char* name_prefix); | 512 void BuildName(const char* name_prefix); |
498 void PrintInvokedFunctions(); | 513 void PrintInvokedFunctions(); |
499 | 514 |
500 void ProfileIdle(); | 515 void ProfileIdle(); |
501 | 516 |
| 517 void set_user_tag(uword tag) { |
| 518 user_tag_ = tag; |
| 519 } |
| 520 |
| 521 |
502 template<class T> T* AllocateReusableHandle(); | 522 template<class T> T* AllocateReusableHandle(); |
503 | 523 |
504 static ThreadLocalKey isolate_key; | 524 static ThreadLocalKey isolate_key; |
505 | 525 |
506 StoreBuffer store_buffer_; | 526 StoreBuffer store_buffer_; |
507 ClassTable class_table_; | 527 ClassTable class_table_; |
508 MegamorphicCacheTable megamorphic_cache_table_; | 528 MegamorphicCacheTable megamorphic_cache_table_; |
509 Dart_MessageNotifyCallback message_notify_callback_; | 529 Dart_MessageNotifyCallback message_notify_callback_; |
510 char* name_; | 530 char* name_; |
511 int64_t start_time_; | 531 int64_t start_time_; |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
546 bool cha_used_; | 566 bool cha_used_; |
547 | 567 |
548 // Ring buffer of objects assigned an id. | 568 // Ring buffer of objects assigned an id. |
549 ObjectIdRing* object_id_ring_; | 569 ObjectIdRing* object_id_ring_; |
550 | 570 |
551 IsolateProfilerData* profiler_data_; | 571 IsolateProfilerData* profiler_data_; |
552 Mutex profiler_data_mutex_; | 572 Mutex profiler_data_mutex_; |
553 InterruptableThreadState* thread_state_; | 573 InterruptableThreadState* thread_state_; |
554 | 574 |
555 VMTagCounters vm_tag_counters_; | 575 VMTagCounters vm_tag_counters_; |
| 576 uword user_tag_; |
| 577 RawGrowableObjectArray* tag_table_; |
| 578 RawUserTag* current_tag_; |
556 | 579 |
557 // Isolate list next pointer. | 580 // Isolate list next pointer. |
558 Isolate* next_; | 581 Isolate* next_; |
559 | 582 |
560 // Reusable handles support. | 583 // Reusable handles support. |
561 #define REUSABLE_HANDLE_FIELDS(object) \ | 584 #define REUSABLE_HANDLE_FIELDS(object) \ |
562 object* object##_handle_; | 585 object* object##_handle_; |
563 REUSABLE_HANDLE_LIST(REUSABLE_HANDLE_FIELDS) | 586 REUSABLE_HANDLE_LIST(REUSABLE_HANDLE_FIELDS) |
564 #undef REUSABLE_HANDLE_FIELDS | 587 #undef REUSABLE_HANDLE_FIELDS |
565 | 588 |
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
688 char* script_url_; | 711 char* script_url_; |
689 char* library_url_; | 712 char* library_url_; |
690 char* class_name_; | 713 char* class_name_; |
691 char* function_name_; | 714 char* function_name_; |
692 char* exception_callback_name_; | 715 char* exception_callback_name_; |
693 }; | 716 }; |
694 | 717 |
695 } // namespace dart | 718 } // namespace dart |
696 | 719 |
697 #endif // VM_ISOLATE_H_ | 720 #endif // VM_ISOLATE_H_ |
OLD | NEW |