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

Side by Side Diff: src/elements-kind.h

Issue 1307743011: Adding GetMoreGeneralElementsKind in elements-kind.h (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: fix? Created 5 years, 3 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/builtins.cc ('k') | src/ic/ic.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_ELEMENTS_KIND_H_ 5 #ifndef V8_ELEMENTS_KIND_H_
6 #define V8_ELEMENTS_KIND_H_ 6 #define V8_ELEMENTS_KIND_H_
7 7
8 #include "src/base/macros.h" 8 #include "src/base/macros.h"
9 #include "src/checks.h" 9 #include "src/checks.h"
10 10
(...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after
204 return (GetHoleyElementsKind(from_kind) == to_kind) || 204 return (GetHoleyElementsKind(from_kind) == to_kind) ||
205 (IsFastSmiElementsKind(from_kind) && 205 (IsFastSmiElementsKind(from_kind) &&
206 IsFastObjectElementsKind(to_kind)); 206 IsFastObjectElementsKind(to_kind));
207 } 207 }
208 208
209 209
210 bool IsMoreGeneralElementsKindTransition(ElementsKind from_kind, 210 bool IsMoreGeneralElementsKindTransition(ElementsKind from_kind,
211 ElementsKind to_kind); 211 ElementsKind to_kind);
212 212
213 213
214 inline ElementsKind GetMoreGeneralElementsKind(ElementsKind from_kind,
215 ElementsKind to_kind) {
216 if (IsMoreGeneralElementsKindTransition(from_kind, to_kind)) {
217 return to_kind;
218 }
219 return from_kind;
220 }
221
222
214 inline bool IsTransitionableFastElementsKind(ElementsKind from_kind) { 223 inline bool IsTransitionableFastElementsKind(ElementsKind from_kind) {
215 return IsFastElementsKind(from_kind) && 224 return IsFastElementsKind(from_kind) &&
216 from_kind != TERMINAL_FAST_ELEMENTS_KIND; 225 from_kind != TERMINAL_FAST_ELEMENTS_KIND;
217 } 226 }
218 227
219 228
220 } } // namespace v8::internal 229 } } // namespace v8::internal
221 230
222 #endif // V8_ELEMENTS_KIND_H_ 231 #endif // V8_ELEMENTS_KIND_H_
OLDNEW
« no previous file with comments | « src/builtins.cc ('k') | src/ic/ic.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698