| 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 if (last_script_id_ == Smi::kMaxValue) { |
| 689 if (!Smi::IsValid(next_id) || next_id < 0) next_id = 1; | 689 last_script_id_ = 1; |
| 690 Smi* next_id_smi = Smi::FromInt(next_id); | 690 } else { |
| 691 set_last_script_id(next_id_smi); | 691 last_script_id_++; |
| 692 return next_id_smi; | 692 } |
| 693 return last_script_id_; |
| 693 } | 694 } |
| 694 | 695 |
| 695 | 696 |
| 696 void Heap::SetArgumentsAdaptorDeoptPCOffset(int pc_offset) { | 697 void Heap::SetArgumentsAdaptorDeoptPCOffset(int pc_offset) { |
| 697 DCHECK(arguments_adaptor_deopt_pc_offset() == Smi::FromInt(0)); | 698 DCHECK(arguments_adaptor_deopt_pc_offset() == Smi::FromInt(0)); |
| 698 set_arguments_adaptor_deopt_pc_offset(Smi::FromInt(pc_offset)); | 699 set_arguments_adaptor_deopt_pc_offset(Smi::FromInt(pc_offset)); |
| 699 } | 700 } |
| 700 | 701 |
| 701 | 702 |
| 702 void Heap::SetConstructStubDeoptPCOffset(int pc_offset) { | 703 void Heap::SetConstructStubDeoptPCOffset(int pc_offset) { |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 741 | 742 |
| 742 void VerifySmisVisitor::VisitPointers(Object** start, Object** end) { | 743 void VerifySmisVisitor::VisitPointers(Object** start, Object** end) { |
| 743 for (Object** current = start; current < end; current++) { | 744 for (Object** current = start; current < end; current++) { |
| 744 CHECK((*current)->IsSmi()); | 745 CHECK((*current)->IsSmi()); |
| 745 } | 746 } |
| 746 } | 747 } |
| 747 } | 748 } |
| 748 } // namespace v8::internal | 749 } // namespace v8::internal |
| 749 | 750 |
| 750 #endif // V8_HEAP_HEAP_INL_H_ | 751 #endif // V8_HEAP_HEAP_INL_H_ |
| OLD | NEW |