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

Side by Side Diff: src/parser.cc

Issue 8396040: Use StrictModeFlag in preparser and preparse data. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 9 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
OLDNEW
1 // Copyright 2011 the V8 project authors. All rights reserved. 1 // Copyright 2011 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 3988 matching lines...) Expand 10 before | Expand all | Expand 10 after
3999 if (scope->end_position() <= function_block_pos) { 3999 if (scope->end_position() <= function_block_pos) {
4000 // End position greater than end of stream is safe, and hard to check. 4000 // End position greater than end of stream is safe, and hard to check.
4001 ReportInvalidPreparseData(function_name, CHECK_OK); 4001 ReportInvalidPreparseData(function_name, CHECK_OK);
4002 } 4002 }
4003 isolate()->counters()->total_preparse_skipped()->Increment( 4003 isolate()->counters()->total_preparse_skipped()->Increment(
4004 scope->end_position() - function_block_pos); 4004 scope->end_position() - function_block_pos);
4005 // Seek to position just before terminal '}'. 4005 // Seek to position just before terminal '}'.
4006 scanner().SeekForward(scope->end_position() - 1); 4006 scanner().SeekForward(scope->end_position() - 1);
4007 materialized_literal_count = entry.literal_count(); 4007 materialized_literal_count = entry.literal_count();
4008 expected_property_count = entry.property_count(); 4008 expected_property_count = entry.property_count();
4009 if (entry.strict_mode()) top_scope_->SetStrictModeFlag(kStrictMode); 4009 top_scope_->SetStrictModeFlag(entry.strict_mode_flag());
4010 only_simple_this_property_assignments = false; 4010 only_simple_this_property_assignments = false;
4011 this_property_assignments = isolate()->factory()->empty_fixed_array(); 4011 this_property_assignments = isolate()->factory()->empty_fixed_array();
4012 Expect(Token::RBRACE, CHECK_OK); 4012 Expect(Token::RBRACE, CHECK_OK);
4013 } 4013 }
4014 } 4014 }
4015 4015
4016 if (!is_lazily_compiled) { 4016 if (!is_lazily_compiled) {
4017 ParseSourceElements(body, Token::RBRACE, CHECK_OK); 4017 ParseSourceElements(body, Token::RBRACE, CHECK_OK);
4018 4018
4019 materialized_literal_count = lexical_scope.materialized_literal_count(); 4019 materialized_literal_count = lexical_scope.materialized_literal_count();
(...skipping 1399 matching lines...) Expand 10 before | Expand all | Expand 10 after
5419 result = parser.ParseProgram(source, 5419 result = parser.ParseProgram(source,
5420 info->is_global(), 5420 info->is_global(),
5421 info->strict_mode_flag()); 5421 info->strict_mode_flag());
5422 } 5422 }
5423 } 5423 }
5424 info->SetFunction(result); 5424 info->SetFunction(result);
5425 return (result != NULL); 5425 return (result != NULL);
5426 } 5426 }
5427 5427
5428 } } // namespace v8::internal 5428 } } // namespace v8::internal
OLDNEW
« src/globals.h ('K') | « src/parser.h ('k') | src/preparse-data.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698