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

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

Issue 2646443005: Track async causal stack traces (Closed)
Patch Set: rebase Created 3 years, 10 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
« no previous file with comments | « runtime/vm/method_recognizer.cc ('k') | runtime/vm/object.cc » ('j') | 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) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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_OBJECT_H_ 5 #ifndef RUNTIME_VM_OBJECT_H_
6 #define RUNTIME_VM_OBJECT_H_ 6 #define RUNTIME_VM_OBJECT_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/utils.h" 10 #include "platform/utils.h"
(...skipping 8370 matching lines...) Expand 10 before | Expand all | Expand 10 after
8381 }; 8381 };
8382 8382
8383 8383
8384 // Internal stacktrace object used in exceptions for printing stack traces. 8384 // Internal stacktrace object used in exceptions for printing stack traces.
8385 class StackTrace : public Instance { 8385 class StackTrace : public Instance {
8386 public: 8386 public:
8387 static const int kPreallocatedStackdepth = 30; 8387 static const int kPreallocatedStackdepth = 30;
8388 8388
8389 intptr_t Length() const; 8389 intptr_t Length() const;
8390 8390
8391 RawFunction* FunctionAtFrame(intptr_t frame_index) const; 8391 RawStackTrace* async_link() const { return raw_ptr()->async_link_; }
8392 void set_async_link(const StackTrace& async_link) const;
8393 void set_expand_inlined(bool value) const;
8392 8394
8395 RawArray* code_array() const { return raw_ptr()->code_array_; }
8393 RawCode* CodeAtFrame(intptr_t frame_index) const; 8396 RawCode* CodeAtFrame(intptr_t frame_index) const;
8394 void SetCodeAtFrame(intptr_t frame_index, const Code& code) const; 8397 void SetCodeAtFrame(intptr_t frame_index, const Code& code) const;
8395 8398
8399 RawFunction* FunctionAtFrame(intptr_t frame_index) const;
8400
8401 RawArray* pc_offset_array() const { return raw_ptr()->pc_offset_array_; }
8396 RawSmi* PcOffsetAtFrame(intptr_t frame_index) const; 8402 RawSmi* PcOffsetAtFrame(intptr_t frame_index) const;
8397 void SetPcOffsetAtFrame(intptr_t frame_index, const Smi& pc_offset) const; 8403 void SetPcOffsetAtFrame(intptr_t frame_index, const Smi& pc_offset) const;
8398 void set_expand_inlined(bool value) const;
8399 8404
8400 static intptr_t InstanceSize() { 8405 static intptr_t InstanceSize() {
8401 return RoundedAllocationSize(sizeof(RawStackTrace)); 8406 return RoundedAllocationSize(sizeof(RawStackTrace));
8402 } 8407 }
8403 static RawStackTrace* New(const Array& code_array, 8408 static RawStackTrace* New(const Array& code_array,
8404 const Array& pc_offset_array, 8409 const Array& pc_offset_array,
8405 Heap::Space space = Heap::kNew); 8410 Heap::Space space = Heap::kNew);
8406 8411
8412 static RawStackTrace* New(const Array& code_array,
8413 const Array& pc_offset_array,
8414 const StackTrace& async_link,
8415 Heap::Space space = Heap::kNew);
8416
8407 // The argument 'max_frames' limits the number of printed frames. 8417 // The argument 'max_frames' limits the number of printed frames.
8408 const char* ToCStringInternal(intptr_t* frame_index, 8418 static const char* ToCStringInternal(const StackTrace& stack_trace,
8409 intptr_t max_frames = kMaxInt32) const; 8419 intptr_t* frame_index,
8420 intptr_t max_frames = kMaxInt32);
8410 8421
8411 private: 8422 private:
8412 void set_code_array(const Array& code_array) const; 8423 void set_code_array(const Array& code_array) const;
8413 void set_pc_offset_array(const Array& pc_offset_array) const; 8424 void set_pc_offset_array(const Array& pc_offset_array) const;
8414 bool expand_inlined() const; 8425 bool expand_inlined() const;
8415 8426
8416 FINAL_HEAP_OBJECT_IMPLEMENTATION(StackTrace, Instance); 8427 FINAL_HEAP_OBJECT_IMPLEMENTATION(StackTrace, Instance);
8417 friend class Class; 8428 friend class Class;
8418 friend class Debugger; 8429 friend class Debugger;
8419 }; 8430 };
(...skipping 473 matching lines...) Expand 10 before | Expand all | Expand 10 after
8893 8904
8894 inline void TypeArguments::SetHash(intptr_t value) const { 8905 inline void TypeArguments::SetHash(intptr_t value) const {
8895 // This is only safe because we create a new Smi, which does not cause 8906 // This is only safe because we create a new Smi, which does not cause
8896 // heap allocation. 8907 // heap allocation.
8897 StoreSmi(&raw_ptr()->hash_, Smi::New(value)); 8908 StoreSmi(&raw_ptr()->hash_, Smi::New(value));
8898 } 8909 }
8899 8910
8900 } // namespace dart 8911 } // namespace dart
8901 8912
8902 #endif // RUNTIME_VM_OBJECT_H_ 8913 #endif // RUNTIME_VM_OBJECT_H_
OLDNEW
« no previous file with comments | « runtime/vm/method_recognizer.cc ('k') | runtime/vm/object.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698