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

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

Issue 2381843002: Add Smi::Zero and replace all Smi::FromInt(0) calls (Closed)
Patch Set: Mark Smi::kZero as V8_EXPORT_PRIVATE Created 4 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/transitions.cc ('k') | src/type-feedback-vector.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_TRANSITIONS_INL_H_ 5 #ifndef V8_TRANSITIONS_INL_H_
6 #define V8_TRANSITIONS_INL_H_ 6 #define V8_TRANSITIONS_INL_H_
7 7
8 #include "src/transitions.h" 8 #include "src/transitions.h"
9 9
10 namespace v8 { 10 namespace v8 {
11 namespace internal { 11 namespace internal {
12 12
13 13
14 TransitionArray* TransitionArray::cast(Object* object) { 14 TransitionArray* TransitionArray::cast(Object* object) {
15 DCHECK(object->IsTransitionArray()); 15 DCHECK(object->IsTransitionArray());
16 return reinterpret_cast<TransitionArray*>(object); 16 return reinterpret_cast<TransitionArray*>(object);
17 } 17 }
18 18
19 19
20 Object* TransitionArray::next_link() { return get(kNextLinkIndex); } 20 Object* TransitionArray::next_link() { return get(kNextLinkIndex); }
21 21
22 22
23 void TransitionArray::set_next_link(Object* next, WriteBarrierMode mode) { 23 void TransitionArray::set_next_link(Object* next, WriteBarrierMode mode) {
24 return set(kNextLinkIndex, next, mode); 24 return set(kNextLinkIndex, next, mode);
25 } 25 }
26 26
27 27
28 bool TransitionArray::HasPrototypeTransitions() { 28 bool TransitionArray::HasPrototypeTransitions() {
29 return get(kPrototypeTransitionsIndex) != Smi::FromInt(0); 29 return get(kPrototypeTransitionsIndex) != Smi::kZero;
30 } 30 }
31 31
32 32
33 FixedArray* TransitionArray::GetPrototypeTransitions() { 33 FixedArray* TransitionArray::GetPrototypeTransitions() {
34 DCHECK(HasPrototypeTransitions()); // Callers must check first. 34 DCHECK(HasPrototypeTransitions()); // Callers must check first.
35 Object* prototype_transitions = get(kPrototypeTransitionsIndex); 35 Object* prototype_transitions = get(kPrototypeTransitionsIndex);
36 return FixedArray::cast(prototype_transitions); 36 return FixedArray::cast(prototype_transitions);
37 } 37 }
38 38
39 39
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after
175 175
176 void TransitionArray::SetNumberOfTransitions(int number_of_transitions) { 176 void TransitionArray::SetNumberOfTransitions(int number_of_transitions) {
177 DCHECK(number_of_transitions <= Capacity(this)); 177 DCHECK(number_of_transitions <= Capacity(this));
178 set(kTransitionLengthIndex, Smi::FromInt(number_of_transitions)); 178 set(kTransitionLengthIndex, Smi::FromInt(number_of_transitions));
179 } 179 }
180 180
181 } // namespace internal 181 } // namespace internal
182 } // namespace v8 182 } // namespace v8
183 183
184 #endif // V8_TRANSITIONS_INL_H_ 184 #endif // V8_TRANSITIONS_INL_H_
OLDNEW
« no previous file with comments | « src/transitions.cc ('k') | src/type-feedback-vector.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698