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 VM_OBJECT_H_ | 5 #ifndef VM_OBJECT_H_ |
6 #define VM_OBJECT_H_ | 6 #define 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 6094 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6105 closure.StorePointer(ContextAddr(closure), value.raw()); | 6105 closure.StorePointer(ContextAddr(closure), value.raw()); |
6106 } | 6106 } |
6107 | 6107 |
6108 friend class Class; | 6108 friend class Class; |
6109 }; | 6109 }; |
6110 | 6110 |
6111 | 6111 |
6112 // Internal stacktrace object used in exceptions for printing stack traces. | 6112 // Internal stacktrace object used in exceptions for printing stack traces. |
6113 class Stacktrace : public Instance { | 6113 class Stacktrace : public Instance { |
6114 public: | 6114 public: |
| 6115 static const int kPreallocatedStackdepth = 10; |
| 6116 |
6115 intptr_t Length() const; | 6117 intptr_t Length() const; |
| 6118 |
6116 RawFunction* FunctionAtFrame(intptr_t frame_index) const; | 6119 RawFunction* FunctionAtFrame(intptr_t frame_index) const; |
| 6120 void SetFunctionAtFrame(intptr_t frame_index, const Function& func) const; |
| 6121 |
6117 RawCode* CodeAtFrame(intptr_t frame_index) const; | 6122 RawCode* CodeAtFrame(intptr_t frame_index) const; |
| 6123 void SetCodeAtFrame(intptr_t frame_index, const Code& code) const; |
| 6124 |
6118 RawSmi* PcOffsetAtFrame(intptr_t frame_index) const; | 6125 RawSmi* PcOffsetAtFrame(intptr_t frame_index) const; |
6119 void Append(const GrowableObjectArray& func_list, | 6126 void SetPcOffsetAtFrame(intptr_t frame_index, const Smi& pc_offset) const; |
6120 const GrowableObjectArray& code_list, | 6127 |
6121 const GrowableObjectArray& pc_offset_list) const; | 6128 void Append(const Array& func_list, |
| 6129 const Array& code_list, |
| 6130 const Array& pc_offset_list) const; |
6122 | 6131 |
6123 static intptr_t InstanceSize() { | 6132 static intptr_t InstanceSize() { |
6124 return RoundedAllocationSize(sizeof(RawStacktrace)); | 6133 return RoundedAllocationSize(sizeof(RawStacktrace)); |
6125 } | 6134 } |
6126 static RawStacktrace* New(const GrowableObjectArray& func_list, | 6135 static RawStacktrace* New(const Array& func_array, |
6127 const GrowableObjectArray& code_list, | 6136 const Array& code_array, |
6128 const GrowableObjectArray& pc_offset_list, | 6137 const Array& pc_offset_array, |
6129 Heap::Space space = Heap::kNew); | 6138 Heap::Space space = Heap::kNew); |
6130 | 6139 |
6131 const char* ToCStringInternal(bool verbose) const; | 6140 const char* ToCStringInternal(bool verbose) const; |
6132 | 6141 |
6133 private: | 6142 private: |
6134 void set_function_array(const Array& function_array) const; | 6143 void set_function_array(const Array& function_array) const; |
6135 void set_code_array(const Array& code_array) const; | 6144 void set_code_array(const Array& code_array) const; |
6136 void set_pc_offset_array(const Array& pc_offset_array) const; | 6145 void set_pc_offset_array(const Array& pc_offset_array) const; |
6137 | 6146 |
6138 FINAL_HEAP_OBJECT_IMPLEMENTATION(Stacktrace, Instance); | 6147 FINAL_HEAP_OBJECT_IMPLEMENTATION(Stacktrace, Instance); |
(...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6372 | 6381 |
6373 | 6382 |
6374 RawObject* MegamorphicCache::GetTargetFunction(const Array& array, | 6383 RawObject* MegamorphicCache::GetTargetFunction(const Array& array, |
6375 intptr_t index) { | 6384 intptr_t index) { |
6376 return array.At((index * kEntryLength) + kTargetFunctionIndex); | 6385 return array.At((index * kEntryLength) + kTargetFunctionIndex); |
6377 } | 6386 } |
6378 | 6387 |
6379 } // namespace dart | 6388 } // namespace dart |
6380 | 6389 |
6381 #endif // VM_OBJECT_H_ | 6390 #endif // VM_OBJECT_H_ |
OLD | NEW |