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

Side by Side Diff: src/types.cc

Issue 1219943002: Expose SIMD.Float32x4 type to Javascript. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 5 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
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/ostreams.h" 9 #include "src/ostreams.h"
10 #include "src/types-inl.h" 10 #include "src/types-inl.h"
(...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after
221 if (map == heap->boolean_map()) return kBoolean; 221 if (map == heap->boolean_map()) return kBoolean;
222 DCHECK(map == heap->the_hole_map() || 222 DCHECK(map == heap->the_hole_map() ||
223 map == heap->uninitialized_map() || 223 map == heap->uninitialized_map() ||
224 map == heap->no_interceptor_result_sentinel_map() || 224 map == heap->no_interceptor_result_sentinel_map() ||
225 map == heap->termination_exception_map() || 225 map == heap->termination_exception_map() ||
226 map == heap->arguments_marker_map()); 226 map == heap->arguments_marker_map());
227 return kInternal & kTaggedPointer; 227 return kInternal & kTaggedPointer;
228 } 228 }
229 case HEAP_NUMBER_TYPE: 229 case HEAP_NUMBER_TYPE:
230 return kNumber & kTaggedPointer; 230 return kNumber & kTaggedPointer;
231 // TODO(bbudge): Add type bits for SIMD value types.
rossberg 2015/07/02 13:35:43 Nit: move down comment by one line
bbudge 2015/07/06 23:59:05 Done.
232 case FLOAT32X4_TYPE:
233 return kAny;
231 case JS_VALUE_TYPE: 234 case JS_VALUE_TYPE:
232 case JS_DATE_TYPE: 235 case JS_DATE_TYPE:
233 case JS_OBJECT_TYPE: 236 case JS_OBJECT_TYPE:
234 case JS_CONTEXT_EXTENSION_OBJECT_TYPE: 237 case JS_CONTEXT_EXTENSION_OBJECT_TYPE:
235 case JS_GENERATOR_OBJECT_TYPE: 238 case JS_GENERATOR_OBJECT_TYPE:
236 case JS_MODULE_TYPE: 239 case JS_MODULE_TYPE:
237 case JS_BUILTINS_OBJECT_TYPE: 240 case JS_BUILTINS_OBJECT_TYPE:
238 case JS_GLOBAL_OBJECT_TYPE: 241 case JS_GLOBAL_OBJECT_TYPE:
239 case JS_GLOBAL_PROXY_TYPE: 242 case JS_GLOBAL_PROXY_TYPE:
240 case JS_ARRAY_BUFFER_TYPE: 243 case JS_ARRAY_BUFFER_TYPE:
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
286 289
287 290
288 template<class Config> 291 template<class Config>
289 typename TypeImpl<Config>::bitset 292 typename TypeImpl<Config>::bitset
290 TypeImpl<Config>::BitsetType::Lub(i::Object* value) { 293 TypeImpl<Config>::BitsetType::Lub(i::Object* value) {
291 DisallowHeapAllocation no_allocation; 294 DisallowHeapAllocation no_allocation;
292 if (value->IsNumber()) { 295 if (value->IsNumber()) {
293 return Lub(value->Number()) & 296 return Lub(value->Number()) &
294 (value->IsSmi() ? kTaggedSigned : kTaggedPointer); 297 (value->IsSmi() ? kTaggedSigned : kTaggedPointer);
295 } 298 }
299 if (value->IsFloat32x4()) return kAny;
rossberg 2015/07/02 13:35:43 This shouldn't be needed, since it's covered by th
bbudge 2015/07/06 23:59:05 Done.
296 return Lub(i::HeapObject::cast(value)->map()); 300 return Lub(i::HeapObject::cast(value)->map());
297 } 301 }
298 302
299 303
300 template<class Config> 304 template<class Config>
301 typename TypeImpl<Config>::bitset 305 typename TypeImpl<Config>::bitset
302 TypeImpl<Config>::BitsetType::Lub(double value) { 306 TypeImpl<Config>::BitsetType::Lub(double value) {
303 DisallowHeapAllocation no_allocation; 307 DisallowHeapAllocation no_allocation;
304 if (i::IsMinusZero(value)) return kMinusZero; 308 if (i::IsMinusZero(value)) return kMinusZero;
305 if (std::isnan(value)) return kNaN; 309 if (std::isnan(value)) return kNaN;
(...skipping 1055 matching lines...) Expand 10 before | Expand all | Expand 10 after
1361 1365
1362 template TypeImpl<ZoneTypeConfig>::TypeHandle 1366 template TypeImpl<ZoneTypeConfig>::TypeHandle
1363 TypeImpl<ZoneTypeConfig>::Convert<HeapType>( 1367 TypeImpl<ZoneTypeConfig>::Convert<HeapType>(
1364 TypeImpl<HeapTypeConfig>::TypeHandle, TypeImpl<ZoneTypeConfig>::Region*); 1368 TypeImpl<HeapTypeConfig>::TypeHandle, TypeImpl<ZoneTypeConfig>::Region*);
1365 template TypeImpl<HeapTypeConfig>::TypeHandle 1369 template TypeImpl<HeapTypeConfig>::TypeHandle
1366 TypeImpl<HeapTypeConfig>::Convert<Type>( 1370 TypeImpl<HeapTypeConfig>::Convert<Type>(
1367 TypeImpl<ZoneTypeConfig>::TypeHandle, TypeImpl<HeapTypeConfig>::Region*); 1371 TypeImpl<ZoneTypeConfig>::TypeHandle, TypeImpl<HeapTypeConfig>::Region*);
1368 1372
1369 } // namespace internal 1373 } // namespace internal
1370 } // namespace v8 1374 } // namespace v8
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698