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

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

Issue 769263002: Add support for enabling DCHECKs in release mode (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: updates Created 6 years 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 | « src/isolate.cc ('k') | src/layout-descriptor.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 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 330 matching lines...) Expand 10 before | Expand all | Expand 10 after
341 Handle<Object> value = ParseJsonValue(); 341 Handle<Object> value = ParseJsonValue();
342 if (value.is_null()) return ReportUnexpectedCharacter(); 342 if (value.is_null()) return ReportUnexpectedCharacter();
343 343
344 JSObject::SetOwnElement(json_object, index, value, SLOPPY).Assert(); 344 JSObject::SetOwnElement(json_object, index, value, SLOPPY).Assert();
345 continue; 345 continue;
346 } 346 }
347 // Not an index, fallback to the slow path. 347 // Not an index, fallback to the slow path.
348 } 348 }
349 349
350 position_ = start_position; 350 position_ = start_position;
351 #ifdef DEBUG 351 #if DCHECK_IS_ON
352 c0_ = '"'; 352 c0_ = '"';
353 #endif 353 #endif
354 354
355 Handle<String> key; 355 Handle<String> key;
356 Handle<Object> value; 356 Handle<Object> value;
357 357
358 // Try to follow existing transitions as long as possible. Once we stop 358 // Try to follow existing transitions as long as possible. Once we stop
359 // transitioning, no transition can be found anymore. 359 // transitioning, no transition can be found anymore.
360 if (transitioning) { 360 if (transitioning) {
361 // First check whether there is a single expected transition. If so, try 361 // First check whether there is a single expected transition. If so, try
(...skipping 400 matching lines...) Expand 10 before | Expand all | Expand 10 after
762 Object* element = string_table->KeyAt(entry); 762 Object* element = string_table->KeyAt(entry);
763 if (element == isolate()->heap()->undefined_value()) { 763 if (element == isolate()->heap()->undefined_value()) {
764 // Lookup failure. 764 // Lookup failure.
765 result = factory()->InternalizeOneByteString( 765 result = factory()->InternalizeOneByteString(
766 seq_source_, position_, length); 766 seq_source_, position_, length);
767 break; 767 break;
768 } 768 }
769 if (element != isolate()->heap()->the_hole_value() && 769 if (element != isolate()->heap()->the_hole_value() &&
770 String::cast(element)->IsOneByteEqualTo(string_vector)) { 770 String::cast(element)->IsOneByteEqualTo(string_vector)) {
771 result = Handle<String>(String::cast(element), isolate()); 771 result = Handle<String>(String::cast(element), isolate());
772 #ifdef DEBUG 772 #if DCHECK_IS_ON
773 uint32_t hash_field = 773 uint32_t hash_field =
774 (hash << String::kHashShift) | String::kIsNotArrayIndexMask; 774 (hash << String::kHashShift) | String::kIsNotArrayIndexMask;
775 DCHECK_EQ(static_cast<int>(result->Hash()), 775 DCHECK_EQ(static_cast<int>(result->Hash()),
776 static_cast<int>(hash_field >> String::kHashShift)); 776 static_cast<int>(hash_field >> String::kHashShift));
777 #endif 777 #endif
778 break; 778 break;
779 } 779 }
780 entry = StringTable::NextProbe(entry, count++, capacity); 780 entry = StringTable::NextProbe(entry, count++, capacity);
781 } 781 }
782 position_ = position; 782 position_ = position;
(...skipping 29 matching lines...) Expand all
812 812
813 DCHECK_EQ('"', c0_); 813 DCHECK_EQ('"', c0_);
814 // Advance past the last '"'. 814 // Advance past the last '"'.
815 AdvanceSkipWhitespace(); 815 AdvanceSkipWhitespace();
816 return result; 816 return result;
817 } 817 }
818 818
819 } } // namespace v8::internal 819 } } // namespace v8::internal
820 820
821 #endif // V8_JSON_PARSER_H_ 821 #endif // V8_JSON_PARSER_H_
OLDNEW
« no previous file with comments | « src/isolate.cc ('k') | src/layout-descriptor.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698