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

Side by Side Diff: src/objects.h

Issue 1153373003: Add new Float32x4 type for SIMD.js. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix int type mismatches. Created 5 years, 6 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/heap/objects-visiting.cc ('k') | src/objects.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 // 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_OBJECTS_H_ 5 #ifndef V8_OBJECTS_H_
6 #define V8_OBJECTS_H_ 6 #define V8_OBJECTS_H_
7 7
8 #include <iosfwd> 8 #include <iosfwd>
9 9
10 #include "src/allocation.h" 10 #include "src/allocation.h"
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
114 // - InternalizedString 114 // - InternalizedString
115 // - SeqInternalizedString 115 // - SeqInternalizedString
116 // - SeqOneByteInternalizedString 116 // - SeqOneByteInternalizedString
117 // - SeqTwoByteInternalizedString 117 // - SeqTwoByteInternalizedString
118 // - ConsInternalizedString 118 // - ConsInternalizedString
119 // - ExternalInternalizedString 119 // - ExternalInternalizedString
120 // - ExternalOneByteInternalizedString 120 // - ExternalOneByteInternalizedString
121 // - ExternalTwoByteInternalizedString 121 // - ExternalTwoByteInternalizedString
122 // - Symbol 122 // - Symbol
123 // - HeapNumber 123 // - HeapNumber
124 // - Float32x4
124 // - Cell 125 // - Cell
125 // - PropertyCell 126 // - PropertyCell
126 // - Code 127 // - Code
127 // - Map 128 // - Map
128 // - Oddball 129 // - Oddball
129 // - Foreign 130 // - Foreign
130 // - SharedFunctionInfo 131 // - SharedFunctionInfo
131 // - Struct 132 // - Struct
132 // - Box 133 // - Box
133 // - AccessorInfo 134 // - AccessorInfo
(...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after
387 V(SYMBOL_TYPE) \ 388 V(SYMBOL_TYPE) \
388 \ 389 \
389 V(MAP_TYPE) \ 390 V(MAP_TYPE) \
390 V(CODE_TYPE) \ 391 V(CODE_TYPE) \
391 V(ODDBALL_TYPE) \ 392 V(ODDBALL_TYPE) \
392 V(CELL_TYPE) \ 393 V(CELL_TYPE) \
393 V(PROPERTY_CELL_TYPE) \ 394 V(PROPERTY_CELL_TYPE) \
394 \ 395 \
395 V(HEAP_NUMBER_TYPE) \ 396 V(HEAP_NUMBER_TYPE) \
396 V(MUTABLE_HEAP_NUMBER_TYPE) \ 397 V(MUTABLE_HEAP_NUMBER_TYPE) \
398 V(FLOAT32X4_TYPE) \
397 V(FOREIGN_TYPE) \ 399 V(FOREIGN_TYPE) \
398 V(BYTE_ARRAY_TYPE) \ 400 V(BYTE_ARRAY_TYPE) \
399 V(FREE_SPACE_TYPE) \ 401 V(FREE_SPACE_TYPE) \
400 /* Note: the order of these external array */ \ 402 /* Note: the order of these external array */ \
401 /* types is relied upon in */ \ 403 /* types is relied upon in */ \
402 /* Object::IsExternalArray(). */ \ 404 /* Object::IsExternalArray(). */ \
403 V(EXTERNAL_INT8_ARRAY_TYPE) \ 405 V(EXTERNAL_INT8_ARRAY_TYPE) \
404 V(EXTERNAL_UINT8_ARRAY_TYPE) \ 406 V(EXTERNAL_UINT8_ARRAY_TYPE) \
405 V(EXTERNAL_INT16_ARRAY_TYPE) \ 407 V(EXTERNAL_INT16_ARRAY_TYPE) \
406 V(EXTERNAL_UINT16_ARRAY_TYPE) \ 408 V(EXTERNAL_UINT16_ARRAY_TYPE) \
(...skipping 276 matching lines...) Expand 10 before | Expand all | Expand 10 after
683 685
684 // Objects allocated in their own spaces (never in new space). 686 // Objects allocated in their own spaces (never in new space).
685 MAP_TYPE, 687 MAP_TYPE,
686 CODE_TYPE, 688 CODE_TYPE,
687 ODDBALL_TYPE, 689 ODDBALL_TYPE,
688 690
689 // "Data", objects that cannot contain non-map-word pointers to heap 691 // "Data", objects that cannot contain non-map-word pointers to heap
690 // objects. 692 // objects.
691 HEAP_NUMBER_TYPE, 693 HEAP_NUMBER_TYPE,
692 MUTABLE_HEAP_NUMBER_TYPE, 694 MUTABLE_HEAP_NUMBER_TYPE,
695 FLOAT32X4_TYPE, // FIRST_SIMD_TYPE, LAST_SIMD_TYPE
693 FOREIGN_TYPE, 696 FOREIGN_TYPE,
694 BYTE_ARRAY_TYPE, 697 BYTE_ARRAY_TYPE,
695 FREE_SPACE_TYPE, 698 FREE_SPACE_TYPE,
696 EXTERNAL_INT8_ARRAY_TYPE, // FIRST_EXTERNAL_ARRAY_TYPE 699 EXTERNAL_INT8_ARRAY_TYPE, // FIRST_EXTERNAL_ARRAY_TYPE
697 EXTERNAL_UINT8_ARRAY_TYPE, 700 EXTERNAL_UINT8_ARRAY_TYPE,
698 EXTERNAL_INT16_ARRAY_TYPE, 701 EXTERNAL_INT16_ARRAY_TYPE,
699 EXTERNAL_UINT16_ARRAY_TYPE, 702 EXTERNAL_UINT16_ARRAY_TYPE,
700 EXTERNAL_INT32_ARRAY_TYPE, 703 EXTERNAL_INT32_ARRAY_TYPE,
701 EXTERNAL_UINT32_ARRAY_TYPE, 704 EXTERNAL_UINT32_ARRAY_TYPE,
702 EXTERNAL_FLOAT32_ARRAY_TYPE, 705 EXTERNAL_FLOAT32_ARRAY_TYPE,
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
775 JS_FUNCTION_TYPE, // LAST_JS_OBJECT_TYPE, LAST_JS_RECEIVER_TYPE 778 JS_FUNCTION_TYPE, // LAST_JS_OBJECT_TYPE, LAST_JS_RECEIVER_TYPE
776 779
777 // Pseudo-types 780 // Pseudo-types
778 FIRST_TYPE = 0x0, 781 FIRST_TYPE = 0x0,
779 LAST_TYPE = JS_FUNCTION_TYPE, 782 LAST_TYPE = JS_FUNCTION_TYPE,
780 FIRST_NAME_TYPE = FIRST_TYPE, 783 FIRST_NAME_TYPE = FIRST_TYPE,
781 LAST_NAME_TYPE = SYMBOL_TYPE, 784 LAST_NAME_TYPE = SYMBOL_TYPE,
782 FIRST_UNIQUE_NAME_TYPE = INTERNALIZED_STRING_TYPE, 785 FIRST_UNIQUE_NAME_TYPE = INTERNALIZED_STRING_TYPE,
783 LAST_UNIQUE_NAME_TYPE = SYMBOL_TYPE, 786 LAST_UNIQUE_NAME_TYPE = SYMBOL_TYPE,
784 FIRST_NONSTRING_TYPE = SYMBOL_TYPE, 787 FIRST_NONSTRING_TYPE = SYMBOL_TYPE,
788 // Boundaries for testing for a SIMD type.
789 FIRST_SIMD_TYPE = FLOAT32X4_TYPE,
790 LAST_SIMD_TYPE = FLOAT32X4_TYPE,
785 // Boundaries for testing for an external array. 791 // Boundaries for testing for an external array.
786 FIRST_EXTERNAL_ARRAY_TYPE = EXTERNAL_INT8_ARRAY_TYPE, 792 FIRST_EXTERNAL_ARRAY_TYPE = EXTERNAL_INT8_ARRAY_TYPE,
787 LAST_EXTERNAL_ARRAY_TYPE = EXTERNAL_UINT8_CLAMPED_ARRAY_TYPE, 793 LAST_EXTERNAL_ARRAY_TYPE = EXTERNAL_UINT8_CLAMPED_ARRAY_TYPE,
788 // Boundaries for testing for a fixed typed array. 794 // Boundaries for testing for a fixed typed array.
789 FIRST_FIXED_TYPED_ARRAY_TYPE = FIXED_INT8_ARRAY_TYPE, 795 FIRST_FIXED_TYPED_ARRAY_TYPE = FIXED_INT8_ARRAY_TYPE,
790 LAST_FIXED_TYPED_ARRAY_TYPE = FIXED_UINT8_CLAMPED_ARRAY_TYPE, 796 LAST_FIXED_TYPED_ARRAY_TYPE = FIXED_UINT8_CLAMPED_ARRAY_TYPE,
791 // Boundary for promotion to old space. 797 // Boundary for promotion to old space.
792 LAST_DATA_TYPE = FILLER_TYPE, 798 LAST_DATA_TYPE = FILLER_TYPE,
793 // Boundary for objects represented as JSReceiver (i.e. JSObject or JSProxy). 799 // Boundary for objects represented as JSReceiver (i.e. JSObject or JSProxy).
794 // Note that there is no range for JSObject or JSProxy, since their subtypes 800 // Note that there is no range for JSObject or JSProxy, since their subtypes
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after
941 V(FixedTypedArrayBase) \ 947 V(FixedTypedArrayBase) \
942 V(FixedUint8Array) \ 948 V(FixedUint8Array) \
943 V(FixedInt8Array) \ 949 V(FixedInt8Array) \
944 V(FixedUint16Array) \ 950 V(FixedUint16Array) \
945 V(FixedInt16Array) \ 951 V(FixedInt16Array) \
946 V(FixedUint32Array) \ 952 V(FixedUint32Array) \
947 V(FixedInt32Array) \ 953 V(FixedInt32Array) \
948 V(FixedFloat32Array) \ 954 V(FixedFloat32Array) \
949 V(FixedFloat64Array) \ 955 V(FixedFloat64Array) \
950 V(FixedUint8ClampedArray) \ 956 V(FixedUint8ClampedArray) \
957 V(Float32x4) \
951 V(ByteArray) \ 958 V(ByteArray) \
952 V(FreeSpace) \ 959 V(FreeSpace) \
953 V(JSReceiver) \ 960 V(JSReceiver) \
954 V(JSObject) \ 961 V(JSObject) \
955 V(JSContextExtensionObject) \ 962 V(JSContextExtensionObject) \
956 V(JSGeneratorObject) \ 963 V(JSGeneratorObject) \
957 V(JSModule) \ 964 V(JSModule) \
958 V(LayoutDescriptor) \ 965 V(LayoutDescriptor) \
959 V(Map) \ 966 V(Map) \
960 V(DescriptorArray) \ 967 V(DescriptorArray) \
(...skipping 642 matching lines...) Expand 10 before | Expand all | Expand 10 after
1603 static const int kInfinityOrNanExponent = 1610 static const int kInfinityOrNanExponent =
1604 (kExponentMask >> kExponentShift) - kExponentBias; 1611 (kExponentMask >> kExponentShift) - kExponentBias;
1605 static const int kMantissaBitsInTopWord = 20; 1612 static const int kMantissaBitsInTopWord = 20;
1606 static const int kNonMantissaBitsInTopWord = 12; 1613 static const int kNonMantissaBitsInTopWord = 12;
1607 1614
1608 private: 1615 private:
1609 DISALLOW_IMPLICIT_CONSTRUCTORS(HeapNumber); 1616 DISALLOW_IMPLICIT_CONSTRUCTORS(HeapNumber);
1610 }; 1617 };
1611 1618
1612 1619
1620 // The Float32x4 class describes heap allocated SIMD values holding 4 32-bit
1621 // IEEE floats.
1622 class Float32x4 : public HeapObject {
1623 public:
1624 inline float get_lane(int lane) const;
1625 inline void set_lane(int lane, float value);
1626
1627 DECLARE_CAST(Float32x4)
1628
1629 // Dispatched behavior.
1630 void Float32x4Print(std::ostream& os); // NOLINT
1631 DECLARE_VERIFIER(Float32x4)
1632
1633 // Layout description.
1634 static const int kValueOffset = HeapObject::kHeaderSize;
1635 static const int kSize = kValueOffset + kSimd128Size;
1636
1637 private:
1638 DISALLOW_IMPLICIT_CONSTRUCTORS(Float32x4);
1639 };
1640
1641
1613 enum EnsureElementsMode { 1642 enum EnsureElementsMode {
1614 DONT_ALLOW_DOUBLE_ELEMENTS, 1643 DONT_ALLOW_DOUBLE_ELEMENTS,
1615 ALLOW_COPIED_DOUBLE_ELEMENTS, 1644 ALLOW_COPIED_DOUBLE_ELEMENTS,
1616 ALLOW_CONVERTED_DOUBLE_ELEMENTS 1645 ALLOW_CONVERTED_DOUBLE_ELEMENTS
1617 }; 1646 };
1618 1647
1619 1648
1620 // Indicates whether a property should be set or (re)defined. Setting of a 1649 // Indicates whether a property should be set or (re)defined. Setting of a
1621 // property causes attributes to remain unchanged, writability to be checked 1650 // property causes attributes to remain unchanged, writability to be checked
1622 // and callbacks to be called. Defining of a property causes attributes to 1651 // and callbacks to be called. Defining of a property causes attributes to
(...skipping 9524 matching lines...) Expand 10 before | Expand all | Expand 10 after
11147 } else { 11176 } else {
11148 value &= ~(1 << bit_position); 11177 value &= ~(1 << bit_position);
11149 } 11178 }
11150 return value; 11179 return value;
11151 } 11180 }
11152 }; 11181 };
11153 11182
11154 } } // namespace v8::internal 11183 } } // namespace v8::internal
11155 11184
11156 #endif // V8_OBJECTS_H_ 11185 #endif // V8_OBJECTS_H_
OLDNEW
« no previous file with comments | « src/heap/objects-visiting.cc ('k') | src/objects.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698