diff options
Diffstat (limited to 'deps/v8/src/preparse-data.h')
-rw-r--r-- | deps/v8/src/preparse-data.h | 46 |
1 files changed, 14 insertions, 32 deletions
diff --git a/deps/v8/src/preparse-data.h b/deps/v8/src/preparse-data.h index bb5707b61d..c6503c4fc1 100644 --- a/deps/v8/src/preparse-data.h +++ b/deps/v8/src/preparse-data.h @@ -1,4 +1,4 @@ -// Copyright 2010 the V8 project authors. All rights reserved. +// Copyright 2011 the V8 project authors. All rights reserved. // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: @@ -25,40 +25,16 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -#ifndef V8_PREPARSER_DATA_H_ -#define V8_PREPARSER_DATA_H_ +#ifndef V8_PREPARSE_DATA_H_ +#define V8_PREPARSE_DATA_H_ +#include "allocation.h" #include "hashmap.h" +#include "utils-inl.h" namespace v8 { namespace internal { -// Generic and general data used by preparse data recorders and readers. - -class PreparseDataConstants : public AllStatic { - public: - // Layout and constants of the preparse data exchange format. - static const unsigned kMagicNumber = 0xBadDead; - static const unsigned kCurrentVersion = 6; - - static const int kMagicOffset = 0; - static const int kVersionOffset = 1; - static const int kHasErrorOffset = 2; - static const int kFunctionsSizeOffset = 3; - static const int kSymbolCountOffset = 4; - static const int kSizeOffset = 5; - static const int kHeaderSize = 6; - - // If encoding a message, the following positions are fixed. - static const int kMessageStartPos = 0; - static const int kMessageEndPos = 1; - static const int kMessageArgCountPos = 2; - static const int kMessageTextPos = 3; - - static const byte kNumberTerminator = 0x80u; -}; - - // ---------------------------------------------------------------------------- // ParserRecorder - Logging of preparser data. @@ -72,7 +48,8 @@ class ParserRecorder { virtual void LogFunction(int start, int end, int literals, - int properties) = 0; + int properties, + int strict_mode) = 0; // Logs a symbol creation of a literal or identifier. virtual void LogAsciiSymbol(int start, Vector<const char> literal) { } @@ -108,11 +85,16 @@ class FunctionLoggingParserRecorder : public ParserRecorder { FunctionLoggingParserRecorder(); virtual ~FunctionLoggingParserRecorder() {} - virtual void LogFunction(int start, int end, int literals, int properties) { + virtual void LogFunction(int start, + int end, + int literals, + int properties, + int strict_mode) { function_store_.Add(start); function_store_.Add(end); function_store_.Add(literals); function_store_.Add(properties); + function_store_.Add(strict_mode); } // Logs an error message and marks the log as containing an error. @@ -246,4 +228,4 @@ class CompleteParserRecorder: public FunctionLoggingParserRecorder { } } // namespace v8::internal. -#endif // V8_PREPARSER_DATA_H_ +#endif // V8_PREPARSE_DATA_H_ |