OLD | NEW |
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 17 matching lines...) Expand all Loading... |
28 #include "elements-kind.h" | 28 #include "elements-kind.h" |
29 | 29 |
30 #include "api.h" | 30 #include "api.h" |
31 #include "elements.h" | 31 #include "elements.h" |
32 #include "objects.h" | 32 #include "objects.h" |
33 | 33 |
34 namespace v8 { | 34 namespace v8 { |
35 namespace internal { | 35 namespace internal { |
36 | 36 |
37 | 37 |
38 void PrintElementsKind(FILE* out, ElementsKind kind) { | 38 const char* ElementsKindToString(ElementsKind kind) { |
39 ElementsAccessor* accessor = ElementsAccessor::ForKind(kind); | 39 ElementsAccessor* accessor = ElementsAccessor::ForKind(kind); |
40 PrintF(out, "%s", accessor->name()); | 40 return accessor->name(); |
41 } | 41 } |
42 | 42 |
43 | 43 |
| 44 void PrintElementsKind(FILE* out, ElementsKind kind) { |
| 45 PrintF(out, "%s", ElementsKindToString(kind)); |
| 46 } |
| 47 |
| 48 |
44 ElementsKind GetInitialFastElementsKind() { | 49 ElementsKind GetInitialFastElementsKind() { |
45 if (FLAG_packed_arrays) { | 50 if (FLAG_packed_arrays) { |
46 return FAST_SMI_ELEMENTS; | 51 return FAST_SMI_ELEMENTS; |
47 } else { | 52 } else { |
48 return FAST_HOLEY_SMI_ELEMENTS; | 53 return FAST_HOLEY_SMI_ELEMENTS; |
49 } | 54 } |
50 } | 55 } |
51 | 56 |
52 | 57 |
53 struct InitializeFastElementsKindSequence { | 58 struct InitializeFastElementsKindSequence { |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
125 return to_kind == FAST_HOLEY_ELEMENTS; | 130 return to_kind == FAST_HOLEY_ELEMENTS; |
126 case FAST_HOLEY_ELEMENTS: | 131 case FAST_HOLEY_ELEMENTS: |
127 return false; | 132 return false; |
128 default: | 133 default: |
129 return false; | 134 return false; |
130 } | 135 } |
131 } | 136 } |
132 | 137 |
133 | 138 |
134 } } // namespace v8::internal | 139 } } // namespace v8::internal |
OLD | NEW |