1 // Copyright 2011 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef V8_PREPARSE_DATA_FORMAT_H_
6 #define V8_PREPARSE_DATA_FORMAT_H_
11 // Generic and general data used by preparse data recorders and readers.
13 struct PreparseDataConstants {
15 // Layout and constants of the preparse data exchange format.
16 static const unsigned kMagicNumber = 0xBadDead;
17 static const unsigned kCurrentVersion = 11;
19 static const int kMagicOffset = 0;
20 static const int kVersionOffset = 1;
21 static const int kHasErrorOffset = 2;
22 static const int kFunctionsSizeOffset = 3;
23 static const int kSizeOffset = 4;
24 static const int kHeaderSize = 5;
26 // If encoding a message, the following positions are fixed.
27 static const int kMessageStartPos = 0;
28 static const int kMessageEndPos = 1;
29 static const int kMessageArgCountPos = 2;
30 static const int kParseErrorTypePos = 3;
31 static const int kMessageTemplatePos = 4;
32 static const int kMessageArgPos = 5;
34 static const unsigned char kNumberTerminator = 0x80u;
38 } } // namespace v8::internal.
40 #endif // V8_PREPARSE_DATA_FORMAT_H_