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

Side by Side Diff: src/parser.cc

Issue 974783003: Speed up parsing of smis (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Ignore partially parsed octal-seeming decimal numbers Created 5 years, 9 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 | « no previous file | src/preparser.h » ('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 676 matching lines...) Expand 10 before | Expand all | Expand 10 after
687 Literal* ParserTraits::ExpressionFromLiteral(Token::Value token, int pos, 687 Literal* ParserTraits::ExpressionFromLiteral(Token::Value token, int pos,
688 Scanner* scanner, 688 Scanner* scanner,
689 AstNodeFactory* factory) { 689 AstNodeFactory* factory) {
690 switch (token) { 690 switch (token) {
691 case Token::NULL_LITERAL: 691 case Token::NULL_LITERAL:
692 return factory->NewNullLiteral(pos); 692 return factory->NewNullLiteral(pos);
693 case Token::TRUE_LITERAL: 693 case Token::TRUE_LITERAL:
694 return factory->NewBooleanLiteral(true, pos); 694 return factory->NewBooleanLiteral(true, pos);
695 case Token::FALSE_LITERAL: 695 case Token::FALSE_LITERAL:
696 return factory->NewBooleanLiteral(false, pos); 696 return factory->NewBooleanLiteral(false, pos);
697 case Token::SMI: {
698 int value = scanner->smi_value();
699 return factory->NewSmiLiteral(value, pos);
700 }
697 case Token::NUMBER: { 701 case Token::NUMBER: {
698 double value = scanner->DoubleValue(); 702 double value = scanner->DoubleValue();
699 return factory->NewNumberLiteral(value, pos); 703 return factory->NewNumberLiteral(value, pos);
700 } 704 }
701 default: 705 default:
702 DCHECK(false); 706 DCHECK(false);
703 } 707 }
704 return NULL; 708 return NULL;
705 } 709 }
706 710
(...skipping 4736 matching lines...) Expand 10 before | Expand all | Expand 10 after
5443 } else { 5447 } else {
5444 const uc16* data = reinterpret_cast<const uc16*>(raw_string->raw_data()); 5448 const uc16* data = reinterpret_cast<const uc16*>(raw_string->raw_data());
5445 running_hash = StringHasher::ComputeRunningHash(running_hash, data, 5449 running_hash = StringHasher::ComputeRunningHash(running_hash, data,
5446 raw_string->length()); 5450 raw_string->length());
5447 } 5451 }
5448 } 5452 }
5449 5453
5450 return running_hash; 5454 return running_hash;
5451 } 5455 }
5452 } } // namespace v8::internal 5456 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | src/preparser.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698