| Index: src/objects.h
|
| diff --git a/src/objects.h b/src/objects.h
|
| index 756631068e719d0345e1889f9b2f63ff367237e8..680e0cd529ce5eb26ab3d0a79be6514ad8c61fae 100644
|
| --- a/src/objects.h
|
| +++ b/src/objects.h
|
| @@ -119,6 +119,8 @@
|
| // - ExternalTwoByteInternalizedString
|
| // - Symbol
|
| // - HeapNumber
|
| +// - Cell
|
| +// - JSGlobalPropertyCell
|
| // - Code
|
| // - Map
|
| // - Oddball
|
| @@ -348,7 +350,8 @@ const int kStubMinorKeyBits = kBitsPerInt - kSmiTagSize - kStubMajorKeyBits;
|
| V(MAP_TYPE) \
|
| V(CODE_TYPE) \
|
| V(ODDBALL_TYPE) \
|
| - V(JS_GLOBAL_PROPERTY_CELL_TYPE) \
|
| + V(CELL_TYPE) \
|
| + V(PROPERTY_CELL_TYPE) \
|
| V(BOX_TYPE) \
|
| \
|
| V(HEAP_NUMBER_TYPE) \
|
| @@ -669,7 +672,8 @@ enum InstanceType {
|
| MAP_TYPE,
|
| CODE_TYPE,
|
| ODDBALL_TYPE,
|
| - JS_GLOBAL_PROPERTY_CELL_TYPE,
|
| + CELL_TYPE,
|
| + PROPERTY_CELL_TYPE,
|
| BOX_TYPE,
|
|
|
| // "Data", objects that cannot contain non-map-word pointers to heap
|
| @@ -841,6 +845,7 @@ class Failure;
|
| class FixedArrayBase;
|
| class ObjectVisitor;
|
| class StringStream;
|
| +class Type;
|
|
|
| struct ValueInfo : public Malloced {
|
| ValueInfo() : type(FIRST_TYPE), ptr(NULL), str(NULL), number(0) { }
|
| @@ -1011,6 +1016,7 @@ class MaybeObject BASE_EMBEDDED {
|
| V(JSGlobalProxy) \
|
| V(UndetectableObject) \
|
| V(AccessCheckNeeded) \
|
| + V(Cell) \
|
| V(JSGlobalPropertyCell) \
|
| V(ObjectHashTable) \
|
|
|
| @@ -4378,6 +4384,7 @@ class DeoptimizationOutputData: public FixedArray {
|
|
|
|
|
| // Forward declaration.
|
| +class Cell;
|
| class JSGlobalPropertyCell;
|
|
|
| // TypeFeedbackCells is a fixed array used to hold the association between
|
| @@ -4395,8 +4402,8 @@ class TypeFeedbackCells: public FixedArray {
|
| inline void SetAstId(int index, TypeFeedbackId id);
|
|
|
| // Accessors for global property cells holding the cache values.
|
| - inline JSGlobalPropertyCell* Cell(int index);
|
| - inline void SetCell(int index, JSGlobalPropertyCell* cell);
|
| + inline Cell* GetCell(int index);
|
| + inline void SetCell(int index, Cell* cell);
|
|
|
| // The object that indicates an uninitialized cache.
|
| static inline Handle<Object> UninitializedSentinel(Isolate* isolate);
|
| @@ -5403,7 +5410,7 @@ class Map: public HeapObject {
|
| set_bit_field3(NumberOfOwnDescriptorsBits::update(bit_field3(), number));
|
| }
|
|
|
| - inline JSGlobalPropertyCell* RetrieveDescriptorsPointer();
|
| + inline Cell* RetrieveDescriptorsPointer();
|
|
|
| int EnumLength() {
|
| return EnumLengthBits::decode(bit_field3());
|
| @@ -8557,16 +8564,18 @@ class Oddball: public HeapObject {
|
| };
|
|
|
|
|
| -class JSGlobalPropertyCell: public HeapObject {
|
| +class Cell: public HeapObject {
|
| public:
|
| // [value]: value of the global property.
|
| DECL_ACCESSORS(value, Object)
|
|
|
| // Casting.
|
| - static inline JSGlobalPropertyCell* cast(Object* obj);
|
| + static inline Cell* cast(Object* obj);
|
|
|
| - static inline JSGlobalPropertyCell* FromValueAddress(Address value) {
|
| - return cast(FromAddress(value - kValueOffset));
|
| + static inline Cell* FromValueAddress(Address value) {
|
| + Object* result = FromAddress(value - kValueOffset);
|
| + ASSERT(result->IsCell() || result->IsJSGlobalPropertyCell());
|
| + return static_cast<Cell*>(result);
|
| }
|
|
|
| inline Address ValueAddress() {
|
| @@ -8574,8 +8583,8 @@ class JSGlobalPropertyCell: public HeapObject {
|
| }
|
|
|
| // Dispatched behavior.
|
| - DECLARE_PRINTER(JSGlobalPropertyCell)
|
| - DECLARE_VERIFIER(JSGlobalPropertyCell)
|
| + DECLARE_PRINTER(Cell)
|
| + DECLARE_VERIFIER(Cell)
|
|
|
| // Layout description.
|
| static const int kValueOffset = HeapObject::kHeaderSize;
|
| @@ -8586,6 +8595,37 @@ class JSGlobalPropertyCell: public HeapObject {
|
| kSize> BodyDescriptor;
|
|
|
| private:
|
| + DISALLOW_IMPLICIT_CONSTRUCTORS(Cell);
|
| +};
|
| +
|
| +
|
| +class JSGlobalPropertyCell: public Cell {
|
| + public:
|
| + Type* type();
|
| + void set_type(Type* value, WriteBarrierMode mode = UPDATE_WRITE_BARRIER);
|
| +
|
| + // Casting.
|
| + static inline JSGlobalPropertyCell* cast(Object* obj);
|
| +
|
| + inline Address TypeAddress() {
|
| + return address() + kTypeOffset;
|
| + }
|
| +
|
| + // Dispatched behavior.
|
| + DECLARE_PRINTER(JSGlobalPropertyCell)
|
| + DECLARE_VERIFIER(JSGlobalPropertyCell)
|
| +
|
| + // Layout description.
|
| + static const int kTypeOffset = kValueOffset + kPointerSize;
|
| + static const int kSize = kTypeOffset + kPointerSize;
|
| +
|
| + typedef FixedBodyDescriptor<
|
| + kValueOffset,
|
| + kTypeOffset + kPointerSize,
|
| + JSGlobalPropertyCell::kSize> BodyDescriptor;
|
| +
|
| + private:
|
| + DECL_ACCESSORS(type_raw, Object)
|
| DISALLOW_IMPLICIT_CONSTRUCTORS(JSGlobalPropertyCell);
|
| };
|
|
|
| @@ -9605,7 +9645,7 @@ class ObjectVisitor BASE_EMBEDDED {
|
| virtual void VisitCodeEntry(Address entry_address);
|
|
|
| // Visits a global property cell reference in the instruction stream.
|
| - virtual void VisitGlobalPropertyCell(RelocInfo* rinfo);
|
| + virtual void VisitCell(RelocInfo* rinfo);
|
|
|
| // Visits a runtime entry in the instruction stream.
|
| virtual void VisitRuntimeEntry(RelocInfo* rinfo) {}
|
|
|