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

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

Issue 2684763002: Use CodeSourceMap for stack traces (still JIT only). (Closed)
Patch Set: 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
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 4766 matching lines...) Expand 10 before | Expand all | Expand 10 after
4777 4777
4778 RawArray* inlined_id_to_function() const; 4778 RawArray* inlined_id_to_function() const;
4779 void set_inlined_id_to_function(const Array& value) const; 4779 void set_inlined_id_to_function(const Array& value) const;
4780 4780
4781 // Provides the call stack at the given pc offset, with the top-of-stack in 4781 // Provides the call stack at the given pc offset, with the top-of-stack in
4782 // the last element and the root function (this) as the first element, along 4782 // the last element and the root function (this) as the first element, along
4783 // with the corresponding source positions. Note the token position for each 4783 // with the corresponding source positions. Note the token position for each
4784 // function except the top-of-stack is the position of the call to the next 4784 // function except the top-of-stack is the position of the call to the next
4785 // function. The stack will be empty if we lack the metadata to produce it, 4785 // function. The stack will be empty if we lack the metadata to produce it,
4786 // which happens for stub code. 4786 // which happens for stub code.
4787 // The pc offset is interpreted as an instruction address (as needed by the
4788 // disassembler or the top frame of a profiler sample), rather than a return
4789 // address (as needed for a stack trace or the bottom frames of a profiler
4790 // sample). Callers with a return address should subtract one.
Florian Schneider 2017/02/08 18:55:20 Subtracting one from from pc_offset is a bit subtl
rmacnak 2017/02/08 19:24:26 Added GetInlinedFunctionsAtReturnAddress and switc
4787 void GetInlinedFunctionsAt( 4791 void GetInlinedFunctionsAt(
4788 intptr_t pc_offset, 4792 intptr_t pc_offset,
4789 GrowableArray<const Function*>* functions, 4793 GrowableArray<const Function*>* functions,
4790 GrowableArray<TokenPosition>* token_positions) const; 4794 GrowableArray<TokenPosition>* token_positions) const;
4791 4795
4792 NOT_IN_PRODUCT(void PrintJSONInlineIntervals(JSONObject* object) const); 4796 NOT_IN_PRODUCT(void PrintJSONInlineIntervals(JSONObject* object) const);
4793 void DumpInlineIntervals() const; 4797 void DumpInlineIntervals() const;
4794 void DumpSourcePositions() const; 4798 void DumpSourcePositions() const;
4795 4799
4796 RawLocalVarDescriptors* var_descriptors() const { 4800 RawLocalVarDescriptors* var_descriptors() const {
(...skipping 3584 matching lines...) Expand 10 before | Expand all | Expand 10 after
8381 }; 8385 };
8382 8386
8383 8387
8384 // Internal stacktrace object used in exceptions for printing stack traces. 8388 // Internal stacktrace object used in exceptions for printing stack traces.
8385 class StackTrace : public Instance { 8389 class StackTrace : public Instance {
8386 public: 8390 public:
8387 static const int kPreallocatedStackdepth = 30; 8391 static const int kPreallocatedStackdepth = 30;
8388 8392
8389 intptr_t Length() const; 8393 intptr_t Length() const;
8390 8394
8391 RawFunction* FunctionAtFrame(intptr_t frame_index) const;
8392
8393 RawCode* CodeAtFrame(intptr_t frame_index) const; 8395 RawCode* CodeAtFrame(intptr_t frame_index) const;
8394 void SetCodeAtFrame(intptr_t frame_index, const Code& code) const; 8396 void SetCodeAtFrame(intptr_t frame_index, const Code& code) const;
8395 8397
8396 RawSmi* PcOffsetAtFrame(intptr_t frame_index) const; 8398 RawSmi* PcOffsetAtFrame(intptr_t frame_index) const;
8397 void SetPcOffsetAtFrame(intptr_t frame_index, const Smi& pc_offset) const; 8399 void SetPcOffsetAtFrame(intptr_t frame_index, const Smi& pc_offset) const;
8398 void set_expand_inlined(bool value) const; 8400 void set_expand_inlined(bool value) const;
8399 8401
8400 static intptr_t InstanceSize() { 8402 static intptr_t InstanceSize() {
8401 return RoundedAllocationSize(sizeof(RawStackTrace)); 8403 return RoundedAllocationSize(sizeof(RawStackTrace));
8402 } 8404 }
(...skipping 490 matching lines...) Expand 10 before | Expand all | Expand 10 after
8893 8895
8894 inline void TypeArguments::SetHash(intptr_t value) const { 8896 inline void TypeArguments::SetHash(intptr_t value) const {
8895 // This is only safe because we create a new Smi, which does not cause 8897 // This is only safe because we create a new Smi, which does not cause
8896 // heap allocation. 8898 // heap allocation.
8897 StoreSmi(&raw_ptr()->hash_, Smi::New(value)); 8899 StoreSmi(&raw_ptr()->hash_, Smi::New(value));
8898 } 8900 }
8899 8901
8900 } // namespace dart 8902 } // namespace dart
8901 8903
8902 #endif // RUNTIME_VM_OBJECT_H_ 8904 #endif // RUNTIME_VM_OBJECT_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698