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 8372 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 RawFunction* FunctionAtFrame(intptr_t frame_index) const; |
8392 | 8392 |
| 8393 RawStackTrace* async_link() const { return raw_ptr()->async_link_; } |
| 8394 void set_async_link(const StackTrace& async_link) const; |
| 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 RawArray* pc_offset_array() const { return raw_ptr()->pc_offset_array_; } |
8396 RawSmi* PcOffsetAtFrame(intptr_t frame_index) const; | 8400 RawSmi* PcOffsetAtFrame(intptr_t frame_index) const; |
8397 void SetPcOffsetAtFrame(intptr_t frame_index, const Smi& pc_offset) const; | 8401 void SetPcOffsetAtFrame(intptr_t frame_index, const Smi& pc_offset) const; |
8398 void set_expand_inlined(bool value) const; | 8402 void set_expand_inlined(bool value) const; |
8399 | 8403 |
8400 static intptr_t InstanceSize() { | 8404 static intptr_t InstanceSize() { |
8401 return RoundedAllocationSize(sizeof(RawStackTrace)); | 8405 return RoundedAllocationSize(sizeof(RawStackTrace)); |
8402 } | 8406 } |
8403 static RawStackTrace* New(const Array& code_array, | 8407 static RawStackTrace* New(const Array& code_array, |
8404 const Array& pc_offset_array, | 8408 const Array& pc_offset_array, |
8405 Heap::Space space = Heap::kNew); | 8409 Heap::Space space = Heap::kNew); |
8406 | 8410 |
| 8411 static RawStackTrace* New(const Array& code_array, |
| 8412 const Array& pc_offset_array, |
| 8413 const StackTrace& async_link, |
| 8414 Heap::Space space = Heap::kNew); |
| 8415 |
8407 // The argument 'max_frames' limits the number of printed frames. | 8416 // The argument 'max_frames' limits the number of printed frames. |
8408 const char* ToCStringInternal(intptr_t* frame_index, | 8417 const char* ToCStringInternal(intptr_t* frame_index, |
8409 intptr_t max_frames = kMaxInt32) const; | 8418 intptr_t max_frames = kMaxInt32) const; |
8410 | 8419 |
8411 private: | 8420 private: |
8412 void set_code_array(const Array& code_array) const; | 8421 void set_code_array(const Array& code_array) const; |
8413 void set_pc_offset_array(const Array& pc_offset_array) const; | 8422 void set_pc_offset_array(const Array& pc_offset_array) const; |
8414 bool expand_inlined() const; | 8423 bool expand_inlined() const; |
8415 | 8424 |
8416 FINAL_HEAP_OBJECT_IMPLEMENTATION(StackTrace, Instance); | 8425 FINAL_HEAP_OBJECT_IMPLEMENTATION(StackTrace, Instance); |
(...skipping 476 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
8893 | 8902 |
8894 inline void TypeArguments::SetHash(intptr_t value) const { | 8903 inline void TypeArguments::SetHash(intptr_t value) const { |
8895 // This is only safe because we create a new Smi, which does not cause | 8904 // This is only safe because we create a new Smi, which does not cause |
8896 // heap allocation. | 8905 // heap allocation. |
8897 StoreSmi(&raw_ptr()->hash_, Smi::New(value)); | 8906 StoreSmi(&raw_ptr()->hash_, Smi::New(value)); |
8898 } | 8907 } |
8899 | 8908 |
8900 } // namespace dart | 8909 } // namespace dart |
8901 | 8910 |
8902 #endif // RUNTIME_VM_OBJECT_H_ | 8911 #endif // RUNTIME_VM_OBJECT_H_ |
OLD | NEW |