Index: src/parser.cc |
=================================================================== |
--- src/parser.cc (revision 654) |
+++ src/parser.cc (working copy) |
@@ -737,10 +737,11 @@ |
ZoneScope zone_scope(DONT_DELETE_ON_EXIT); |
StatsRateScope timer(&Counters::parse); |
- Counters::total_parse_size.Increment(source->length()); |
+ StringShape shape(*source); |
+ Counters::total_parse_size.Increment(source->length(shape)); |
// Initialize parser state. |
- source->TryFlatten(); |
+ source->TryFlatten(shape); |
scanner_.Init(source, stream, 0); |
ASSERT(target_stack_ == NULL); |
@@ -767,7 +768,7 @@ |
temp_scope.materialized_literal_count(), |
temp_scope.contains_array_literal(), |
temp_scope.expected_property_count(), |
- 0, 0, source->length(), false)); |
+ 0, 0, source->length(shape), false)); |
} else if (scanner().stack_overflow()) { |
Top::StackOverflow(); |
} |
@@ -789,11 +790,12 @@ |
bool is_expression) { |
ZoneScope zone_scope(DONT_DELETE_ON_EXIT); |
StatsRateScope timer(&Counters::parse_lazy); |
- Counters::total_parse_size.Increment(source->length()); |
+ StringShape shape(*source); |
+ source->TryFlatten(shape); |
+ Counters::total_parse_size.Increment(source->length(shape)); |
SafeStringInputBuffer buffer(source.location()); |
// Initialize parser state. |
- source->TryFlatten(); |
scanner_.Init(source, &buffer, start_position); |
ASSERT(target_stack_ == NULL); |
mode_ = PARSE_EAGERLY; |