 Chromium Code Reviews
 Chromium Code Reviews Issue 8725001:
  Reapply "Fix the ScopeIterator reimplementation".  (Closed) 
  Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
    
  
    Issue 8725001:
  Reapply "Fix the ScopeIterator reimplementation".  (Closed) 
  Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge| Index: src/parser.cc | 
| diff --git a/src/parser.cc b/src/parser.cc | 
| index b79589160190cd4019428bf5cc4b2293ff3276a6..efffe5a4e68d92414118302a497b56502a2aa2e2 100644 | 
| --- a/src/parser.cc | 
| +++ b/src/parser.cc | 
| @@ -5541,7 +5541,7 @@ static ScriptDataImpl* DoPreParse(UC16CharacterStream* source, | 
| // Preparse, but only collect data that is immediately useful, | 
| // even if the preparser data is only used once. | 
| -ScriptDataImpl* ParserApi::PartialPreParse(UC16CharacterStream* source, | 
| +ScriptDataImpl* ParserApi::PartialPreParse(Handle<String> source, | 
| 
Lasse Reichstein
2011/11/29 08:07:27
For what it's worth, there is no longer any need f
 | 
| v8::Extension* extension, | 
| int flags) { | 
| bool allow_lazy = FLAG_lazy && (extension == NULL); | 
| @@ -5552,7 +5552,15 @@ ScriptDataImpl* ParserApi::PartialPreParse(UC16CharacterStream* source, | 
| } | 
| flags |= kAllowLazy; | 
| PartialParserRecorder recorder; | 
| - return DoPreParse(source, flags, &recorder); | 
| + int source_length = source->length(); | 
| + if (source->IsExternalTwoByteString()) { | 
| + ExternalTwoByteStringUC16CharacterStream stream( | 
| + Handle<ExternalTwoByteString>::cast(source), 0, source_length); | 
| + return DoPreParse(&stream, flags, &recorder); | 
| + } else { | 
| + GenericStringUC16CharacterStream stream(source, 0, source_length); | 
| + return DoPreParse(&stream, flags, &recorder); | 
| + } | 
| } |