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

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

Issue 2951333002: Moves the top_ and end_ words of the Scavenger into mutator thread. (Closed)
Patch Set: Created 3 years, 6 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
« runtime/vm/scavenger.cc ('K') | « runtime/vm/stub_code_x64.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2015, 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 RUNTIME_VM_THREAD_H_ 5 #ifndef RUNTIME_VM_THREAD_H_
6 #define RUNTIME_VM_THREAD_H_ 6 #define RUNTIME_VM_THREAD_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 "vm/atomic.h" 10 #include "vm/atomic.h"
(...skipping 348 matching lines...) Expand 10 before | Expand all | Expand 10 after
359 StackResource* top_resource() const { return top_resource_; } 359 StackResource* top_resource() const { return top_resource_; }
360 void set_top_resource(StackResource* value) { top_resource_ = value; } 360 void set_top_resource(StackResource* value) { top_resource_ = value; }
361 static intptr_t top_resource_offset() { 361 static intptr_t top_resource_offset() {
362 return OFFSET_OF(Thread, top_resource_); 362 return OFFSET_OF(Thread, top_resource_);
363 } 363 }
364 364
365 // Heap of the isolate that this thread is operating on. 365 // Heap of the isolate that this thread is operating on.
366 Heap* heap() const { return heap_; } 366 Heap* heap() const { return heap_; }
367 static intptr_t heap_offset() { return OFFSET_OF(Thread, heap_); } 367 static intptr_t heap_offset() { return OFFSET_OF(Thread, heap_); }
368 368
369 void set_top_offset(uword value) {
370 ASSERT(heap_ != NULL);
371 top_ = value;
372 }
373 void set_end_offset(uword value) {
374 ASSERT(heap_ != NULL);
375 end_ = value;
376 }
377
378 uword top() { return top_; }
379 uword end() { return end_; }
380
381 static intptr_t top_offset() { return OFFSET_OF(Thread, top_); }
382 static intptr_t end_offset() { return OFFSET_OF(Thread, end_); }
383
369 int32_t no_handle_scope_depth() const { 384 int32_t no_handle_scope_depth() const {
370 #if defined(DEBUG) 385 #if defined(DEBUG)
371 return no_handle_scope_depth_; 386 return no_handle_scope_depth_;
372 #else 387 #else
373 return 0; 388 return 0;
374 #endif 389 #endif
375 } 390 }
376 391
377 void IncrementNoHandleScopeDepth() { 392 void IncrementNoHandleScopeDepth() {
378 #if defined(DEBUG) 393 #if defined(DEBUG)
(...skipping 366 matching lines...) Expand 10 before | Expand all | Expand 10 after
745 760
746 // JumpToExceptionHandler state: 761 // JumpToExceptionHandler state:
747 RawObject* active_exception_; 762 RawObject* active_exception_;
748 RawObject* active_stacktrace_; 763 RawObject* active_stacktrace_;
749 uword resume_pc_; 764 uword resume_pc_;
750 765
751 RawError* sticky_error_; 766 RawError* sticky_error_;
752 767
753 CompilerStats* compiler_stats_; 768 CompilerStats* compiler_stats_;
754 769
770 uword top_;
rmacnak 2017/06/22 22:31:51 initialize to 0 in Thread::Thread
danunez 2017/06/30 20:35:57 Done.
771 uword end_;
772
755 // Reusable handles support. 773 // Reusable handles support.
756 #define REUSABLE_HANDLE_FIELDS(object) object* object##_handle_; 774 #define REUSABLE_HANDLE_FIELDS(object) object* object##_handle_;
757 REUSABLE_HANDLE_LIST(REUSABLE_HANDLE_FIELDS) 775 REUSABLE_HANDLE_LIST(REUSABLE_HANDLE_FIELDS)
758 #undef REUSABLE_HANDLE_FIELDS 776 #undef REUSABLE_HANDLE_FIELDS
759 777
760 #if defined(DEBUG) 778 #if defined(DEBUG)
761 #define REUSABLE_HANDLE_SCOPE_VARIABLE(object) \ 779 #define REUSABLE_HANDLE_SCOPE_VARIABLE(object) \
762 bool reusable_##object##_handle_scope_active_; 780 bool reusable_##object##_handle_scope_active_;
763 REUSABLE_HANDLE_LIST(REUSABLE_HANDLE_SCOPE_VARIABLE); 781 REUSABLE_HANDLE_LIST(REUSABLE_HANDLE_SCOPE_VARIABLE);
764 #undef REUSABLE_HANDLE_SCOPE_VARIABLE 782 #undef REUSABLE_HANDLE_SCOPE_VARIABLE
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
818 // Disable thread interrupts. 836 // Disable thread interrupts.
819 class DisableThreadInterruptsScope : public StackResource { 837 class DisableThreadInterruptsScope : public StackResource {
820 public: 838 public:
821 explicit DisableThreadInterruptsScope(Thread* thread); 839 explicit DisableThreadInterruptsScope(Thread* thread);
822 ~DisableThreadInterruptsScope(); 840 ~DisableThreadInterruptsScope();
823 }; 841 };
824 842
825 } // namespace dart 843 } // namespace dart
826 844
827 #endif // RUNTIME_VM_THREAD_H_ 845 #endif // RUNTIME_VM_THREAD_H_
OLDNEW
« runtime/vm/scavenger.cc ('K') | « runtime/vm/stub_code_x64.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698