| 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 591 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 602 CHECK(IsOddball()); | 602 CHECK(IsOddball()); |
| 603 Heap* heap = GetHeap(); | 603 Heap* heap = GetHeap(); |
| 604 VerifyHeapPointer(to_string()); | 604 VerifyHeapPointer(to_string()); |
| 605 Object* number = to_number(); | 605 Object* number = to_number(); |
| 606 if (number->IsHeapObject()) { | 606 if (number->IsHeapObject()) { |
| 607 CHECK(number == heap->nan_value()); | 607 CHECK(number == heap->nan_value()); |
| 608 } else { | 608 } else { |
| 609 CHECK(number->IsSmi()); | 609 CHECK(number->IsSmi()); |
| 610 int value = Smi::cast(number)->value(); | 610 int value = Smi::cast(number)->value(); |
| 611 // Hidden oddballs have negative smis. | 611 // Hidden oddballs have negative smis. |
| 612 const int kLeastHiddenOddballNumber = -6; | 612 const int kLeastHiddenOddballNumber = -7; |
| 613 CHECK_LE(value, 1); | 613 CHECK_LE(value, 1); |
| 614 CHECK(value >= kLeastHiddenOddballNumber); | 614 CHECK(value >= kLeastHiddenOddballNumber); |
| 615 } | 615 } |
| 616 if (map() == heap->undefined_map()) { | 616 if (map() == heap->undefined_map()) { |
| 617 CHECK(this == heap->undefined_value()); | 617 CHECK(this == heap->undefined_value()); |
| 618 } else if (map() == heap->the_hole_map()) { | 618 } else if (map() == heap->the_hole_map()) { |
| 619 CHECK(this == heap->the_hole_value()); | 619 CHECK(this == heap->the_hole_value()); |
| 620 } else if (map() == heap->null_map()) { | 620 } else if (map() == heap->null_map()) { |
| 621 CHECK(this == heap->null_value()); | 621 CHECK(this == heap->null_value()); |
| 622 } else if (map() == heap->boolean_map()) { | 622 } else if (map() == heap->boolean_map()) { |
| 623 CHECK(this == heap->true_value() || | 623 CHECK(this == heap->true_value() || |
| 624 this == heap->false_value()); | 624 this == heap->false_value()); |
| 625 } else if (map() == heap->uninitialized_map()) { | 625 } else if (map() == heap->uninitialized_map()) { |
| 626 CHECK(this == heap->uninitialized_value()); | 626 CHECK(this == heap->uninitialized_value()); |
| 627 } else if (map() == heap->no_interceptor_result_sentinel_map()) { | 627 } else if (map() == heap->no_interceptor_result_sentinel_map()) { |
| 628 CHECK(this == heap->no_interceptor_result_sentinel()); | 628 CHECK(this == heap->no_interceptor_result_sentinel()); |
| 629 } else if (map() == heap->arguments_marker_map()) { | 629 } else if (map() == heap->arguments_marker_map()) { |
| 630 CHECK(this == heap->arguments_marker()); | 630 CHECK(this == heap->arguments_marker()); |
| 631 } else if (map() == heap->termination_exception_map()) { | 631 } else if (map() == heap->termination_exception_map()) { |
| 632 CHECK(this == heap->termination_exception()); | 632 CHECK(this == heap->termination_exception()); |
| 633 } else if (map() == heap->exception_map()) { | 633 } else if (map() == heap->exception_map()) { |
| 634 CHECK(this == heap->exception()); | 634 CHECK(this == heap->exception()); |
| 635 } else if (map() == heap->optimized_out_map()) { | 635 } else if (map() == heap->optimized_out_map()) { |
| 636 CHECK(this == heap->optimized_out()); | 636 CHECK(this == heap->optimized_out()); |
| 637 } else if (map() == heap->stale_register_map()) { |
| 638 CHECK(this == heap->stale_register()); |
| 637 } else { | 639 } else { |
| 638 UNREACHABLE(); | 640 UNREACHABLE(); |
| 639 } | 641 } |
| 640 } | 642 } |
| 641 | 643 |
| 642 | 644 |
| 643 void Cell::CellVerify() { | 645 void Cell::CellVerify() { |
| 644 CHECK(IsCell()); | 646 CHECK(IsCell()); |
| 645 VerifyObjectField(kValueOffset); | 647 VerifyObjectField(kValueOffset); |
| 646 } | 648 } |
| (...skipping 667 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1314 | 1316 |
| 1315 // Both are done at the same time. | 1317 // Both are done at the same time. |
| 1316 CHECK_EQ(new_it.done(), old_it.done()); | 1318 CHECK_EQ(new_it.done(), old_it.done()); |
| 1317 } | 1319 } |
| 1318 | 1320 |
| 1319 | 1321 |
| 1320 #endif // DEBUG | 1322 #endif // DEBUG |
| 1321 | 1323 |
| 1322 } // namespace internal | 1324 } // namespace internal |
| 1323 } // namespace v8 | 1325 } // namespace v8 |
| OLD | NEW |