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

Side by Side Diff: src/types.cc

Issue 2236443004: [turbofan] Introduce a dedicated ConvertTaggedHoleToUndefined operator. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix verify heap. Created 4 years, 4 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/types.h ('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 #include <iomanip> 5 #include <iomanip>
6 6
7 #include "src/types.h" 7 #include "src/types.h"
8 8
9 #include "src/handles-inl.h" 9 #include "src/handles-inl.h"
10 #include "src/ostreams.h" 10 #include "src/ostreams.h"
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after
140 int bitset = type->AsUnion()->Get(0)->BitsetLub(); 140 int bitset = type->AsUnion()->Get(0)->BitsetLub();
141 for (int i = 0, n = type->AsUnion()->Length(); i < n; ++i) { 141 for (int i = 0, n = type->AsUnion()->Length(); i < n; ++i) {
142 // Other elements only contribute their semantic part. 142 // Other elements only contribute their semantic part.
143 bitset |= SEMANTIC(type->AsUnion()->Get(i)->BitsetLub()); 143 bitset |= SEMANTIC(type->AsUnion()->Get(i)->BitsetLub());
144 } 144 }
145 return bitset; 145 return bitset;
146 } 146 }
147 if (type->IsClass()) return type->AsClass()->Lub(); 147 if (type->IsClass()) return type->AsClass()->Lub();
148 if (type->IsConstant()) return type->AsConstant()->Lub(); 148 if (type->IsConstant()) return type->AsConstant()->Lub();
149 if (type->IsRange()) return type->AsRange()->Lub(); 149 if (type->IsRange()) return type->AsRange()->Lub();
150 if (type->IsContext()) return kInternal & kTaggedPointer; 150 if (type->IsContext()) return kOtherInternal & kTaggedPointer;
151 if (type->IsArray()) return kOtherObject; 151 if (type->IsArray()) return kOtherObject;
152 if (type->IsFunction()) return kFunction; 152 if (type->IsFunction()) return kFunction;
153 if (type->IsTuple()) return kInternal; 153 if (type->IsTuple()) return kOtherInternal;
154 UNREACHABLE(); 154 UNREACHABLE();
155 return kNone; 155 return kNone;
156 } 156 }
157 157
158 Type::bitset BitsetType::Lub(i::Map* map) { 158 Type::bitset BitsetType::Lub(i::Map* map) {
159 DisallowHeapAllocation no_allocation; 159 DisallowHeapAllocation no_allocation;
160 switch (map->instance_type()) { 160 switch (map->instance_type()) {
161 case STRING_TYPE: 161 case STRING_TYPE:
162 case ONE_BYTE_STRING_TYPE: 162 case ONE_BYTE_STRING_TYPE:
163 case CONS_STRING_TYPE: 163 case CONS_STRING_TYPE:
(...skipping 16 matching lines...) Expand all
180 case SHORT_EXTERNAL_ONE_BYTE_INTERNALIZED_STRING_TYPE: 180 case SHORT_EXTERNAL_ONE_BYTE_INTERNALIZED_STRING_TYPE:
181 case SHORT_EXTERNAL_INTERNALIZED_STRING_WITH_ONE_BYTE_DATA_TYPE: 181 case SHORT_EXTERNAL_INTERNALIZED_STRING_WITH_ONE_BYTE_DATA_TYPE:
182 return kInternalizedString; 182 return kInternalizedString;
183 case SYMBOL_TYPE: 183 case SYMBOL_TYPE:
184 return kSymbol; 184 return kSymbol;
185 case ODDBALL_TYPE: { 185 case ODDBALL_TYPE: {
186 Heap* heap = map->GetHeap(); 186 Heap* heap = map->GetHeap();
187 if (map == heap->undefined_map()) return kUndefined; 187 if (map == heap->undefined_map()) return kUndefined;
188 if (map == heap->null_map()) return kNull; 188 if (map == heap->null_map()) return kNull;
189 if (map == heap->boolean_map()) return kBoolean; 189 if (map == heap->boolean_map()) return kBoolean;
190 DCHECK(map == heap->the_hole_map() || 190 if (map == heap->the_hole_map()) return kHole;
191 map == heap->uninitialized_map() || 191 DCHECK(map == heap->uninitialized_map() ||
192 map == heap->no_interceptor_result_sentinel_map() || 192 map == heap->no_interceptor_result_sentinel_map() ||
193 map == heap->termination_exception_map() || 193 map == heap->termination_exception_map() ||
194 map == heap->arguments_marker_map() || 194 map == heap->arguments_marker_map() ||
195 map == heap->optimized_out_map() || 195 map == heap->optimized_out_map() ||
196 map == heap->stale_register_map()); 196 map == heap->stale_register_map());
197 return kInternal & kTaggedPointer; 197 return kOtherInternal & kTaggedPointer;
198 } 198 }
199 case HEAP_NUMBER_TYPE: 199 case HEAP_NUMBER_TYPE:
200 return kNumber & kTaggedPointer; 200 return kNumber & kTaggedPointer;
201 case SIMD128_VALUE_TYPE: 201 case SIMD128_VALUE_TYPE:
202 return kSimd; 202 return kSimd;
203 case JS_OBJECT_TYPE: 203 case JS_OBJECT_TYPE:
204 case JS_ARGUMENTS_TYPE: 204 case JS_ARGUMENTS_TYPE:
205 case JS_ERROR_TYPE: 205 case JS_ERROR_TYPE:
206 case JS_GLOBAL_OBJECT_TYPE: 206 case JS_GLOBAL_OBJECT_TYPE:
207 case JS_GLOBAL_PROXY_TYPE: 207 case JS_GLOBAL_PROXY_TYPE:
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
243 case ACCESSOR_PAIR_TYPE: 243 case ACCESSOR_PAIR_TYPE:
244 case FIXED_ARRAY_TYPE: 244 case FIXED_ARRAY_TYPE:
245 case FIXED_DOUBLE_ARRAY_TYPE: 245 case FIXED_DOUBLE_ARRAY_TYPE:
246 case BYTE_ARRAY_TYPE: 246 case BYTE_ARRAY_TYPE:
247 case BYTECODE_ARRAY_TYPE: 247 case BYTECODE_ARRAY_TYPE:
248 case TRANSITION_ARRAY_TYPE: 248 case TRANSITION_ARRAY_TYPE:
249 case FOREIGN_TYPE: 249 case FOREIGN_TYPE:
250 case SCRIPT_TYPE: 250 case SCRIPT_TYPE:
251 case CODE_TYPE: 251 case CODE_TYPE:
252 case PROPERTY_CELL_TYPE: 252 case PROPERTY_CELL_TYPE:
253 return kInternal & kTaggedPointer; 253 return kOtherInternal & kTaggedPointer;
254 254
255 // Remaining instance types are unsupported for now. If any of them do 255 // Remaining instance types are unsupported for now. If any of them do
256 // require bit set types, they should get kInternal & kTaggedPointer. 256 // require bit set types, they should get kOtherInternal & kTaggedPointer.
257 case MUTABLE_HEAP_NUMBER_TYPE: 257 case MUTABLE_HEAP_NUMBER_TYPE:
258 case FREE_SPACE_TYPE: 258 case FREE_SPACE_TYPE:
259 #define FIXED_TYPED_ARRAY_CASE(Type, type, TYPE, ctype, size) \ 259 #define FIXED_TYPED_ARRAY_CASE(Type, type, TYPE, ctype, size) \
260 case FIXED_##TYPE##_ARRAY_TYPE: 260 case FIXED_##TYPE##_ARRAY_TYPE:
261 261
262 TYPED_ARRAYS(FIXED_TYPED_ARRAY_CASE) 262 TYPED_ARRAYS(FIXED_TYPED_ARRAY_CASE)
263 #undef FIXED_TYPED_ARRAY_CASE 263 #undef FIXED_TYPED_ARRAY_CASE
264 case FILLER_TYPE: 264 case FILLER_TYPE:
265 case ACCESS_CHECK_INFO_TYPE: 265 case ACCESS_CHECK_INFO_TYPE:
266 case INTERCEPTOR_INFO_TYPE: 266 case INTERCEPTOR_INFO_TYPE:
(...skipping 1003 matching lines...) Expand 10 before | Expand all | Expand 10 after
1270 #undef CONSTRUCT_SIMD_TYPE 1270 #undef CONSTRUCT_SIMD_TYPE
1271 1271
1272 // ----------------------------------------------------------------------------- 1272 // -----------------------------------------------------------------------------
1273 // Instantiations. 1273 // Instantiations.
1274 1274
1275 template class Type::Iterator<i::Map>; 1275 template class Type::Iterator<i::Map>;
1276 template class Type::Iterator<i::Object>; 1276 template class Type::Iterator<i::Object>;
1277 1277
1278 } // namespace internal 1278 } // namespace internal
1279 } // namespace v8 1279 } // namespace v8
OLDNEW
« no previous file with comments | « src/types.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698