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 2353 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2364 return RoundedAllocationSize( | 2364 return RoundedAllocationSize( |
2365 sizeof(RawPcDescriptors) + (len * kBytesPerElement)); | 2365 sizeof(RawPcDescriptors) + (len * kBytesPerElement)); |
2366 } | 2366 } |
2367 | 2367 |
2368 static RawPcDescriptors* New(intptr_t num_descriptors); | 2368 static RawPcDescriptors* New(intptr_t num_descriptors); |
2369 | 2369 |
2370 // Returns 0 if not found. | 2370 // Returns 0 if not found. |
2371 uword GetPcForKind(Kind kind) const; | 2371 uword GetPcForKind(Kind kind) const; |
2372 | 2372 |
2373 // Verify (assert) assumptions about pc descriptors in debug mode. | 2373 // Verify (assert) assumptions about pc descriptors in debug mode. |
2374 void Verify(bool check_ids) const; | 2374 void Verify(const Function& function) const; |
2375 | 2375 |
2376 static void PrintHeaderString(); | 2376 static void PrintHeaderString(); |
2377 | 2377 |
2378 // We would have a VisitPointers function here to traverse the | 2378 // We would have a VisitPointers function here to traverse the |
2379 // pc descriptors table to visit objects if any in the table. | 2379 // pc descriptors table to visit objects if any in the table. |
2380 | 2380 |
2381 private: | 2381 private: |
2382 void SetPC(intptr_t index, uword value) const; | 2382 void SetPC(intptr_t index, uword value) const; |
2383 void SetKind(intptr_t index, PcDescriptors::Kind kind) const; | 2383 void SetKind(intptr_t index, PcDescriptors::Kind kind) const; |
2384 void SetDeoptId(intptr_t index, intptr_t value) const; | 2384 void SetDeoptId(intptr_t index, intptr_t value) const; |
(...skipping 328 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2713 // Returns true if there is an object in the code between 'start_offset' | 2713 // Returns true if there is an object in the code between 'start_offset' |
2714 // (inclusive) and 'end_offset' (exclusive). | 2714 // (inclusive) and 'end_offset' (exclusive). |
2715 bool ObjectExistsInArea(intptr_t start_offest, intptr_t end_offset) const; | 2715 bool ObjectExistsInArea(intptr_t start_offest, intptr_t end_offset) const; |
2716 | 2716 |
2717 // Each (*node_ids)[n] has a an extracted ic data array (*arrays)[n]. | 2717 // Each (*node_ids)[n] has a an extracted ic data array (*arrays)[n]. |
2718 // Returns the maximum id found. | 2718 // Returns the maximum id found. |
2719 intptr_t ExtractIcDataArraysAtCalls( | 2719 intptr_t ExtractIcDataArraysAtCalls( |
2720 GrowableArray<intptr_t>* node_ids, | 2720 GrowableArray<intptr_t>* node_ids, |
2721 const GrowableObjectArray& ic_data_objs) const; | 2721 const GrowableObjectArray& ic_data_objs) const; |
2722 | 2722 |
| 2723 // Returns an array indexed by deopt id, containing the extracted ICData. |
| 2724 RawArray* ExtractTypeFeedbackArray() const; |
| 2725 |
2723 private: | 2726 private: |
2724 // An object finder visitor interface. | 2727 // An object finder visitor interface. |
2725 class FindRawCodeVisitor : public FindObjectVisitor { | 2728 class FindRawCodeVisitor : public FindObjectVisitor { |
2726 public: | 2729 public: |
2727 explicit FindRawCodeVisitor(uword pc) | 2730 explicit FindRawCodeVisitor(uword pc) |
2728 : FindObjectVisitor(Isolate::Current()), pc_(pc) { } | 2731 : FindObjectVisitor(Isolate::Current()), pc_(pc) { } |
2729 virtual ~FindRawCodeVisitor() { } | 2732 virtual ~FindRawCodeVisitor() { } |
2730 | 2733 |
2731 // Check if object matches find condition. | 2734 // Check if object matches find condition. |
2732 virtual bool FindObject(RawObject* obj); | 2735 virtual bool FindObject(RawObject* obj); |
(...skipping 2885 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5618 if (this->CharAt(i) != str.CharAt(begin_index + i)) { | 5621 if (this->CharAt(i) != str.CharAt(begin_index + i)) { |
5619 return false; | 5622 return false; |
5620 } | 5623 } |
5621 } | 5624 } |
5622 return true; | 5625 return true; |
5623 } | 5626 } |
5624 | 5627 |
5625 } // namespace dart | 5628 } // namespace dart |
5626 | 5629 |
5627 #endif // VM_OBJECT_H_ | 5630 #endif // VM_OBJECT_H_ |
OLD | NEW |