| 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/objects.h" | 5 #include "src/objects.h" |
| 6 | 6 |
| 7 #include "src/bootstrapper.h" | 7 #include "src/bootstrapper.h" |
| 8 #include "src/disasm.h" | 8 #include "src/disasm.h" |
| 9 #include "src/disassembler.h" | 9 #include "src/disassembler.h" |
| 10 #include "src/field-type.h" | 10 #include "src/field-type.h" |
| (...skipping 601 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 612 CHECK(IsOddball()); | 612 CHECK(IsOddball()); |
| 613 Heap* heap = GetHeap(); | 613 Heap* heap = GetHeap(); |
| 614 VerifyHeapPointer(to_string()); | 614 VerifyHeapPointer(to_string()); |
| 615 Object* number = to_number(); | 615 Object* number = to_number(); |
| 616 if (number->IsHeapObject()) { | 616 if (number->IsHeapObject()) { |
| 617 CHECK(number == heap->nan_value()); | 617 CHECK(number == heap->nan_value()); |
| 618 } else { | 618 } else { |
| 619 CHECK(number->IsSmi()); | 619 CHECK(number->IsSmi()); |
| 620 int value = Smi::cast(number)->value(); | 620 int value = Smi::cast(number)->value(); |
| 621 // Hidden oddballs have negative smis. | 621 // Hidden oddballs have negative smis. |
| 622 const int kLeastHiddenOddballNumber = -5; | 622 const int kLeastHiddenOddballNumber = -6; |
| 623 CHECK_LE(value, 1); | 623 CHECK_LE(value, 1); |
| 624 CHECK(value >= kLeastHiddenOddballNumber); | 624 CHECK(value >= kLeastHiddenOddballNumber); |
| 625 } | 625 } |
| 626 if (map() == heap->undefined_map()) { | 626 if (map() == heap->undefined_map()) { |
| 627 CHECK(this == heap->undefined_value()); | 627 CHECK(this == heap->undefined_value()); |
| 628 } else if (map() == heap->the_hole_map()) { | 628 } else if (map() == heap->the_hole_map()) { |
| 629 CHECK(this == heap->the_hole_value()); | 629 CHECK(this == heap->the_hole_value()); |
| 630 } else if (map() == heap->null_map()) { | 630 } else if (map() == heap->null_map()) { |
| 631 CHECK(this == heap->null_value()); | 631 CHECK(this == heap->null_value()); |
| 632 } else if (map() == heap->boolean_map()) { | 632 } else if (map() == heap->boolean_map()) { |
| 633 CHECK(this == heap->true_value() || | 633 CHECK(this == heap->true_value() || |
| 634 this == heap->false_value()); | 634 this == heap->false_value()); |
| 635 } else if (map() == heap->uninitialized_map()) { | 635 } else if (map() == heap->uninitialized_map()) { |
| 636 CHECK(this == heap->uninitialized_value()); | 636 CHECK(this == heap->uninitialized_value()); |
| 637 } else if (map() == heap->no_interceptor_result_sentinel_map()) { | 637 } else if (map() == heap->no_interceptor_result_sentinel_map()) { |
| 638 CHECK(this == heap->no_interceptor_result_sentinel()); | 638 CHECK(this == heap->no_interceptor_result_sentinel()); |
| 639 } else if (map() == heap->arguments_marker_map()) { | 639 } else if (map() == heap->arguments_marker_map()) { |
| 640 CHECK(this == heap->arguments_marker()); | 640 CHECK(this == heap->arguments_marker()); |
| 641 } else if (map() == heap->termination_exception_map()) { | 641 } else if (map() == heap->termination_exception_map()) { |
| 642 CHECK(this == heap->termination_exception()); | 642 CHECK(this == heap->termination_exception()); |
| 643 } else if (map() == heap->exception_map()) { | 643 } else if (map() == heap->exception_map()) { |
| 644 CHECK(this == heap->exception()); | 644 CHECK(this == heap->exception()); |
| 645 } else if (map() == heap->optimized_out_map()) { |
| 646 CHECK(this == heap->optimized_out()); |
| 645 } else { | 647 } else { |
| 646 UNREACHABLE(); | 648 UNREACHABLE(); |
| 647 } | 649 } |
| 648 } | 650 } |
| 649 | 651 |
| 650 | 652 |
| 651 void Cell::CellVerify() { | 653 void Cell::CellVerify() { |
| 652 CHECK(IsCell()); | 654 CHECK(IsCell()); |
| 653 VerifyObjectField(kValueOffset); | 655 VerifyObjectField(kValueOffset); |
| 654 } | 656 } |
| (...skipping 666 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1321 | 1323 |
| 1322 // Both are done at the same time. | 1324 // Both are done at the same time. |
| 1323 CHECK_EQ(new_it.done(), old_it.done()); | 1325 CHECK_EQ(new_it.done(), old_it.done()); |
| 1324 } | 1326 } |
| 1325 | 1327 |
| 1326 | 1328 |
| 1327 #endif // DEBUG | 1329 #endif // DEBUG |
| 1328 | 1330 |
| 1329 } // namespace internal | 1331 } // namespace internal |
| 1330 } // namespace v8 | 1332 } // namespace v8 |
| OLD | NEW |