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

Side by Side Diff: src/lexer/lexer-shell.cc

Issue 31453004: Experimental parser: unify regexp handling with the baseline some more. (Closed) Base URL: https://v8.googlecode.com/svn/branches/experimental/parser
Patch Set: Created 7 years, 2 months 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/lexer/lexer.re ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 the V8 project authors. All rights reserved. 1 // Copyright 2013 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 131 matching lines...) Expand 10 before | Expand all | Expand 10 after
142 token = experimental.Next(); 142 token = experimental.Next();
143 experimental_tokens.push_back(token); 143 experimental_tokens.push_back(token);
144 ExperimentalScanner::Location location = experimental.location(); 144 ExperimentalScanner::Location location = experimental.location();
145 experimental_beg.push_back(location.beg_pos); 145 experimental_beg.push_back(location.beg_pos);
146 experimental_end.push_back(location.end_pos); 146 experimental_end.push_back(location.end_pos);
147 } while (token != Token::EOS); 147 } while (token != Token::EOS);
148 experimental_time = timer.Elapsed(); 148 experimental_time = timer.Elapsed();
149 } 149 }
150 150
151 for (size_t i = 0; i < experimental_tokens.size(); ++i) { 151 for (size_t i = 0; i < experimental_tokens.size(); ++i) {
152 printf("=> %11s at (%zd, %zd)\n", 152 printf("=> %11s at (%d, %d)\n",
153 Token::Name(experimental_tokens[i]), 153 Token::Name(experimental_tokens[i]),
154 experimental_beg[i], experimental_end[i]); 154 static_cast<int>(experimental_beg[i]),
155 static_cast<int>(experimental_end[i]));
155 if (experimental_tokens[i] != baseline_tokens[i] || 156 if (experimental_tokens[i] != baseline_tokens[i] ||
156 experimental_beg[i] != baseline_beg[i] || 157 experimental_beg[i] != baseline_beg[i] ||
157 experimental_end[i] != baseline_end[i]) { 158 experimental_end[i] != baseline_end[i]) {
158 printf("MISMATCH:\n"); 159 printf("MISMATCH:\n");
159 printf("Expected: %s at (%zd, %zd)\n", 160 printf("Expected: %s at (%d, %d)\n",
160 Token::Name(baseline_tokens[i]), 161 Token::Name(baseline_tokens[i]),
161 baseline_beg[i], baseline_end[i]); 162 static_cast<int>(baseline_beg[i]),
162 printf("Actual: %s at (%zd, %zd)\n", 163 static_cast<int>(baseline_end[i]));
164 printf("Actual: %s at (%d, %d)\n",
163 Token::Name(experimental_tokens[i]), 165 Token::Name(experimental_tokens[i]),
164 experimental_beg[i], experimental_end[i]); 166 static_cast<int>(experimental_beg[i]),
167 static_cast<int>(experimental_end[i]));
165 return 1; 168 return 1;
166 } 169 }
167 } 170 }
168 printf("No of tokens: %zd\n", experimental_tokens.size()); 171 printf("No of tokens: %d\n",
172 static_cast<int>(experimental_tokens.size()));
169 printf("Baseline: %f ms\nExperimental %f ms\n", 173 printf("Baseline: %f ms\nExperimental %f ms\n",
170 baseline_time.InMillisecondsF(), 174 baseline_time.InMillisecondsF(),
171 experimental_time.InMillisecondsF()); 175 experimental_time.InMillisecondsF());
172 } 176 }
173 } 177 }
174 v8::V8::Dispose(); 178 v8::V8::Dispose();
175 return 0; 179 return 0;
176 } 180 }
OLDNEW
« no previous file with comments | « src/lexer/lexer.re ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698