Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(4)

Unified Diff: src/parser.cc

Issue 9038: Create an abstraction for the string type flags so that they can be cached.... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 12 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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;

Powered by Google App Engine
This is Rietveld 408576698