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

Side by Side Diff: src/preparser.cc

Issue 5545006: Optimized scanner to avoid virtual calls for every character read. (Closed)
Patch Set: Addressed review comments. Created 10 years 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
« no previous file with comments | « src/parser.cc ('k') | src/preparser-api.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 2010 the V8 project authors. All rights reserved. 1 // Copyright 2010 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 1060 matching lines...) Expand 10 before | Expand all | Expand 10 after
1071 (outer_scope_type == kTopLevelScope && !inside_with && allow_lazy_); 1071 (outer_scope_type == kTopLevelScope && !inside_with && allow_lazy_);
1072 1072
1073 if (is_lazily_compiled) { 1073 if (is_lazily_compiled) {
1074 log_->PauseRecording(); 1074 log_->PauseRecording();
1075 ParseSourceElements(i::Token::RBRACE, ok); 1075 ParseSourceElements(i::Token::RBRACE, ok);
1076 log_->ResumeRecording(); 1076 log_->ResumeRecording();
1077 if (!*ok) return kUnknownExpression; 1077 if (!*ok) return kUnknownExpression;
1078 1078
1079 Expect(i::Token::RBRACE, CHECK_OK); 1079 Expect(i::Token::RBRACE, CHECK_OK);
1080 1080
1081 // Position right after terminal '}'.
1081 int end_pos = scanner_->location().end_pos; 1082 int end_pos = scanner_->location().end_pos;
1082 log_->LogFunction(function_block_pos, end_pos, 1083 log_->LogFunction(function_block_pos, end_pos,
1083 function_scope.materialized_literal_count(), 1084 function_scope.materialized_literal_count(),
1084 function_scope.expected_properties()); 1085 function_scope.expected_properties());
1085 } else { 1086 } else {
1086 ParseSourceElements(i::Token::RBRACE, CHECK_OK); 1087 ParseSourceElements(i::Token::RBRACE, CHECK_OK);
1087 Expect(i::Token::RBRACE, CHECK_OK); 1088 Expect(i::Token::RBRACE, CHECK_OK);
1088 } 1089 }
1089 return kUnknownExpression; 1090 return kUnknownExpression;
1090 } 1091 }
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
1175 if (scanner_->literal_length() == 3) { 1176 if (scanner_->literal_length() == 3) {
1176 const char* token = scanner_->literal_string(); 1177 const char* token = scanner_->literal_string();
1177 *is_get = strncmp(token, "get", 3) == 0; 1178 *is_get = strncmp(token, "get", 3) == 0;
1178 *is_set = !*is_get && strncmp(token, "set", 3) == 0; 1179 *is_set = !*is_get && strncmp(token, "set", 3) == 0;
1179 } 1180 }
1180 return GetIdentifierSymbol(); 1181 return GetIdentifierSymbol();
1181 } 1182 }
1182 1183
1183 #undef CHECK_OK 1184 #undef CHECK_OK
1184 } } // v8::preparser 1185 } } // v8::preparser
OLDNEW
« no previous file with comments | « src/parser.cc ('k') | src/preparser-api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698