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

Side by Side Diff: src/parser.cc

Issue 9408: Removed some unsafe uses of StringShape.... (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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/objects.cc ('k') | src/runtime.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 772 matching lines...) Expand 10 before | Expand all | Expand 10 after
783 return result; 783 return result;
784 } 784 }
785 785
786 786
787 FunctionLiteral* Parser::ParseLazy(Handle<String> source, 787 FunctionLiteral* Parser::ParseLazy(Handle<String> source,
788 Handle<String> name, 788 Handle<String> name,
789 int start_position, 789 int start_position,
790 bool is_expression) { 790 bool is_expression) {
791 ZoneScope zone_scope(DONT_DELETE_ON_EXIT); 791 ZoneScope zone_scope(DONT_DELETE_ON_EXIT);
792 StatsRateScope timer(&Counters::parse_lazy); 792 StatsRateScope timer(&Counters::parse_lazy);
793 source->TryFlatten(StringShape(*source));
793 StringShape shape(*source); 794 StringShape shape(*source);
794 source->TryFlatten(shape);
795 Counters::total_parse_size.Increment(source->length(shape)); 795 Counters::total_parse_size.Increment(source->length(shape));
796 SafeStringInputBuffer buffer(source.location()); 796 SafeStringInputBuffer buffer(source.location());
797 797
798 // Initialize parser state. 798 // Initialize parser state.
799 scanner_.Init(source, &buffer, start_position); 799 scanner_.Init(source, &buffer, start_position);
800 ASSERT(target_stack_ == NULL); 800 ASSERT(target_stack_ == NULL);
801 mode_ = PARSE_EAGERLY; 801 mode_ = PARSE_EAGERLY;
802 802
803 // Place holder for the result. 803 // Place holder for the result.
804 FunctionLiteral* result = NULL; 804 FunctionLiteral* result = NULL;
(...skipping 2451 matching lines...) Expand 10 before | Expand all | Expand 10 after
3256 start_position, 3256 start_position,
3257 is_expression); 3257 is_expression);
3258 return result; 3258 return result;
3259 } 3259 }
3260 3260
3261 3261
3262 #undef NEW 3262 #undef NEW
3263 3263
3264 3264
3265 } } // namespace v8::internal 3265 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/objects.cc ('k') | src/runtime.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698