Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(78)

Side by Side Diff: src/heap/heap-inl.h

Issue 1371893002: objects-inl.h: Remove ACCESSORS_TO_SMI macro (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: undo last_script_id storage change Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/heap/heap.cc ('k') | src/isolate.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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_
OLDNEW
« no previous file with comments | « src/heap/heap.cc ('k') | src/isolate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698