Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(720)

Side by Side Diff: src/objects.h

Issue 1607943003: [runtime] Introduce maps for the likely cases of FromPropertyDescriptor. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: REBASE Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/contexts.h ('k') | src/property-descriptor.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 2544 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 void CollectFastPropertyKeysTo(KeyAccumulator* keys, PropertyFilter filter, 2558 void CollectFastPropertyKeysTo(KeyAccumulator* keys, PropertyFilter filter,
2559 JSReceiver::KeyCollectionType type); 2559 JSReceiver::KeyCollectionType type);
2560 2560
2561 DISALLOW_IMPLICIT_CONSTRUCTORS(JSObject); 2561 DISALLOW_IMPLICIT_CONSTRUCTORS(JSObject);
2562 }; 2562 };
2563 2563
2564 2564
2565 // JSAccessorPropertyDescriptor is just a JSObject with a specific initial
2566 // map. This initial map adds in-object properties for "get", "set",
2567 // "enumerable" and "configurable" properties, as assigned by the
2568 // FromPropertyDescriptor function for regular accessor properties.
2569 class JSAccessorPropertyDescriptor: public JSObject {
2570 public:
2571 // Offsets of object fields.
2572 static const int kGetOffset = JSObject::kHeaderSize;
2573 static const int kSetOffset = kGetOffset + kPointerSize;
2574 static const int kEnumerableOffset = kSetOffset + kPointerSize;
2575 static const int kConfigurableOffset = kEnumerableOffset + kPointerSize;
2576 static const int kSize = kConfigurableOffset + kPointerSize;
2577 // Indices of in-object properties.
2578 static const int kGetIndex = 0;
2579 static const int kSetIndex = 1;
2580 static const int kEnumerableIndex = 2;
2581 static const int kConfigurableIndex = 3;
2582
2583 private:
2584 DISALLOW_IMPLICIT_CONSTRUCTORS(JSAccessorPropertyDescriptor);
2585 };
2586
2587
2588 // JSDataPropertyDescriptor is just a JSObject with a specific initial map.
2589 // This initial map adds in-object properties for "value", "writable",
2590 // "enumerable" and "configurable" properties, as assigned by the
2591 // FromPropertyDescriptor function for regular data properties.
2592 class JSDataPropertyDescriptor: public JSObject {
2593 public:
2594 // Offsets of object fields.
2595 static const int kValueOffset = JSObject::kHeaderSize;
2596 static const int kWritableOffset = kValueOffset + kPointerSize;
2597 static const int kEnumerableOffset = kWritableOffset + kPointerSize;
2598 static const int kConfigurableOffset = kEnumerableOffset + kPointerSize;
2599 static const int kSize = kConfigurableOffset + kPointerSize;
2600 // Indices of in-object properties.
2601 static const int kValueIndex = 0;
2602 static const int kWritableIndex = 1;
2603 static const int kEnumerableIndex = 2;
2604 static const int kConfigurableIndex = 3;
2605
2606 private:
2607 DISALLOW_IMPLICIT_CONSTRUCTORS(JSDataPropertyDescriptor);
2608 };
2609
2610
2565 // Common superclass for FixedArrays that allow implementations to share 2611 // Common superclass for FixedArrays that allow implementations to share
2566 // common accessors and some code paths. 2612 // common accessors and some code paths.
2567 class FixedArrayBase: public HeapObject { 2613 class FixedArrayBase: public HeapObject {
2568 public: 2614 public:
2569 // [length]: length of the array. 2615 // [length]: length of the array.
2570 inline int length() const; 2616 inline int length() const;
2571 inline void set_length(int value); 2617 inline void set_length(int value);
2572 2618
2573 // Get and set the length using acquire loads and release stores. 2619 // Get and set the length using acquire loads and release stores.
2574 inline int synchronized_length() const; 2620 inline int synchronized_length() const;
(...skipping 8164 matching lines...) Expand 10 before | Expand all | Expand 10 after
10739 } 10785 }
10740 return value; 10786 return value;
10741 } 10787 }
10742 }; 10788 };
10743 10789
10744 10790
10745 } // NOLINT, false-positive due to second-order macros. 10791 } // NOLINT, false-positive due to second-order macros.
10746 } // NOLINT, false-positive due to second-order macros. 10792 } // NOLINT, false-positive due to second-order macros.
10747 10793
10748 #endif // V8_OBJECTS_H_ 10794 #endif // V8_OBJECTS_H_
OLDNEW
« no previous file with comments | « src/contexts.h ('k') | src/property-descriptor.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698