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

Side by Side Diff: src/json-parser.h

Issue 440663002: Enable C++11. Synch toolchains with Chrome. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Disabled test on VisualStudio for now. Created 6 years, 4 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 | Annotate | Revision Log
« no previous file with comments | « src/base/platform/platform-posix.cc ('k') | test/cctest/test-utils.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 2011 the V8 project authors. All rights reserved. 1 // Copyright 2011 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 #ifndef V8_JSON_PARSER_H_ 5 #ifndef V8_JSON_PARSER_H_
6 #define V8_JSON_PARSER_H_ 6 #define V8_JSON_PARSER_H_
7 7
8 #include "src/v8.h" 8 #include "src/v8.h"
9 9
10 #include "src/char-predicates-inl.h" 10 #include "src/char-predicates-inl.h"
(...skipping 701 matching lines...) Expand 10 before | Expand all | Expand 10 after
712 unibrow::Utf16::TrailSurrogate(c0)); 712 unibrow::Utf16::TrailSurrogate(c0));
713 } else { 713 } else {
714 running_hash = StringHasher::AddCharacterCore(running_hash, c0); 714 running_hash = StringHasher::AddCharacterCore(running_hash, c0);
715 } 715 }
716 position++; 716 position++;
717 if (position >= source_length_) return Handle<String>::null(); 717 if (position >= source_length_) return Handle<String>::null();
718 c0 = seq_source_->SeqOneByteStringGet(position); 718 c0 = seq_source_->SeqOneByteStringGet(position);
719 } while (c0 != '"'); 719 } while (c0 != '"');
720 int length = position - position_; 720 int length = position - position_;
721 uint32_t hash = (length <= String::kMaxHashCalcLength) 721 uint32_t hash = (length <= String::kMaxHashCalcLength)
722 ? StringHasher::GetHashCore(running_hash) : length; 722 ? StringHasher::GetHashCore(running_hash)
723 : static_cast<uint32_t>(length);
723 Vector<const uint8_t> string_vector( 724 Vector<const uint8_t> string_vector(
724 seq_source_->GetChars() + position_, length); 725 seq_source_->GetChars() + position_, length);
725 StringTable* string_table = isolate()->heap()->string_table(); 726 StringTable* string_table = isolate()->heap()->string_table();
726 uint32_t capacity = string_table->Capacity(); 727 uint32_t capacity = string_table->Capacity();
727 uint32_t entry = StringTable::FirstProbe(hash, capacity); 728 uint32_t entry = StringTable::FirstProbe(hash, capacity);
728 uint32_t count = 1; 729 uint32_t count = 1;
729 Handle<String> result; 730 Handle<String> result;
730 while (true) { 731 while (true) {
731 Object* element = string_table->KeyAt(entry); 732 Object* element = string_table->KeyAt(entry);
732 if (element == isolate()->heap()->undefined_value()) { 733 if (element == isolate()->heap()->undefined_value()) {
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
781 782
782 DCHECK_EQ('"', c0_); 783 DCHECK_EQ('"', c0_);
783 // Advance past the last '"'. 784 // Advance past the last '"'.
784 AdvanceSkipWhitespace(); 785 AdvanceSkipWhitespace();
785 return result; 786 return result;
786 } 787 }
787 788
788 } } // namespace v8::internal 789 } } // namespace v8::internal
789 790
790 #endif // V8_JSON_PARSER_H_ 791 #endif // V8_JSON_PARSER_H_
OLDNEW
« no previous file with comments | « src/base/platform/platform-posix.cc ('k') | test/cctest/test-utils.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698