blob: 4d1ad7abbfa30708a751dc8ca257a44fd16b5584 [file] [log] [blame]
Ben Murdoch3fb3ca82011-12-02 17:19:32 +00001// Copyright 2011 the V8 project authors. All rights reserved.
Ben Murdochb8a8cc12014-11-26 15:28:44 +00002// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
Steve Block8defd9f2010-07-08 12:39:36 +01004
Ben Murdoch257744e2011-11-30 15:57:28 +00005#ifndef V8_PREPARSE_DATA_FORMAT_H_
6#define V8_PREPARSE_DATA_FORMAT_H_
Steve Block8defd9f2010-07-08 12:39:36 +01007
8namespace v8 {
9namespace internal {
10
Ben Murdoch257744e2011-11-30 15:57:28 +000011// Generic and general data used by preparse data recorders and readers.
Steve Block8defd9f2010-07-08 12:39:36 +010012
Ben Murdoch257744e2011-11-30 15:57:28 +000013struct PreparseDataConstants {
14 public:
15 // Layout and constants of the preparse data exchange format.
16 static const unsigned kMagicNumber = 0xBadDead;
Ben Murdochb8a8cc12014-11-26 15:28:44 +000017 static const unsigned kCurrentVersion = 9;
Steve Block8defd9f2010-07-08 12:39:36 +010018
Ben Murdoch257744e2011-11-30 15:57:28 +000019 static const int kMagicOffset = 0;
20 static const int kVersionOffset = 1;
21 static const int kHasErrorOffset = 2;
22 static const int kFunctionsSizeOffset = 3;
Ben Murdochb8a8cc12014-11-26 15:28:44 +000023 static const int kSizeOffset = 4;
24 static const int kHeaderSize = 5;
Ben Murdoch257744e2011-11-30 15:57:28 +000025
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;
Ben Murdochb8a8cc12014-11-26 15:28:44 +000030 static const int kIsReferenceErrorPos = 3;
31 static const int kMessageTextPos = 4;
Ben Murdoch257744e2011-11-30 15:57:28 +000032
33 static const unsigned char kNumberTerminator = 0x80u;
34};
35
36
37} } // namespace v8::internal.
38
39#endif // V8_PREPARSE_DATA_FORMAT_H_