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

Side by Side Diff: src/parser.cc

Issue 1041863002: Use counter for legacy const. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Ready for review Created 5 years, 8 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
« no previous file with comments | « include/v8.h ('k') | test/cctest/test-parsing.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 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/v8.h" 5 #include "src/v8.h"
6 6
7 #include "src/api.h" 7 #include "src/api.h"
8 #include "src/ast.h" 8 #include "src/ast.h"
9 #include "src/bailout-reason.h" 9 #include "src/bailout-reason.h"
10 #include "src/base/platform/platform.h" 10 #include "src/base/platform/platform.h"
(...skipping 2254 matching lines...) Expand 10 before | Expand all | Expand 10 after
2265 ReportMessageAt(location, "strong_var"); 2265 ReportMessageAt(location, "strong_var");
2266 *ok = false; 2266 *ok = false;
2267 return NULL; 2267 return NULL;
2268 } 2268 }
2269 Consume(Token::VAR); 2269 Consume(Token::VAR);
2270 } else if (peek() == Token::CONST) { 2270 } else if (peek() == Token::CONST) {
2271 Consume(Token::CONST); 2271 Consume(Token::CONST);
2272 if (is_sloppy(language_mode())) { 2272 if (is_sloppy(language_mode())) {
2273 mode = CONST_LEGACY; 2273 mode = CONST_LEGACY;
2274 init_op = Token::INIT_CONST_LEGACY; 2274 init_op = Token::INIT_CONST_LEGACY;
2275 ++use_counts_[v8::Isolate::kLegacyConst];
adamk 2015/03/31 18:19:32 Counting each const in a script separately seems a
2275 } else { 2276 } else {
2276 DCHECK(var_context != kStatement); 2277 DCHECK(var_context != kStatement);
2277 mode = CONST; 2278 mode = CONST;
2278 init_op = Token::INIT_CONST; 2279 init_op = Token::INIT_CONST;
2279 } 2280 }
2280 is_const = true; 2281 is_const = true;
2281 needs_init = true; 2282 needs_init = true;
2282 } else if (peek() == Token::LET && is_strict(language_mode())) { 2283 } else if (peek() == Token::LET && is_strict(language_mode())) {
2283 Consume(Token::LET); 2284 Consume(Token::LET);
2284 DCHECK(var_context != kStatement); 2285 DCHECK(var_context != kStatement);
(...skipping 3274 matching lines...) Expand 10 before | Expand all | Expand 10 after
5559 } else { 5560 } else {
5560 const uc16* data = reinterpret_cast<const uc16*>(raw_string->raw_data()); 5561 const uc16* data = reinterpret_cast<const uc16*>(raw_string->raw_data());
5561 running_hash = StringHasher::ComputeRunningHash(running_hash, data, 5562 running_hash = StringHasher::ComputeRunningHash(running_hash, data,
5562 raw_string->length()); 5563 raw_string->length());
5563 } 5564 }
5564 } 5565 }
5565 5566
5566 return running_hash; 5567 return running_hash;
5567 } 5568 }
5568 } } // namespace v8::internal 5569 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « include/v8.h ('k') | test/cctest/test-parsing.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698