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

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

Issue 356923006: Iterate over PcDescriptors only via iterators, not via an index. (preparation for more compression … (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 5 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 | Annotate | Revision Log
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_RAW_OBJECT_H_ 5 #ifndef VM_RAW_OBJECT_H_
6 #define VM_RAW_OBJECT_H_ 6 #define VM_RAW_OBJECT_H_
7 7
8 #include "platform/assert.h" 8 #include "platform/assert.h"
9 #include "vm/globals.h" 9 #include "vm/globals.h"
10 #include "vm/token.h" 10 #include "vm/token.h"
(...skipping 884 matching lines...) Expand 10 before | Expand all | Expand 10 after
895 895
896 friend class RawCode; 896 friend class RawCode;
897 friend class Code; 897 friend class Code;
898 friend class StackFrame; 898 friend class StackFrame;
899 friend class MarkingVisitor; 899 friend class MarkingVisitor;
900 friend class Function; 900 friend class Function;
901 }; 901 };
902 902
903 903
904 class RawPcDescriptors : public RawObject { 904 class RawPcDescriptors : public RawObject {
905 RAW_HEAP_OBJECT_IMPLEMENTATION(PcDescriptors); 905 public:
906 906 enum Kind {
907 intptr_t length_; // Number of descriptors. 907 kDeopt, // Deoptimization continuation point.
908 kIcCall, // IC call.
909 kOptStaticCall, // Call directly to known target, e.g. static call.
910 kUnoptStaticCall, // Call to a known target via a stub.
911 kClosureCall, // Closure call.
912 kRuntimeCall, // Runtime call.
913 kOsrEntry, // OSR entry point in unoptimized code.
914 kOther
915 };
908 916
909 struct PcDescriptorRec { 917 struct PcDescriptorRec {
910 uword pc; 918 uword pc;
911 int32_t deopt_id; 919 int32_t deopt_id;
912 int32_t token_pos; // Or deopt reason. 920 int32_t token_pos; // Or deopt reason.
913 int16_t try_index; // Or deopt index. 921 int16_t try_index; // Or deopt index.
914 int8_t kind; 922 int8_t kind_;
923
924 Kind kind() const { return static_cast<Kind>(kind_); }
915 }; 925 };
916 926
927 private:
928 RAW_HEAP_OBJECT_IMPLEMENTATION(PcDescriptors);
929
930 intptr_t length_; // Number of descriptors.
931
917 // Variable length data follows here. 932 // Variable length data follows here.
918 PcDescriptorRec* data() { OPEN_ARRAY_START(PcDescriptorRec, intptr_t); } 933 PcDescriptorRec* data() { OPEN_ARRAY_START(PcDescriptorRec, intptr_t); }
919 934
920 friend class Object; 935 friend class Object;
921 }; 936 };
922 937
923 938
924 // Stackmap is an immutable representation of the layout of the stack at a 939 // Stackmap is an immutable representation of the layout of the stack at a
925 // PC. The stack map representation consists of a bit map which marks each 940 // PC. The stack map representation consists of a bit map which marks each
926 // live object index starting from the base of the frame. 941 // live object index starting from the base of the frame.
(...skipping 954 matching lines...) Expand 10 before | Expand all | Expand 10 after
1881 COMPILE_ASSERT(kTypedDataInt8ArrayViewCid == kTypedDataInt8ArrayCid + 14); 1896 COMPILE_ASSERT(kTypedDataInt8ArrayViewCid == kTypedDataInt8ArrayCid + 14);
1882 COMPILE_ASSERT(kExternalTypedDataInt8ArrayCid == 1897 COMPILE_ASSERT(kExternalTypedDataInt8ArrayCid ==
1883 kTypedDataInt8ArrayViewCid + 15); 1898 kTypedDataInt8ArrayViewCid + 15);
1884 COMPILE_ASSERT(kNullCid == kExternalTypedDataInt8ArrayCid + 14); 1899 COMPILE_ASSERT(kNullCid == kExternalTypedDataInt8ArrayCid + 14);
1885 return (kNullCid - kTypedDataInt8ArrayCid); 1900 return (kNullCid - kTypedDataInt8ArrayCid);
1886 } 1901 }
1887 1902
1888 } // namespace dart 1903 } // namespace dart
1889 1904
1890 #endif // VM_RAW_OBJECT_H_ 1905 #endif // VM_RAW_OBJECT_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698