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

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

Issue 23691008: Compress memory usage. Imprive speed of finding exception handlers: if a code does not have any han… (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 3 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
« no previous file with comments | « runtime/vm/object.cc ('k') | runtime/vm/raw_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_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 819 matching lines...) Expand 10 before | Expand all | Expand 10 after
830 RawArray* object_table_; 830 RawArray* object_table_;
831 RawArray* static_calls_target_table_; // (code-offset, function, code). 831 RawArray* static_calls_target_table_; // (code-offset, function, code).
832 RawArray* stackmaps_; 832 RawArray* stackmaps_;
833 RawLocalVarDescriptors* var_descriptors_; 833 RawLocalVarDescriptors* var_descriptors_;
834 RawArray* comments_; 834 RawArray* comments_;
835 RawObject** to() { 835 RawObject** to() {
836 return reinterpret_cast<RawObject**>(&ptr()->comments_); 836 return reinterpret_cast<RawObject**>(&ptr()->comments_);
837 } 837 }
838 838
839 intptr_t pointer_offsets_length_; 839 intptr_t pointer_offsets_length_;
840 // These fields cannot be boolean because of alignment issues on x64 840 // Alive: If true, the embedded object pointers will be visited during GC.
841 // This field cannot be shorter because of alignment issues on x64
841 // architectures. 842 // architectures.
842 intptr_t is_optimized_; 843 intptr_t state_bits_; // state, is_optimized, is_alive.
843 // If true, the embedded object pointers will be visited during GC.
844 intptr_t is_alive_;
845 844
846 // Variable length data follows here. 845 // Variable length data follows here.
847 int32_t data_[0]; 846 int32_t data_[0];
848 847
849 friend class StackFrame; 848 friend class StackFrame;
850 }; 849 };
851 850
852 851
853 class RawInstructions : public RawObject { 852 class RawInstructions : public RawObject {
854 RAW_HEAP_OBJECT_IMPLEMENTATION(Instructions); 853 RAW_HEAP_OBJECT_IMPLEMENTATION(Instructions);
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
936 935
937 VarInfo data_[0]; // Variable info with [length_] entries. 936 VarInfo data_[0]; // Variable info with [length_] entries.
938 }; 937 };
939 938
940 939
941 class RawExceptionHandlers : public RawObject { 940 class RawExceptionHandlers : public RawObject {
942 public: 941 public:
943 // The index into the ExceptionHandlers table corresponds to 942 // The index into the ExceptionHandlers table corresponds to
944 // the try_index of the handler. 943 // the try_index of the handler.
945 struct HandlerInfo { 944 struct HandlerInfo {
946 intptr_t outer_try_index; // Try block index of enclosing try block.
947 intptr_t handler_pc; // PC value of handler. 945 intptr_t handler_pc; // PC value of handler.
948 bool needs_stacktrace; // True if a stacktrace is needed. 946 int16_t outer_try_index; // Try block index of enclosing try block.
947 int16_t needs_stacktrace; // True if a stacktrace is needed.
949 }; 948 };
950 private: 949 private:
951 RAW_HEAP_OBJECT_IMPLEMENTATION(ExceptionHandlers); 950 RAW_HEAP_OBJECT_IMPLEMENTATION(ExceptionHandlers);
952 951
953 // Number of exception handler entries. 952 // Number of exception handler entries.
954 intptr_t length_; 953 intptr_t length_;
955 954
956 // Array with [length_] entries. Each entry is an array of all handled 955 // Array with [length_] entries. Each entry is an array of all handled
957 // exception types. 956 // exception types.
958 RawArray* handled_types_data_; 957 RawArray* handled_types_data_;
(...skipping 753 matching lines...) Expand 10 before | Expand all | Expand 10 after
1712 // Make sure this is updated when new TypedData types are added. 1711 // Make sure this is updated when new TypedData types are added.
1713 ASSERT(kTypedDataInt8ArrayViewCid == kTypedDataInt8ArrayCid + 12); 1712 ASSERT(kTypedDataInt8ArrayViewCid == kTypedDataInt8ArrayCid + 12);
1714 ASSERT(kExternalTypedDataInt8ArrayCid == kTypedDataInt8ArrayViewCid + 13); 1713 ASSERT(kExternalTypedDataInt8ArrayCid == kTypedDataInt8ArrayViewCid + 13);
1715 ASSERT(kNullCid == kExternalTypedDataInt8ArrayCid + 12); 1714 ASSERT(kNullCid == kExternalTypedDataInt8ArrayCid + 12);
1716 return (kNullCid - kTypedDataInt8ArrayCid); 1715 return (kNullCid - kTypedDataInt8ArrayCid);
1717 } 1716 }
1718 1717
1719 } // namespace dart 1718 } // namespace dart
1720 1719
1721 #endif // VM_RAW_OBJECT_H_ 1720 #endif // VM_RAW_OBJECT_H_
OLDNEW
« no previous file with comments | « runtime/vm/object.cc ('k') | runtime/vm/raw_object.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698