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

Unified Diff: runtime/vm/raw_object.h

Issue 566053002: Save more memory by compacting LocalVarDescriptors (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/vm/object.cc ('k') | runtime/vm/raw_object.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/raw_object.h
===================================================================
--- runtime/vm/raw_object.h (revision 40226)
+++ runtime/vm/raw_object.h (working copy)
@@ -1097,12 +1097,28 @@
private:
RAW_HEAP_OBJECT_IMPLEMENTATION(LocalVarDescriptors);
- RawArray* names_; // Array of [length_] variable names.
- int32_t length_; // Number of descriptors.
+ int32_t num_entries_; // Number of descriptors.
- // Variable info with [length_] entries.
- VarInfo* data() { OPEN_ARRAY_START(VarInfo, int32_t); }
+ RawObject** from() {
+ return reinterpret_cast<RawObject**>(&ptr()->names()[0]);
+ }
+ RawString** names() {
+ // Array of [num_entries_] variable names.
+ OPEN_ARRAY_START(RawString*, RawString*);
+ }
+ RawString** nameAddrAt(intptr_t i) {
+ return &(ptr()->names()[i]);
+ }
+ RawObject** to(intptr_t num_entries) {
+ return reinterpret_cast<RawObject**>(nameAddrAt(num_entries - 1));
+ }
+
+ // Variable info with [num_entries_] entries.
+ VarInfo* data() {
+ return reinterpret_cast<VarInfo*>(nameAddrAt(ptr()->num_entries_));
+ }
+
friend class Object;
};
« 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