Update V8 to r5017 as required by WebKit r62496
Change-Id: I1b4b7718d1d77ceef07f543e9150a2cb3a628f3a
diff --git a/src/objects.h b/src/objects.h
index 0c14665..15cfd5c 100644
--- a/src/objects.h
+++ b/src/objects.h
@@ -1191,6 +1191,7 @@
// case, and a PixelArray or ExternalArray in special cases.
DECL_ACCESSORS(elements, HeapObject)
inline void initialize_elements();
+ inline Object* ResetElements();
inline ElementsKind GetElementsKind();
inline bool HasFastElements();
inline bool HasDictionaryElements();
@@ -1366,8 +1367,9 @@
// Returns the index'th element.
// The undefined object if index is out of bounds.
Object* GetElementWithReceiver(JSObject* receiver, uint32_t index);
+ Object* GetElementWithInterceptor(JSObject* receiver, uint32_t index);
- void SetFastElements(FixedArray* elements);
+ Object* SetFastElementsCapacityAndLength(int capacity, int length);
Object* SetSlowElements(Object* length);
// Lookup interceptors are used for handling properties controlled by host
@@ -1515,6 +1517,10 @@
// Casting.
static inline JSObject* cast(Object* obj);
+ // Disalow further properties to be added to the object.
+ Object* PreventExtensions();
+
+
// Dispatched behavior.
void JSObjectIterateBody(int object_size, ObjectVisitor* v);
void JSObjectShortPrint(StringStream* accumulator);
@@ -1546,6 +1552,11 @@
#endif
Object* SlowReverseLookup(Object* value);
+ // Maximal number of fast properties for the JSObject. Used to
+ // restrict the number of map transitions to avoid an explosion in
+ // the number of maps for objects used as dictionaries.
+ inline int MaxFastProperties();
+
// Maximal number of elements (numbered 0 .. kMaxElementCount - 1).
// Also maximal value of JSArray's length property.
static const uint32_t kMaxElementCount = 0xffffffffu;
@@ -1567,8 +1578,6 @@
STATIC_CHECK(kHeaderSize == Internals::kJSObjectHeaderSize);
- Object* GetElementWithInterceptor(JSObject* receiver, uint32_t index);
-
private:
Object* GetElementWithCallback(Object* receiver,
Object* structure,
@@ -2764,11 +2773,13 @@
InLoopFlag in_loop = NOT_IN_LOOP,
InlineCacheState ic_state = UNINITIALIZED,
PropertyType type = NORMAL,
- int argc = -1);
+ int argc = -1,
+ InlineCacheHolderFlag holder = OWN_MAP);
static inline Flags ComputeMonomorphicFlags(
Kind kind,
PropertyType type,
+ InlineCacheHolderFlag holder = OWN_MAP,
InLoopFlag in_loop = NOT_IN_LOOP,
int argc = -1);
@@ -2777,6 +2788,7 @@
static inline InLoopFlag ExtractICInLoopFromFlags(Flags flags);
static inline PropertyType ExtractTypeFromFlags(Flags flags);
static inline int ExtractArgumentsCountFromFlags(Flags flags);
+ static inline InlineCacheHolderFlag ExtractCacheHolderFromFlags(Flags flags);
static inline Flags RemoveTypeFromFlags(Flags flags);
// Convert a target address into a code object.
@@ -2863,16 +2875,18 @@
static const int kFlagsICInLoopShift = 3;
static const int kFlagsTypeShift = 4;
static const int kFlagsKindShift = 7;
- static const int kFlagsArgumentsCountShift = 11;
+ static const int kFlagsICHolderShift = 11;
+ static const int kFlagsArgumentsCountShift = 12;
static const int kFlagsICStateMask = 0x00000007; // 00000000111
static const int kFlagsICInLoopMask = 0x00000008; // 00000001000
static const int kFlagsTypeMask = 0x00000070; // 00001110000
static const int kFlagsKindMask = 0x00000780; // 11110000000
- static const int kFlagsArgumentsCountMask = 0xFFFFF800;
+ static const int kFlagsCacheInPrototypeMapMask = 0x00000800;
+ static const int kFlagsArgumentsCountMask = 0xFFFFF000;
static const int kFlagsNotUsedInLookup =
- (kFlagsICInLoopMask | kFlagsTypeMask);
+ (kFlagsICInLoopMask | kFlagsTypeMask | kFlagsCacheInPrototypeMapMask);
private:
DISALLOW_IMPLICIT_CONSTRUCTORS(Code);
@@ -2979,12 +2993,20 @@
return ((1 << kHasInstanceCallHandler) & bit_field()) != 0;
}
- inline void set_is_extensible() {
- set_bit_field2(bit_field2() | (1 << kIsExtensible));
+ inline void set_is_extensible(bool value);
+ inline bool is_extensible();
+
+ // Tells whether the instance has fast elements.
+ void set_has_fast_elements(bool value) {
+ if (value) {
+ set_bit_field2(bit_field2() | (1 << kHasFastElements));
+ } else {
+ set_bit_field2(bit_field2() & ~(1 << kHasFastElements));
+ }
}
- inline bool is_extensible() {
- return ((1 << kIsExtensible) & bit_field2()) != 0;
+ bool has_fast_elements() {
+ return ((1 << kHasFastElements) & bit_field2()) != 0;
}
// Tells whether the instance needs security checks when accessing its
@@ -3010,6 +3032,16 @@
// instance descriptors.
Object* CopyDropTransitions();
+ // Returns this map if it has the fast elements bit set, otherwise
+ // returns a copy of the map, with all transitions dropped from the
+ // descriptors and the fast elements bit set.
+ inline Object* GetFastElementsMap();
+
+ // Returns this map if it has the fast elements bit cleared,
+ // otherwise returns a copy of the map, with all transitions dropped
+ // from the descriptors and the fast elements bit cleared.
+ inline Object* GetSlowElementsMap();
+
// Returns the property index for name (only valid for FAST MODE).
int PropertyIndexFor(String* name);
@@ -3111,6 +3143,7 @@
// Bit positions for bit field 2
static const int kIsExtensible = 0;
static const int kFunctionWithPrototype = 1;
+ static const int kHasFastElements = 2;
// Layout of the default cache. It holds alternating name and code objects.
static const int kCodeCacheEntrySize = 2;