| 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 // The pc offset is interpreted as an instruction address (as needed by the | 4787 void GetInlinedFunctionsAt( |
| 4788 // disassembler or the top frame of a profiler sample). | |
| 4789 void GetInlinedFunctionsAtInstruction( | |
| 4790 intptr_t pc_offset, | 4788 intptr_t pc_offset, |
| 4791 GrowableArray<const Function*>* functions, | 4789 GrowableArray<const Function*>* functions, |
| 4792 GrowableArray<TokenPosition>* token_positions) const; | 4790 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 } | |
| 4801 | 4791 |
| 4802 NOT_IN_PRODUCT(void PrintJSONInlineIntervals(JSONObject* object) const); | 4792 NOT_IN_PRODUCT(void PrintJSONInlineIntervals(JSONObject* object) const); |
| 4803 void DumpInlineIntervals() const; | 4793 void DumpInlineIntervals() const; |
| 4804 void DumpSourcePositions() const; | 4794 void DumpSourcePositions() const; |
| 4805 | 4795 |
| 4806 RawLocalVarDescriptors* var_descriptors() const { | 4796 RawLocalVarDescriptors* var_descriptors() const { |
| 4807 #if defined(DART_PRECOMPILED_RUNTIME) | 4797 #if defined(DART_PRECOMPILED_RUNTIME) |
| 4808 UNREACHABLE(); | 4798 UNREACHABLE(); |
| 4809 return NULL; | 4799 return NULL; |
| 4810 #else | 4800 #else |
| (...skipping 3580 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 8391 }; | 8381 }; |
| 8392 | 8382 |
| 8393 | 8383 |
| 8394 // Internal stacktrace object used in exceptions for printing stack traces. | 8384 // Internal stacktrace object used in exceptions for printing stack traces. |
| 8395 class StackTrace : public Instance { | 8385 class StackTrace : public Instance { |
| 8396 public: | 8386 public: |
| 8397 static const int kPreallocatedStackdepth = 30; | 8387 static const int kPreallocatedStackdepth = 30; |
| 8398 | 8388 |
| 8399 intptr_t Length() const; | 8389 intptr_t Length() const; |
| 8400 | 8390 |
| 8391 RawFunction* FunctionAtFrame(intptr_t frame_index) const; |
| 8392 |
| 8401 RawCode* CodeAtFrame(intptr_t frame_index) const; | 8393 RawCode* CodeAtFrame(intptr_t frame_index) const; |
| 8402 void SetCodeAtFrame(intptr_t frame_index, const Code& code) const; | 8394 void SetCodeAtFrame(intptr_t frame_index, const Code& code) const; |
| 8403 | 8395 |
| 8404 RawSmi* PcOffsetAtFrame(intptr_t frame_index) const; | 8396 RawSmi* PcOffsetAtFrame(intptr_t frame_index) const; |
| 8405 void SetPcOffsetAtFrame(intptr_t frame_index, const Smi& pc_offset) const; | 8397 void SetPcOffsetAtFrame(intptr_t frame_index, const Smi& pc_offset) const; |
| 8406 void set_expand_inlined(bool value) const; | 8398 void set_expand_inlined(bool value) const; |
| 8407 | 8399 |
| 8408 static intptr_t InstanceSize() { | 8400 static intptr_t InstanceSize() { |
| 8409 return RoundedAllocationSize(sizeof(RawStackTrace)); | 8401 return RoundedAllocationSize(sizeof(RawStackTrace)); |
| 8410 } | 8402 } |
| (...skipping 490 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 8901 | 8893 |
| 8902 inline void TypeArguments::SetHash(intptr_t value) const { | 8894 inline void TypeArguments::SetHash(intptr_t value) const { |
| 8903 // This is only safe because we create a new Smi, which does not cause | 8895 // This is only safe because we create a new Smi, which does not cause |
| 8904 // heap allocation. | 8896 // heap allocation. |
| 8905 StoreSmi(&raw_ptr()->hash_, Smi::New(value)); | 8897 StoreSmi(&raw_ptr()->hash_, Smi::New(value)); |
| 8906 } | 8898 } |
| 8907 | 8899 |
| 8908 } // namespace dart | 8900 } // namespace dart |
| 8909 | 8901 |
| 8910 #endif // RUNTIME_VM_OBJECT_H_ | 8902 #endif // RUNTIME_VM_OBJECT_H_ |
| OLD | NEW |