| 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 718 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 729 Expression* ParserTraits::ExpressionFromString(int pos, Scanner* scanner, | 729 Expression* ParserTraits::ExpressionFromString(int pos, Scanner* scanner, |
| 730 AstNodeFactory* factory) { | 730 AstNodeFactory* factory) { |
| 731 const AstRawString* symbol = GetSymbol(scanner); | 731 const AstRawString* symbol = GetSymbol(scanner); |
| 732 if (parser_->fni_ != NULL) parser_->fni_->PushLiteralName(symbol); | 732 if (parser_->fni_ != NULL) parser_->fni_->PushLiteralName(symbol); |
| 733 return factory->NewStringLiteral(symbol, pos); | 733 return factory->NewStringLiteral(symbol, pos); |
| 734 } | 734 } |
| 735 | 735 |
| 736 | 736 |
| 737 Expression* ParserTraits::GetIterator(Expression* iterable, | 737 Expression* ParserTraits::GetIterator(Expression* iterable, |
| 738 AstNodeFactory* factory) { | 738 AstNodeFactory* factory) { |
| 739 Expression* iterator_symbol_literal = | 739 return factory->GetIterator(iterable); |
| 740 factory->NewSymbolLiteral("iterator_symbol", RelocInfo::kNoPosition); | |
| 741 int pos = iterable->position(); | |
| 742 Expression* prop = | |
| 743 factory->NewProperty(iterable, iterator_symbol_literal, pos); | |
| 744 Zone* zone = parser_->zone(); | |
| 745 ZoneList<Expression*>* args = new (zone) ZoneList<Expression*>(0, zone); | |
| 746 return factory->NewCall(prop, args, pos); | |
| 747 } | 740 } |
| 748 | 741 |
| 749 | 742 |
| 750 Literal* ParserTraits::GetLiteralTheHole(int position, | 743 Literal* ParserTraits::GetLiteralTheHole(int position, |
| 751 AstNodeFactory* factory) { | 744 AstNodeFactory* factory) { |
| 752 return factory->NewTheHoleLiteral(RelocInfo::kNoPosition); | 745 return factory->NewTheHoleLiteral(RelocInfo::kNoPosition); |
| 753 } | 746 } |
| 754 | 747 |
| 755 | 748 |
| 756 Expression* ParserTraits::ParseV8Intrinsic(bool* ok) { | 749 Expression* ParserTraits::ParseV8Intrinsic(bool* ok) { |
| (...skipping 4662 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5419 } else { | 5412 } else { |
| 5420 const uc16* data = reinterpret_cast<const uc16*>(raw_string->raw_data()); | 5413 const uc16* data = reinterpret_cast<const uc16*>(raw_string->raw_data()); |
| 5421 running_hash = StringHasher::ComputeRunningHash(running_hash, data, | 5414 running_hash = StringHasher::ComputeRunningHash(running_hash, data, |
| 5422 raw_string->length()); | 5415 raw_string->length()); |
| 5423 } | 5416 } |
| 5424 } | 5417 } |
| 5425 | 5418 |
| 5426 return running_hash; | 5419 return running_hash; |
| 5427 } | 5420 } |
| 5428 } } // namespace v8::internal | 5421 } } // namespace v8::internal |
| OLD | NEW |