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

Side by Side Diff: src/objects-debug.cc

Issue 240883003: Introduce exception object and remove some uses of MaybeObject::IsFailure(). (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 8 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/objects.h ('k') | src/objects-inl.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 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 594 matching lines...) Expand 10 before | Expand all | Expand 10 after
605 CHECK(IsOddball()); 605 CHECK(IsOddball());
606 Heap* heap = GetHeap(); 606 Heap* heap = GetHeap();
607 VerifyHeapPointer(to_string()); 607 VerifyHeapPointer(to_string());
608 Object* number = to_number(); 608 Object* number = to_number();
609 if (number->IsHeapObject()) { 609 if (number->IsHeapObject()) {
610 CHECK(number == heap->nan_value()); 610 CHECK(number == heap->nan_value());
611 } else { 611 } else {
612 CHECK(number->IsSmi()); 612 CHECK(number->IsSmi());
613 int value = Smi::cast(number)->value(); 613 int value = Smi::cast(number)->value();
614 // Hidden oddballs have negative smis. 614 // Hidden oddballs have negative smis.
615 const int kLeastHiddenOddballNumber = -4; 615 const int kLeastHiddenOddballNumber = -5;
616 CHECK_LE(value, 1); 616 CHECK_LE(value, 1);
617 CHECK(value >= kLeastHiddenOddballNumber); 617 CHECK(value >= kLeastHiddenOddballNumber);
618 } 618 }
619 if (map() == heap->undefined_map()) { 619 if (map() == heap->undefined_map()) {
620 CHECK(this == heap->undefined_value()); 620 CHECK(this == heap->undefined_value());
621 } else if (map() == heap->the_hole_map()) { 621 } else if (map() == heap->the_hole_map()) {
622 CHECK(this == heap->the_hole_value()); 622 CHECK(this == heap->the_hole_value());
623 } else if (map() == heap->null_map()) { 623 } else if (map() == heap->null_map()) {
624 CHECK(this == heap->null_value()); 624 CHECK(this == heap->null_value());
625 } else if (map() == heap->boolean_map()) { 625 } else if (map() == heap->boolean_map()) {
626 CHECK(this == heap->true_value() || 626 CHECK(this == heap->true_value() ||
627 this == heap->false_value()); 627 this == heap->false_value());
628 } else if (map() == heap->uninitialized_map()) { 628 } else if (map() == heap->uninitialized_map()) {
629 CHECK(this == heap->uninitialized_value()); 629 CHECK(this == heap->uninitialized_value());
630 } else if (map() == heap->no_interceptor_result_sentinel_map()) { 630 } else if (map() == heap->no_interceptor_result_sentinel_map()) {
631 CHECK(this == heap->no_interceptor_result_sentinel()); 631 CHECK(this == heap->no_interceptor_result_sentinel());
632 } else if (map() == heap->arguments_marker_map()) { 632 } else if (map() == heap->arguments_marker_map()) {
633 CHECK(this == heap->arguments_marker()); 633 CHECK(this == heap->arguments_marker());
634 } else if (map() == heap->termination_exception_map()) { 634 } else if (map() == heap->termination_exception_map()) {
635 CHECK(this == heap->termination_exception()); 635 CHECK(this == heap->termination_exception());
636 } else if (map() == heap->exception_map()) {
637 CHECK(this == heap->exception());
636 } else { 638 } else {
637 UNREACHABLE(); 639 UNREACHABLE();
638 } 640 }
639 } 641 }
640 642
641 643
642 void Cell::CellVerify() { 644 void Cell::CellVerify() {
643 CHECK(IsCell()); 645 CHECK(IsCell());
644 VerifyObjectField(kValueOffset); 646 VerifyObjectField(kValueOffset);
645 } 647 }
(...skipping 543 matching lines...) Expand 10 before | Expand all | Expand 10 after
1189 for (int i = 0; i < number_of_transitions(); ++i) { 1191 for (int i = 0; i < number_of_transitions(); ++i) {
1190 if (!CheckOneBackPointer(current_map, GetTarget(i))) return false; 1192 if (!CheckOneBackPointer(current_map, GetTarget(i))) return false;
1191 } 1193 }
1192 return true; 1194 return true;
1193 } 1195 }
1194 1196
1195 1197
1196 #endif // DEBUG 1198 #endif // DEBUG
1197 1199
1198 } } // namespace v8::internal 1200 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/objects.h ('k') | src/objects-inl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698