| Index: src/objects.h
|
| ===================================================================
|
| --- src/objects.h (revision 6170)
|
| +++ src/objects.h (working copy)
|
| @@ -1446,11 +1446,15 @@
|
| bool HasElementWithInterceptor(JSObject* receiver, uint32_t index);
|
| bool HasElementPostInterceptor(JSObject* receiver, uint32_t index);
|
|
|
| - MUST_USE_RESULT MaybeObject* SetFastElement(uint32_t index, Object* value);
|
| + MUST_USE_RESULT MaybeObject* SetFastElement(uint32_t index,
|
| + Object* value,
|
| + bool check_prototype = true);
|
|
|
| // Set the index'th array element.
|
| // A Failure object is returned if GC is needed.
|
| - MUST_USE_RESULT MaybeObject* SetElement(uint32_t index, Object* value);
|
| + MUST_USE_RESULT MaybeObject* SetElement(uint32_t index,
|
| + Object* value,
|
| + bool check_prototype = true);
|
|
|
| // Returns the index'th element.
|
| // The undefined object if index is out of bounds.
|
| @@ -1704,9 +1708,12 @@
|
| Object* value,
|
| JSObject* holder);
|
| MUST_USE_RESULT MaybeObject* SetElementWithInterceptor(uint32_t index,
|
| - Object* value);
|
| - MUST_USE_RESULT MaybeObject* SetElementWithoutInterceptor(uint32_t index,
|
| - Object* value);
|
| + Object* value,
|
| + bool check_prototype);
|
| + MUST_USE_RESULT MaybeObject* SetElementWithoutInterceptor(
|
| + uint32_t index,
|
| + Object* value,
|
| + bool check_prototype);
|
|
|
| MaybeObject* GetElementPostInterceptor(JSObject* receiver, uint32_t index);
|
|
|
| @@ -2268,6 +2275,10 @@
|
| // been enlarged. If the return value is not a failure, the symbol
|
| // pointer *s is set to the symbol found.
|
| MUST_USE_RESULT MaybeObject* LookupSymbol(Vector<const char> str, Object** s);
|
| + MUST_USE_RESULT MaybeObject* LookupAsciiSymbol(Vector<const char> str,
|
| + Object** s);
|
| + MUST_USE_RESULT MaybeObject* LookupTwoByteSymbol(Vector<const uc16> str,
|
| + Object** s);
|
| MUST_USE_RESULT MaybeObject* LookupString(String* key, Object** s);
|
|
|
| // Looks up a symbol that is equal to the given string and returns
|
| @@ -5015,6 +5026,8 @@
|
| // String equality operations.
|
| inline bool Equals(String* other);
|
| bool IsEqualTo(Vector<const char> str);
|
| + bool IsAsciiEqualTo(Vector<const char> str);
|
| + bool IsTwoByteEqualTo(Vector<const uc16> str);
|
|
|
| // Return a UTF8 representation of the string. The string is null
|
| // terminated but may optionally contain nulls. Length is returned
|
| @@ -5186,6 +5199,34 @@
|
| int from,
|
| int to);
|
|
|
| + static inline bool IsAscii(const char* chars, int length) {
|
| + const char* limit = chars + length;
|
| +#ifdef V8_HOST_CAN_READ_UNALIGNED
|
| + ASSERT(kMaxAsciiCharCode == 0x7F);
|
| + const uintptr_t non_ascii_mask = kUintptrAllBitsSet / 0xFF * 0x80;
|
| + while (chars <= limit - sizeof(uintptr_t)) {
|
| + if (*reinterpret_cast<const uintptr_t*>(chars) & non_ascii_mask) {
|
| + return false;
|
| + }
|
| + chars += sizeof(uintptr_t);
|
| + }
|
| +#endif
|
| + while (chars < limit) {
|
| + if (static_cast<uint8_t>(*chars) > kMaxAsciiCharCodeU) return false;
|
| + ++chars;
|
| + }
|
| + return true;
|
| + }
|
| +
|
| + static inline bool IsAscii(const uc16* chars, int length) {
|
| + const uc16* limit = chars + length;
|
| + while (chars < limit) {
|
| + if (*chars > kMaxAsciiCharCodeU) return false;
|
| + ++chars;
|
| + }
|
| + return true;
|
| + }
|
| +
|
| protected:
|
| class ReadBlockBuffer {
|
| public:
|
|
|