| 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 5828 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5839 | 5839 |
| 5840 | 5840 |
| 5841 // Internal stacktrace object used in exceptions for printing stack traces. | 5841 // Internal stacktrace object used in exceptions for printing stack traces. |
| 5842 class Stacktrace : public Instance { | 5842 class Stacktrace : public Instance { |
| 5843 public: | 5843 public: |
| 5844 static const int kPreallocatedStackdepth = 10; | 5844 static const int kPreallocatedStackdepth = 10; |
| 5845 | 5845 |
| 5846 intptr_t Length() const; | 5846 intptr_t Length() const; |
| 5847 | 5847 |
| 5848 RawFunction* FunctionAtFrame(intptr_t frame_index) const; | 5848 RawFunction* FunctionAtFrame(intptr_t frame_index) const; |
| 5849 void SetFunctionAtFrame(intptr_t frame_index, const Function& func) const; | |
| 5850 | 5849 |
| 5851 RawCode* CodeAtFrame(intptr_t frame_index) const; | 5850 RawCode* CodeAtFrame(intptr_t frame_index) const; |
| 5852 void SetCodeAtFrame(intptr_t frame_index, const Code& code) const; | 5851 void SetCodeAtFrame(intptr_t frame_index, const Code& code) const; |
| 5853 | 5852 |
| 5854 RawSmi* PcOffsetAtFrame(intptr_t frame_index) const; | 5853 RawSmi* PcOffsetAtFrame(intptr_t frame_index) const; |
| 5855 void SetPcOffsetAtFrame(intptr_t frame_index, const Smi& pc_offset) const; | 5854 void SetPcOffsetAtFrame(intptr_t frame_index, const Smi& pc_offset) const; |
| 5856 void SetCatchStacktrace(const Array& func_array, | 5855 void SetCatchStacktrace(const Array& code_array, |
| 5857 const Array& code_array, | |
| 5858 const Array& pc_offset_array) const; | 5856 const Array& pc_offset_array) const; |
| 5859 | 5857 |
| 5860 void Append(const Array& func_list, | 5858 void Append(const Array& code_list, const Array& pc_offset_list) const; |
| 5861 const Array& code_list, | |
| 5862 const Array& pc_offset_list) const; | |
| 5863 | 5859 |
| 5864 static intptr_t InstanceSize() { | 5860 static intptr_t InstanceSize() { |
| 5865 return RoundedAllocationSize(sizeof(RawStacktrace)); | 5861 return RoundedAllocationSize(sizeof(RawStacktrace)); |
| 5866 } | 5862 } |
| 5867 static RawStacktrace* New(const Array& func_array, | 5863 static RawStacktrace* New(const Array& code_array, |
| 5868 const Array& code_array, | |
| 5869 const Array& pc_offset_array, | 5864 const Array& pc_offset_array, |
| 5870 Heap::Space space = Heap::kNew); | 5865 Heap::Space space = Heap::kNew); |
| 5871 | 5866 |
| 5872 RawString* FullStacktrace() const; | 5867 RawString* FullStacktrace() const; |
| 5873 const char* ToCStringInternal(intptr_t frame_index) const; | 5868 const char* ToCStringInternal(intptr_t frame_index) const; |
| 5874 | 5869 |
| 5875 private: | 5870 private: |
| 5876 void set_function_array(const Array& function_array) const; | |
| 5877 void set_code_array(const Array& code_array) const; | 5871 void set_code_array(const Array& code_array) const; |
| 5878 void set_pc_offset_array(const Array& pc_offset_array) const; | 5872 void set_pc_offset_array(const Array& pc_offset_array) const; |
| 5879 void set_catch_func_array(const Array& function_array) const; | |
| 5880 void set_catch_code_array(const Array& code_array) const; | 5873 void set_catch_code_array(const Array& code_array) const; |
| 5881 void set_catch_pc_offset_array(const Array& pc_offset_array) const; | 5874 void set_catch_pc_offset_array(const Array& pc_offset_array) const; |
| 5882 | 5875 |
| 5883 FINAL_HEAP_OBJECT_IMPLEMENTATION(Stacktrace, Instance); | 5876 FINAL_HEAP_OBJECT_IMPLEMENTATION(Stacktrace, Instance); |
| 5884 friend class Class; | 5877 friend class Class; |
| 5885 }; | 5878 }; |
| 5886 | 5879 |
| 5887 | 5880 |
| 5888 // Internal JavaScript regular expression object. | 5881 // Internal JavaScript regular expression object. |
| 5889 class JSRegExp : public Instance { | 5882 class JSRegExp : public Instance { |
| (...skipping 262 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6152 | 6145 |
| 6153 | 6146 |
| 6154 RawObject* MegamorphicCache::GetTargetFunction(const Array& array, | 6147 RawObject* MegamorphicCache::GetTargetFunction(const Array& array, |
| 6155 intptr_t index) { | 6148 intptr_t index) { |
| 6156 return array.At((index * kEntryLength) + kTargetFunctionIndex); | 6149 return array.At((index * kEntryLength) + kTargetFunctionIndex); |
| 6157 } | 6150 } |
| 6158 | 6151 |
| 6159 } // namespace dart | 6152 } // namespace dart |
| 6160 | 6153 |
| 6161 #endif // VM_OBJECT_H_ | 6154 #endif // VM_OBJECT_H_ |
| OLD | NEW |