diff options
author | Ryan Dahl <ry@tinyclouds.org> | 2011-07-08 16:40:11 -0700 |
---|---|---|
committer | Ryan Dahl <ry@tinyclouds.org> | 2011-07-08 16:40:11 -0700 |
commit | e5564a3f29e0a818832a97c7c3b28d7c8b3b0460 (patch) | |
tree | 4b48a6577080d5e44da4d2cbebb7fe7951660de8 /deps/v8/src/preparser-api.cc | |
parent | 0df2f74d364826053641395b01c2fcb1345057a9 (diff) | |
download | node-new-e5564a3f29e0a818832a97c7c3b28d7c8b3b0460.tar.gz |
Upgrade V8 to 3.4.10
Diffstat (limited to 'deps/v8/src/preparser-api.cc')
-rw-r--r-- | deps/v8/src/preparser-api.cc | 24 |
1 files changed, 7 insertions, 17 deletions
diff --git a/deps/v8/src/preparser-api.cc b/deps/v8/src/preparser-api.cc index 3817935f8f..e0ab5001f5 100644 --- a/deps/v8/src/preparser-api.cc +++ b/deps/v8/src/preparser-api.cc @@ -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: @@ -26,12 +26,14 @@ // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include "../include/v8-preparser.h" + #include "globals.h" #include "checks.h" #include "allocation.h" #include "utils.h" #include "list.h" #include "scanner-base.h" +#include "preparse-data-format.h" #include "preparse-data.h" #include "preparser.h" @@ -156,21 +158,8 @@ class InputStreamUTF16Buffer : public UC16CharacterStream { }; -class StandAloneJavaScriptScanner : public JavaScriptScanner { - public: - void Initialize(UC16CharacterStream* source) { - source_ = source; - Init(); - // Skip initial whitespace allowing HTML comment ends just like - // after a newline and scan first token. - has_line_terminator_before_next_ = true; - SkipWhiteSpace(); - Scan(); - } -}; - - -// Functions declared by allocation.h +// Functions declared by allocation.h and implemented in both api.cc (for v8) +// or here (for a stand-alone preparser). void FatalProcessOutOfMemory(const char* reason) { V8_Fatal(__FILE__, __LINE__, reason); @@ -187,7 +176,8 @@ UnicodeInputStream::~UnicodeInputStream() { } PreParserData Preparse(UnicodeInputStream* input, size_t max_stack) { internal::InputStreamUTF16Buffer buffer(input); uintptr_t stack_limit = reinterpret_cast<uintptr_t>(&buffer) - max_stack; - internal::StandAloneJavaScriptScanner scanner; + internal::UnicodeCache unicode_cache; + internal::JavaScriptScanner scanner(&unicode_cache); scanner.Initialize(&buffer); internal::CompleteParserRecorder recorder; preparser::PreParser::PreParseResult result = |