Chromium Code Reviews| Index: src/compiler.cc |
| diff --git a/src/compiler.cc b/src/compiler.cc |
| index 29bbbc7034e92deef346bb0d85e7c3e2aad4e4f8..3f9d532b34817658d2a235d7541935e8b6b419ad 100755 |
| --- a/src/compiler.cc |
| +++ b/src/compiler.cc |
| @@ -280,7 +280,14 @@ Handle<SharedFunctionInfo> Compiler::Compile(Handle<String> source, |
| ScriptDataImpl* pre_data = input_pre_data; |
| if (pre_data == NULL |
| && source_length >= FLAG_min_preparse_length) { |
| - pre_data = ParserApi::PartialPreParse(source, NULL, extension); |
| + if (source->IsExternalTwoByteString()) { |
| + ExternalTwoByteStringUC16CharacterStream stream( |
| + Handle<ExternalTwoByteString>::cast(source), 0, source->length()); |
|
Erik Corry
2010/12/07 12:27:30
This is found several places. Perhaps the constru
Lasse Reichstein
2010/12/07 14:05:54
As discussed offline, let's leave it so that the c
|
| + pre_data = ParserApi::PartialPreParse(&stream, extension); |
| + } else { |
| + GenericStringUC16CharacterStream stream(source, 0, source->length()); |
| + pre_data = ParserApi::PartialPreParse(&stream, extension); |
| + } |
| } |
| // Create a script object describing the script to be compiled. |