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 2059 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2070 Expect(Token::RBRACE, CHECK_OK); | 2070 Expect(Token::RBRACE, CHECK_OK); |
2071 return result; | 2071 return result; |
2072 } | 2072 } |
2073 | 2073 |
2074 | 2074 |
2075 Block* Parser::ParseScopedBlock(ZoneList<const AstRawString*>* labels, | 2075 Block* Parser::ParseScopedBlock(ZoneList<const AstRawString*>* labels, |
2076 bool* ok) { | 2076 bool* ok) { |
2077 // The harmony mode uses block elements instead of statements. | 2077 // The harmony mode uses block elements instead of statements. |
2078 // | 2078 // |
2079 // Block :: | 2079 // Block :: |
2080 // '{' BlockElement* '}' | 2080 // '{' StatementList '}' |
2081 | 2081 |
2082 // Construct block expecting 16 statements. | 2082 // Construct block expecting 16 statements. |
2083 Block* body = | 2083 Block* body = |
2084 factory()->NewBlock(labels, 16, false, RelocInfo::kNoPosition); | 2084 factory()->NewBlock(labels, 16, false, RelocInfo::kNoPosition); |
2085 Scope* block_scope = NewScope(scope_, BLOCK_SCOPE); | 2085 Scope* block_scope = NewScope(scope_, BLOCK_SCOPE); |
2086 | 2086 |
2087 // Parse the statements and collect escaping labels. | 2087 // Parse the statements and collect escaping labels. |
2088 Expect(Token::LBRACE, CHECK_OK); | 2088 Expect(Token::LBRACE, CHECK_OK); |
2089 block_scope->set_start_position(scanner()->location().beg_pos); | 2089 block_scope->set_start_position(scanner()->location().beg_pos); |
2090 { BlockState block_state(&scope_, block_scope); | 2090 { BlockState block_state(&scope_, block_scope); |
(...skipping 3343 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5434 } else { | 5434 } else { |
5435 const uc16* data = reinterpret_cast<const uc16*>(raw_string->raw_data()); | 5435 const uc16* data = reinterpret_cast<const uc16*>(raw_string->raw_data()); |
5436 running_hash = StringHasher::ComputeRunningHash(running_hash, data, | 5436 running_hash = StringHasher::ComputeRunningHash(running_hash, data, |
5437 raw_string->length()); | 5437 raw_string->length()); |
5438 } | 5438 } |
5439 } | 5439 } |
5440 | 5440 |
5441 return running_hash; | 5441 return running_hash; |
5442 } | 5442 } |
5443 } } // namespace v8::internal | 5443 } } // namespace v8::internal |
OLD | NEW |