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 667 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
678 int last_id = last_script_id()->value(); | 678 int last_id = last_script_id()->value(); |
679 if (last_id == Smi::kMaxValue) { | 679 if (last_id == Smi::kMaxValue) { |
680 last_id = 1; | 680 last_id = 1; |
681 } else { | 681 } else { |
682 last_id++; | 682 last_id++; |
683 } | 683 } |
684 set_last_script_id(Smi::FromInt(last_id)); | 684 set_last_script_id(Smi::FromInt(last_id)); |
685 return last_id; | 685 return last_id; |
686 } | 686 } |
687 | 687 |
| 688 |
688 void Heap::SetArgumentsAdaptorDeoptPCOffset(int pc_offset) { | 689 void Heap::SetArgumentsAdaptorDeoptPCOffset(int pc_offset) { |
689 DCHECK(arguments_adaptor_deopt_pc_offset() == Smi::FromInt(0)); | 690 DCHECK(arguments_adaptor_deopt_pc_offset() == Smi::FromInt(0)); |
690 set_arguments_adaptor_deopt_pc_offset(Smi::FromInt(pc_offset)); | 691 set_arguments_adaptor_deopt_pc_offset(Smi::FromInt(pc_offset)); |
691 } | 692 } |
692 | 693 |
| 694 |
693 void Heap::SetConstructStubDeoptPCOffset(int pc_offset) { | 695 void Heap::SetConstructStubDeoptPCOffset(int pc_offset) { |
694 DCHECK(construct_stub_deopt_pc_offset() == Smi::FromInt(0)); | 696 DCHECK(construct_stub_deopt_pc_offset() == Smi::FromInt(0)); |
695 set_construct_stub_deopt_pc_offset(Smi::FromInt(pc_offset)); | 697 set_construct_stub_deopt_pc_offset(Smi::FromInt(pc_offset)); |
696 } | 698 } |
697 | 699 |
| 700 |
698 void Heap::SetGetterStubDeoptPCOffset(int pc_offset) { | 701 void Heap::SetGetterStubDeoptPCOffset(int pc_offset) { |
699 DCHECK(getter_stub_deopt_pc_offset() == Smi::FromInt(0)); | 702 DCHECK(getter_stub_deopt_pc_offset() == Smi::FromInt(0)); |
700 set_getter_stub_deopt_pc_offset(Smi::FromInt(pc_offset)); | 703 set_getter_stub_deopt_pc_offset(Smi::FromInt(pc_offset)); |
701 } | 704 } |
702 | 705 |
| 706 |
703 void Heap::SetSetterStubDeoptPCOffset(int pc_offset) { | 707 void Heap::SetSetterStubDeoptPCOffset(int pc_offset) { |
704 DCHECK(setter_stub_deopt_pc_offset() == Smi::FromInt(0)); | 708 DCHECK(setter_stub_deopt_pc_offset() == Smi::FromInt(0)); |
705 set_setter_stub_deopt_pc_offset(Smi::FromInt(pc_offset)); | 709 set_setter_stub_deopt_pc_offset(Smi::FromInt(pc_offset)); |
706 } | 710 } |
707 | 711 |
708 void Heap::SetInterpreterEntryReturnPCOffset(int pc_offset) { | |
709 DCHECK(interpreter_entry_return_pc_offset() == Smi::FromInt(0)); | |
710 set_interpreter_entry_return_pc_offset(Smi::FromInt(pc_offset)); | |
711 } | |
712 | 712 |
713 AlwaysAllocateScope::AlwaysAllocateScope(Isolate* isolate) | 713 AlwaysAllocateScope::AlwaysAllocateScope(Isolate* isolate) |
714 : heap_(isolate->heap()) { | 714 : heap_(isolate->heap()) { |
715 heap_->always_allocate_scope_count_.Increment(1); | 715 heap_->always_allocate_scope_count_.Increment(1); |
716 } | 716 } |
717 | 717 |
718 | 718 |
719 AlwaysAllocateScope::~AlwaysAllocateScope() { | 719 AlwaysAllocateScope::~AlwaysAllocateScope() { |
720 heap_->always_allocate_scope_count_.Increment(-1); | 720 heap_->always_allocate_scope_count_.Increment(-1); |
721 } | 721 } |
(...skipping 12 matching lines...) Expand all Loading... |
734 | 734 |
735 void VerifySmisVisitor::VisitPointers(Object** start, Object** end) { | 735 void VerifySmisVisitor::VisitPointers(Object** start, Object** end) { |
736 for (Object** current = start; current < end; current++) { | 736 for (Object** current = start; current < end; current++) { |
737 CHECK((*current)->IsSmi()); | 737 CHECK((*current)->IsSmi()); |
738 } | 738 } |
739 } | 739 } |
740 } // namespace internal | 740 } // namespace internal |
741 } // namespace v8 | 741 } // namespace v8 |
742 | 742 |
743 #endif // V8_HEAP_HEAP_INL_H_ | 743 #endif // V8_HEAP_HEAP_INL_H_ |
OLD | NEW |