OLD | NEW |
---|---|
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 Loading... | |
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 Loading... | |
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 |
OLD | NEW |