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

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

Issue 10532063: Optimistically assume that elements IC only transition once. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Review feedback Created 8 years, 6 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | src/hydrogen.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 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
79 79
80 void PrintElementsKind(FILE* out, ElementsKind kind); 80 void PrintElementsKind(FILE* out, ElementsKind kind);
81 81
82 ElementsKind GetInitialFastElementsKind(); 82 ElementsKind GetInitialFastElementsKind();
83 83
84 ElementsKind GetFastElementsKindFromSequenceIndex(int sequence_index); 84 ElementsKind GetFastElementsKindFromSequenceIndex(int sequence_index);
85 85
86 int GetSequenceIndexFromFastElementsKind(ElementsKind elements_kind); 86 int GetSequenceIndexFromFastElementsKind(ElementsKind elements_kind);
87 87
88 88
89 inline bool IsDictionaryElementsKind(ElementsKind kind) {
90 return kind == DICTIONARY_ELEMENTS;
91 }
92
93
94 inline bool IsExternalArrayElementsKind(ElementsKind kind) {
95 return kind >= FIRST_EXTERNAL_ARRAY_ELEMENTS_KIND &&
96 kind <= LAST_EXTERNAL_ARRAY_ELEMENTS_KIND;
97 }
98
99
89 inline bool IsFastElementsKind(ElementsKind kind) { 100 inline bool IsFastElementsKind(ElementsKind kind) {
90 ASSERT(FIRST_FAST_ELEMENTS_KIND == 0); 101 ASSERT(FIRST_FAST_ELEMENTS_KIND == 0);
91 return kind <= FAST_HOLEY_DOUBLE_ELEMENTS; 102 return kind <= FAST_HOLEY_DOUBLE_ELEMENTS;
92 } 103 }
93 104
94 105
95 inline bool IsFastDoubleElementsKind(ElementsKind kind) { 106 inline bool IsFastDoubleElementsKind(ElementsKind kind) {
96 return kind == FAST_DOUBLE_ELEMENTS || 107 return kind == FAST_DOUBLE_ELEMENTS ||
97 kind == FAST_HOLEY_DOUBLE_ELEMENTS; 108 kind == FAST_HOLEY_DOUBLE_ELEMENTS;
98 } 109 }
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
201 bool allow_only_packed) { 212 bool allow_only_packed) {
202 return IsFastElementsKind(elements_kind) && 213 return IsFastElementsKind(elements_kind) &&
203 (elements_kind != TERMINAL_FAST_ELEMENTS_KIND && 214 (elements_kind != TERMINAL_FAST_ELEMENTS_KIND &&
204 (!allow_only_packed || elements_kind != FAST_ELEMENTS)); 215 (!allow_only_packed || elements_kind != FAST_ELEMENTS));
205 } 216 }
206 217
207 218
208 } } // namespace v8::internal 219 } } // namespace v8::internal
209 220
210 #endif // V8_ELEMENTS_KIND_H_ 221 #endif // V8_ELEMENTS_KIND_H_
OLDNEW
« no previous file with comments | « no previous file | src/hydrogen.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698