Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(27)

Side by Side Diff: runtime/vm/isolate.h

Issue 354763004: - Implement Isolate.pause and Isolate.resume. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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"
11 #include "vm/base_isolate.h" 11 #include "vm/base_isolate.h"
12 #include "vm/class_table.h" 12 #include "vm/class_table.h"
13 #include "vm/counters.h" 13 #include "vm/counters.h"
14 #include "vm/handles.h" 14 #include "vm/handles.h"
15 #include "vm/megamorphic_cache_table.h" 15 #include "vm/megamorphic_cache_table.h"
16 #include "vm/random.h" 16 #include "vm/random.h"
17 #include "vm/store_buffer.h" 17 #include "vm/store_buffer.h"
18 #include "vm/tags.h" 18 #include "vm/tags.h"
19 #include "vm/trace_buffer.h" 19 #include "vm/trace_buffer.h"
20 #include "vm/timer.h" 20 #include "vm/timer.h"
21 21
22 namespace dart { 22 namespace dart {
23 23
24 // Forward declarations. 24 // Forward declarations.
25 class AbstractType; 25 class AbstractType;
26 class ApiState; 26 class ApiState;
27 class Array; 27 class Array;
28 class Capability;
28 class Class; 29 class Class;
29 class Code; 30 class Code;
30 class CodeIndexTable; 31 class CodeIndexTable;
31 class Debugger; 32 class Debugger;
32 class DeoptContext; 33 class DeoptContext;
33 class Error; 34 class Error;
34 class ExceptionHandlers; 35 class ExceptionHandlers;
35 class Field; 36 class Field;
36 class Function; 37 class Function;
37 class GrowableObjectArray; 38 class GrowableObjectArray;
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after
158 159
159 const char* name() const { return name_; } 160 const char* name() const { return name_; }
160 161
161 int64_t start_time() const { return start_time_; } 162 int64_t start_time() const { return start_time_; }
162 163
163 Dart_Port main_port() const { return main_port_; } 164 Dart_Port main_port() const { return main_port_; }
164 void set_main_port(Dart_Port port) { 165 void set_main_port(Dart_Port port) {
165 ASSERT(main_port_ == 0); // Only set main port once. 166 ASSERT(main_port_ == 0); // Only set main port once.
166 main_port_ = port; 167 main_port_ = port;
167 } 168 }
169 void set_pause_capability(uint64_t value) { pause_capability_ = value; }
170 uint64_t pause_capability() const { return pause_capability_; }
171 void set_terminate_capability(uint64_t value) {
172 terminate_capability_ = value;
173 }
174 uint64_t terminate_capability() const { return terminate_capability_; }
168 175
169 Heap* heap() const { return heap_; } 176 Heap* heap() const { return heap_; }
170 void set_heap(Heap* value) { heap_ = value; } 177 void set_heap(Heap* value) { heap_ = value; }
171 static intptr_t heap_offset() { return OFFSET_OF(Isolate, heap_); } 178 static intptr_t heap_offset() { return OFFSET_OF(Isolate, heap_); }
172 179
173 ObjectStore* object_store() const { return object_store_; } 180 ObjectStore* object_store() const { return object_store_; }
174 void set_object_store(ObjectStore* value) { object_store_ = value; } 181 void set_object_store(ObjectStore* value) { object_store_ = value; }
175 static intptr_t object_store_offset() { 182 static intptr_t object_store_offset() {
176 return OFFSET_OF(Isolate, object_store_); 183 return OFFSET_OF(Isolate, object_store_);
177 } 184 }
(...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after
347 } 354 }
348 355
349 // Returns whether the vm service has requested that the debugger 356 // Returns whether the vm service has requested that the debugger
350 // resume execution. 357 // resume execution.
351 bool GetAndClearResumeRequest() { 358 bool GetAndClearResumeRequest() {
352 bool resume_request = resume_request_; 359 bool resume_request = resume_request_;
353 resume_request_ = false; 360 resume_request_ = false;
354 return resume_request; 361 return resume_request;
355 } 362 }
356 363
364 // Verify that the sender had the capability to pause this isolate.
siva 2014/07/01 21:42:56 sender has
Ivan Posva 2014/07/03 12:51:17 Done.
365 bool VerifyPauseCapability(const Capability& capability);
siva 2014/07/01 21:42:56 ) const;
Ivan Posva 2014/07/03 12:51:16 Done.
366 // Returns true if the capability was added or removed from this isolate's
367 // list of pause events.
368 bool AddPauseCapability(const Capability& capability);
Ivan Posva 2014/07/03 12:51:17 Renamed to resume capabilities and refactored the
369 bool RemovePauseCapability(const Capability& capability);
370
357 Random* random() { return &random_; } 371 Random* random() { return &random_; }
358 372
359 Simulator* simulator() const { return simulator_; } 373 Simulator* simulator() const { return simulator_; }
360 void set_simulator(Simulator* value) { simulator_ = value; } 374 void set_simulator(Simulator* value) { simulator_ = value; }
361 375
362 Dart_GcPrologueCallback gc_prologue_callback() const { 376 Dart_GcPrologueCallback gc_prologue_callback() const {
363 return gc_prologue_callback_; 377 return gc_prologue_callback_;
364 } 378 }
365 379
366 void set_gc_prologue_callback(Dart_GcPrologueCallback callback) { 380 void set_gc_prologue_callback(Dart_GcPrologueCallback callback) {
(...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after
586 600
587 static ThreadLocalKey isolate_key; 601 static ThreadLocalKey isolate_key;
588 602
589 StoreBuffer store_buffer_; 603 StoreBuffer store_buffer_;
590 ClassTable class_table_; 604 ClassTable class_table_;
591 MegamorphicCacheTable megamorphic_cache_table_; 605 MegamorphicCacheTable megamorphic_cache_table_;
592 Dart_MessageNotifyCallback message_notify_callback_; 606 Dart_MessageNotifyCallback message_notify_callback_;
593 char* name_; 607 char* name_;
594 int64_t start_time_; 608 int64_t start_time_;
595 Dart_Port main_port_; 609 Dart_Port main_port_;
610 uint64_t pause_capability_;
611 uint64_t terminate_capability_;
596 Heap* heap_; 612 Heap* heap_;
597 ObjectStore* object_store_; 613 ObjectStore* object_store_;
598 RawContext* top_context_; 614 RawContext* top_context_;
599 uword top_exit_frame_info_; 615 uword top_exit_frame_info_;
600 void* init_callback_data_; 616 void* init_callback_data_;
601 Dart_EnvironmentCallback environment_callback_; 617 Dart_EnvironmentCallback environment_callback_;
602 Dart_LibraryTagHandler library_tag_handler_; 618 Dart_LibraryTagHandler library_tag_handler_;
603 ApiState* api_state_; 619 ApiState* api_state_;
604 StubCode* stub_code_; 620 StubCode* stub_code_;
605 Debugger* debugger_; 621 Debugger* debugger_;
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after
784 char* script_url_; 800 char* script_url_;
785 char* library_url_; 801 char* library_url_;
786 char* class_name_; 802 char* class_name_;
787 char* function_name_; 803 char* function_name_;
788 char* exception_callback_name_; 804 char* exception_callback_name_;
789 }; 805 };
790 806
791 } // namespace dart 807 } // namespace dart
792 808
793 #endif // VM_ISOLATE_H_ 809 #endif // VM_ISOLATE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698