| OLD | NEW |
| 1 // Copyright 2015 the V8 project authors. All rights reserved. | 1 // Copyright 2015 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef V8_OBJECTS_H_ | 5 #ifndef V8_OBJECTS_H_ |
| 6 #define V8_OBJECTS_H_ | 6 #define V8_OBJECTS_H_ |
| 7 | 7 |
| 8 #include <iosfwd> | 8 #include <iosfwd> |
| 9 | 9 |
| 10 #include "src/allocation.h" | 10 #include "src/allocation.h" |
| (...skipping 2541 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2552 Handle<JSObject> object, ShouldThrow should_throw); | 2552 Handle<JSObject> object, ShouldThrow should_throw); |
| 2553 | 2553 |
| 2554 MUST_USE_RESULT static Maybe<bool> SetPrototypeUnobserved( | 2554 MUST_USE_RESULT static Maybe<bool> SetPrototypeUnobserved( |
| 2555 Handle<JSObject> object, Handle<Object> value, bool from_javascript, | 2555 Handle<JSObject> object, Handle<Object> value, bool from_javascript, |
| 2556 ShouldThrow should_throw); | 2556 ShouldThrow should_throw); |
| 2557 | 2557 |
| 2558 DISALLOW_IMPLICIT_CONSTRUCTORS(JSObject); | 2558 DISALLOW_IMPLICIT_CONSTRUCTORS(JSObject); |
| 2559 }; | 2559 }; |
| 2560 | 2560 |
| 2561 | 2561 |
| 2562 // JSAccessorPropertyDescriptor is just a JSObject with a specific initial | |
| 2563 // map. This initial map adds in-object properties for "get", "set", | |
| 2564 // "enumerable" and "configurable" properties, as assigned by the | |
| 2565 // FromPropertyDescriptor function for regular accessor properties. | |
| 2566 class JSAccessorPropertyDescriptor: public JSObject { | |
| 2567 public: | |
| 2568 // Offsets of object fields. | |
| 2569 static const int kGetOffset = JSObject::kHeaderSize; | |
| 2570 static const int kSetOffset = kGetOffset + kPointerSize; | |
| 2571 static const int kEnumerableOffset = kSetOffset + kPointerSize; | |
| 2572 static const int kConfigurableOffset = kEnumerableOffset + kPointerSize; | |
| 2573 static const int kSize = kConfigurableOffset + kPointerSize; | |
| 2574 // Indices of in-object properties. | |
| 2575 static const int kGetIndex = 0; | |
| 2576 static const int kSetIndex = 1; | |
| 2577 static const int kEnumerableIndex = 2; | |
| 2578 static const int kConfigurableIndex = 3; | |
| 2579 | |
| 2580 private: | |
| 2581 DISALLOW_IMPLICIT_CONSTRUCTORS(JSAccessorPropertyDescriptor); | |
| 2582 }; | |
| 2583 | |
| 2584 | |
| 2585 // JSDataPropertyDescriptor is just a JSObject with a specific initial map. | |
| 2586 // This initial map adds in-object properties for "value", "writable", | |
| 2587 // "enumerable" and "configurable" properties, as assigned by the | |
| 2588 // FromPropertyDescriptor function for regular data properties. | |
| 2589 class JSDataPropertyDescriptor: public JSObject { | |
| 2590 public: | |
| 2591 // Offsets of object fields. | |
| 2592 static const int kValueOffset = JSObject::kHeaderSize; | |
| 2593 static const int kWritableOffset = kValueOffset + kPointerSize; | |
| 2594 static const int kEnumerableOffset = kWritableOffset + kPointerSize; | |
| 2595 static const int kConfigurableOffset = kEnumerableOffset + kPointerSize; | |
| 2596 static const int kSize = kConfigurableOffset + kPointerSize; | |
| 2597 // Indices of in-object properties. | |
| 2598 static const int kValueIndex = 0; | |
| 2599 static const int kWritableIndex = 1; | |
| 2600 static const int kEnumerableIndex = 2; | |
| 2601 static const int kConfigurableIndex = 3; | |
| 2602 | |
| 2603 private: | |
| 2604 DISALLOW_IMPLICIT_CONSTRUCTORS(JSDataPropertyDescriptor); | |
| 2605 }; | |
| 2606 | |
| 2607 | |
| 2608 // Common superclass for FixedArrays that allow implementations to share | 2562 // Common superclass for FixedArrays that allow implementations to share |
| 2609 // common accessors and some code paths. | 2563 // common accessors and some code paths. |
| 2610 class FixedArrayBase: public HeapObject { | 2564 class FixedArrayBase: public HeapObject { |
| 2611 public: | 2565 public: |
| 2612 // [length]: length of the array. | 2566 // [length]: length of the array. |
| 2613 inline int length() const; | 2567 inline int length() const; |
| 2614 inline void set_length(int value); | 2568 inline void set_length(int value); |
| 2615 | 2569 |
| 2616 // Get and set the length using acquire loads and release stores. | 2570 // Get and set the length using acquire loads and release stores. |
| 2617 inline int synchronized_length() const; | 2571 inline int synchronized_length() const; |
| (...skipping 8158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 10776 } | 10730 } |
| 10777 return value; | 10731 return value; |
| 10778 } | 10732 } |
| 10779 }; | 10733 }; |
| 10780 | 10734 |
| 10781 | 10735 |
| 10782 } // NOLINT, false-positive due to second-order macros. | 10736 } // NOLINT, false-positive due to second-order macros. |
| 10783 } // NOLINT, false-positive due to second-order macros. | 10737 } // NOLINT, false-positive due to second-order macros. |
| 10784 | 10738 |
| 10785 #endif // V8_OBJECTS_H_ | 10739 #endif // V8_OBJECTS_H_ |
| OLD | NEW |