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 #ifndef V8_HEAP_HEAP_INL_H_ | 5 #ifndef V8_HEAP_HEAP_INL_H_ |
6 #define V8_HEAP_HEAP_INL_H_ | 6 #define V8_HEAP_HEAP_INL_H_ |
7 | 7 |
8 #include <cmath> | 8 #include <cmath> |
9 | 9 |
10 #include "src/base/platform/platform.h" | 10 #include "src/base/platform/platform.h" |
(...skipping 666 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
677 } | 677 } |
678 | 678 |
679 | 679 |
680 uint32_t Heap::HashSeed() { | 680 uint32_t Heap::HashSeed() { |
681 uint32_t seed = static_cast<uint32_t>(hash_seed()->value()); | 681 uint32_t seed = static_cast<uint32_t>(hash_seed()->value()); |
682 DCHECK(FLAG_randomize_hashes || seed == 0); | 682 DCHECK(FLAG_randomize_hashes || seed == 0); |
683 return seed; | 683 return seed; |
684 } | 684 } |
685 | 685 |
686 | 686 |
687 Smi* Heap::NextScriptId() { | 687 int Heap::NextScriptId() { |
688 int next_id = last_script_id()->value() + 1; | 688 int last_id = last_script_id()->value(); |
689 if (!Smi::IsValid(next_id) || next_id < 0) next_id = 1; | 689 if (last_id == Smi::kMaxValue) { |
690 Smi* next_id_smi = Smi::FromInt(next_id); | 690 last_id = 1; |
691 set_last_script_id(next_id_smi); | 691 } else { |
692 return next_id_smi; | 692 last_id++; |
| 693 } |
| 694 set_last_script_id(Smi::FromInt(last_id)); |
| 695 return last_id; |
693 } | 696 } |
694 | 697 |
695 | 698 |
696 void Heap::SetArgumentsAdaptorDeoptPCOffset(int pc_offset) { | 699 void Heap::SetArgumentsAdaptorDeoptPCOffset(int pc_offset) { |
697 DCHECK(arguments_adaptor_deopt_pc_offset() == Smi::FromInt(0)); | 700 DCHECK(arguments_adaptor_deopt_pc_offset() == Smi::FromInt(0)); |
698 set_arguments_adaptor_deopt_pc_offset(Smi::FromInt(pc_offset)); | 701 set_arguments_adaptor_deopt_pc_offset(Smi::FromInt(pc_offset)); |
699 } | 702 } |
700 | 703 |
701 | 704 |
702 void Heap::SetConstructStubDeoptPCOffset(int pc_offset) { | 705 void Heap::SetConstructStubDeoptPCOffset(int pc_offset) { |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
741 | 744 |
742 void VerifySmisVisitor::VisitPointers(Object** start, Object** end) { | 745 void VerifySmisVisitor::VisitPointers(Object** start, Object** end) { |
743 for (Object** current = start; current < end; current++) { | 746 for (Object** current = start; current < end; current++) { |
744 CHECK((*current)->IsSmi()); | 747 CHECK((*current)->IsSmi()); |
745 } | 748 } |
746 } | 749 } |
747 } | 750 } |
748 } // namespace v8::internal | 751 } // namespace v8::internal |
749 | 752 |
750 #endif // V8_HEAP_HEAP_INL_H_ | 753 #endif // V8_HEAP_HEAP_INL_H_ |
OLD | NEW |