29 #define V8_WIN32_LEAN_AND_MEAN
33 #include "../include/v8-preparser.h"
66 pushback_buffer_(buffer_),
67 pushback_buffer_end_cache_(
NULL),
68 pushback_buffer_backing_(
NULL),
69 pushback_buffer_backing_size_(0) {
74 if (pushback_buffer_backing_ !=
NULL) {
87 if (pushback_buffer_end_cache_ ==
NULL) {
90 if (pushback_buffer_backing_ ==
NULL) {
92 pushback_buffer_backing_ = NewArray<uc16>(kPushBackSize);
93 pushback_buffer_backing_size_ = kPushBackSize;
95 pushback_buffer_ = pushback_buffer_backing_;
97 buffer_end_ = pushback_buffer_backing_ + pushback_buffer_backing_size_;
102 uc16* new_buffer = NewArray<uc16>(pushback_buffer_backing_size_ * 2);
103 memcpy(new_buffer + pushback_buffer_backing_size_,
104 pushback_buffer_backing_,
105 pushback_buffer_backing_size_);
108 pushback_buffer_backing_ = pushback_buffer_ = new_buffer;
109 buffer_end_ = pushback_buffer_backing_ + pushback_buffer_backing_size_;
113 static_cast<uc16>(ch);
119 if (pushback_buffer_end_cache_ !=
NULL) {
122 pushback_buffer_end_cache_ =
NULL;
127 uc16* buffer_start = buffer_ + kPushBackSize;
129 while ((value = stream_->
Next()) >= 0) {
141 if (
buffer_end_ <= buffer_ + 1 + kPushBackSize + kBufferSize)
break;
154 static const unsigned kBufferSize = 512;
155 static const unsigned kPushBackSize = 16;
161 uc16 buffer_[kPushBackSize + kBufferSize];
163 uc16* pushback_buffer_;
166 const uc16* pushback_buffer_end_cache_;
167 uc16* pushback_buffer_backing_;
168 unsigned pushback_buffer_backing_size_;
176 V8_Fatal(__FILE__, __LINE__, reason);
189 uintptr_t stack_limit =
reinterpret_cast<uintptr_t
>(&buffer) - max_stack;
203 size_t size = pre_data.
length() *
sizeof(pre_data[0]);
204 unsigned char* data =
reinterpret_cast<unsigned char*
>(pre_data.
start());
212 extern "C" void V8_Fatal(
const char* file,
int line,
const char* format, ...) {
static uchar TrailSurrogate(int char_code)
static uchar LeadSurrogate(int char_code)
const uc16 * buffer_cursor_
static const uc32 kEndOfInput
#define ASSERT(condition)
static const uchar kMaxNonSurrogateCharCode
PreParserData V8EXPORT Preparse(UnicodeInputStream *input, size_t max_stack_size)
void Initialize(Utf16CharacterStream *source)
virtual Vector< unsigned > ExtractData()
void V8_Fatal(const char *file, int line, const char *format,...)
void FatalProcessOutOfMemory(const char *message)
activate correct semantics for inheriting readonliness enable harmony semantics for typeof enable harmony enable harmony proxies enable all harmony harmony_scoping harmony_proxies harmony_scoping tracks arrays with only smi values automatically unbox arrays of doubles use crankshaft use hydrogen range analysis use hydrogen global value numbering use function inlining maximum number of AST nodes considered for a single inlining loop invariant code motion print statistics for hydrogen trace generated IR for specified phases trace register allocator trace range analysis trace representation types environment for every instruction put a break point before deoptimizing polymorphic inlining perform array bounds checks elimination trace on stack replacement optimize closures functions with arguments object optimize functions containing for in loops profiler considers IC stability primitive functions trigger their own optimization re try self optimization if it failed insert an interrupt check at function exit execution budget before interrupt is triggered call count before self optimization self_optimization count_based_interrupts weighted_back_edges trace_opt emit comments in code disassembly enable use of SSE3 instructions if available enable use of CMOV instruction if available enable use of SAHF instruction if enable use of VFP3 instructions if available this implies enabling ARMv7 enable use of ARMv7 instructions if enable use of MIPS FPU instructions if NULL
static PreParseResult PreParseProgram(i::Scanner *scanner, i::ParserRecorder *log, int flags, uintptr_t stack_limit)
static PreParserData StackOverflow()
void DeleteArray(T *array)