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

Side by Side Diff: src/type-cache.h

Issue 1465203002: [turbofan] Initial support for inline allocations of arrays. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix unbounded inlining. Reduce code duplication. Add proper code dependencies. Created 5 years 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/compiler/js-typed-lowering.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 the V8 project authors. All rights reserved. 1 // Copyright 2014 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_TYPE_CACHE_H_ 5 #ifndef V8_TYPE_CACHE_H_
6 #define V8_TYPE_CACHE_H_ 6 #define V8_TYPE_CACHE_H_
7 7
8 #include "src/types.h" 8 #include "src/types.h"
9 9
10 namespace v8 { 10 namespace v8 {
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
87 // The JSArray::length property always contains a tagged number in the range 87 // The JSArray::length property always contains a tagged number in the range
88 // [0, kMaxUInt32]. 88 // [0, kMaxUInt32].
89 Type* const kJSArrayLengthType = 89 Type* const kJSArrayLengthType =
90 CreateNative(Type::Unsigned32(), Type::Tagged()); 90 CreateNative(Type::Unsigned32(), Type::Tagged());
91 91
92 // The String::length property always contains a smi in the range 92 // The String::length property always contains a smi in the range
93 // [0, String::kMaxLength]. 93 // [0, String::kMaxLength].
94 Type* const kStringLengthType = 94 Type* const kStringLengthType =
95 CreateNative(CreateRange(0.0, String::kMaxLength), Type::TaggedSigned()); 95 CreateNative(CreateRange(0.0, String::kMaxLength), Type::TaggedSigned());
96 96
97 // When initializing arrays, we'll unfold the loop if the number of
98 // elements is known to be of this type.
99 Type* const kElementLoopUnrollType = CreateRange(0.0, 16.0);
100
97 #define TYPED_ARRAY(TypeName, type_name, TYPE_NAME, ctype, size) \ 101 #define TYPED_ARRAY(TypeName, type_name, TYPE_NAME, ctype, size) \
98 Type* const k##TypeName##Array = CreateArray(k##TypeName); 102 Type* const k##TypeName##Array = CreateArray(k##TypeName);
99 TYPED_ARRAYS(TYPED_ARRAY) 103 TYPED_ARRAYS(TYPED_ARRAY)
100 #undef TYPED_ARRAY 104 #undef TYPED_ARRAY
101 105
102 private: 106 private:
103 Type* CreateArray(Type* element) { return Type::Array(element, zone()); } 107 Type* CreateArray(Type* element) { return Type::Array(element, zone()); }
104 108
105 Type* CreateArrayFunction(Type* array) { 109 Type* CreateArrayFunction(Type* array) {
106 Type* arg1 = Type::Union(Type::Unsigned32(), Type::Object(), zone()); 110 Type* arg1 = Type::Union(Type::Unsigned32(), Type::Object(), zone());
(...skipping 16 matching lines...) Expand all
123 return Type::Range(min, max, zone()); 127 return Type::Range(min, max, zone());
124 } 128 }
125 129
126 Zone* zone() { return &zone_; } 130 Zone* zone() { return &zone_; }
127 }; 131 };
128 132
129 } // namespace internal 133 } // namespace internal
130 } // namespace v8 134 } // namespace v8
131 135
132 #endif // V8_TYPE_CACHE_H_ 136 #endif // V8_TYPE_CACHE_H_
OLDNEW
« no previous file with comments | « src/compiler/js-typed-lowering.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698