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

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

Issue 387993007: 5% smaller snapshots by omitting object ids when possible (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
« no previous file with comments | « runtime/vm/snapshot.cc ('k') | runtime/vm/snapshot_test.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_SNAPSHOT_IDS_H_ 5 #ifndef VM_SNAPSHOT_IDS_H_
6 #define VM_SNAPSHOT_IDS_H_ 6 #define VM_SNAPSHOT_IDS_H_
7 7
8 #include "vm/raw_object.h" 8 #include "vm/raw_object.h"
9 9
10 namespace dart { 10 namespace dart {
11 11
12 // Index for predefined singleton objects used in a snapshot. 12 // Index for predefined singleton objects used in a snapshot.
13 enum { 13 enum {
14 kNullObject = 0, 14 kNullObject = 0,
15 kSentinelObject, 15 kSentinelObject,
16 kEmptyArrayObject, 16 kEmptyArrayObject,
17 kZeroArrayObject, 17 kZeroArrayObject,
18 kTrueValue, 18 kTrueValue,
19 kFalseValue, 19 kFalseValue,
20 // Marker for special encoding of double objects in message snapshots. 20 // Marker for special encoding of double objects in message snapshots.
21 kDoubleObject, 21 kDoubleObject,
22 // Object id has been optimized away; reader should use next available id.
23 kOmittedObjectId,
22 24
23 kClassIdsOffset = kDoubleObject, 25 kClassIdsOffset = kDoubleObject,
24 26
25 // The class ids of predefined classes are included in this list 27 // The class ids of predefined classes are included in this list
26 // at an offset of kClassIdsOffset. 28 // at an offset of kClassIdsOffset.
27 29
28 kObjectType = (kNumPredefinedCids + kClassIdsOffset), 30 kObjectType = (kNumPredefinedCids + kClassIdsOffset),
29 kNullType, 31 kNullType,
30 kDynamicType, 32 kDynamicType,
31 kVoidType, 33 kVoidType,
32 kFunctionType, 34 kFunctionType,
33 kNumberType, 35 kNumberType,
34 kSmiType, 36 kSmiType,
35 kMintType, 37 kMintType,
36 kDoubleType, 38 kDoubleType,
37 kIntType, 39 kIntType,
38 kBoolType, 40 kBoolType,
39 kStringType, 41 kStringType,
40 kArrayType, 42 kArrayType,
41 43
42 kInstanceObjectId, 44 kInstanceObjectId,
43 kMaxPredefinedObjectIds, 45 kMaxPredefinedObjectIds,
44 kInvalidIndex = -1, 46 kInvalidIndex = -1,
45 }; 47 };
46 48
47 } // namespace dart 49 } // namespace dart
48 50
49 #endif // VM_SNAPSHOT_IDS_H_ 51 #endif // VM_SNAPSHOT_IDS_H_
OLDNEW
« no previous file with comments | « runtime/vm/snapshot.cc ('k') | runtime/vm/snapshot_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698