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

Side by Side Diff: include/v8-preparser.h

Issue 6927075: Strict mode detection in preparser. (Closed)
Patch Set: Added TODO with bugnumber for R Created 9 years, 7 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
« no previous file with comments | « no previous file | preparser/preparser-process.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 2011 the V8 project authors. All rights reserved. 1 // Copyright 2011 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
59 #define V8EXPORT __attribute__ ((visibility("default"))) 59 #define V8EXPORT __attribute__ ((visibility("default")))
60 #else // defined(__GNUC__) && (__GNUC__ >= 4) 60 #else // defined(__GNUC__) && (__GNUC__ >= 4)
61 #define V8EXPORT 61 #define V8EXPORT
62 #endif // defined(__GNUC__) && (__GNUC__ >= 4) 62 #endif // defined(__GNUC__) && (__GNUC__ >= 4)
63 63
64 #endif // _WIN32 64 #endif // _WIN32
65 65
66 66
67 namespace v8 { 67 namespace v8 {
68 68
69 69 // The result of preparsing is either a stack overflow error, or an opaque
70 // blob of data that can be passed back into the parser.
70 class V8EXPORT PreParserData { 71 class V8EXPORT PreParserData {
71 public: 72 public:
72 PreParserData(size_t size, const uint8_t* data) 73 PreParserData(size_t size, const uint8_t* data)
73 : data_(data), size_(size) { } 74 : data_(data), size_(size) { }
74 75
75 // Create a PreParserData value where stack_overflow reports true. 76 // Create a PreParserData value where stack_overflow reports true.
76 static PreParserData StackOverflow() { return PreParserData(0, NULL); } 77 static PreParserData StackOverflow() { return PreParserData(0, NULL); }
77 78
78 // Whether the pre-parser stopped due to a stack overflow. 79 // Whether the pre-parser stopped due to a stack overflow.
79 // If this is the case, size() and data() should not be used. 80 // If this is the case, size() and data() should not be used.
(...skipping 27 matching lines...) Expand all
107 // space that the preparser is allowed to use. If the preparser uses 108 // space that the preparser is allowed to use. If the preparser uses
108 // more stack space than the limit provided, the result's stack_overflow() 109 // more stack space than the limit provided, the result's stack_overflow()
109 // method will return true. Otherwise the result contains preparser 110 // method will return true. Otherwise the result contains preparser
110 // data that can be used by the V8 parser to speed up parsing. 111 // data that can be used by the V8 parser to speed up parsing.
111 PreParserData V8EXPORT Preparse(UnicodeInputStream* input, 112 PreParserData V8EXPORT Preparse(UnicodeInputStream* input,
112 size_t max_stack_size); 113 size_t max_stack_size);
113 114
114 } // namespace v8. 115 } // namespace v8.
115 116
116 #endif // PREPARSER_H 117 #endif // PREPARSER_H
OLDNEW
« no previous file with comments | « no previous file | preparser/preparser-process.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698