OLD | NEW |
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 Loading... |
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 void GetInlinedFunctionsAt( | 4787 // The pc offset is interpreted as an instruction address (as needed by the |
| 4788 // disassembler or the top frame of a profiler sample). |
| 4789 void GetInlinedFunctionsAtInstruction( |
4788 intptr_t pc_offset, | 4790 intptr_t pc_offset, |
4789 GrowableArray<const Function*>* functions, | 4791 GrowableArray<const Function*>* functions, |
4790 GrowableArray<TokenPosition>* token_positions) const; | 4792 GrowableArray<TokenPosition>* token_positions) const; |
| 4793 // Same as above, expect the pc is intepreted as a return address (as needed |
| 4794 // for a stack trace or the bottom frames of a profiler sample). |
| 4795 void GetInlinedFunctionsAtReturnAddress( |
| 4796 intptr_t pc_offset, |
| 4797 GrowableArray<const Function*>* functions, |
| 4798 GrowableArray<TokenPosition>* token_positions) const { |
| 4799 GetInlinedFunctionsAtInstruction(pc_offset - 1, functions, token_positions); |
| 4800 } |
4791 | 4801 |
4792 NOT_IN_PRODUCT(void PrintJSONInlineIntervals(JSONObject* object) const); | 4802 NOT_IN_PRODUCT(void PrintJSONInlineIntervals(JSONObject* object) const); |
4793 void DumpInlineIntervals() const; | 4803 void DumpInlineIntervals() const; |
4794 void DumpSourcePositions() const; | 4804 void DumpSourcePositions() const; |
4795 | 4805 |
4796 RawLocalVarDescriptors* var_descriptors() const { | 4806 RawLocalVarDescriptors* var_descriptors() const { |
4797 #if defined(DART_PRECOMPILED_RUNTIME) | 4807 #if defined(DART_PRECOMPILED_RUNTIME) |
4798 UNREACHABLE(); | 4808 UNREACHABLE(); |
4799 return NULL; | 4809 return NULL; |
4800 #else | 4810 #else |
(...skipping 3588 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
8389 intptr_t Length() const; | 8399 intptr_t Length() const; |
8390 | 8400 |
8391 RawStackTrace* async_link() const { return raw_ptr()->async_link_; } | 8401 RawStackTrace* async_link() const { return raw_ptr()->async_link_; } |
8392 void set_async_link(const StackTrace& async_link) const; | 8402 void set_async_link(const StackTrace& async_link) const; |
8393 void set_expand_inlined(bool value) const; | 8403 void set_expand_inlined(bool value) const; |
8394 | 8404 |
8395 RawArray* code_array() const { return raw_ptr()->code_array_; } | 8405 RawArray* code_array() const { return raw_ptr()->code_array_; } |
8396 RawCode* CodeAtFrame(intptr_t frame_index) const; | 8406 RawCode* CodeAtFrame(intptr_t frame_index) const; |
8397 void SetCodeAtFrame(intptr_t frame_index, const Code& code) const; | 8407 void SetCodeAtFrame(intptr_t frame_index, const Code& code) const; |
8398 | 8408 |
8399 RawFunction* FunctionAtFrame(intptr_t frame_index) const; | |
8400 | |
8401 RawArray* pc_offset_array() const { return raw_ptr()->pc_offset_array_; } | 8409 RawArray* pc_offset_array() const { return raw_ptr()->pc_offset_array_; } |
8402 RawSmi* PcOffsetAtFrame(intptr_t frame_index) const; | 8410 RawSmi* PcOffsetAtFrame(intptr_t frame_index) const; |
8403 void SetPcOffsetAtFrame(intptr_t frame_index, const Smi& pc_offset) const; | 8411 void SetPcOffsetAtFrame(intptr_t frame_index, const Smi& pc_offset) const; |
8404 | 8412 |
8405 static intptr_t InstanceSize() { | 8413 static intptr_t InstanceSize() { |
8406 return RoundedAllocationSize(sizeof(RawStackTrace)); | 8414 return RoundedAllocationSize(sizeof(RawStackTrace)); |
8407 } | 8415 } |
8408 static RawStackTrace* New(const Array& code_array, | 8416 static RawStackTrace* New(const Array& code_array, |
8409 const Array& pc_offset_array, | 8417 const Array& pc_offset_array, |
8410 Heap::Space space = Heap::kNew); | 8418 Heap::Space space = Heap::kNew); |
(...skipping 493 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
8904 | 8912 |
8905 inline void TypeArguments::SetHash(intptr_t value) const { | 8913 inline void TypeArguments::SetHash(intptr_t value) const { |
8906 // This is only safe because we create a new Smi, which does not cause | 8914 // This is only safe because we create a new Smi, which does not cause |
8907 // heap allocation. | 8915 // heap allocation. |
8908 StoreSmi(&raw_ptr()->hash_, Smi::New(value)); | 8916 StoreSmi(&raw_ptr()->hash_, Smi::New(value)); |
8909 } | 8917 } |
8910 | 8918 |
8911 } // namespace dart | 8919 } // namespace dart |
8912 | 8920 |
8913 #endif // RUNTIME_VM_OBJECT_H_ | 8921 #endif // RUNTIME_VM_OBJECT_H_ |
OLD | NEW |