| OLD | NEW |
| 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 Loading... |
| 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 (%d, %d)\n", | 152 printf("=> %11s at (%zd, %zd)\n", |
| 153 Token::Name(experimental_tokens[i]), | 153 Token::Name(experimental_tokens[i]), |
| 154 experimental_beg[i], experimental_end[i]); | 154 experimental_beg[i], experimental_end[i]); |
| 155 if (experimental_tokens[i] != baseline_tokens[i] || | 155 if (experimental_tokens[i] != baseline_tokens[i] || |
| 156 experimental_beg[i] != baseline_beg[i] || | 156 experimental_beg[i] != baseline_beg[i] || |
| 157 experimental_end[i] != baseline_end[i]) { | 157 experimental_end[i] != baseline_end[i]) { |
| 158 printf("MISMATCH:\n"); | 158 printf("MISMATCH:\n"); |
| 159 printf("Expected: %s at (%d, %d)\n", | 159 printf("Expected: %s at (%zd, %zd)\n", |
| 160 Token::Name(baseline_tokens[i]), | 160 Token::Name(baseline_tokens[i]), |
| 161 baseline_beg[i], baseline_end[i]); | 161 baseline_beg[i], baseline_end[i]); |
| 162 printf("Actual: %s at (%d, %d)\n", | 162 printf("Actual: %s at (%zd, %zd)\n", |
| 163 Token::Name(experimental_tokens[i]), | 163 Token::Name(experimental_tokens[i]), |
| 164 experimental_beg[i], experimental_end[i]); | 164 experimental_beg[i], experimental_end[i]); |
| 165 return 1; | 165 return 1; |
| 166 } | 166 } |
| 167 } | 167 } |
| 168 printf("No of tokens: %d\n", experimental_tokens.size()); | 168 printf("No of tokens: %zd\n", experimental_tokens.size()); |
| 169 printf("Baseline: %f ms\nExperimental %f ms\n", | 169 printf("Baseline: %f ms\nExperimental %f ms\n", |
| 170 baseline_time.InMillisecondsF(), | 170 baseline_time.InMillisecondsF(), |
| 171 experimental_time.InMillisecondsF()); | 171 experimental_time.InMillisecondsF()); |
| 172 } | 172 } |
| 173 } | 173 } |
| 174 v8::V8::Dispose(); | 174 v8::V8::Dispose(); |
| 175 return 0; | 175 return 0; |
| 176 } | 176 } |
| OLD | NEW |