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

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

Issue 2517473002: Fix tsan failure (Closed)
Patch Set: Address code review comments. Created 4 years, 1 month 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
« no previous file with comments | « runtime/vm/profiler_test.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) 2011, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2011, 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_STACK_FRAME_H_ 5 #ifndef RUNTIME_VM_STACK_FRAME_H_
6 #define RUNTIME_VM_STACK_FRAME_H_ 6 #define RUNTIME_VM_STACK_FRAME_H_
7 7
8 #include "vm/allocation.h" 8 #include "vm/allocation.h"
9 #include "vm/object.h" 9 #include "vm/object.h"
10 #include "vm/stub_code.h" 10 #include "vm/stub_code.h"
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after
140 140
141 uword fp_; 141 uword fp_;
142 uword sp_; 142 uword sp_;
143 uword pc_; 143 uword pc_;
144 Thread* thread_; 144 Thread* thread_;
145 145
146 // The iterators FrameSetIterator and StackFrameIterator set the private 146 // The iterators FrameSetIterator and StackFrameIterator set the private
147 // fields fp_ and sp_ when they return the respective frame objects. 147 // fields fp_ and sp_ when they return the respective frame objects.
148 friend class FrameSetIterator; 148 friend class FrameSetIterator;
149 friend class StackFrameIterator; 149 friend class StackFrameIterator;
150 friend class ProfilerDartStackWalker;
150 DISALLOW_COPY_AND_ASSIGN(StackFrame); 151 DISALLOW_COPY_AND_ASSIGN(StackFrame);
151 }; 152 };
152 153
153 154
154 // Exit frame is used to mark the transition from dart code into dart VM 155 // Exit frame is used to mark the transition from dart code into dart VM
155 // runtime code. 156 // runtime code.
156 class ExitFrame : public StackFrame { 157 class ExitFrame : public StackFrame {
157 public: 158 public:
158 bool IsValid() const { return sp() == 0; } 159 bool IsValid() const { return sp() == 0; }
159 bool IsDartFrame(bool validate = true) const { return false; } 160 bool IsDartFrame(bool validate = true) const { return false; }
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after
279 void SetupLastExitFrameData(); 280 void SetupLastExitFrameData();
280 void SetupNextExitFrameData(); 281 void SetupNextExitFrameData();
281 282
282 bool validate_; // Validate each frame as we traverse the frames. 283 bool validate_; // Validate each frame as we traverse the frames.
283 EntryFrame entry_; // Singleton entry frame returned by NextEntryFrame(). 284 EntryFrame entry_; // Singleton entry frame returned by NextEntryFrame().
284 ExitFrame exit_; // Singleton exit frame returned by NextExitFrame(). 285 ExitFrame exit_; // Singleton exit frame returned by NextExitFrame().
285 FrameSetIterator frames_; 286 FrameSetIterator frames_;
286 StackFrame* current_frame_; // Points to the current frame in the iterator. 287 StackFrame* current_frame_; // Points to the current frame in the iterator.
287 Thread* thread_; 288 Thread* thread_;
288 289
290 friend class ProfilerDartStackWalker;
289 DISALLOW_COPY_AND_ASSIGN(StackFrameIterator); 291 DISALLOW_COPY_AND_ASSIGN(StackFrameIterator);
290 }; 292 };
291 293
292 294
293 // Iterator for iterating over all dart frames (skips over exit frames, 295 // Iterator for iterating over all dart frames (skips over exit frames,
294 // entry frames and stub frames). 296 // entry frames and stub frames).
295 // A DartFrameIterator can be initialized with an isolate other than the 297 // A DartFrameIterator can be initialized with an isolate other than the
296 // current thread's isolate. Because this is generally a bad idea, 298 // current thread's isolate. Because this is generally a bad idea,
297 // it is only allowed on Windows- where it is needed for the profiler. 299 // it is only allowed on Windows- where it is needed for the profiler.
298 // It is the responsibility of users of DartFrameIterator to ensure that the 300 // It is the responsibility of users of DartFrameIterator to ensure that the
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after
400 402
401 403
402 DART_FORCE_INLINE static uword LocalVarAddress(uword fp, intptr_t index) { 404 DART_FORCE_INLINE static uword LocalVarAddress(uword fp, intptr_t index) {
403 return fp + LocalVarIndex(0, index) * kWordSize; 405 return fp + LocalVarIndex(0, index) * kWordSize;
404 } 406 }
405 407
406 408
407 } // namespace dart 409 } // namespace dart
408 410
409 #endif // RUNTIME_VM_STACK_FRAME_H_ 411 #endif // RUNTIME_VM_STACK_FRAME_H_
OLDNEW
« no previous file with comments | « runtime/vm/profiler_test.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698