Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(172)

Side by Side Diff: runtime/vm/object.h

Issue 1188973003: Port "Add snapshoting methods for code's metadata." (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | runtime/vm/object.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 3798 matching lines...) Expand 10 before | Expand all | Expand 10 after
3809 intptr_t cur_pc_offset_; 3809 intptr_t cur_pc_offset_;
3810 intptr_t cur_kind_; 3810 intptr_t cur_kind_;
3811 intptr_t cur_deopt_id_; 3811 intptr_t cur_deopt_id_;
3812 intptr_t cur_token_pos_; 3812 intptr_t cur_token_pos_;
3813 intptr_t cur_try_index_; 3813 intptr_t cur_try_index_;
3814 }; 3814 };
3815 3815
3816 private: 3816 private:
3817 static const char* KindAsStr(RawPcDescriptors::Kind kind); 3817 static const char* KindAsStr(RawPcDescriptors::Kind kind);
3818 3818
3819 static RawPcDescriptors* New(intptr_t length);
3820
3819 intptr_t Length() const; 3821 intptr_t Length() const;
3820 void SetLength(intptr_t value) const; 3822 void SetLength(intptr_t value) const;
3821 void CopyData(GrowableArray<uint8_t>* data); 3823 void CopyData(GrowableArray<uint8_t>* data);
3822 3824
3823 FINAL_HEAP_OBJECT_IMPLEMENTATION(PcDescriptors, Object); 3825 FINAL_HEAP_OBJECT_IMPLEMENTATION(PcDescriptors, Object);
3824 friend class Class; 3826 friend class Class;
3825 friend class Object; 3827 friend class Object;
3826 }; 3828 };
3827 3829
3828 3830
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
3860 ASSERT(length >= 0); 3862 ASSERT(length >= 0);
3861 // The stackmap payload is in an array of bytes. 3863 // The stackmap payload is in an array of bytes.
3862 intptr_t payload_size = 3864 intptr_t payload_size =
3863 Utils::RoundUp(length, kBitsPerByte) / kBitsPerByte; 3865 Utils::RoundUp(length, kBitsPerByte) / kBitsPerByte;
3864 return RoundedAllocationSize(sizeof(RawStackmap) + payload_size); 3866 return RoundedAllocationSize(sizeof(RawStackmap) + payload_size);
3865 } 3867 }
3866 static RawStackmap* New(intptr_t pc_offset, 3868 static RawStackmap* New(intptr_t pc_offset,
3867 BitmapBuilder* bmap, 3869 BitmapBuilder* bmap,
3868 intptr_t register_bit_count); 3870 intptr_t register_bit_count);
3869 3871
3872 static RawStackmap* New(intptr_t length,
3873 intptr_t register_bit_count,
3874 intptr_t pc_offset);
3875
3870 private: 3876 private:
3871 void SetLength(intptr_t length) const { 3877 void SetLength(intptr_t length) const {
3872 StoreNonPointer(&raw_ptr()->length_, length); 3878 StoreNonPointer(&raw_ptr()->length_, length);
3873 } 3879 }
3874 3880
3875 bool InRange(intptr_t index) const { return index < Length(); } 3881 bool InRange(intptr_t index) const { return index < Length(); }
3876 3882
3877 bool GetBit(intptr_t bit_index) const; 3883 bool GetBit(intptr_t bit_index) const;
3878 void SetBit(intptr_t bit_index, bool value) const; 3884 void SetBit(intptr_t bit_index, bool value) const;
3879 3885
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
3911 OFFSET_OF_RETURNED_VALUE(RawExceptionHandlers, data)); 3917 OFFSET_OF_RETURNED_VALUE(RawExceptionHandlers, data));
3912 return 0; 3918 return 0;
3913 } 3919 }
3914 static intptr_t InstanceSize(intptr_t len) { 3920 static intptr_t InstanceSize(intptr_t len) {
3915 return RoundedAllocationSize( 3921 return RoundedAllocationSize(
3916 sizeof(RawExceptionHandlers) + 3922 sizeof(RawExceptionHandlers) +
3917 (len * sizeof(RawExceptionHandlers::HandlerInfo))); 3923 (len * sizeof(RawExceptionHandlers::HandlerInfo)));
3918 } 3924 }
3919 3925
3920 static RawExceptionHandlers* New(intptr_t num_handlers); 3926 static RawExceptionHandlers* New(intptr_t num_handlers);
3927 static RawExceptionHandlers* New(const Array& handled_types_data);
3921 3928
3922 // We would have a VisitPointers function here to traverse the 3929 // We would have a VisitPointers function here to traverse the
3923 // exception handler table to visit objects if any in the table. 3930 // exception handler table to visit objects if any in the table.
3924 3931
3925 private: 3932 private:
3926 // Pick somewhat arbitrary maximum number of exception handlers 3933 // Pick somewhat arbitrary maximum number of exception handlers
3927 // for a function. This value is used to catch potentially 3934 // for a function. This value is used to catch potentially
3928 // malicious code. 3935 // malicious code.
3929 static const intptr_t kMaxHandlers = 1024 * 1024; 3936 static const intptr_t kMaxHandlers = 1024 * 1024;
3930 3937
(...skipping 4038 matching lines...) Expand 10 before | Expand all | Expand 10 after
7969 7976
7970 7977
7971 RawObject* MegamorphicCache::GetTargetFunction(const Array& array, 7978 RawObject* MegamorphicCache::GetTargetFunction(const Array& array,
7972 intptr_t index) { 7979 intptr_t index) {
7973 return array.At((index * kEntryLength) + kTargetFunctionIndex); 7980 return array.At((index * kEntryLength) + kTargetFunctionIndex);
7974 } 7981 }
7975 7982
7976 } // namespace dart 7983 } // namespace dart
7977 7984
7978 #endif // VM_OBJECT_H_ 7985 #endif // VM_OBJECT_H_
OLDNEW
« no previous file with comments | « no previous file | runtime/vm/object.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698