| Index: src/objects.h
|
| diff --git a/src/objects.h b/src/objects.h
|
| index a3d214bcb340862fac05f5971799d12db91dbe78..7183fa5bf35e319ce01023aabc67b36fc031a87c 100644
|
| --- a/src/objects.h
|
| +++ b/src/objects.h
|
| @@ -388,6 +388,17 @@ const int kStubMinorKeyBits = kBitsPerInt - kSmiTagSize - kStubMajorKeyBits;
|
| V(EXTERNAL_FLOAT_ARRAY_TYPE) \
|
| V(EXTERNAL_DOUBLE_ARRAY_TYPE) \
|
| V(EXTERNAL_PIXEL_ARRAY_TYPE) \
|
| + \
|
| + V(FIXED_INT8_ARRAY_TYPE) \
|
| + V(FIXED_UINT8_ARRAY_TYPE) \
|
| + V(FIXED_INT16_ARRAY_TYPE) \
|
| + V(FIXED_UINT16_ARRAY_TYPE) \
|
| + V(FIXED_INT32_ARRAY_TYPE) \
|
| + V(FIXED_UINT32_ARRAY_TYPE) \
|
| + V(FIXED_FLOAT32_ARRAY_TYPE) \
|
| + V(FIXED_FLOAT64_ARRAY_TYPE) \
|
| + V(FIXED_UINT8_CLAMPED_ARRAY_TYPE) \
|
| + \
|
| V(FILLER_TYPE) \
|
| \
|
| V(DECLARED_ACCESSOR_DESCRIPTOR_TYPE) \
|
| @@ -722,6 +733,17 @@ enum InstanceType {
|
| EXTERNAL_FLOAT_ARRAY_TYPE,
|
| EXTERNAL_DOUBLE_ARRAY_TYPE,
|
| EXTERNAL_PIXEL_ARRAY_TYPE, // LAST_EXTERNAL_ARRAY_TYPE
|
| +
|
| + FIXED_INT8_ARRAY_TYPE, // FIRST_FIXED_TYPED_ARRAY_TYPE
|
| + FIXED_UINT8_ARRAY_TYPE,
|
| + FIXED_INT16_ARRAY_TYPE,
|
| + FIXED_UINT16_ARRAY_TYPE,
|
| + FIXED_INT32_ARRAY_TYPE,
|
| + FIXED_UINT32_ARRAY_TYPE,
|
| + FIXED_FLOAT32_ARRAY_TYPE,
|
| + FIXED_FLOAT64_ARRAY_TYPE,
|
| + FIXED_UINT8_CLAMPED_ARRAY_TYPE, // LAST_FIXED_TYPED_ARRAY_TYPE
|
| +
|
| FIXED_DOUBLE_ARRAY_TYPE,
|
| FILLER_TYPE, // LAST_DATA_TYPE
|
|
|
| @@ -799,6 +821,9 @@ enum InstanceType {
|
| // Boundaries for testing for an external array.
|
| FIRST_EXTERNAL_ARRAY_TYPE = EXTERNAL_BYTE_ARRAY_TYPE,
|
| LAST_EXTERNAL_ARRAY_TYPE = EXTERNAL_PIXEL_ARRAY_TYPE,
|
| + // Boundaries for testing for a fixed typed array.
|
| + FIRST_FIXED_TYPED_ARRAY_TYPE = FIXED_INT8_ARRAY_TYPE,
|
| + LAST_FIXED_TYPED_ARRAY_TYPE = FIXED_UINT8_CLAMPED_ARRAY_TYPE,
|
| // Boundary for promotion to old data space/old pointer space.
|
| LAST_DATA_TYPE = FILLER_TYPE,
|
| // Boundary for objects represented as JSReceiver (i.e. JSObject or JSProxy).
|
| @@ -883,10 +908,10 @@ class FixedArrayBase;
|
| class GlobalObject;
|
| class ObjectVisitor;
|
| class StringStream;
|
| -// We cannot just say "class Type;" if it is created from a template... =8-?
|
| +// We cannot just say "class HeapType;" if it is created from a template... =8-?
|
| template<class> class TypeImpl;
|
| struct HeapTypeConfig;
|
| -typedef TypeImpl<HeapTypeConfig> Type;
|
| +typedef TypeImpl<HeapTypeConfig> HeapType;
|
|
|
|
|
| // A template-ized version of the IsXXX functions.
|
| @@ -991,6 +1016,16 @@ class MaybeObject BASE_EMBEDDED {
|
| V(ExternalFloatArray) \
|
| V(ExternalDoubleArray) \
|
| V(ExternalPixelArray) \
|
| + V(FixedTypedArrayBase) \
|
| + V(FixedUint8Array) \
|
| + V(FixedInt8Array) \
|
| + V(FixedUint16Array) \
|
| + V(FixedInt16Array) \
|
| + V(FixedUint32Array) \
|
| + V(FixedInt32Array) \
|
| + V(FixedFloat32Array) \
|
| + V(FixedFloat64Array) \
|
| + V(FixedUint8ClampedArray) \
|
| V(ByteArray) \
|
| V(FreeSpace) \
|
| V(JSReceiver) \
|
| @@ -2150,6 +2185,7 @@ class JSObject: public JSReceiver {
|
| inline bool HasFastHoleyElements();
|
| inline bool HasNonStrictArgumentsElements();
|
| inline bool HasDictionaryElements();
|
| +
|
| inline bool HasExternalPixelElements();
|
| inline bool HasExternalArrayElements();
|
| inline bool HasExternalByteElements();
|
| @@ -2160,6 +2196,9 @@ class JSObject: public JSReceiver {
|
| inline bool HasExternalUnsignedIntElements();
|
| inline bool HasExternalFloatElements();
|
| inline bool HasExternalDoubleElements();
|
| +
|
| + inline bool HasFixedTypedArrayElements();
|
| +
|
| bool HasFastArgumentsElements();
|
| bool HasDictionaryArgumentsElements();
|
| inline SeededNumberDictionary* element_dictionary(); // Gets slow elements.
|
| @@ -2982,6 +3021,9 @@ class FixedArray: public FixedArrayBase {
|
| // Gives access to raw memory which stores the array's data.
|
| inline Object** data_start();
|
|
|
| + // Shrink length and insert filler objects.
|
| + void Shrink(int length);
|
| +
|
| // Copy operations.
|
| MUST_USE_RESULT inline MaybeObject* Copy();
|
| MUST_USE_RESULT MaybeObject* CopySize(int new_length,
|
| @@ -3769,21 +3811,8 @@ class StringTable: public HashTable<StringTableShape, HashTableKey*> {
|
| // added. The return value is the string table which might have
|
| // been enlarged. If the return value is not a failure, the string
|
| // pointer *s is set to the string found.
|
| - MUST_USE_RESULT MaybeObject* LookupUtf8String(
|
| - Vector<const char> str,
|
| - Object** s);
|
| - MUST_USE_RESULT MaybeObject* LookupOneByteString(
|
| - Vector<const uint8_t> str,
|
| - Object** s);
|
| - MUST_USE_RESULT MaybeObject* LookupSubStringOneByteString(
|
| - Handle<SeqOneByteString> str,
|
| - int from,
|
| - int length,
|
| - Object** s);
|
| - MUST_USE_RESULT MaybeObject* LookupTwoByteString(
|
| - Vector<const uc16> str,
|
| - Object** s);
|
| MUST_USE_RESULT MaybeObject* LookupString(String* key, Object** s);
|
| + MUST_USE_RESULT MaybeObject* LookupKey(HashTableKey* key, Object** s);
|
|
|
| // Looks up a string that is equal to the given string and returns
|
| // true if it is found, assigning the string to the given output
|
| @@ -3795,8 +3824,6 @@ class StringTable: public HashTable<StringTableShape, HashTableKey*> {
|
| static inline StringTable* cast(Object* obj);
|
|
|
| private:
|
| - MUST_USE_RESULT MaybeObject* LookupKey(HashTableKey* key, Object** s);
|
| -
|
| template <bool seq_ascii> friend class JsonParser;
|
|
|
| DISALLOW_IMPLICIT_CONSTRUCTORS(StringTable);
|
| @@ -4869,6 +4896,76 @@ class ExternalDoubleArray: public ExternalArray {
|
| };
|
|
|
|
|
| +class FixedTypedArrayBase: public FixedArrayBase {
|
| + public:
|
| + // Casting:
|
| + static inline FixedTypedArrayBase* cast(Object* obj);
|
| +
|
| + static const int kDataOffset = kHeaderSize;
|
| +
|
| + inline int size();
|
| +
|
| + private:
|
| + DISALLOW_IMPLICIT_CONSTRUCTORS(FixedTypedArrayBase);
|
| +};
|
| +
|
| +
|
| +template <class Traits>
|
| +class FixedTypedArray: public FixedTypedArrayBase {
|
| + public:
|
| + typedef typename Traits::ElementType ElementType;
|
| + static const InstanceType kInstanceType = Traits::kInstanceType;
|
| +
|
| + // Casting:
|
| + static inline FixedTypedArray<Traits>* cast(Object* obj);
|
| +
|
| + static inline int SizeFor(int length) {
|
| + return kDataOffset + length * sizeof(ElementType);
|
| + }
|
| +
|
| + inline ElementType get_scalar(int index);
|
| + MUST_USE_RESULT inline MaybeObject* get(int index);
|
| + inline void set(int index, ElementType value);
|
| +
|
| + // This accessor applies the correct conversion from Smi, HeapNumber
|
| + // and undefined.
|
| + MUST_USE_RESULT MaybeObject* SetValue(uint32_t index, Object* value);
|
| +
|
| + static Handle<Object> SetValue(Handle<FixedTypedArray<Traits> > array,
|
| + uint32_t index,
|
| + Handle<Object> value);
|
| +
|
| + DECLARE_PRINTER(FixedTypedArray)
|
| + DECLARE_VERIFIER(FixedTypedArray)
|
| +
|
| + private:
|
| + DISALLOW_IMPLICIT_CONSTRUCTORS(FixedTypedArray);
|
| +};
|
| +
|
| +#define FIXED_TYPED_ARRAY_TRAITS(Type, type, TYPE, elementType) \
|
| + class Type##ArrayTraits { \
|
| + public: \
|
| + typedef elementType ElementType; \
|
| + static const InstanceType kInstanceType = FIXED_##TYPE##_ARRAY_TYPE; \
|
| + static const char* Designator() { return #type " array"; } \
|
| + static inline MaybeObject* ToObject(Heap* heap, elementType scalar); \
|
| + static elementType defaultValue() { return 0; } \
|
| + }; \
|
| + \
|
| + typedef FixedTypedArray<Type##ArrayTraits> Fixed##Type##Array;
|
| +
|
| +FIXED_TYPED_ARRAY_TRAITS(Uint8, uint8, UINT8, uint8_t)
|
| +FIXED_TYPED_ARRAY_TRAITS(Int8, int8, INT8, int8_t)
|
| +FIXED_TYPED_ARRAY_TRAITS(Uint16, uint16, UINT16, uint16_t)
|
| +FIXED_TYPED_ARRAY_TRAITS(Int16, int16, INT16, int16_t)
|
| +FIXED_TYPED_ARRAY_TRAITS(Uint32, uint32, UINT32, uint32_t)
|
| +FIXED_TYPED_ARRAY_TRAITS(Int32, int32, INT32, int32_t)
|
| +FIXED_TYPED_ARRAY_TRAITS(Float32, float32, FLOAT32, float)
|
| +FIXED_TYPED_ARRAY_TRAITS(Float64, float64, FLOAT64, double)
|
| +FIXED_TYPED_ARRAY_TRAITS(Uint8Clamped, uint8_clamped, UINT8_CLAMPED, uint8_t)
|
| +
|
| +#undef FIXED_TYPED_ARRAY_TRAITS
|
| +
|
| // DeoptimizationInputData is a fixed array used to hold the deoptimization
|
| // data for code generated by the Hydrogen/Lithium compiler. It also
|
| // contains information about functions that were inlined. If N different
|
| @@ -5181,7 +5278,6 @@ class Code: public HeapObject {
|
| kind == BINARY_OP_IC;
|
| }
|
|
|
| - bool IsContextual(); // Only valid for IC stubs.
|
| inline StubType type(); // Only valid for monomorphic IC stubs.
|
| inline int arguments_count(); // Only valid for call IC stubs.
|
|
|
| @@ -5878,6 +5974,10 @@ class Map: public HeapObject {
|
| return IsExternalArrayElementsKind(elements_kind());
|
| }
|
|
|
| + inline bool has_fixed_typed_array_elements() {
|
| + return IsFixedTypedArrayElementsKind(elements_kind());
|
| + }
|
| +
|
| inline bool has_dictionary_elements() {
|
| return IsDictionaryElementsKind(elements_kind());
|
| }
|
| @@ -9455,8 +9555,8 @@ class Cell: public HeapObject {
|
| class PropertyCell: public Cell {
|
| public:
|
| // [type]: type of the global property.
|
| - Type* type();
|
| - void set_type(Type* value, WriteBarrierMode mode = UPDATE_WRITE_BARRIER);
|
| + HeapType* type();
|
| + void set_type(HeapType* value, WriteBarrierMode mode = UPDATE_WRITE_BARRIER);
|
|
|
| // [dependent_code]: dependent code that depends on the type of the global
|
| // property.
|
| @@ -9471,8 +9571,8 @@ class PropertyCell: public Cell {
|
|
|
| // Computes the new type of the cell's contents for the given value, but
|
| // without actually modifying the 'type' field.
|
| - static Handle<Type> UpdatedType(Handle<PropertyCell> cell,
|
| - Handle<Object> value);
|
| + static Handle<HeapType> UpdatedType(Handle<PropertyCell> cell,
|
| + Handle<Object> value);
|
|
|
| void AddDependentCompilationInfo(CompilationInfo* info);
|
|
|
|
|