| OLD | NEW |
| 1 // Copyright 2006-2008 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2008 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 1034 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1045 return result; | 1045 return result; |
| 1046 } | 1046 } |
| 1047 | 1047 |
| 1048 | 1048 |
| 1049 FunctionLiteral* Parser::ParseLazy(Handle<String> source, | 1049 FunctionLiteral* Parser::ParseLazy(Handle<String> source, |
| 1050 Handle<String> name, | 1050 Handle<String> name, |
| 1051 int start_position, | 1051 int start_position, |
| 1052 bool is_expression) { | 1052 bool is_expression) { |
| 1053 ZoneScope zone_scope(DONT_DELETE_ON_EXIT); | 1053 ZoneScope zone_scope(DONT_DELETE_ON_EXIT); |
| 1054 StatsRateScope timer(&Counters::parse_lazy); | 1054 StatsRateScope timer(&Counters::parse_lazy); |
| 1055 source->TryFlatten(StringShape(*source)); |
| 1055 StringShape shape(*source); | 1056 StringShape shape(*source); |
| 1056 source->TryFlatten(shape); | |
| 1057 Counters::total_parse_size.Increment(source->length(shape)); | 1057 Counters::total_parse_size.Increment(source->length(shape)); |
| 1058 SafeStringInputBuffer buffer(source.location()); | 1058 SafeStringInputBuffer buffer(source.location()); |
| 1059 | 1059 |
| 1060 // Initialize parser state. | 1060 // Initialize parser state. |
| 1061 scanner_.Init(source, &buffer, start_position); | 1061 scanner_.Init(source, &buffer, start_position); |
| 1062 ASSERT(target_stack_ == NULL); | 1062 ASSERT(target_stack_ == NULL); |
| 1063 mode_ = PARSE_EAGERLY; | 1063 mode_ = PARSE_EAGERLY; |
| 1064 | 1064 |
| 1065 // Place holder for the result. | 1065 // Place holder for the result. |
| 1066 FunctionLiteral* result = NULL; | 1066 FunctionLiteral* result = NULL; |
| (...skipping 3147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4214 start_position, | 4214 start_position, |
| 4215 is_expression); | 4215 is_expression); |
| 4216 return result; | 4216 return result; |
| 4217 } | 4217 } |
| 4218 | 4218 |
| 4219 | 4219 |
| 4220 #undef NEW | 4220 #undef NEW |
| 4221 | 4221 |
| 4222 | 4222 |
| 4223 } } // namespace v8::internal | 4223 } } // namespace v8::internal |
| OLD | NEW |