OLD | NEW |
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 1451 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1462 */ | 1462 */ |
1463 bool IsInt32Array() const; | 1463 bool IsInt32Array() const; |
1464 | 1464 |
1465 /** | 1465 /** |
1466 * Returns true if this value is a Float32Array. | 1466 * Returns true if this value is a Float32Array. |
1467 * This is an experimental feature. | 1467 * This is an experimental feature. |
1468 */ | 1468 */ |
1469 bool IsFloat32Array() const; | 1469 bool IsFloat32Array() const; |
1470 | 1470 |
1471 /** | 1471 /** |
| 1472 * Returns true if this value is a Float32x4Array. |
| 1473 * This is an experimental feature. |
| 1474 */ |
| 1475 bool IsFloat32x4Array() const; |
| 1476 |
| 1477 /** |
| 1478 * Returns true if this value is a Int32x4Array. |
| 1479 * This is an experimental feature. |
| 1480 */ |
| 1481 bool IsInt32x4Array() const; |
| 1482 |
| 1483 /** |
1472 * Returns true if this value is a Float64Array. | 1484 * Returns true if this value is a Float64Array. |
1473 * This is an experimental feature. | 1485 * This is an experimental feature. |
1474 */ | 1486 */ |
1475 bool IsFloat64Array() const; | 1487 bool IsFloat64Array() const; |
1476 | 1488 |
1477 /** | 1489 /** |
1478 * Returns true if this value is a DataView. | 1490 * Returns true if this value is a DataView. |
1479 * This is an experimental feature. | 1491 * This is an experimental feature. |
1480 */ | 1492 */ |
1481 bool IsDataView() const; | 1493 bool IsDataView() const; |
(...skipping 559 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2041 }; | 2053 }; |
2042 | 2054 |
2043 enum ExternalArrayType { | 2055 enum ExternalArrayType { |
2044 kExternalByteArray = 1, | 2056 kExternalByteArray = 1, |
2045 kExternalUnsignedByteArray, | 2057 kExternalUnsignedByteArray, |
2046 kExternalShortArray, | 2058 kExternalShortArray, |
2047 kExternalUnsignedShortArray, | 2059 kExternalUnsignedShortArray, |
2048 kExternalIntArray, | 2060 kExternalIntArray, |
2049 kExternalUnsignedIntArray, | 2061 kExternalUnsignedIntArray, |
2050 kExternalFloatArray, | 2062 kExternalFloatArray, |
| 2063 kExternalFloat32x4Array, |
| 2064 kExternalInt32x4Array, |
2051 kExternalDoubleArray, | 2065 kExternalDoubleArray, |
2052 kExternalPixelArray | 2066 kExternalPixelArray |
2053 }; | 2067 }; |
2054 | 2068 |
2055 /** | 2069 /** |
2056 * Accessor[Getter|Setter] are used as callback functions when | 2070 * Accessor[Getter|Setter] are used as callback functions when |
2057 * setting|getting a particular property. See Object and ObjectTemplate's | 2071 * setting|getting a particular property. See Object and ObjectTemplate's |
2058 * method SetAccessor. | 2072 * method SetAccessor. |
2059 */ | 2073 */ |
2060 typedef void (*AccessorGetterCallback)( | 2074 typedef void (*AccessorGetterCallback)( |
(...skipping 818 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2879 static Local<Float32Array> New(Handle<ArrayBuffer> array_buffer, | 2893 static Local<Float32Array> New(Handle<ArrayBuffer> array_buffer, |
2880 size_t byte_offset, size_t length); | 2894 size_t byte_offset, size_t length); |
2881 V8_INLINE static Float32Array* Cast(Value* obj); | 2895 V8_INLINE static Float32Array* Cast(Value* obj); |
2882 | 2896 |
2883 private: | 2897 private: |
2884 Float32Array(); | 2898 Float32Array(); |
2885 static void CheckCast(Value* obj); | 2899 static void CheckCast(Value* obj); |
2886 }; | 2900 }; |
2887 | 2901 |
2888 | 2902 |
| 2903 class V8_EXPORT Float32x4Array : public TypedArray { |
| 2904 public: |
| 2905 static Local<Float32x4Array> New(Handle<ArrayBuffer> array_buffer, |
| 2906 size_t byte_offset, size_t length); |
| 2907 V8_INLINE static Float32x4Array* Cast(Value* obj); |
| 2908 |
| 2909 private: |
| 2910 Float32x4Array(); |
| 2911 static void CheckCast(Value* obj); |
| 2912 }; |
| 2913 |
| 2914 |
| 2915 class V8_EXPORT Int32x4Array : public TypedArray { |
| 2916 public: |
| 2917 static Local<Int32x4Array> New(Handle<ArrayBuffer> array_buffer, |
| 2918 size_t byte_offset, size_t length); |
| 2919 V8_INLINE static Int32x4Array* Cast(Value* obj); |
| 2920 |
| 2921 private: |
| 2922 Int32x4Array(); |
| 2923 static void CheckCast(Value* obj); |
| 2924 }; |
| 2925 |
| 2926 |
2889 /** | 2927 /** |
2890 * An instance of Float64Array constructor (ES6 draft 15.13.6). | 2928 * An instance of Float64Array constructor (ES6 draft 15.13.6). |
2891 * This API is experimental and may change significantly. | 2929 * This API is experimental and may change significantly. |
2892 */ | 2930 */ |
2893 class V8_EXPORT Float64Array : public TypedArray { | 2931 class V8_EXPORT Float64Array : public TypedArray { |
2894 public: | 2932 public: |
2895 static Local<Float64Array> New(Handle<ArrayBuffer> array_buffer, | 2933 static Local<Float64Array> New(Handle<ArrayBuffer> array_buffer, |
2896 size_t byte_offset, size_t length); | 2934 size_t byte_offset, size_t length); |
2897 V8_INLINE static Float64Array* Cast(Value* obj); | 2935 V8_INLINE static Float64Array* Cast(Value* obj); |
2898 | 2936 |
(...skipping 2616 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5515 // the implementation of v8. | 5553 // the implementation of v8. |
5516 static const int kHeapObjectMapOffset = 0; | 5554 static const int kHeapObjectMapOffset = 0; |
5517 static const int kMapInstanceTypeOffset = 1 * kApiPointerSize + kApiIntSize; | 5555 static const int kMapInstanceTypeOffset = 1 * kApiPointerSize + kApiIntSize; |
5518 static const int kStringResourceOffset = 3 * kApiPointerSize; | 5556 static const int kStringResourceOffset = 3 * kApiPointerSize; |
5519 | 5557 |
5520 static const int kOddballKindOffset = 3 * kApiPointerSize; | 5558 static const int kOddballKindOffset = 3 * kApiPointerSize; |
5521 static const int kForeignAddressOffset = kApiPointerSize; | 5559 static const int kForeignAddressOffset = kApiPointerSize; |
5522 static const int kJSObjectHeaderSize = 3 * kApiPointerSize; | 5560 static const int kJSObjectHeaderSize = 3 * kApiPointerSize; |
5523 static const int kFixedArrayHeaderSize = 2 * kApiPointerSize; | 5561 static const int kFixedArrayHeaderSize = 2 * kApiPointerSize; |
5524 static const int kContextHeaderSize = 2 * kApiPointerSize; | 5562 static const int kContextHeaderSize = 2 * kApiPointerSize; |
5525 static const int kContextEmbedderDataIndex = 65; | 5563 static const int kContextEmbedderDataIndex = 71; |
5526 static const int kFullStringRepresentationMask = 0x07; | 5564 static const int kFullStringRepresentationMask = 0x07; |
5527 static const int kStringEncodingMask = 0x4; | 5565 static const int kStringEncodingMask = 0x4; |
5528 static const int kExternalTwoByteRepresentationTag = 0x02; | 5566 static const int kExternalTwoByteRepresentationTag = 0x02; |
5529 static const int kExternalAsciiRepresentationTag = 0x06; | 5567 static const int kExternalAsciiRepresentationTag = 0x06; |
5530 | 5568 |
5531 static const int kIsolateEmbedderDataOffset = 0 * kApiPointerSize; | 5569 static const int kIsolateEmbedderDataOffset = 0 * kApiPointerSize; |
5532 static const int kIsolateRootsOffset = 5 * kApiPointerSize; | 5570 static const int kIsolateRootsOffset = 5 * kApiPointerSize; |
5533 static const int kUndefinedValueRootIndex = 5; | 5571 static const int kUndefinedValueRootIndex = 5; |
5534 static const int kNullValueRootIndex = 7; | 5572 static const int kNullValueRootIndex = 7; |
5535 static const int kTrueValueRootIndex = 8; | 5573 static const int kTrueValueRootIndex = 8; |
5536 static const int kFalseValueRootIndex = 9; | 5574 static const int kFalseValueRootIndex = 9; |
5537 static const int kEmptyStringRootIndex = 134; | 5575 static const int kEmptyStringRootIndex = 140; |
5538 | 5576 |
5539 static const int kNodeClassIdOffset = 1 * kApiPointerSize; | 5577 static const int kNodeClassIdOffset = 1 * kApiPointerSize; |
5540 static const int kNodeFlagsOffset = 1 * kApiPointerSize + 3; | 5578 static const int kNodeFlagsOffset = 1 * kApiPointerSize + 3; |
5541 static const int kNodeStateMask = 0xf; | 5579 static const int kNodeStateMask = 0xf; |
5542 static const int kNodeStateIsWeakValue = 2; | 5580 static const int kNodeStateIsWeakValue = 2; |
5543 static const int kNodeStateIsPendingValue = 3; | 5581 static const int kNodeStateIsPendingValue = 3; |
5544 static const int kNodeStateIsNearDeathValue = 4; | 5582 static const int kNodeStateIsNearDeathValue = 4; |
5545 static const int kNodeIsIndependentShift = 4; | 5583 static const int kNodeIsIndependentShift = 4; |
5546 static const int kNodeIsPartiallyDependentShift = 5; | 5584 static const int kNodeIsPartiallyDependentShift = 5; |
5547 | 5585 |
5548 static const int kJSObjectType = 0xb2; | 5586 static const int kJSObjectType = 0xb6; |
5549 static const int kFirstNonstringType = 0x80; | 5587 static const int kFirstNonstringType = 0x80; |
5550 static const int kOddballType = 0x83; | 5588 static const int kOddballType = 0x83; |
5551 static const int kForeignType = 0x87; | 5589 static const int kForeignType = 0x89; |
5552 | 5590 |
5553 static const int kUndefinedOddballKind = 5; | 5591 static const int kUndefinedOddballKind = 5; |
5554 static const int kNullOddballKind = 3; | 5592 static const int kNullOddballKind = 3; |
5555 | 5593 |
5556 static const uint32_t kNumIsolateDataSlots = 4; | 5594 static const uint32_t kNumIsolateDataSlots = 4; |
5557 | 5595 |
5558 V8_EXPORT static void CheckInitializedImpl(v8::Isolate* isolate); | 5596 V8_EXPORT static void CheckInitializedImpl(v8::Isolate* isolate); |
5559 V8_INLINE static void CheckInitialized(v8::Isolate* isolate) { | 5597 V8_INLINE static void CheckInitialized(v8::Isolate* isolate) { |
5560 #ifdef V8_ENABLE_CHECKS | 5598 #ifdef V8_ENABLE_CHECKS |
5561 CheckInitializedImpl(isolate); | 5599 CheckInitializedImpl(isolate); |
(...skipping 886 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6448 | 6486 |
6449 | 6487 |
6450 Float32Array* Float32Array::Cast(v8::Value* value) { | 6488 Float32Array* Float32Array::Cast(v8::Value* value) { |
6451 #ifdef V8_ENABLE_CHECKS | 6489 #ifdef V8_ENABLE_CHECKS |
6452 CheckCast(value); | 6490 CheckCast(value); |
6453 #endif | 6491 #endif |
6454 return static_cast<Float32Array*>(value); | 6492 return static_cast<Float32Array*>(value); |
6455 } | 6493 } |
6456 | 6494 |
6457 | 6495 |
| 6496 Float32x4Array* Float32x4Array::Cast(v8::Value* value) { |
| 6497 #ifdef V8_ENABLE_CHECKS |
| 6498 CheckCast(value); |
| 6499 #endif |
| 6500 return static_cast<Float32x4Array*>(value); |
| 6501 } |
| 6502 |
| 6503 |
| 6504 Int32x4Array* Int32x4Array::Cast(v8::Value* value) { |
| 6505 #ifdef V8_ENABLE_CHECKS |
| 6506 CheckCast(value); |
| 6507 #endif |
| 6508 return static_cast<Int32x4Array*>(value); |
| 6509 } |
| 6510 |
| 6511 |
6458 Float64Array* Float64Array::Cast(v8::Value* value) { | 6512 Float64Array* Float64Array::Cast(v8::Value* value) { |
6459 #ifdef V8_ENABLE_CHECKS | 6513 #ifdef V8_ENABLE_CHECKS |
6460 CheckCast(value); | 6514 CheckCast(value); |
6461 #endif | 6515 #endif |
6462 return static_cast<Float64Array*>(value); | 6516 return static_cast<Float64Array*>(value); |
6463 } | 6517 } |
6464 | 6518 |
6465 | 6519 |
6466 Uint8ClampedArray* Uint8ClampedArray::Cast(v8::Value* value) { | 6520 Uint8ClampedArray* Uint8ClampedArray::Cast(v8::Value* value) { |
6467 #ifdef V8_ENABLE_CHECKS | 6521 #ifdef V8_ENABLE_CHECKS |
(...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6655 */ | 6709 */ |
6656 | 6710 |
6657 | 6711 |
6658 } // namespace v8 | 6712 } // namespace v8 |
6659 | 6713 |
6660 | 6714 |
6661 #undef TYPE_CHECK | 6715 #undef TYPE_CHECK |
6662 | 6716 |
6663 | 6717 |
6664 #endif // V8_H_ | 6718 #endif // V8_H_ |
OLD | NEW |