| 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 6268 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6279 closure.StorePointer(ContextAddr(closure), value.raw()); | 6279 closure.StorePointer(ContextAddr(closure), value.raw()); |
| 6280 } | 6280 } |
| 6281 | 6281 |
| 6282 friend class Class; | 6282 friend class Class; |
| 6283 }; | 6283 }; |
| 6284 | 6284 |
| 6285 | 6285 |
| 6286 // Internal stacktrace object used in exceptions for printing stack traces. | 6286 // Internal stacktrace object used in exceptions for printing stack traces. |
| 6287 class Stacktrace : public Instance { | 6287 class Stacktrace : public Instance { |
| 6288 public: | 6288 public: |
| 6289 static const int kPreallocatedStackdepth = 10; | |
| 6290 | |
| 6291 intptr_t Length() const; | 6289 intptr_t Length() const; |
| 6292 | |
| 6293 RawFunction* FunctionAtFrame(intptr_t frame_index) const; | 6290 RawFunction* FunctionAtFrame(intptr_t frame_index) const; |
| 6294 void SetFunctionAtFrame(intptr_t frame_index, const Function& func) const; | |
| 6295 | |
| 6296 RawCode* CodeAtFrame(intptr_t frame_index) const; | 6291 RawCode* CodeAtFrame(intptr_t frame_index) const; |
| 6297 void SetCodeAtFrame(intptr_t frame_index, const Code& code) const; | |
| 6298 | |
| 6299 RawSmi* PcOffsetAtFrame(intptr_t frame_index) const; | 6292 RawSmi* PcOffsetAtFrame(intptr_t frame_index) const; |
| 6300 void SetPcOffsetAtFrame(intptr_t frame_index, const Smi& pc_offset) const; | 6293 void Append(const GrowableObjectArray& func_list, |
| 6301 | 6294 const GrowableObjectArray& code_list, |
| 6302 void Append(const Array& func_list, | 6295 const GrowableObjectArray& pc_offset_list) const; |
| 6303 const Array& code_list, | |
| 6304 const Array& pc_offset_list) const; | |
| 6305 | 6296 |
| 6306 static intptr_t InstanceSize() { | 6297 static intptr_t InstanceSize() { |
| 6307 return RoundedAllocationSize(sizeof(RawStacktrace)); | 6298 return RoundedAllocationSize(sizeof(RawStacktrace)); |
| 6308 } | 6299 } |
| 6309 static RawStacktrace* New(const Array& func_array, | 6300 static RawStacktrace* New(const GrowableObjectArray& func_list, |
| 6310 const Array& code_array, | 6301 const GrowableObjectArray& code_list, |
| 6311 const Array& pc_offset_array, | 6302 const GrowableObjectArray& pc_offset_list, |
| 6312 Heap::Space space = Heap::kNew); | 6303 Heap::Space space = Heap::kNew); |
| 6313 | 6304 |
| 6314 const char* ToCStringInternal(bool verbose) const; | 6305 const char* ToCStringInternal(bool verbose) const; |
| 6315 | 6306 |
| 6316 private: | 6307 private: |
| 6317 void set_function_array(const Array& function_array) const; | 6308 void set_function_array(const Array& function_array) const; |
| 6318 void set_code_array(const Array& code_array) const; | 6309 void set_code_array(const Array& code_array) const; |
| 6319 void set_pc_offset_array(const Array& pc_offset_array) const; | 6310 void set_pc_offset_array(const Array& pc_offset_array) const; |
| 6320 | 6311 |
| 6321 FINAL_HEAP_OBJECT_IMPLEMENTATION(Stacktrace, Instance); | 6312 FINAL_HEAP_OBJECT_IMPLEMENTATION(Stacktrace, Instance); |
| (...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6555 | 6546 |
| 6556 | 6547 |
| 6557 RawObject* MegamorphicCache::GetTargetFunction(const Array& array, | 6548 RawObject* MegamorphicCache::GetTargetFunction(const Array& array, |
| 6558 intptr_t index) { | 6549 intptr_t index) { |
| 6559 return array.At((index * kEntryLength) + kTargetFunctionIndex); | 6550 return array.At((index * kEntryLength) + kTargetFunctionIndex); |
| 6560 } | 6551 } |
| 6561 | 6552 |
| 6562 } // namespace dart | 6553 } // namespace dart |
| 6563 | 6554 |
| 6564 #endif // VM_OBJECT_H_ | 6555 #endif // VM_OBJECT_H_ |
| OLD | NEW |