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 2588 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2599 static const int kWritableIndex = 1; | 2599 static const int kWritableIndex = 1; |
2600 static const int kEnumerableIndex = 2; | 2600 static const int kEnumerableIndex = 2; |
2601 static const int kConfigurableIndex = 3; | 2601 static const int kConfigurableIndex = 3; |
2602 | 2602 |
2603 private: | 2603 private: |
2604 DISALLOW_IMPLICIT_CONSTRUCTORS(JSDataPropertyDescriptor); | 2604 DISALLOW_IMPLICIT_CONSTRUCTORS(JSDataPropertyDescriptor); |
2605 }; | 2605 }; |
2606 | 2606 |
2607 | 2607 |
2608 // JSIteratorResult is just a JSObject with a specific initial map. | 2608 // JSIteratorResult is just a JSObject with a specific initial map. |
2609 // This initial map adds in-object properties for "done" and "value, | 2609 // This initial map adds in-object properties for "done" and "value", |
2610 // as specified by ES6 section 25.1.1.3 The IteratorResult Interface | 2610 // as specified by ES6 section 25.1.1.3 The IteratorResult Interface |
2611 class JSIteratorResult: public JSObject { | 2611 class JSIteratorResult: public JSObject { |
2612 public: | 2612 public: |
2613 // Offsets of object fields. | 2613 // Offsets of object fields. |
2614 static const int kValueOffset = JSObject::kHeaderSize; | 2614 static const int kValueOffset = JSObject::kHeaderSize; |
2615 static const int kDoneOffset = kValueOffset + kPointerSize; | 2615 static const int kDoneOffset = kValueOffset + kPointerSize; |
2616 static const int kSize = kDoneOffset + kPointerSize; | 2616 static const int kSize = kDoneOffset + kPointerSize; |
2617 // Indices of in-object properties. | 2617 // Indices of in-object properties. |
2618 static const int kValueIndex = 0; | 2618 static const int kValueIndex = 0; |
2619 static const int kDoneIndex = 1; | 2619 static const int kDoneIndex = 1; |
2620 | 2620 |
2621 private: | 2621 private: |
2622 DISALLOW_IMPLICIT_CONSTRUCTORS(JSIteratorResult); | 2622 DISALLOW_IMPLICIT_CONSTRUCTORS(JSIteratorResult); |
2623 }; | 2623 }; |
2624 | 2624 |
2625 | 2625 |
| 2626 // Common superclass for JSSloppyArgumentsObject and JSStrictArgumentsObject. |
| 2627 class JSArgumentsObject: public JSObject { |
| 2628 public: |
| 2629 // Offsets of object fields. |
| 2630 static const int kLengthOffset = JSObject::kHeaderSize; |
| 2631 static const int kHeaderSize = kLengthOffset + kPointerSize; |
| 2632 // Indices of in-object properties. |
| 2633 static const int kLengthIndex = 0; |
| 2634 |
| 2635 private: |
| 2636 DISALLOW_IMPLICIT_CONSTRUCTORS(JSArgumentsObject); |
| 2637 }; |
| 2638 |
| 2639 |
| 2640 // JSSloppyArgumentsObject is just a JSObject with specific initial map. |
| 2641 // This initial map adds in-object properties for "length" and "callee". |
| 2642 class JSSloppyArgumentsObject: public JSArgumentsObject { |
| 2643 public: |
| 2644 // Offsets of object fields. |
| 2645 static const int kCalleeOffset = JSArgumentsObject::kHeaderSize; |
| 2646 static const int kSize = kCalleeOffset + kPointerSize; |
| 2647 // Indices of in-object properties. |
| 2648 static const int kCalleeIndex = 1; |
| 2649 |
| 2650 private: |
| 2651 DISALLOW_IMPLICIT_CONSTRUCTORS(JSSloppyArgumentsObject); |
| 2652 }; |
| 2653 |
| 2654 |
| 2655 // JSStrictArgumentsObject is just a JSObject with specific initial map. |
| 2656 // This initial map adds an in-object property for "length". |
| 2657 class JSStrictArgumentsObject: public JSArgumentsObject { |
| 2658 public: |
| 2659 // Offsets of object fields. |
| 2660 static const int kSize = JSArgumentsObject::kHeaderSize; |
| 2661 |
| 2662 private: |
| 2663 DISALLOW_IMPLICIT_CONSTRUCTORS(JSStrictArgumentsObject); |
| 2664 }; |
| 2665 |
| 2666 |
2626 // Common superclass for FixedArrays that allow implementations to share | 2667 // Common superclass for FixedArrays that allow implementations to share |
2627 // common accessors and some code paths. | 2668 // common accessors and some code paths. |
2628 class FixedArrayBase: public HeapObject { | 2669 class FixedArrayBase: public HeapObject { |
2629 public: | 2670 public: |
2630 // [length]: length of the array. | 2671 // [length]: length of the array. |
2631 inline int length() const; | 2672 inline int length() const; |
2632 inline void set_length(int value); | 2673 inline void set_length(int value); |
2633 | 2674 |
2634 // Get and set the length using acquire loads and release stores. | 2675 // Get and set the length using acquire loads and release stores. |
2635 inline int synchronized_length() const; | 2676 inline int synchronized_length() const; |
(...skipping 8172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
10808 } | 10849 } |
10809 return value; | 10850 return value; |
10810 } | 10851 } |
10811 }; | 10852 }; |
10812 | 10853 |
10813 | 10854 |
10814 } // NOLINT, false-positive due to second-order macros. | 10855 } // NOLINT, false-positive due to second-order macros. |
10815 } // NOLINT, false-positive due to second-order macros. | 10856 } // NOLINT, false-positive due to second-order macros. |
10816 | 10857 |
10817 #endif // V8_OBJECTS_H_ | 10858 #endif // V8_OBJECTS_H_ |
OLD | NEW |