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

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

Issue 55933002: Inline array constructor. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Added comment to CreateArrayDispatchOneArgument Created 7 years, 1 month 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 | « src/elements-kind.h ('k') | src/heap.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 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
61 ElementsKind* fast_elements_kind_sequence = 61 ElementsKind* fast_elements_kind_sequence =
62 new ElementsKind[kFastElementsKindCount]; 62 new ElementsKind[kFastElementsKindCount];
63 *fast_elements_kind_sequence_ptr = fast_elements_kind_sequence; 63 *fast_elements_kind_sequence_ptr = fast_elements_kind_sequence;
64 STATIC_ASSERT(FAST_SMI_ELEMENTS == FIRST_FAST_ELEMENTS_KIND); 64 STATIC_ASSERT(FAST_SMI_ELEMENTS == FIRST_FAST_ELEMENTS_KIND);
65 fast_elements_kind_sequence[0] = FAST_SMI_ELEMENTS; 65 fast_elements_kind_sequence[0] = FAST_SMI_ELEMENTS;
66 fast_elements_kind_sequence[1] = FAST_HOLEY_SMI_ELEMENTS; 66 fast_elements_kind_sequence[1] = FAST_HOLEY_SMI_ELEMENTS;
67 fast_elements_kind_sequence[2] = FAST_DOUBLE_ELEMENTS; 67 fast_elements_kind_sequence[2] = FAST_DOUBLE_ELEMENTS;
68 fast_elements_kind_sequence[3] = FAST_HOLEY_DOUBLE_ELEMENTS; 68 fast_elements_kind_sequence[3] = FAST_HOLEY_DOUBLE_ELEMENTS;
69 fast_elements_kind_sequence[4] = FAST_ELEMENTS; 69 fast_elements_kind_sequence[4] = FAST_ELEMENTS;
70 fast_elements_kind_sequence[5] = FAST_HOLEY_ELEMENTS; 70 fast_elements_kind_sequence[5] = FAST_HOLEY_ELEMENTS;
71
72 // Verify that kFastElementsKindPackedToHoley is correct.
73 STATIC_ASSERT(FAST_SMI_ELEMENTS + kFastElementsKindPackedToHoley ==
74 FAST_HOLEY_SMI_ELEMENTS);
75 STATIC_ASSERT(FAST_DOUBLE_ELEMENTS + kFastElementsKindPackedToHoley ==
76 FAST_HOLEY_DOUBLE_ELEMENTS);
77 STATIC_ASSERT(FAST_ELEMENTS + kFastElementsKindPackedToHoley ==
78 FAST_HOLEY_ELEMENTS);
71 } 79 }
72 }; 80 };
73 81
74 82
75 static LazyInstance<ElementsKind*, 83 static LazyInstance<ElementsKind*,
76 InitializeFastElementsKindSequence>::type 84 InitializeFastElementsKindSequence>::type
77 fast_elements_kind_sequence = LAZY_INSTANCE_INITIALIZER; 85 fast_elements_kind_sequence = LAZY_INSTANCE_INITIALIZER;
78 86
79 87
80 ElementsKind GetFastElementsKindFromSequenceIndex(int sequence_number) { 88 ElementsKind GetFastElementsKindFromSequenceIndex(int sequence_number) {
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
131 return to_kind == FAST_HOLEY_ELEMENTS; 139 return to_kind == FAST_HOLEY_ELEMENTS;
132 case FAST_HOLEY_ELEMENTS: 140 case FAST_HOLEY_ELEMENTS:
133 return false; 141 return false;
134 default: 142 default:
135 return false; 143 return false;
136 } 144 }
137 } 145 }
138 146
139 147
140 } } // namespace v8::internal 148 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/elements-kind.h ('k') | src/heap.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698