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

Side by Side Diff: src/objects.h

Issue 23064017: Use V8_FINAL and V8_OVERRIDE in various places, fixing bugs revealed by them. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Use V8_FINAL and V8_OVERRIDE instead. Created 7 years, 4 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 | Annotate | Revision Log
« no previous file with comments | « src/mips/lithium-mips.h ('k') | src/objects.cc » ('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 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 1523 matching lines...) Expand 10 before | Expand all | Expand 10 after
1534 DISALLOW_IMPLICIT_CONSTRUCTORS(Object); 1534 DISALLOW_IMPLICIT_CONSTRUCTORS(Object);
1535 }; 1535 };
1536 1536
1537 1537
1538 // Smi represents integer Numbers that can be stored in 31 bits. 1538 // Smi represents integer Numbers that can be stored in 31 bits.
1539 // Smis are immediate which means they are NOT allocated in the heap. 1539 // Smis are immediate which means they are NOT allocated in the heap.
1540 // The this pointer has the following format: [31 bit signed int] 0 1540 // The this pointer has the following format: [31 bit signed int] 0
1541 // For long smis it has the following format: 1541 // For long smis it has the following format:
1542 // [32 bit signed int] [31 bits zero padding] 0 1542 // [32 bit signed int] [31 bits zero padding] 0
1543 // Smi stands for small integer. 1543 // Smi stands for small integer.
1544 class Smi FINAL : public Object { 1544 class Smi V8_FINAL : public Object {
1545 public: 1545 public:
1546 // Returns the integer value. 1546 // Returns the integer value.
1547 inline int value(); 1547 inline int value();
1548 1548
1549 // Convert a value to a Smi object. 1549 // Convert a value to a Smi object.
1550 static inline Smi* FromInt(int value); 1550 static inline Smi* FromInt(int value);
1551 1551
1552 static inline Smi* FromIntptr(intptr_t value); 1552 static inline Smi* FromIntptr(intptr_t value);
1553 1553
1554 // Returns whether value can be represented in a Smi. 1554 // Returns whether value can be represented in a Smi.
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
1595 // 1595 //
1596 // The next three bits, 4-6, are an allocation space tag 'sss'. The 1596 // The next three bits, 4-6, are an allocation space tag 'sss'. The
1597 // allocation space tag is 000 for all failure types except 1597 // allocation space tag is 000 for all failure types except
1598 // RETRY_AFTER_GC. For RETRY_AFTER_GC, the possible values are the 1598 // RETRY_AFTER_GC. For RETRY_AFTER_GC, the possible values are the
1599 // allocation spaces (the encoding is found in globals.h). 1599 // allocation spaces (the encoding is found in globals.h).
1600 1600
1601 // Failure type tag info. 1601 // Failure type tag info.
1602 const int kFailureTypeTagSize = 2; 1602 const int kFailureTypeTagSize = 2;
1603 const int kFailureTypeTagMask = (1 << kFailureTypeTagSize) - 1; 1603 const int kFailureTypeTagMask = (1 << kFailureTypeTagSize) - 1;
1604 1604
1605 class Failure FINAL : public MaybeObject { 1605 class Failure V8_FINAL : public MaybeObject {
1606 public: 1606 public:
1607 // RuntimeStubs assumes EXCEPTION = 1 in the compiler-generated code. 1607 // RuntimeStubs assumes EXCEPTION = 1 in the compiler-generated code.
1608 enum Type { 1608 enum Type {
1609 RETRY_AFTER_GC = 0, 1609 RETRY_AFTER_GC = 0,
1610 EXCEPTION = 1, // Returning this marker tells the real exception 1610 EXCEPTION = 1, // Returning this marker tells the real exception
1611 // is in Isolate::pending_exception. 1611 // is in Isolate::pending_exception.
1612 INTERNAL_ERROR = 2, 1612 INTERNAL_ERROR = 2,
1613 OUT_OF_MEMORY_EXCEPTION = 3 1613 OUT_OF_MEMORY_EXCEPTION = 3
1614 }; 1614 };
1615 1615
(...skipping 29 matching lines...) Expand all
1645 static inline Failure* Construct(Type type, intptr_t value = 0); 1645 static inline Failure* Construct(Type type, intptr_t value = 0);
1646 1646
1647 DISALLOW_IMPLICIT_CONSTRUCTORS(Failure); 1647 DISALLOW_IMPLICIT_CONSTRUCTORS(Failure);
1648 }; 1648 };
1649 1649
1650 1650
1651 // Heap objects typically have a map pointer in their first word. However, 1651 // Heap objects typically have a map pointer in their first word. However,
1652 // during GC other data (e.g. mark bits, forwarding addresses) is sometimes 1652 // during GC other data (e.g. mark bits, forwarding addresses) is sometimes
1653 // encoded in the first word. The class MapWord is an abstraction of the 1653 // encoded in the first word. The class MapWord is an abstraction of the
1654 // value in a heap object's first word. 1654 // value in a heap object's first word.
1655 class MapWord FINAL BASE_EMBEDDED { 1655 class MapWord V8_FINAL BASE_EMBEDDED {
1656 public: 1656 public:
1657 // Normal state: the map word contains a map pointer. 1657 // Normal state: the map word contains a map pointer.
1658 1658
1659 // Create a map word from a map pointer. 1659 // Create a map word from a map pointer.
1660 static inline MapWord FromMap(Map* map); 1660 static inline MapWord FromMap(Map* map);
1661 1661
1662 // View this map word as a map pointer. 1662 // View this map word as a map pointer.
1663 inline Map* ToMap(); 1663 inline Map* ToMap();
1664 1664
1665 1665
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after
1834 template<typename StaticVisitor> 1834 template<typename StaticVisitor>
1835 static inline void IterateBody(HeapObject* obj, int object_size) { 1835 static inline void IterateBody(HeapObject* obj, int object_size) {
1836 StaticVisitor::VisitPointers(HeapObject::RawField(obj, start_offset), 1836 StaticVisitor::VisitPointers(HeapObject::RawField(obj, start_offset),
1837 HeapObject::RawField(obj, object_size)); 1837 HeapObject::RawField(obj, object_size));
1838 } 1838 }
1839 }; 1839 };
1840 1840
1841 1841
1842 // The HeapNumber class describes heap allocated numbers that cannot be 1842 // The HeapNumber class describes heap allocated numbers that cannot be
1843 // represented in a Smi (small integer) 1843 // represented in a Smi (small integer)
1844 class HeapNumber FINAL : public HeapObject { 1844 class HeapNumber V8_FINAL : public HeapObject {
1845 public: 1845 public:
1846 // [value]: number value. 1846 // [value]: number value.
1847 inline double value(); 1847 inline double value();
1848 inline void set_value(double value); 1848 inline void set_value(double value);
1849 1849
1850 // Casting. 1850 // Casting.
1851 static inline HeapNumber* cast(Object* obj); 1851 static inline HeapNumber* cast(Object* obj);
1852 1852
1853 // Dispatched behavior. 1853 // Dispatched behavior.
1854 bool HeapNumberBooleanValue(); 1854 bool HeapNumberBooleanValue();
(...skipping 819 matching lines...) Expand 10 before | Expand all | Expand 10 after
2674 #endif 2674 #endif
2675 2675
2676 void PrintElementsTransition( 2676 void PrintElementsTransition(
2677 FILE* file, ElementsKind from_kind, FixedArrayBase* from_elements, 2677 FILE* file, ElementsKind from_kind, FixedArrayBase* from_elements,
2678 ElementsKind to_kind, FixedArrayBase* to_elements); 2678 ElementsKind to_kind, FixedArrayBase* to_elements);
2679 2679
2680 void PrintInstanceMigration(FILE* file, Map* original_map, Map* new_map); 2680 void PrintInstanceMigration(FILE* file, Map* original_map, Map* new_map);
2681 2681
2682 #ifdef DEBUG 2682 #ifdef DEBUG
2683 // Structure for collecting spill information about JSObjects. 2683 // Structure for collecting spill information about JSObjects.
2684 class SpillInformation FINAL { 2684 class SpillInformation V8_FINAL {
2685 public: 2685 public:
2686 void Clear(); 2686 void Clear();
2687 void Print(); 2687 void Print();
2688 int number_of_objects_; 2688 int number_of_objects_;
2689 int number_of_objects_with_fast_properties_; 2689 int number_of_objects_with_fast_properties_;
2690 int number_of_objects_with_fast_elements_; 2690 int number_of_objects_with_fast_elements_;
2691 int number_of_fast_used_fields_; 2691 int number_of_fast_used_fields_;
2692 int number_of_fast_unused_fields_; 2692 int number_of_fast_unused_fields_;
2693 int number_of_slow_used_properties_; 2693 int number_of_slow_used_properties_;
2694 int number_of_slow_unused_properties_; 2694 int number_of_slow_unused_properties_;
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
2735 // to the same object requires fewer allocations and copies. 2735 // to the same object requires fewer allocations and copies.
2736 static const int kFieldsAdded = 3; 2736 static const int kFieldsAdded = 3;
2737 2737
2738 // Layout description. 2738 // Layout description.
2739 static const int kPropertiesOffset = HeapObject::kHeaderSize; 2739 static const int kPropertiesOffset = HeapObject::kHeaderSize;
2740 static const int kElementsOffset = kPropertiesOffset + kPointerSize; 2740 static const int kElementsOffset = kPropertiesOffset + kPointerSize;
2741 static const int kHeaderSize = kElementsOffset + kPointerSize; 2741 static const int kHeaderSize = kElementsOffset + kPointerSize;
2742 2742
2743 STATIC_CHECK(kHeaderSize == Internals::kJSObjectHeaderSize); 2743 STATIC_CHECK(kHeaderSize == Internals::kJSObjectHeaderSize);
2744 2744
2745 class BodyDescriptor FINAL 2745 class BodyDescriptor V8_FINAL
2746 : public FlexibleBodyDescriptor<kPropertiesOffset> { 2746 : public FlexibleBodyDescriptor<kPropertiesOffset> {
2747 public: 2747 public:
2748 static inline int SizeOf(Map* map, HeapObject* object); 2748 static inline int SizeOf(Map* map, HeapObject* object);
2749 }; 2749 };
2750 2750
2751 // Enqueue change record for Object.observe. May cause GC. 2751 // Enqueue change record for Object.observe. May cause GC.
2752 static void EnqueueChangeRecord(Handle<JSObject> object, 2752 static void EnqueueChangeRecord(Handle<JSObject> object,
2753 const char* type, 2753 const char* type,
2754 Handle<Name> name, 2754 Handle<Name> name,
2755 Handle<Object> old_value); 2755 Handle<Object> old_value);
(...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after
2975 // Swap two elements in a pair of arrays. If this array and the 2975 // Swap two elements in a pair of arrays. If this array and the
2976 // numbers array are the same object, the elements are only swapped 2976 // numbers array are the same object, the elements are only swapped
2977 // once. 2977 // once.
2978 void SwapPairs(FixedArray* numbers, int i, int j); 2978 void SwapPairs(FixedArray* numbers, int i, int j);
2979 2979
2980 // Sort prefix of this array and the numbers array as pairs wrt. the 2980 // Sort prefix of this array and the numbers array as pairs wrt. the
2981 // numbers. If the numbers array and the this array are the same 2981 // numbers. If the numbers array and the this array are the same
2982 // object, the prefix of this array is sorted. 2982 // object, the prefix of this array is sorted.
2983 void SortPairs(FixedArray* numbers, uint32_t len); 2983 void SortPairs(FixedArray* numbers, uint32_t len);
2984 2984
2985 class BodyDescriptor FINAL : public FlexibleBodyDescriptor<kHeaderSize> { 2985 class BodyDescriptor V8_FINAL : public FlexibleBodyDescriptor<kHeaderSize> {
2986 public: 2986 public:
2987 static inline int SizeOf(Map* map, HeapObject* object) { 2987 static inline int SizeOf(Map* map, HeapObject* object) {
2988 return SizeFor(reinterpret_cast<FixedArray*>(object)->length()); 2988 return SizeFor(reinterpret_cast<FixedArray*>(object)->length());
2989 } 2989 }
2990 }; 2990 };
2991 2991
2992 protected: 2992 protected:
2993 // Set operation on FixedArray without using write barriers. Can 2993 // Set operation on FixedArray without using write barriers. Can
2994 // only be used for storing old space objects or smis. 2994 // only be used for storing old space objects or smis.
2995 static inline void NoWriteBarrierSet(FixedArray* array, 2995 static inline void NoWriteBarrierSet(FixedArray* array,
2996 int index, 2996 int index,
2997 Object* value); 2997 Object* value);
2998 2998
2999 // Set operation on FixedArray without incremental write barrier. Can 2999 // Set operation on FixedArray without incremental write barrier. Can
3000 // only be used if the object is guaranteed to be white (whiteness witness 3000 // only be used if the object is guaranteed to be white (whiteness witness
3001 // is present). 3001 // is present).
3002 static inline void NoIncrementalWriteBarrierSet(FixedArray* array, 3002 static inline void NoIncrementalWriteBarrierSet(FixedArray* array,
3003 int index, 3003 int index,
3004 Object* value); 3004 Object* value);
3005 3005
3006 private: 3006 private:
3007 STATIC_CHECK(kHeaderSize == Internals::kFixedArrayHeaderSize); 3007 STATIC_CHECK(kHeaderSize == Internals::kFixedArrayHeaderSize);
3008 3008
3009 DISALLOW_IMPLICIT_CONSTRUCTORS(FixedArray); 3009 DISALLOW_IMPLICIT_CONSTRUCTORS(FixedArray);
3010 }; 3010 };
3011 3011
3012 3012
3013 // FixedDoubleArray describes fixed-sized arrays with element type double. 3013 // FixedDoubleArray describes fixed-sized arrays with element type double.
3014 class FixedDoubleArray FINAL : public FixedArrayBase { 3014 class FixedDoubleArray V8_FINAL : public FixedArrayBase {
3015 public: 3015 public:
3016 // Setter and getter for elements. 3016 // Setter and getter for elements.
3017 inline double get_scalar(int index); 3017 inline double get_scalar(int index);
3018 inline int64_t get_representation(int index); 3018 inline int64_t get_representation(int index);
3019 MUST_USE_RESULT inline MaybeObject* get(int index); 3019 MUST_USE_RESULT inline MaybeObject* get(int index);
3020 inline void set(int index, double value); 3020 inline void set(int index, double value);
3021 inline void set_the_hole(int index); 3021 inline void set_the_hole(int index);
3022 3022
3023 // Checking for the hole. 3023 // Checking for the hole.
3024 inline bool is_the_hole(int index); 3024 inline bool is_the_hole(int index);
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
3061 3061
3062 3062
3063 // DescriptorArrays are fixed arrays used to hold instance descriptors. 3063 // DescriptorArrays are fixed arrays used to hold instance descriptors.
3064 // The format of the these objects is: 3064 // The format of the these objects is:
3065 // [0]: Number of descriptors 3065 // [0]: Number of descriptors
3066 // [1]: Either Smi(0) if uninitialized, or a pointer to small fixed array: 3066 // [1]: Either Smi(0) if uninitialized, or a pointer to small fixed array:
3067 // [0]: pointer to fixed array with enum cache 3067 // [0]: pointer to fixed array with enum cache
3068 // [1]: either Smi(0) or pointer to fixed array with indices 3068 // [1]: either Smi(0) or pointer to fixed array with indices
3069 // [2]: first key 3069 // [2]: first key
3070 // [2 + number of descriptors * kDescriptorSize]: start of slack 3070 // [2 + number of descriptors * kDescriptorSize]: start of slack
3071 class DescriptorArray FINAL : public FixedArray { 3071 class DescriptorArray V8_FINAL : public FixedArray {
3072 public: 3072 public:
3073 // WhitenessWitness is used to prove that a descriptor array is white 3073 // WhitenessWitness is used to prove that a descriptor array is white
3074 // (unmarked), so incremental write barriers can be skipped because the 3074 // (unmarked), so incremental write barriers can be skipped because the
3075 // marking invariant cannot be broken and slots pointing into evacuation 3075 // marking invariant cannot be broken and slots pointing into evacuation
3076 // candidates will be discovered when the object is scanned. A witness is 3076 // candidates will be discovered when the object is scanned. A witness is
3077 // always stack-allocated right after creating an array. By allocating a 3077 // always stack-allocated right after creating an array. By allocating a
3078 // witness, incremental marking is globally disabled. The witness is then 3078 // witness, incremental marking is globally disabled. The witness is then
3079 // passed along wherever needed to statically prove that the array is known to 3079 // passed along wherever needed to statically prove that the array is known to
3080 // be white. 3080 // be white.
3081 class WhitenessWitness FINAL { 3081 class WhitenessWitness V8_FINAL {
3082 public: 3082 public:
3083 inline explicit WhitenessWitness(FixedArray* array); 3083 inline explicit WhitenessWitness(FixedArray* array);
3084 inline ~WhitenessWitness(); 3084 inline ~WhitenessWitness();
3085 3085
3086 private: 3086 private:
3087 IncrementalMarking* marking_; 3087 IncrementalMarking* marking_;
3088 }; 3088 };
3089 3089
3090 // Returns true for both shared empty_descriptor_array and for smis, which the 3090 // Returns true for both shared empty_descriptor_array and for smis, which the
3091 // map uses to encode additional bit fields when the descriptor array is not 3091 // map uses to encode additional bit fields when the descriptor array is not
(...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after
3279 static const int kMaxNumberOfDescriptors = 1024 + 512; 3279 static const int kMaxNumberOfDescriptors = 1024 + 512;
3280 3280
3281 // Returns the fixed array length required to hold number_of_descriptors 3281 // Returns the fixed array length required to hold number_of_descriptors
3282 // descriptors. 3282 // descriptors.
3283 static int LengthFor(int number_of_descriptors) { 3283 static int LengthFor(int number_of_descriptors) {
3284 return ToKeyIndex(number_of_descriptors); 3284 return ToKeyIndex(number_of_descriptors);
3285 } 3285 }
3286 3286
3287 private: 3287 private:
3288 // An entry in a DescriptorArray, represented as an (array, index) pair. 3288 // An entry in a DescriptorArray, represented as an (array, index) pair.
3289 class Entry FINAL { 3289 class Entry V8_FINAL {
3290 public: 3290 public:
3291 inline explicit Entry(DescriptorArray* descs, int index) : 3291 inline explicit Entry(DescriptorArray* descs, int index) :
3292 descs_(descs), index_(index) { } 3292 descs_(descs), index_(index) { }
3293 3293
3294 inline PropertyType type() { return descs_->GetType(index_); } 3294 inline PropertyType type() { return descs_->GetType(index_); }
3295 inline Object* GetCallbackObject() { return descs_->GetValue(index_); } 3295 inline Object* GetCallbackObject() { return descs_->GetValue(index_); }
3296 3296
3297 private: 3297 private:
3298 DescriptorArray* descs_; 3298 DescriptorArray* descs_;
3299 int index_; 3299 int index_;
(...skipping 265 matching lines...) Expand 10 before | Expand all | Expand 10 after
3565 // Returns the hash value for object. 3565 // Returns the hash value for object.
3566 virtual uint32_t HashForObject(Object* key) = 0; 3566 virtual uint32_t HashForObject(Object* key) = 0;
3567 // Returns the key object for storing into the hash table. 3567 // Returns the key object for storing into the hash table.
3568 // If allocations fails a failure object is returned. 3568 // If allocations fails a failure object is returned.
3569 MUST_USE_RESULT virtual MaybeObject* AsObject(Heap* heap) = 0; 3569 MUST_USE_RESULT virtual MaybeObject* AsObject(Heap* heap) = 0;
3570 // Required. 3570 // Required.
3571 virtual ~HashTableKey() {} 3571 virtual ~HashTableKey() {}
3572 }; 3572 };
3573 3573
3574 3574
3575 class StringTableShape FINAL : public BaseShape<HashTableKey*> { 3575 class StringTableShape V8_FINAL : public BaseShape<HashTableKey*> {
3576 public: 3576 public:
3577 static inline bool IsMatch(HashTableKey* key, Object* value) { 3577 static inline bool IsMatch(HashTableKey* key, Object* value) {
3578 return key->IsMatch(value); 3578 return key->IsMatch(value);
3579 } 3579 }
3580 static inline uint32_t Hash(HashTableKey* key) { 3580 static inline uint32_t Hash(HashTableKey* key) {
3581 return key->Hash(); 3581 return key->Hash();
3582 } 3582 }
3583 static inline uint32_t HashForObject(HashTableKey* key, Object* object) { 3583 static inline uint32_t HashForObject(HashTableKey* key, Object* object) {
3584 return key->HashForObject(object); 3584 return key->HashForObject(object);
3585 } 3585 }
3586 MUST_USE_RESULT static inline MaybeObject* AsObject(Heap* heap, 3586 MUST_USE_RESULT static inline MaybeObject* AsObject(Heap* heap,
3587 HashTableKey* key) { 3587 HashTableKey* key) {
3588 return key->AsObject(heap); 3588 return key->AsObject(heap);
3589 } 3589 }
3590 3590
3591 static const int kPrefixSize = 0; 3591 static const int kPrefixSize = 0;
3592 static const int kEntrySize = 1; 3592 static const int kEntrySize = 1;
3593 }; 3593 };
3594 3594
3595 class SeqOneByteString; 3595 class SeqOneByteString;
3596 3596
3597 // StringTable. 3597 // StringTable.
3598 // 3598 //
3599 // No special elements in the prefix and the element size is 1 3599 // No special elements in the prefix and the element size is 1
3600 // because only the string itself (the key) needs to be stored. 3600 // because only the string itself (the key) needs to be stored.
3601 class StringTable FINAL : public HashTable<StringTableShape, HashTableKey*> { 3601 class StringTable V8_FINAL : public HashTable<StringTableShape, HashTableKey*> {
3602 public: 3602 public:
3603 // Find string in the string table. If it is not there yet, it is 3603 // Find string in the string table. If it is not there yet, it is
3604 // added. The return value is the string table which might have 3604 // added. The return value is the string table which might have
3605 // been enlarged. If the return value is not a failure, the string 3605 // been enlarged. If the return value is not a failure, the string
3606 // pointer *s is set to the string found. 3606 // pointer *s is set to the string found.
3607 MUST_USE_RESULT MaybeObject* LookupUtf8String( 3607 MUST_USE_RESULT MaybeObject* LookupUtf8String(
3608 Vector<const char> str, 3608 Vector<const char> str,
3609 Object** s); 3609 Object** s);
3610 MUST_USE_RESULT MaybeObject* LookupOneByteString( 3610 MUST_USE_RESULT MaybeObject* LookupOneByteString(
3611 Vector<const uint8_t> str, 3611 Vector<const uint8_t> str,
(...skipping 19 matching lines...) Expand all
3631 3631
3632 private: 3632 private:
3633 MUST_USE_RESULT MaybeObject* LookupKey(HashTableKey* key, Object** s); 3633 MUST_USE_RESULT MaybeObject* LookupKey(HashTableKey* key, Object** s);
3634 3634
3635 template <bool seq_ascii> friend class JsonParser; 3635 template <bool seq_ascii> friend class JsonParser;
3636 3636
3637 DISALLOW_IMPLICIT_CONSTRUCTORS(StringTable); 3637 DISALLOW_IMPLICIT_CONSTRUCTORS(StringTable);
3638 }; 3638 };
3639 3639
3640 3640
3641 class MapCacheShape FINAL : public BaseShape<HashTableKey*> { 3641 class MapCacheShape V8_FINAL : public BaseShape<HashTableKey*> {
3642 public: 3642 public:
3643 static inline bool IsMatch(HashTableKey* key, Object* value) { 3643 static inline bool IsMatch(HashTableKey* key, Object* value) {
3644 return key->IsMatch(value); 3644 return key->IsMatch(value);
3645 } 3645 }
3646 static inline uint32_t Hash(HashTableKey* key) { 3646 static inline uint32_t Hash(HashTableKey* key) {
3647 return key->Hash(); 3647 return key->Hash();
3648 } 3648 }
3649 3649
3650 static inline uint32_t HashForObject(HashTableKey* key, Object* object) { 3650 static inline uint32_t HashForObject(HashTableKey* key, Object* object) {
3651 return key->HashForObject(object); 3651 return key->HashForObject(object);
3652 } 3652 }
3653 3653
3654 MUST_USE_RESULT static inline MaybeObject* AsObject(Heap* heap, 3654 MUST_USE_RESULT static inline MaybeObject* AsObject(Heap* heap,
3655 HashTableKey* key) { 3655 HashTableKey* key) {
3656 return key->AsObject(heap); 3656 return key->AsObject(heap);
3657 } 3657 }
3658 3658
3659 static const int kPrefixSize = 0; 3659 static const int kPrefixSize = 0;
3660 static const int kEntrySize = 2; 3660 static const int kEntrySize = 2;
3661 }; 3661 };
3662 3662
3663 3663
3664 // MapCache. 3664 // MapCache.
3665 // 3665 //
3666 // Maps keys that are a fixed array of unique names to a map. 3666 // Maps keys that are a fixed array of unique names to a map.
3667 // Used for canonicalize maps for object literals. 3667 // Used for canonicalize maps for object literals.
3668 class MapCache FINAL : public HashTable<MapCacheShape, HashTableKey*> { 3668 class MapCache V8_FINAL : public HashTable<MapCacheShape, HashTableKey*> {
3669 public: 3669 public:
3670 // Find cached value for a name key, otherwise return null. 3670 // Find cached value for a name key, otherwise return null.
3671 Object* Lookup(FixedArray* key); 3671 Object* Lookup(FixedArray* key);
3672 MUST_USE_RESULT MaybeObject* Put(FixedArray* key, Map* value); 3672 MUST_USE_RESULT MaybeObject* Put(FixedArray* key, Map* value);
3673 static inline MapCache* cast(Object* obj); 3673 static inline MapCache* cast(Object* obj);
3674 3674
3675 private: 3675 private:
3676 DISALLOW_IMPLICIT_CONSTRUCTORS(MapCache); 3676 DISALLOW_IMPLICIT_CONSTRUCTORS(MapCache);
3677 }; 3677 };
3678 3678
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
3785 uint32_t hash); 3785 uint32_t hash);
3786 3786
3787 // Generate new enumeration indices to avoid enumeration index overflow. 3787 // Generate new enumeration indices to avoid enumeration index overflow.
3788 MUST_USE_RESULT MaybeObject* GenerateNewEnumerationIndices(); 3788 MUST_USE_RESULT MaybeObject* GenerateNewEnumerationIndices();
3789 static const int kMaxNumberKeyIndex = 3789 static const int kMaxNumberKeyIndex =
3790 HashTable<Shape, Key>::kPrefixStartIndex; 3790 HashTable<Shape, Key>::kPrefixStartIndex;
3791 static const int kNextEnumerationIndexIndex = kMaxNumberKeyIndex + 1; 3791 static const int kNextEnumerationIndexIndex = kMaxNumberKeyIndex + 1;
3792 }; 3792 };
3793 3793
3794 3794
3795 class NameDictionaryShape FINAL : public BaseShape<Name*> { 3795 class NameDictionaryShape V8_FINAL : public BaseShape<Name*> {
3796 public: 3796 public:
3797 static inline bool IsMatch(Name* key, Object* other); 3797 static inline bool IsMatch(Name* key, Object* other);
3798 static inline uint32_t Hash(Name* key); 3798 static inline uint32_t Hash(Name* key);
3799 static inline uint32_t HashForObject(Name* key, Object* object); 3799 static inline uint32_t HashForObject(Name* key, Object* object);
3800 MUST_USE_RESULT static inline MaybeObject* AsObject(Heap* heap, 3800 MUST_USE_RESULT static inline MaybeObject* AsObject(Heap* heap,
3801 Name* key); 3801 Name* key);
3802 static const int kPrefixSize = 2; 3802 static const int kPrefixSize = 2;
3803 static const int kEntrySize = 3; 3803 static const int kEntrySize = 3;
3804 static const bool kIsEnumerable = true; 3804 static const bool kIsEnumerable = true;
3805 }; 3805 };
3806 3806
3807 3807
3808 class NameDictionary FINAL : public Dictionary<NameDictionaryShape, Name*> { 3808 class NameDictionary V8_FINAL : public Dictionary<NameDictionaryShape, Name*> {
3809 public: 3809 public:
3810 static inline NameDictionary* cast(Object* obj) { 3810 static inline NameDictionary* cast(Object* obj) {
3811 ASSERT(obj->IsDictionary()); 3811 ASSERT(obj->IsDictionary());
3812 return reinterpret_cast<NameDictionary*>(obj); 3812 return reinterpret_cast<NameDictionary*>(obj);
3813 } 3813 }
3814 3814
3815 // Copies enumerable keys to preallocated fixed array. 3815 // Copies enumerable keys to preallocated fixed array.
3816 FixedArray* CopyEnumKeysTo(FixedArray* storage); 3816 FixedArray* CopyEnumKeysTo(FixedArray* storage);
3817 static void DoGenerateNewEnumerationIndices( 3817 static void DoGenerateNewEnumerationIndices(
3818 Handle<NameDictionary> dictionary); 3818 Handle<NameDictionary> dictionary);
(...skipping 12 matching lines...) Expand all
3831 class NumberDictionaryShape : public BaseShape<uint32_t> { 3831 class NumberDictionaryShape : public BaseShape<uint32_t> {
3832 public: 3832 public:
3833 static inline bool IsMatch(uint32_t key, Object* other); 3833 static inline bool IsMatch(uint32_t key, Object* other);
3834 MUST_USE_RESULT static inline MaybeObject* AsObject(Heap* heap, 3834 MUST_USE_RESULT static inline MaybeObject* AsObject(Heap* heap,
3835 uint32_t key); 3835 uint32_t key);
3836 static const int kEntrySize = 3; 3836 static const int kEntrySize = 3;
3837 static const bool kIsEnumerable = false; 3837 static const bool kIsEnumerable = false;
3838 }; 3838 };
3839 3839
3840 3840
3841 class SeededNumberDictionaryShape FINAL : public NumberDictionaryShape { 3841 class SeededNumberDictionaryShape V8_FINAL : public NumberDictionaryShape {
3842 public: 3842 public:
3843 static const bool UsesSeed = true; 3843 static const bool UsesSeed = true;
3844 static const int kPrefixSize = 2; 3844 static const int kPrefixSize = 2;
3845 3845
3846 static inline uint32_t SeededHash(uint32_t key, uint32_t seed); 3846 static inline uint32_t SeededHash(uint32_t key, uint32_t seed);
3847 static inline uint32_t SeededHashForObject(uint32_t key, 3847 static inline uint32_t SeededHashForObject(uint32_t key,
3848 uint32_t seed, 3848 uint32_t seed,
3849 Object* object); 3849 Object* object);
3850 }; 3850 };
3851 3851
3852 3852
3853 class UnseededNumberDictionaryShape FINAL : public NumberDictionaryShape { 3853 class UnseededNumberDictionaryShape V8_FINAL : public NumberDictionaryShape {
3854 public: 3854 public:
3855 static const int kPrefixSize = 0; 3855 static const int kPrefixSize = 0;
3856 3856
3857 static inline uint32_t Hash(uint32_t key); 3857 static inline uint32_t Hash(uint32_t key);
3858 static inline uint32_t HashForObject(uint32_t key, Object* object); 3858 static inline uint32_t HashForObject(uint32_t key, Object* object);
3859 }; 3859 };
3860 3860
3861 3861
3862 class SeededNumberDictionary FINAL 3862 class SeededNumberDictionary V8_FINAL
3863 : public Dictionary<SeededNumberDictionaryShape, uint32_t> { 3863 : public Dictionary<SeededNumberDictionaryShape, uint32_t> {
3864 public: 3864 public:
3865 static SeededNumberDictionary* cast(Object* obj) { 3865 static SeededNumberDictionary* cast(Object* obj) {
3866 ASSERT(obj->IsDictionary()); 3866 ASSERT(obj->IsDictionary());
3867 return reinterpret_cast<SeededNumberDictionary*>(obj); 3867 return reinterpret_cast<SeededNumberDictionary*>(obj);
3868 } 3868 }
3869 3869
3870 // Type specific at put (default NONE attributes is used when adding). 3870 // Type specific at put (default NONE attributes is used when adding).
3871 MUST_USE_RESULT MaybeObject* AtNumberPut(uint32_t key, Object* value); 3871 MUST_USE_RESULT MaybeObject* AtNumberPut(uint32_t key, Object* value);
3872 MUST_USE_RESULT MaybeObject* AddNumberEntry(uint32_t key, 3872 MUST_USE_RESULT MaybeObject* AddNumberEntry(uint32_t key,
(...skipping 27 matching lines...) Expand all
3900 // requires_slow_elements returns false. 3900 // requires_slow_elements returns false.
3901 inline uint32_t max_number_key(); 3901 inline uint32_t max_number_key();
3902 3902
3903 // Bit masks. 3903 // Bit masks.
3904 static const int kRequiresSlowElementsMask = 1; 3904 static const int kRequiresSlowElementsMask = 1;
3905 static const int kRequiresSlowElementsTagSize = 1; 3905 static const int kRequiresSlowElementsTagSize = 1;
3906 static const uint32_t kRequiresSlowElementsLimit = (1 << 29) - 1; 3906 static const uint32_t kRequiresSlowElementsLimit = (1 << 29) - 1;
3907 }; 3907 };
3908 3908
3909 3909
3910 class UnseededNumberDictionary FINAL 3910 class UnseededNumberDictionary V8_FINAL
3911 : public Dictionary<UnseededNumberDictionaryShape, uint32_t> { 3911 : public Dictionary<UnseededNumberDictionaryShape, uint32_t> {
3912 public: 3912 public:
3913 static UnseededNumberDictionary* cast(Object* obj) { 3913 static UnseededNumberDictionary* cast(Object* obj) {
3914 ASSERT(obj->IsDictionary()); 3914 ASSERT(obj->IsDictionary());
3915 return reinterpret_cast<UnseededNumberDictionary*>(obj); 3915 return reinterpret_cast<UnseededNumberDictionary*>(obj);
3916 } 3916 }
3917 3917
3918 // Type specific at put (default NONE attributes is used when adding). 3918 // Type specific at put (default NONE attributes is used when adding).
3919 MUST_USE_RESULT MaybeObject* AtNumberPut(uint32_t key, Object* value); 3919 MUST_USE_RESULT MaybeObject* AtNumberPut(uint32_t key, Object* value);
3920 MUST_USE_RESULT MaybeObject* AddNumberEntry(uint32_t key, Object* value); 3920 MUST_USE_RESULT MaybeObject* AddNumberEntry(uint32_t key, Object* value);
3921 3921
3922 // Set an existing entry or add a new one if needed. 3922 // Set an existing entry or add a new one if needed.
3923 // Return the updated dictionary. 3923 // Return the updated dictionary.
3924 MUST_USE_RESULT static Handle<UnseededNumberDictionary> Set( 3924 MUST_USE_RESULT static Handle<UnseededNumberDictionary> Set(
3925 Handle<UnseededNumberDictionary> dictionary, 3925 Handle<UnseededNumberDictionary> dictionary,
3926 uint32_t index, 3926 uint32_t index,
3927 Handle<Object> value); 3927 Handle<Object> value);
3928 3928
3929 MUST_USE_RESULT MaybeObject* Set(uint32_t key, Object* value); 3929 MUST_USE_RESULT MaybeObject* Set(uint32_t key, Object* value);
3930 }; 3930 };
3931 3931
3932 3932
3933 template <int entrysize> 3933 template <int entrysize>
3934 class ObjectHashTableShape FINAL : public BaseShape<Object*> { 3934 class ObjectHashTableShape V8_FINAL : public BaseShape<Object*> {
3935 public: 3935 public:
3936 static inline bool IsMatch(Object* key, Object* other); 3936 static inline bool IsMatch(Object* key, Object* other);
3937 static inline uint32_t Hash(Object* key); 3937 static inline uint32_t Hash(Object* key);
3938 static inline uint32_t HashForObject(Object* key, Object* object); 3938 static inline uint32_t HashForObject(Object* key, Object* object);
3939 MUST_USE_RESULT static inline MaybeObject* AsObject(Heap* heap, 3939 MUST_USE_RESULT static inline MaybeObject* AsObject(Heap* heap,
3940 Object* key); 3940 Object* key);
3941 static const int kPrefixSize = 0; 3941 static const int kPrefixSize = 0;
3942 static const int kEntrySize = entrysize; 3942 static const int kEntrySize = entrysize;
3943 }; 3943 };
3944 3944
3945 3945
3946 // ObjectHashSet holds keys that are arbitrary objects by using the identity 3946 // ObjectHashSet holds keys that are arbitrary objects by using the identity
3947 // hash of the key for hashing purposes. 3947 // hash of the key for hashing purposes.
3948 class ObjectHashSet FINAL : public HashTable<ObjectHashTableShape<1>, Object*> { 3948 class ObjectHashSet V8_FINAL
3949 : public HashTable<ObjectHashTableShape<1>, Object*> {
3949 public: 3950 public:
3950 static inline ObjectHashSet* cast(Object* obj) { 3951 static inline ObjectHashSet* cast(Object* obj) {
3951 ASSERT(obj->IsHashTable()); 3952 ASSERT(obj->IsHashTable());
3952 return reinterpret_cast<ObjectHashSet*>(obj); 3953 return reinterpret_cast<ObjectHashSet*>(obj);
3953 } 3954 }
3954 3955
3955 // Looks up whether the given key is part of this hash set. 3956 // Looks up whether the given key is part of this hash set.
3956 bool Contains(Object* key); 3957 bool Contains(Object* key);
3957 3958
3958 // Adds the given key to this hash set. 3959 // Adds the given key to this hash set.
3959 MUST_USE_RESULT MaybeObject* Add(Object* key); 3960 MUST_USE_RESULT MaybeObject* Add(Object* key);
3960 3961
3961 // Removes the given key from this hash set. 3962 // Removes the given key from this hash set.
3962 MUST_USE_RESULT MaybeObject* Remove(Object* key); 3963 MUST_USE_RESULT MaybeObject* Remove(Object* key);
3963 }; 3964 };
3964 3965
3965 3966
3966 // ObjectHashTable maps keys that are arbitrary objects to object values by 3967 // ObjectHashTable maps keys that are arbitrary objects to object values by
3967 // using the identity hash of the key for hashing purposes. 3968 // using the identity hash of the key for hashing purposes.
3968 class ObjectHashTable FINAL 3969 class ObjectHashTable V8_FINAL
3969 : public HashTable<ObjectHashTableShape<2>, Object*> { 3970 : public HashTable<ObjectHashTableShape<2>, Object*> {
3970 public: 3971 public:
3971 static inline ObjectHashTable* cast(Object* obj) { 3972 static inline ObjectHashTable* cast(Object* obj) {
3972 ASSERT(obj->IsHashTable()); 3973 ASSERT(obj->IsHashTable());
3973 return reinterpret_cast<ObjectHashTable*>(obj); 3974 return reinterpret_cast<ObjectHashTable*>(obj);
3974 } 3975 }
3975 3976
3976 // Looks up the value associated with the given key. The hole value is 3977 // Looks up the value associated with the given key. The hole value is
3977 // returned in case the key is not present. 3978 // returned in case the key is not present.
3978 Object* Lookup(Object* key); 3979 Object* Lookup(Object* key);
(...skipping 15 matching lines...) Expand all
3994 }; 3995 };
3995 3996
3996 3997
3997 // JSFunctionResultCache caches results of some JSFunction invocation. 3998 // JSFunctionResultCache caches results of some JSFunction invocation.
3998 // It is a fixed array with fixed structure: 3999 // It is a fixed array with fixed structure:
3999 // [0]: factory function 4000 // [0]: factory function
4000 // [1]: finger index 4001 // [1]: finger index
4001 // [2]: current cache size 4002 // [2]: current cache size
4002 // [3]: dummy field. 4003 // [3]: dummy field.
4003 // The rest of array are key/value pairs. 4004 // The rest of array are key/value pairs.
4004 class JSFunctionResultCache FINAL : public FixedArray { 4005 class JSFunctionResultCache V8_FINAL : public FixedArray {
4005 public: 4006 public:
4006 static const int kFactoryIndex = 0; 4007 static const int kFactoryIndex = 0;
4007 static const int kFingerIndex = kFactoryIndex + 1; 4008 static const int kFingerIndex = kFactoryIndex + 1;
4008 static const int kCacheSizeIndex = kFingerIndex + 1; 4009 static const int kCacheSizeIndex = kFingerIndex + 1;
4009 static const int kDummyIndex = kCacheSizeIndex + 1; 4010 static const int kDummyIndex = kCacheSizeIndex + 1;
4010 static const int kEntriesIndex = kDummyIndex + 1; 4011 static const int kEntriesIndex = kDummyIndex + 1;
4011 4012
4012 static const int kEntrySize = 2; // key + value 4013 static const int kEntrySize = 2; // key + value
4013 4014
4014 static const int kFactoryOffset = kHeaderSize; 4015 static const int kFactoryOffset = kHeaderSize;
(...skipping 15 matching lines...) Expand all
4030 }; 4031 };
4031 4032
4032 4033
4033 // ScopeInfo represents information about different scopes of a source 4034 // ScopeInfo represents information about different scopes of a source
4034 // program and the allocation of the scope's variables. Scope information 4035 // program and the allocation of the scope's variables. Scope information
4035 // is stored in a compressed form in ScopeInfo objects and is used 4036 // is stored in a compressed form in ScopeInfo objects and is used
4036 // at runtime (stack dumps, deoptimization, etc.). 4037 // at runtime (stack dumps, deoptimization, etc.).
4037 4038
4038 // This object provides quick access to scope info details for runtime 4039 // This object provides quick access to scope info details for runtime
4039 // routines. 4040 // routines.
4040 class ScopeInfo FINAL : public FixedArray { 4041 class ScopeInfo V8_FINAL : public FixedArray {
4041 public: 4042 public:
4042 static inline ScopeInfo* cast(Object* object); 4043 static inline ScopeInfo* cast(Object* object);
4043 4044
4044 // Return the type of this scope. 4045 // Return the type of this scope.
4045 ScopeType scope_type(); 4046 ScopeType scope_type();
4046 4047
4047 // Does this scope call eval? 4048 // Does this scope call eval?
4048 bool CallsEval(); 4049 bool CallsEval();
4049 4050
4050 // Return the language mode of this scope. 4051 // Return the language mode of this scope.
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after
4234 // BitFields representing the encoded information for context locals in the 4235 // BitFields representing the encoded information for context locals in the
4235 // ContextLocalInfoEntries part. 4236 // ContextLocalInfoEntries part.
4236 class ContextLocalMode: public BitField<VariableMode, 0, 3> {}; 4237 class ContextLocalMode: public BitField<VariableMode, 0, 3> {};
4237 class ContextLocalInitFlag: public BitField<InitializationFlag, 3, 1> {}; 4238 class ContextLocalInitFlag: public BitField<InitializationFlag, 3, 1> {};
4238 }; 4239 };
4239 4240
4240 4241
4241 // The cache for maps used by normalized (dictionary mode) objects. 4242 // The cache for maps used by normalized (dictionary mode) objects.
4242 // Such maps do not have property descriptors, so a typical program 4243 // Such maps do not have property descriptors, so a typical program
4243 // needs very limited number of distinct normalized maps. 4244 // needs very limited number of distinct normalized maps.
4244 class NormalizedMapCache FINAL : public FixedArray { 4245 class NormalizedMapCache V8_FINAL : public FixedArray {
4245 public: 4246 public:
4246 static const int kEntries = 64; 4247 static const int kEntries = 64;
4247 4248
4248 MUST_USE_RESULT MaybeObject* Get(JSObject* object, 4249 MUST_USE_RESULT MaybeObject* Get(JSObject* object,
4249 PropertyNormalizationMode mode); 4250 PropertyNormalizationMode mode);
4250 4251
4251 void Clear(); 4252 void Clear();
4252 4253
4253 // Casting 4254 // Casting
4254 static inline NormalizedMapCache* cast(Object* obj); 4255 static inline NormalizedMapCache* cast(Object* obj);
4255 4256
4256 DECLARE_VERIFIER(NormalizedMapCache) 4257 DECLARE_VERIFIER(NormalizedMapCache)
4257 }; 4258 };
4258 4259
4259 4260
4260 // ByteArray represents fixed sized byte arrays. Used for the relocation info 4261 // ByteArray represents fixed sized byte arrays. Used for the relocation info
4261 // that is attached to code objects. 4262 // that is attached to code objects.
4262 class ByteArray FINAL : public FixedArrayBase { 4263 class ByteArray V8_FINAL : public FixedArrayBase {
4263 public: 4264 public:
4264 inline int Size() { return RoundUp(length() + kHeaderSize, kPointerSize); } 4265 inline int Size() { return RoundUp(length() + kHeaderSize, kPointerSize); }
4265 4266
4266 // Setter and getter. 4267 // Setter and getter.
4267 inline byte get(int index); 4268 inline byte get(int index);
4268 inline void set(int index, byte value); 4269 inline void set(int index, byte value);
4269 4270
4270 // Treat contents as an int array. 4271 // Treat contents as an int array.
4271 inline int get_int(int index); 4272 inline int get_int(int index);
4272 4273
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
4307 // Maximal length of a single ByteArray. 4308 // Maximal length of a single ByteArray.
4308 static const int kMaxLength = kMaxSize - kHeaderSize; 4309 static const int kMaxLength = kMaxSize - kHeaderSize;
4309 4310
4310 private: 4311 private:
4311 DISALLOW_IMPLICIT_CONSTRUCTORS(ByteArray); 4312 DISALLOW_IMPLICIT_CONSTRUCTORS(ByteArray);
4312 }; 4313 };
4313 4314
4314 4315
4315 // FreeSpace represents fixed sized areas of the heap that are not currently in 4316 // FreeSpace represents fixed sized areas of the heap that are not currently in
4316 // use. Used by the heap and GC. 4317 // use. Used by the heap and GC.
4317 class FreeSpace FINAL : public HeapObject { 4318 class FreeSpace V8_FINAL : public HeapObject {
4318 public: 4319 public:
4319 // [size]: size of the free space including the header. 4320 // [size]: size of the free space including the header.
4320 inline int size(); 4321 inline int size();
4321 inline void set_size(int value); 4322 inline void set_size(int value);
4322 4323
4323 inline int Size() { return size(); } 4324 inline int Size() { return size(); }
4324 4325
4325 // Casting. 4326 // Casting.
4326 static inline FreeSpace* cast(Object* obj); 4327 static inline FreeSpace* cast(Object* obj);
4327 4328
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
4378 4379
4379 4380
4380 // A ExternalPixelArray represents a fixed-size byte array with special 4381 // A ExternalPixelArray represents a fixed-size byte array with special
4381 // semantics used for implementing the CanvasPixelArray object. Please see the 4382 // semantics used for implementing the CanvasPixelArray object. Please see the
4382 // specification at: 4383 // specification at:
4383 4384
4384 // http://www.whatwg.org/specs/web-apps/current-work/ 4385 // http://www.whatwg.org/specs/web-apps/current-work/
4385 // multipage/the-canvas-element.html#canvaspixelarray 4386 // multipage/the-canvas-element.html#canvaspixelarray
4386 // In particular, write access clamps the value written to 0 or 255 if the 4387 // In particular, write access clamps the value written to 0 or 255 if the
4387 // value written is outside this range. 4388 // value written is outside this range.
4388 class ExternalPixelArray FINAL : public ExternalArray { 4389 class ExternalPixelArray V8_FINAL : public ExternalArray {
4389 public: 4390 public:
4390 inline uint8_t* external_pixel_pointer(); 4391 inline uint8_t* external_pixel_pointer();
4391 4392
4392 // Setter and getter. 4393 // Setter and getter.
4393 inline uint8_t get_scalar(int index); 4394 inline uint8_t get_scalar(int index);
4394 MUST_USE_RESULT inline MaybeObject* get(int index); 4395 MUST_USE_RESULT inline MaybeObject* get(int index);
4395 inline void set(int index, uint8_t value); 4396 inline void set(int index, uint8_t value);
4396 4397
4397 // This accessor applies the correct conversion from Smi, HeapNumber and 4398 // This accessor applies the correct conversion from Smi, HeapNumber and
4398 // undefined and clamps the converted value between 0 and 255. 4399 // undefined and clamps the converted value between 0 and 255.
4399 Object* SetValue(uint32_t index, Object* value); 4400 Object* SetValue(uint32_t index, Object* value);
4400 4401
4401 // Casting. 4402 // Casting.
4402 static inline ExternalPixelArray* cast(Object* obj); 4403 static inline ExternalPixelArray* cast(Object* obj);
4403 4404
4404 // Dispatched behavior. 4405 // Dispatched behavior.
4405 DECLARE_PRINTER(ExternalPixelArray) 4406 DECLARE_PRINTER(ExternalPixelArray)
4406 DECLARE_VERIFIER(ExternalPixelArray) 4407 DECLARE_VERIFIER(ExternalPixelArray)
4407 4408
4408 private: 4409 private:
4409 DISALLOW_IMPLICIT_CONSTRUCTORS(ExternalPixelArray); 4410 DISALLOW_IMPLICIT_CONSTRUCTORS(ExternalPixelArray);
4410 }; 4411 };
4411 4412
4412 4413
4413 class ExternalByteArray FINAL : public ExternalArray { 4414 class ExternalByteArray V8_FINAL : public ExternalArray {
4414 public: 4415 public:
4415 // Setter and getter. 4416 // Setter and getter.
4416 inline int8_t get_scalar(int index); 4417 inline int8_t get_scalar(int index);
4417 MUST_USE_RESULT inline MaybeObject* get(int index); 4418 MUST_USE_RESULT inline MaybeObject* get(int index);
4418 inline void set(int index, int8_t value); 4419 inline void set(int index, int8_t value);
4419 4420
4420 // This accessor applies the correct conversion from Smi, HeapNumber 4421 // This accessor applies the correct conversion from Smi, HeapNumber
4421 // and undefined. 4422 // and undefined.
4422 MUST_USE_RESULT MaybeObject* SetValue(uint32_t index, Object* value); 4423 MUST_USE_RESULT MaybeObject* SetValue(uint32_t index, Object* value);
4423 4424
4424 // Casting. 4425 // Casting.
4425 static inline ExternalByteArray* cast(Object* obj); 4426 static inline ExternalByteArray* cast(Object* obj);
4426 4427
4427 // Dispatched behavior. 4428 // Dispatched behavior.
4428 DECLARE_PRINTER(ExternalByteArray) 4429 DECLARE_PRINTER(ExternalByteArray)
4429 DECLARE_VERIFIER(ExternalByteArray) 4430 DECLARE_VERIFIER(ExternalByteArray)
4430 4431
4431 private: 4432 private:
4432 DISALLOW_IMPLICIT_CONSTRUCTORS(ExternalByteArray); 4433 DISALLOW_IMPLICIT_CONSTRUCTORS(ExternalByteArray);
4433 }; 4434 };
4434 4435
4435 4436
4436 class ExternalUnsignedByteArray FINAL : public ExternalArray { 4437 class ExternalUnsignedByteArray V8_FINAL : public ExternalArray {
4437 public: 4438 public:
4438 // Setter and getter. 4439 // Setter and getter.
4439 inline uint8_t get_scalar(int index); 4440 inline uint8_t get_scalar(int index);
4440 MUST_USE_RESULT inline MaybeObject* get(int index); 4441 MUST_USE_RESULT inline MaybeObject* get(int index);
4441 inline void set(int index, uint8_t value); 4442 inline void set(int index, uint8_t value);
4442 4443
4443 // This accessor applies the correct conversion from Smi, HeapNumber 4444 // This accessor applies the correct conversion from Smi, HeapNumber
4444 // and undefined. 4445 // and undefined.
4445 MUST_USE_RESULT MaybeObject* SetValue(uint32_t index, Object* value); 4446 MUST_USE_RESULT MaybeObject* SetValue(uint32_t index, Object* value);
4446 4447
4447 // Casting. 4448 // Casting.
4448 static inline ExternalUnsignedByteArray* cast(Object* obj); 4449 static inline ExternalUnsignedByteArray* cast(Object* obj);
4449 4450
4450 // Dispatched behavior. 4451 // Dispatched behavior.
4451 DECLARE_PRINTER(ExternalUnsignedByteArray) 4452 DECLARE_PRINTER(ExternalUnsignedByteArray)
4452 DECLARE_VERIFIER(ExternalUnsignedByteArray) 4453 DECLARE_VERIFIER(ExternalUnsignedByteArray)
4453 4454
4454 private: 4455 private:
4455 DISALLOW_IMPLICIT_CONSTRUCTORS(ExternalUnsignedByteArray); 4456 DISALLOW_IMPLICIT_CONSTRUCTORS(ExternalUnsignedByteArray);
4456 }; 4457 };
4457 4458
4458 4459
4459 class ExternalShortArray FINAL : public ExternalArray { 4460 class ExternalShortArray V8_FINAL : public ExternalArray {
4460 public: 4461 public:
4461 // Setter and getter. 4462 // Setter and getter.
4462 inline int16_t get_scalar(int index); 4463 inline int16_t get_scalar(int index);
4463 MUST_USE_RESULT inline MaybeObject* get(int index); 4464 MUST_USE_RESULT inline MaybeObject* get(int index);
4464 inline void set(int index, int16_t value); 4465 inline void set(int index, int16_t value);
4465 4466
4466 // This accessor applies the correct conversion from Smi, HeapNumber 4467 // This accessor applies the correct conversion from Smi, HeapNumber
4467 // and undefined. 4468 // and undefined.
4468 MUST_USE_RESULT MaybeObject* SetValue(uint32_t index, Object* value); 4469 MUST_USE_RESULT MaybeObject* SetValue(uint32_t index, Object* value);
4469 4470
4470 // Casting. 4471 // Casting.
4471 static inline ExternalShortArray* cast(Object* obj); 4472 static inline ExternalShortArray* cast(Object* obj);
4472 4473
4473 // Dispatched behavior. 4474 // Dispatched behavior.
4474 DECLARE_PRINTER(ExternalShortArray) 4475 DECLARE_PRINTER(ExternalShortArray)
4475 DECLARE_VERIFIER(ExternalShortArray) 4476 DECLARE_VERIFIER(ExternalShortArray)
4476 4477
4477 private: 4478 private:
4478 DISALLOW_IMPLICIT_CONSTRUCTORS(ExternalShortArray); 4479 DISALLOW_IMPLICIT_CONSTRUCTORS(ExternalShortArray);
4479 }; 4480 };
4480 4481
4481 4482
4482 class ExternalUnsignedShortArray FINAL : public ExternalArray { 4483 class ExternalUnsignedShortArray V8_FINAL : public ExternalArray {
4483 public: 4484 public:
4484 // Setter and getter. 4485 // Setter and getter.
4485 inline uint16_t get_scalar(int index); 4486 inline uint16_t get_scalar(int index);
4486 MUST_USE_RESULT inline MaybeObject* get(int index); 4487 MUST_USE_RESULT inline MaybeObject* get(int index);
4487 inline void set(int index, uint16_t value); 4488 inline void set(int index, uint16_t value);
4488 4489
4489 // This accessor applies the correct conversion from Smi, HeapNumber 4490 // This accessor applies the correct conversion from Smi, HeapNumber
4490 // and undefined. 4491 // and undefined.
4491 MUST_USE_RESULT MaybeObject* SetValue(uint32_t index, Object* value); 4492 MUST_USE_RESULT MaybeObject* SetValue(uint32_t index, Object* value);
4492 4493
4493 // Casting. 4494 // Casting.
4494 static inline ExternalUnsignedShortArray* cast(Object* obj); 4495 static inline ExternalUnsignedShortArray* cast(Object* obj);
4495 4496
4496 // Dispatched behavior. 4497 // Dispatched behavior.
4497 DECLARE_PRINTER(ExternalUnsignedShortArray) 4498 DECLARE_PRINTER(ExternalUnsignedShortArray)
4498 DECLARE_VERIFIER(ExternalUnsignedShortArray) 4499 DECLARE_VERIFIER(ExternalUnsignedShortArray)
4499 4500
4500 private: 4501 private:
4501 DISALLOW_IMPLICIT_CONSTRUCTORS(ExternalUnsignedShortArray); 4502 DISALLOW_IMPLICIT_CONSTRUCTORS(ExternalUnsignedShortArray);
4502 }; 4503 };
4503 4504
4504 4505
4505 class ExternalIntArray FINAL : public ExternalArray { 4506 class ExternalIntArray V8_FINAL : public ExternalArray {
4506 public: 4507 public:
4507 // Setter and getter. 4508 // Setter and getter.
4508 inline int32_t get_scalar(int index); 4509 inline int32_t get_scalar(int index);
4509 MUST_USE_RESULT inline MaybeObject* get(int index); 4510 MUST_USE_RESULT inline MaybeObject* get(int index);
4510 inline void set(int index, int32_t value); 4511 inline void set(int index, int32_t value);
4511 4512
4512 // This accessor applies the correct conversion from Smi, HeapNumber 4513 // This accessor applies the correct conversion from Smi, HeapNumber
4513 // and undefined. 4514 // and undefined.
4514 MUST_USE_RESULT MaybeObject* SetValue(uint32_t index, Object* value); 4515 MUST_USE_RESULT MaybeObject* SetValue(uint32_t index, Object* value);
4515 4516
4516 // Casting. 4517 // Casting.
4517 static inline ExternalIntArray* cast(Object* obj); 4518 static inline ExternalIntArray* cast(Object* obj);
4518 4519
4519 // Dispatched behavior. 4520 // Dispatched behavior.
4520 DECLARE_PRINTER(ExternalIntArray) 4521 DECLARE_PRINTER(ExternalIntArray)
4521 DECLARE_VERIFIER(ExternalIntArray) 4522 DECLARE_VERIFIER(ExternalIntArray)
4522 4523
4523 private: 4524 private:
4524 DISALLOW_IMPLICIT_CONSTRUCTORS(ExternalIntArray); 4525 DISALLOW_IMPLICIT_CONSTRUCTORS(ExternalIntArray);
4525 }; 4526 };
4526 4527
4527 4528
4528 class ExternalUnsignedIntArray FINAL : public ExternalArray { 4529 class ExternalUnsignedIntArray V8_FINAL : public ExternalArray {
4529 public: 4530 public:
4530 // Setter and getter. 4531 // Setter and getter.
4531 inline uint32_t get_scalar(int index); 4532 inline uint32_t get_scalar(int index);
4532 MUST_USE_RESULT inline MaybeObject* get(int index); 4533 MUST_USE_RESULT inline MaybeObject* get(int index);
4533 inline void set(int index, uint32_t value); 4534 inline void set(int index, uint32_t value);
4534 4535
4535 // This accessor applies the correct conversion from Smi, HeapNumber 4536 // This accessor applies the correct conversion from Smi, HeapNumber
4536 // and undefined. 4537 // and undefined.
4537 MUST_USE_RESULT MaybeObject* SetValue(uint32_t index, Object* value); 4538 MUST_USE_RESULT MaybeObject* SetValue(uint32_t index, Object* value);
4538 4539
4539 // Casting. 4540 // Casting.
4540 static inline ExternalUnsignedIntArray* cast(Object* obj); 4541 static inline ExternalUnsignedIntArray* cast(Object* obj);
4541 4542
4542 // Dispatched behavior. 4543 // Dispatched behavior.
4543 DECLARE_PRINTER(ExternalUnsignedIntArray) 4544 DECLARE_PRINTER(ExternalUnsignedIntArray)
4544 DECLARE_VERIFIER(ExternalUnsignedIntArray) 4545 DECLARE_VERIFIER(ExternalUnsignedIntArray)
4545 4546
4546 private: 4547 private:
4547 DISALLOW_IMPLICIT_CONSTRUCTORS(ExternalUnsignedIntArray); 4548 DISALLOW_IMPLICIT_CONSTRUCTORS(ExternalUnsignedIntArray);
4548 }; 4549 };
4549 4550
4550 4551
4551 class ExternalFloatArray FINAL : public ExternalArray { 4552 class ExternalFloatArray V8_FINAL : public ExternalArray {
4552 public: 4553 public:
4553 // Setter and getter. 4554 // Setter and getter.
4554 inline float get_scalar(int index); 4555 inline float get_scalar(int index);
4555 MUST_USE_RESULT inline MaybeObject* get(int index); 4556 MUST_USE_RESULT inline MaybeObject* get(int index);
4556 inline void set(int index, float value); 4557 inline void set(int index, float value);
4557 4558
4558 // This accessor applies the correct conversion from Smi, HeapNumber 4559 // This accessor applies the correct conversion from Smi, HeapNumber
4559 // and undefined. 4560 // and undefined.
4560 MUST_USE_RESULT MaybeObject* SetValue(uint32_t index, Object* value); 4561 MUST_USE_RESULT MaybeObject* SetValue(uint32_t index, Object* value);
4561 4562
4562 // Casting. 4563 // Casting.
4563 static inline ExternalFloatArray* cast(Object* obj); 4564 static inline ExternalFloatArray* cast(Object* obj);
4564 4565
4565 // Dispatched behavior. 4566 // Dispatched behavior.
4566 DECLARE_PRINTER(ExternalFloatArray) 4567 DECLARE_PRINTER(ExternalFloatArray)
4567 DECLARE_VERIFIER(ExternalFloatArray) 4568 DECLARE_VERIFIER(ExternalFloatArray)
4568 4569
4569 private: 4570 private:
4570 DISALLOW_IMPLICIT_CONSTRUCTORS(ExternalFloatArray); 4571 DISALLOW_IMPLICIT_CONSTRUCTORS(ExternalFloatArray);
4571 }; 4572 };
4572 4573
4573 4574
4574 class ExternalDoubleArray FINAL : public ExternalArray { 4575 class ExternalDoubleArray V8_FINAL : public ExternalArray {
4575 public: 4576 public:
4576 // Setter and getter. 4577 // Setter and getter.
4577 inline double get_scalar(int index); 4578 inline double get_scalar(int index);
4578 MUST_USE_RESULT inline MaybeObject* get(int index); 4579 MUST_USE_RESULT inline MaybeObject* get(int index);
4579 inline void set(int index, double value); 4580 inline void set(int index, double value);
4580 4581
4581 // This accessor applies the correct conversion from Smi, HeapNumber 4582 // This accessor applies the correct conversion from Smi, HeapNumber
4582 // and undefined. 4583 // and undefined.
4583 MUST_USE_RESULT MaybeObject* SetValue(uint32_t index, Object* value); 4584 MUST_USE_RESULT MaybeObject* SetValue(uint32_t index, Object* value);
4584 4585
4585 // Casting. 4586 // Casting.
4586 static inline ExternalDoubleArray* cast(Object* obj); 4587 static inline ExternalDoubleArray* cast(Object* obj);
4587 4588
4588 // Dispatched behavior. 4589 // Dispatched behavior.
4589 DECLARE_PRINTER(ExternalDoubleArray) 4590 DECLARE_PRINTER(ExternalDoubleArray)
4590 DECLARE_VERIFIER(ExternalDoubleArray) 4591 DECLARE_VERIFIER(ExternalDoubleArray)
4591 4592
4592 private: 4593 private:
4593 DISALLOW_IMPLICIT_CONSTRUCTORS(ExternalDoubleArray); 4594 DISALLOW_IMPLICIT_CONSTRUCTORS(ExternalDoubleArray);
4594 }; 4595 };
4595 4596
4596 4597
4597 // DeoptimizationInputData is a fixed array used to hold the deoptimization 4598 // DeoptimizationInputData is a fixed array used to hold the deoptimization
4598 // data for code generated by the Hydrogen/Lithium compiler. It also 4599 // data for code generated by the Hydrogen/Lithium compiler. It also
4599 // contains information about functions that were inlined. If N different 4600 // contains information about functions that were inlined. If N different
4600 // functions were inlined then first N elements of the literal array will 4601 // functions were inlined then first N elements of the literal array will
4601 // contain these functions. 4602 // contain these functions.
4602 // 4603 //
4603 // It can be empty. 4604 // It can be empty.
4604 class DeoptimizationInputData FINAL : public FixedArray { 4605 class DeoptimizationInputData V8_FINAL : public FixedArray {
4605 public: 4606 public:
4606 // Layout description. Indices in the array. 4607 // Layout description. Indices in the array.
4607 static const int kTranslationByteArrayIndex = 0; 4608 static const int kTranslationByteArrayIndex = 0;
4608 static const int kInlinedFunctionCountIndex = 1; 4609 static const int kInlinedFunctionCountIndex = 1;
4609 static const int kLiteralArrayIndex = 2; 4610 static const int kLiteralArrayIndex = 2;
4610 static const int kOsrAstIdIndex = 3; 4611 static const int kOsrAstIdIndex = 3;
4611 static const int kOsrPcOffsetIndex = 4; 4612 static const int kOsrPcOffsetIndex = 4;
4612 static const int kFirstDeoptEntryIndex = 5; 4613 static const int kFirstDeoptEntryIndex = 5;
4613 4614
4614 // Offsets of deopt entry elements relative to the start of the entry. 4615 // Offsets of deopt entry elements relative to the start of the entry.
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
4683 return IndexForEntry(entry_count); 4684 return IndexForEntry(entry_count);
4684 } 4685 }
4685 }; 4686 };
4686 4687
4687 4688
4688 // DeoptimizationOutputData is a fixed array used to hold the deoptimization 4689 // DeoptimizationOutputData is a fixed array used to hold the deoptimization
4689 // data for code generated by the full compiler. 4690 // data for code generated by the full compiler.
4690 // The format of the these objects is 4691 // The format of the these objects is
4691 // [i * 2]: Ast ID for ith deoptimization. 4692 // [i * 2]: Ast ID for ith deoptimization.
4692 // [i * 2 + 1]: PC and state of ith deoptimization 4693 // [i * 2 + 1]: PC and state of ith deoptimization
4693 class DeoptimizationOutputData FINAL : public FixedArray { 4694 class DeoptimizationOutputData V8_FINAL : public FixedArray {
4694 public: 4695 public:
4695 int DeoptPoints() { return length() / 2; } 4696 int DeoptPoints() { return length() / 2; }
4696 4697
4697 BailoutId AstId(int index) { 4698 BailoutId AstId(int index) {
4698 return BailoutId(Smi::cast(get(index * 2))->value()); 4699 return BailoutId(Smi::cast(get(index * 2))->value());
4699 } 4700 }
4700 4701
4701 void SetAstId(int index, BailoutId id) { 4702 void SetAstId(int index, BailoutId id) {
4702 set(index * 2, Smi::FromInt(id.ToInt())); 4703 set(index * 2, Smi::FromInt(id.ToInt()));
4703 } 4704 }
(...skipping 20 matching lines...) Expand all
4724 4725
4725 // Forward declaration. 4726 // Forward declaration.
4726 class Cell; 4727 class Cell;
4727 class PropertyCell; 4728 class PropertyCell;
4728 4729
4729 // TypeFeedbackCells is a fixed array used to hold the association between 4730 // TypeFeedbackCells is a fixed array used to hold the association between
4730 // cache cells and AST ids for code generated by the full compiler. 4731 // cache cells and AST ids for code generated by the full compiler.
4731 // The format of the these objects is 4732 // The format of the these objects is
4732 // [i * 2]: Global property cell of ith cache cell. 4733 // [i * 2]: Global property cell of ith cache cell.
4733 // [i * 2 + 1]: Ast ID for ith cache cell. 4734 // [i * 2 + 1]: Ast ID for ith cache cell.
4734 class TypeFeedbackCells FINAL : public FixedArray { 4735 class TypeFeedbackCells V8_FINAL : public FixedArray {
4735 public: 4736 public:
4736 int CellCount() { return length() / 2; } 4737 int CellCount() { return length() / 2; }
4737 static int LengthOfFixedArray(int cell_count) { return cell_count * 2; } 4738 static int LengthOfFixedArray(int cell_count) { return cell_count * 2; }
4738 4739
4739 // Accessors for AST ids associated with cache values. 4740 // Accessors for AST ids associated with cache values.
4740 inline TypeFeedbackId AstId(int index); 4741 inline TypeFeedbackId AstId(int index);
4741 inline void SetAstId(int index, TypeFeedbackId id); 4742 inline void SetAstId(int index, TypeFeedbackId id);
4742 4743
4743 // Accessors for global property cells holding the cache values. 4744 // Accessors for global property cells holding the cache values.
4744 inline Cell* GetCell(int index); 4745 inline Cell* GetCell(int index);
(...skipping 20 matching lines...) Expand all
4765 static const int kForInFastCaseMarker = 0; 4766 static const int kForInFastCaseMarker = 0;
4766 static const int kForInSlowCaseMarker = 1; 4767 static const int kForInSlowCaseMarker = 1;
4767 }; 4768 };
4768 4769
4769 4770
4770 // Forward declaration. 4771 // Forward declaration.
4771 class SafepointEntry; 4772 class SafepointEntry;
4772 class TypeFeedbackInfo; 4773 class TypeFeedbackInfo;
4773 4774
4774 // Code describes objects with on-the-fly generated machine code. 4775 // Code describes objects with on-the-fly generated machine code.
4775 class Code FINAL : public HeapObject { 4776 class Code V8_FINAL : public HeapObject {
4776 public: 4777 public:
4777 // Opaque data type for encapsulating code flags like kind, inline 4778 // Opaque data type for encapsulating code flags like kind, inline
4778 // cache state, and arguments count. 4779 // cache state, and arguments count.
4779 typedef uint32_t Flags; 4780 typedef uint32_t Flags;
4780 4781
4781 #define NON_IC_KIND_LIST(V) \ 4782 #define NON_IC_KIND_LIST(V) \
4782 V(FUNCTION) \ 4783 V(FUNCTION) \
4783 V(OPTIMIZED_FUNCTION) \ 4784 V(OPTIMIZED_FUNCTION) \
4784 V(STUB) \ 4785 V(STUB) \
4785 V(BUILTIN) \ 4786 V(BUILTIN) \
(...skipping 550 matching lines...) Expand 10 before | Expand all | Expand 10 after
5336 // The first n elements are Smis, each of them specifies the number of codes 5337 // The first n elements are Smis, each of them specifies the number of codes
5337 // in the corresponding group. The subsequent elements contain grouped code 5338 // in the corresponding group. The subsequent elements contain grouped code
5338 // objects. The suffix of the array can be filled with the undefined value if 5339 // objects. The suffix of the array can be filled with the undefined value if
5339 // the number of codes is less than the length of the array. The order of the 5340 // the number of codes is less than the length of the array. The order of the
5340 // code objects within a group is not preserved. 5341 // code objects within a group is not preserved.
5341 // 5342 //
5342 // All code indexes used in the class are counted starting from the first 5343 // All code indexes used in the class are counted starting from the first
5343 // code object of the first group. In other words, code index 0 corresponds 5344 // code object of the first group. In other words, code index 0 corresponds
5344 // to array index n = kCodesStartIndex. 5345 // to array index n = kCodesStartIndex.
5345 5346
5346 class DependentCode FINAL : public FixedArray { 5347 class DependentCode V8_FINAL : public FixedArray {
5347 public: 5348 public:
5348 enum DependencyGroup { 5349 enum DependencyGroup {
5349 // Group of code that weakly embed this map and depend on being 5350 // Group of code that weakly embed this map and depend on being
5350 // deoptimized when the map is garbage collected. 5351 // deoptimized when the map is garbage collected.
5351 kWeaklyEmbeddedGroup, 5352 kWeaklyEmbeddedGroup,
5352 // Group of code that embed a transition to this map, and depend on being 5353 // Group of code that embed a transition to this map, and depend on being
5353 // deoptimized when the transition is replaced by a new version. 5354 // deoptimized when the transition is replaced by a new version.
5354 kTransitionGroup, 5355 kTransitionGroup,
5355 // Group of code that omit run-time prototype checks for prototypes 5356 // Group of code that omit run-time prototype checks for prototypes
5356 // described by this map. The group is deoptimized whenever an object 5357 // described by this map. The group is deoptimized whenever an object
5357 // described by this map changes shape (and transitions to a new map), 5358 // described by this map changes shape (and transitions to a new map),
5358 // possibly invalidating the assumptions embedded in the code. 5359 // possibly invalidating the assumptions embedded in the code.
5359 kPrototypeCheckGroup, 5360 kPrototypeCheckGroup,
5360 // Group of code that depends on elements not being added to objects with 5361 // Group of code that depends on elements not being added to objects with
5361 // this map. 5362 // this map.
5362 kElementsCantBeAddedGroup, 5363 kElementsCantBeAddedGroup,
5363 // Group of code that depends on global property values in property cells 5364 // Group of code that depends on global property values in property cells
5364 // not being changed. 5365 // not being changed.
5365 kPropertyCellChangedGroup, 5366 kPropertyCellChangedGroup,
5366 kGroupCount = kPropertyCellChangedGroup + 1 5367 kGroupCount = kPropertyCellChangedGroup + 1
5367 }; 5368 };
5368 5369
5369 // Array for holding the index of the first code object of each group. 5370 // Array for holding the index of the first code object of each group.
5370 // The last element stores the total number of code objects. 5371 // The last element stores the total number of code objects.
5371 class GroupStartIndexes FINAL { 5372 class GroupStartIndexes V8_FINAL {
5372 public: 5373 public:
5373 explicit GroupStartIndexes(DependentCode* entries); 5374 explicit GroupStartIndexes(DependentCode* entries);
5374 void Recompute(DependentCode* entries); 5375 void Recompute(DependentCode* entries);
5375 int at(int i) { return start_indexes_[i]; } 5376 int at(int i) { return start_indexes_[i]; }
5376 int number_of_entries() { return start_indexes_[kGroupCount]; } 5377 int number_of_entries() { return start_indexes_[kGroupCount]; }
5377 private: 5378 private:
5378 int start_indexes_[kGroupCount + 1]; 5379 int start_indexes_[kGroupCount + 1];
5379 }; 5380 };
5380 5381
5381 bool Contains(DependencyGroup group, Code* code); 5382 bool Contains(DependencyGroup group, Code* code);
(...skipping 685 matching lines...) Expand 10 before | Expand all | Expand 10 after
6067 // It doesn't carry much functionality but allows struct classes to be 6068 // It doesn't carry much functionality but allows struct classes to be
6068 // identified in the type system. 6069 // identified in the type system.
6069 class Struct: public HeapObject { 6070 class Struct: public HeapObject {
6070 public: 6071 public:
6071 inline void InitializeBody(int object_size); 6072 inline void InitializeBody(int object_size);
6072 static inline Struct* cast(Object* that); 6073 static inline Struct* cast(Object* that);
6073 }; 6074 };
6074 6075
6075 6076
6076 // A simple one-element struct, useful where smis need to be boxed. 6077 // A simple one-element struct, useful where smis need to be boxed.
6077 class Box FINAL : public Struct { 6078 class Box V8_FINAL : public Struct {
6078 public: 6079 public:
6079 // [value]: the boxed contents. 6080 // [value]: the boxed contents.
6080 DECL_ACCESSORS(value, Object) 6081 DECL_ACCESSORS(value, Object)
6081 6082
6082 static inline Box* cast(Object* obj); 6083 static inline Box* cast(Object* obj);
6083 6084
6084 // Dispatched behavior. 6085 // Dispatched behavior.
6085 DECLARE_PRINTER(Box) 6086 DECLARE_PRINTER(Box)
6086 DECLARE_VERIFIER(Box) 6087 DECLARE_VERIFIER(Box)
6087 6088
6088 static const int kValueOffset = HeapObject::kHeaderSize; 6089 static const int kValueOffset = HeapObject::kHeaderSize;
6089 static const int kSize = kValueOffset + kPointerSize; 6090 static const int kSize = kValueOffset + kPointerSize;
6090 6091
6091 private: 6092 private:
6092 DISALLOW_IMPLICIT_CONSTRUCTORS(Box); 6093 DISALLOW_IMPLICIT_CONSTRUCTORS(Box);
6093 }; 6094 };
6094 6095
6095 6096
6096 // Script describes a script which has been added to the VM. 6097 // Script describes a script which has been added to the VM.
6097 class Script FINAL : public Struct { 6098 class Script V8_FINAL : public Struct {
6098 public: 6099 public:
6099 // Script types. 6100 // Script types.
6100 enum Type { 6101 enum Type {
6101 TYPE_NATIVE = 0, 6102 TYPE_NATIVE = 0,
6102 TYPE_EXTENSION = 1, 6103 TYPE_EXTENSION = 1,
6103 TYPE_NORMAL = 2 6104 TYPE_NORMAL = 2
6104 }; 6105 };
6105 6106
6106 // Script compilation types. 6107 // Script compilation types.
6107 enum CompilationType { 6108 enum CompilationType {
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after
6256 #undef DECLARE_FUNCTION_ID 6257 #undef DECLARE_FUNCTION_ID
6257 // Fake id for a special case of Math.pow. Note, it continues the 6258 // Fake id for a special case of Math.pow. Note, it continues the
6258 // list of math functions. 6259 // list of math functions.
6259 kMathPowHalf, 6260 kMathPowHalf,
6260 kFirstMathFunctionId = kMathFloor 6261 kFirstMathFunctionId = kMathFloor
6261 }; 6262 };
6262 6263
6263 6264
6264 // SharedFunctionInfo describes the JSFunction information that can be 6265 // SharedFunctionInfo describes the JSFunction information that can be
6265 // shared by multiple instances of the function. 6266 // shared by multiple instances of the function.
6266 class SharedFunctionInfo FINAL : public HeapObject { 6267 class SharedFunctionInfo V8_FINAL : public HeapObject {
6267 public: 6268 public:
6268 // [name]: Function name. 6269 // [name]: Function name.
6269 DECL_ACCESSORS(name, Object) 6270 DECL_ACCESSORS(name, Object)
6270 6271
6271 // [code]: Function code. 6272 // [code]: Function code.
6272 DECL_ACCESSORS(code, Code) 6273 DECL_ACCESSORS(code, Code)
6273 inline void ReplaceCode(Code* code); 6274 inline void ReplaceCode(Code* code);
6274 6275
6275 // [optimized_code_map]: Map from native context to optimized code 6276 // [optimized_code_map]: Map from native context to optimized code
6276 // and a shared literals array or Smi(0) if none. 6277 // and a shared literals array or Smi(0) if none.
(...skipping 558 matching lines...) Expand 10 before | Expand all | Expand 10 after
6835 ((kNative + kCompilerHintsSmiTagSize) / kBitsPerByte); 6836 ((kNative + kCompilerHintsSmiTagSize) / kBitsPerByte);
6836 #else 6837 #else
6837 #error Unknown byte ordering 6838 #error Unknown byte ordering
6838 #endif 6839 #endif
6839 6840
6840 private: 6841 private:
6841 DISALLOW_IMPLICIT_CONSTRUCTORS(SharedFunctionInfo); 6842 DISALLOW_IMPLICIT_CONSTRUCTORS(SharedFunctionInfo);
6842 }; 6843 };
6843 6844
6844 6845
6845 class JSGeneratorObject FINAL : public JSObject { 6846 class JSGeneratorObject V8_FINAL : public JSObject {
6846 public: 6847 public:
6847 // [function]: The function corresponding to this generator object. 6848 // [function]: The function corresponding to this generator object.
6848 DECL_ACCESSORS(function, JSFunction) 6849 DECL_ACCESSORS(function, JSFunction)
6849 6850
6850 // [context]: The context of the suspended computation. 6851 // [context]: The context of the suspended computation.
6851 DECL_ACCESSORS(context, Context) 6852 DECL_ACCESSORS(context, Context)
6852 6853
6853 // [receiver]: The receiver of the suspended computation. 6854 // [receiver]: The receiver of the suspended computation.
6854 DECL_ACCESSORS(receiver, Object) 6855 DECL_ACCESSORS(receiver, Object)
6855 6856
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
6903 static const int kResultDonePropertyOffset = 6904 static const int kResultDonePropertyOffset =
6904 kResultValuePropertyOffset + kPointerSize; 6905 kResultValuePropertyOffset + kPointerSize;
6905 static const int kResultSize = kResultDonePropertyOffset + kPointerSize; 6906 static const int kResultSize = kResultDonePropertyOffset + kPointerSize;
6906 6907
6907 private: 6908 private:
6908 DISALLOW_IMPLICIT_CONSTRUCTORS(JSGeneratorObject); 6909 DISALLOW_IMPLICIT_CONSTRUCTORS(JSGeneratorObject);
6909 }; 6910 };
6910 6911
6911 6912
6912 // Representation for module instance objects. 6913 // Representation for module instance objects.
6913 class JSModule FINAL : public JSObject { 6914 class JSModule V8_FINAL : public JSObject {
6914 public: 6915 public:
6915 // [context]: the context holding the module's locals, or undefined if none. 6916 // [context]: the context holding the module's locals, or undefined if none.
6916 DECL_ACCESSORS(context, Object) 6917 DECL_ACCESSORS(context, Object)
6917 6918
6918 // [scope_info]: Scope info. 6919 // [scope_info]: Scope info.
6919 DECL_ACCESSORS(scope_info, ScopeInfo) 6920 DECL_ACCESSORS(scope_info, ScopeInfo)
6920 6921
6921 // Casting. 6922 // Casting.
6922 static inline JSModule* cast(Object* obj); 6923 static inline JSModule* cast(Object* obj);
6923 6924
6924 // Dispatched behavior. 6925 // Dispatched behavior.
6925 DECLARE_PRINTER(JSModule) 6926 DECLARE_PRINTER(JSModule)
6926 DECLARE_VERIFIER(JSModule) 6927 DECLARE_VERIFIER(JSModule)
6927 6928
6928 // Layout description. 6929 // Layout description.
6929 static const int kContextOffset = JSObject::kHeaderSize; 6930 static const int kContextOffset = JSObject::kHeaderSize;
6930 static const int kScopeInfoOffset = kContextOffset + kPointerSize; 6931 static const int kScopeInfoOffset = kContextOffset + kPointerSize;
6931 static const int kSize = kScopeInfoOffset + kPointerSize; 6932 static const int kSize = kScopeInfoOffset + kPointerSize;
6932 6933
6933 private: 6934 private:
6934 DISALLOW_IMPLICIT_CONSTRUCTORS(JSModule); 6935 DISALLOW_IMPLICIT_CONSTRUCTORS(JSModule);
6935 }; 6936 };
6936 6937
6937 6938
6938 // JSFunction describes JavaScript functions. 6939 // JSFunction describes JavaScript functions.
6939 class JSFunction FINAL : public JSObject { 6940 class JSFunction V8_FINAL : public JSObject {
6940 public: 6941 public:
6941 // [prototype_or_initial_map]: 6942 // [prototype_or_initial_map]:
6942 DECL_ACCESSORS(prototype_or_initial_map, Object) 6943 DECL_ACCESSORS(prototype_or_initial_map, Object)
6943 6944
6944 // [shared]: The information about the function that 6945 // [shared]: The information about the function that
6945 // can be shared by instances. 6946 // can be shared by instances.
6946 DECL_ACCESSORS(shared, SharedFunctionInfo) 6947 DECL_ACCESSORS(shared, SharedFunctionInfo)
6947 6948
6948 // [context]: The context for this function. 6949 // [context]: The context for this function.
6949 inline Context* context(); 6950 inline Context* context();
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after
7116 7117
7117 7118
7118 // JSGlobalProxy's prototype must be a JSGlobalObject or null, 7119 // JSGlobalProxy's prototype must be a JSGlobalObject or null,
7119 // and the prototype is hidden. JSGlobalProxy always delegates 7120 // and the prototype is hidden. JSGlobalProxy always delegates
7120 // property accesses to its prototype if the prototype is not null. 7121 // property accesses to its prototype if the prototype is not null.
7121 // 7122 //
7122 // A JSGlobalProxy can be reinitialized which will preserve its identity. 7123 // A JSGlobalProxy can be reinitialized which will preserve its identity.
7123 // 7124 //
7124 // Accessing a JSGlobalProxy requires security check. 7125 // Accessing a JSGlobalProxy requires security check.
7125 7126
7126 class JSGlobalProxy FINAL : public JSObject { 7127 class JSGlobalProxy V8_FINAL : public JSObject {
7127 public: 7128 public:
7128 // [native_context]: the owner native context of this global proxy object. 7129 // [native_context]: the owner native context of this global proxy object.
7129 // It is null value if this object is not used by any context. 7130 // It is null value if this object is not used by any context.
7130 DECL_ACCESSORS(native_context, Object) 7131 DECL_ACCESSORS(native_context, Object)
7131 7132
7132 // Casting. 7133 // Casting.
7133 static inline JSGlobalProxy* cast(Object* obj); 7134 static inline JSGlobalProxy* cast(Object* obj);
7134 7135
7135 // Dispatched behavior. 7136 // Dispatched behavior.
7136 DECLARE_PRINTER(JSGlobalProxy) 7137 DECLARE_PRINTER(JSGlobalProxy)
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
7189 static const int kGlobalContextOffset = kNativeContextOffset + kPointerSize; 7190 static const int kGlobalContextOffset = kNativeContextOffset + kPointerSize;
7190 static const int kGlobalReceiverOffset = kGlobalContextOffset + kPointerSize; 7191 static const int kGlobalReceiverOffset = kGlobalContextOffset + kPointerSize;
7191 static const int kHeaderSize = kGlobalReceiverOffset + kPointerSize; 7192 static const int kHeaderSize = kGlobalReceiverOffset + kPointerSize;
7192 7193
7193 private: 7194 private:
7194 DISALLOW_IMPLICIT_CONSTRUCTORS(GlobalObject); 7195 DISALLOW_IMPLICIT_CONSTRUCTORS(GlobalObject);
7195 }; 7196 };
7196 7197
7197 7198
7198 // JavaScript global object. 7199 // JavaScript global object.
7199 class JSGlobalObject FINAL : public GlobalObject { 7200 class JSGlobalObject V8_FINAL : public GlobalObject {
7200 public: 7201 public:
7201 // Casting. 7202 // Casting.
7202 static inline JSGlobalObject* cast(Object* obj); 7203 static inline JSGlobalObject* cast(Object* obj);
7203 7204
7204 // Dispatched behavior. 7205 // Dispatched behavior.
7205 DECLARE_PRINTER(JSGlobalObject) 7206 DECLARE_PRINTER(JSGlobalObject)
7206 DECLARE_VERIFIER(JSGlobalObject) 7207 DECLARE_VERIFIER(JSGlobalObject)
7207 7208
7208 // Layout description. 7209 // Layout description.
7209 static const int kSize = GlobalObject::kHeaderSize; 7210 static const int kSize = GlobalObject::kHeaderSize;
7210 7211
7211 private: 7212 private:
7212 DISALLOW_IMPLICIT_CONSTRUCTORS(JSGlobalObject); 7213 DISALLOW_IMPLICIT_CONSTRUCTORS(JSGlobalObject);
7213 }; 7214 };
7214 7215
7215 7216
7216 // Builtins global object which holds the runtime routines written in 7217 // Builtins global object which holds the runtime routines written in
7217 // JavaScript. 7218 // JavaScript.
7218 class JSBuiltinsObject FINAL : public GlobalObject { 7219 class JSBuiltinsObject V8_FINAL : public GlobalObject {
7219 public: 7220 public:
7220 // Accessors for the runtime routines written in JavaScript. 7221 // Accessors for the runtime routines written in JavaScript.
7221 inline Object* javascript_builtin(Builtins::JavaScript id); 7222 inline Object* javascript_builtin(Builtins::JavaScript id);
7222 inline void set_javascript_builtin(Builtins::JavaScript id, Object* value); 7223 inline void set_javascript_builtin(Builtins::JavaScript id, Object* value);
7223 7224
7224 // Accessors for code of the runtime routines written in JavaScript. 7225 // Accessors for code of the runtime routines written in JavaScript.
7225 inline Code* javascript_builtin_code(Builtins::JavaScript id); 7226 inline Code* javascript_builtin_code(Builtins::JavaScript id);
7226 inline void set_javascript_builtin_code(Builtins::JavaScript id, Code* value); 7227 inline void set_javascript_builtin_code(Builtins::JavaScript id, Code* value);
7227 7228
7228 // Casting. 7229 // Casting.
(...skipping 20 matching lines...) Expand all
7249 static int OffsetOfCodeWithId(Builtins::JavaScript id) { 7250 static int OffsetOfCodeWithId(Builtins::JavaScript id) {
7250 return kJSBuiltinsCodeOffset + id * kPointerSize; 7251 return kJSBuiltinsCodeOffset + id * kPointerSize;
7251 } 7252 }
7252 7253
7253 private: 7254 private:
7254 DISALLOW_IMPLICIT_CONSTRUCTORS(JSBuiltinsObject); 7255 DISALLOW_IMPLICIT_CONSTRUCTORS(JSBuiltinsObject);
7255 }; 7256 };
7256 7257
7257 7258
7258 // Representation for JS Wrapper objects, String, Number, Boolean, etc. 7259 // Representation for JS Wrapper objects, String, Number, Boolean, etc.
7259 class JSValue FINAL : public JSObject { 7260 class JSValue V8_FINAL : public JSObject {
7260 public: 7261 public:
7261 // [value]: the object being wrapped. 7262 // [value]: the object being wrapped.
7262 DECL_ACCESSORS(value, Object) 7263 DECL_ACCESSORS(value, Object)
7263 7264
7264 // Casting. 7265 // Casting.
7265 static inline JSValue* cast(Object* obj); 7266 static inline JSValue* cast(Object* obj);
7266 7267
7267 // Dispatched behavior. 7268 // Dispatched behavior.
7268 DECLARE_PRINTER(JSValue) 7269 DECLARE_PRINTER(JSValue)
7269 DECLARE_VERIFIER(JSValue) 7270 DECLARE_VERIFIER(JSValue)
7270 7271
7271 // Layout description. 7272 // Layout description.
7272 static const int kValueOffset = JSObject::kHeaderSize; 7273 static const int kValueOffset = JSObject::kHeaderSize;
7273 static const int kSize = kValueOffset + kPointerSize; 7274 static const int kSize = kValueOffset + kPointerSize;
7274 7275
7275 private: 7276 private:
7276 DISALLOW_IMPLICIT_CONSTRUCTORS(JSValue); 7277 DISALLOW_IMPLICIT_CONSTRUCTORS(JSValue);
7277 }; 7278 };
7278 7279
7279 7280
7280 class DateCache; 7281 class DateCache;
7281 7282
7282 // Representation for JS date objects. 7283 // Representation for JS date objects.
7283 class JSDate FINAL : public JSObject { 7284 class JSDate V8_FINAL : public JSObject {
7284 public: 7285 public:
7285 // If one component is NaN, all of them are, indicating a NaN time value. 7286 // If one component is NaN, all of them are, indicating a NaN time value.
7286 // [value]: the time value. 7287 // [value]: the time value.
7287 DECL_ACCESSORS(value, Object) 7288 DECL_ACCESSORS(value, Object)
7288 // [year]: caches year. Either undefined, smi, or NaN. 7289 // [year]: caches year. Either undefined, smi, or NaN.
7289 DECL_ACCESSORS(year, Object) 7290 DECL_ACCESSORS(year, Object)
7290 // [month]: caches month. Either undefined, smi, or NaN. 7291 // [month]: caches month. Either undefined, smi, or NaN.
7291 DECL_ACCESSORS(month, Object) 7292 DECL_ACCESSORS(month, Object)
7292 // [day]: caches day. Either undefined, smi, or NaN. 7293 // [day]: caches day. Either undefined, smi, or NaN.
7293 DECL_ACCESSORS(day, Object) 7294 DECL_ACCESSORS(day, Object)
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
7370 DISALLOW_IMPLICIT_CONSTRUCTORS(JSDate); 7371 DISALLOW_IMPLICIT_CONSTRUCTORS(JSDate);
7371 }; 7372 };
7372 7373
7373 7374
7374 // Representation of message objects used for error reporting through 7375 // Representation of message objects used for error reporting through
7375 // the API. The messages are formatted in JavaScript so this object is 7376 // the API. The messages are formatted in JavaScript so this object is
7376 // a real JavaScript object. The information used for formatting the 7377 // a real JavaScript object. The information used for formatting the
7377 // error messages are not directly accessible from JavaScript to 7378 // error messages are not directly accessible from JavaScript to
7378 // prevent leaking information to user code called during error 7379 // prevent leaking information to user code called during error
7379 // formatting. 7380 // formatting.
7380 class JSMessageObject FINAL : public JSObject { 7381 class JSMessageObject V8_FINAL : public JSObject {
7381 public: 7382 public:
7382 // [type]: the type of error message. 7383 // [type]: the type of error message.
7383 DECL_ACCESSORS(type, String) 7384 DECL_ACCESSORS(type, String)
7384 7385
7385 // [arguments]: the arguments for formatting the error message. 7386 // [arguments]: the arguments for formatting the error message.
7386 DECL_ACCESSORS(arguments, JSArray) 7387 DECL_ACCESSORS(arguments, JSArray)
7387 7388
7388 // [script]: the script from which the error message originated. 7389 // [script]: the script from which the error message originated.
7389 DECL_ACCESSORS(script, Object) 7390 DECL_ACCESSORS(script, Object)
7390 7391
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
7434 // - reference to the original flag string 7435 // - reference to the original flag string
7435 // If it is an atom regexp 7436 // If it is an atom regexp
7436 // - a reference to a literal string to search for 7437 // - a reference to a literal string to search for
7437 // If it is an irregexp regexp: 7438 // If it is an irregexp regexp:
7438 // - a reference to code for ASCII inputs (bytecode or compiled), or a smi 7439 // - a reference to code for ASCII inputs (bytecode or compiled), or a smi
7439 // used for tracking the last usage (used for code flushing). 7440 // used for tracking the last usage (used for code flushing).
7440 // - a reference to code for UC16 inputs (bytecode or compiled), or a smi 7441 // - a reference to code for UC16 inputs (bytecode or compiled), or a smi
7441 // used for tracking the last usage (used for code flushing).. 7442 // used for tracking the last usage (used for code flushing)..
7442 // - max number of registers used by irregexp implementations. 7443 // - max number of registers used by irregexp implementations.
7443 // - number of capture registers (output values) of the regexp. 7444 // - number of capture registers (output values) of the regexp.
7444 class JSRegExp FINAL : public JSObject { 7445 class JSRegExp V8_FINAL : public JSObject {
7445 public: 7446 public:
7446 // Meaning of Type: 7447 // Meaning of Type:
7447 // NOT_COMPILED: Initial value. No data has been stored in the JSRegExp yet. 7448 // NOT_COMPILED: Initial value. No data has been stored in the JSRegExp yet.
7448 // ATOM: A simple string to match against using an indexOf operation. 7449 // ATOM: A simple string to match against using an indexOf operation.
7449 // IRREGEXP: Compiled with Irregexp. 7450 // IRREGEXP: Compiled with Irregexp.
7450 // IRREGEXP_NATIVE: Compiled to native code with Irregexp. 7451 // IRREGEXP_NATIVE: Compiled to native code with Irregexp.
7451 enum Type { NOT_COMPILED, ATOM, IRREGEXP }; 7452 enum Type { NOT_COMPILED, ATOM, IRREGEXP };
7452 enum Flag { NONE = 0, GLOBAL = 1, IGNORE_CASE = 2, MULTILINE = 4 }; 7453 enum Flag { NONE = 0, GLOBAL = 1, IGNORE_CASE = 2, MULTILINE = 4 };
7453 7454
7454 class Flags { 7455 class Flags {
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
7557 // object is in the saved code field. 7558 // object is in the saved code field.
7558 static const int kCompilationErrorValue = -2; 7559 static const int kCompilationErrorValue = -2;
7559 7560
7560 // When we store the sweep generation at which we moved the code from the 7561 // When we store the sweep generation at which we moved the code from the
7561 // code index to the saved code index we mask it of to be in the [0:255] 7562 // code index to the saved code index we mask it of to be in the [0:255]
7562 // range. 7563 // range.
7563 static const int kCodeAgeMask = 0xff; 7564 static const int kCodeAgeMask = 0xff;
7564 }; 7565 };
7565 7566
7566 7567
7567 class CompilationCacheShape FINAL : public BaseShape<HashTableKey*> { 7568 class CompilationCacheShape V8_FINAL : public BaseShape<HashTableKey*> {
7568 public: 7569 public:
7569 static inline bool IsMatch(HashTableKey* key, Object* value) { 7570 static inline bool IsMatch(HashTableKey* key, Object* value) {
7570 return key->IsMatch(value); 7571 return key->IsMatch(value);
7571 } 7572 }
7572 7573
7573 static inline uint32_t Hash(HashTableKey* key) { 7574 static inline uint32_t Hash(HashTableKey* key) {
7574 return key->Hash(); 7575 return key->Hash();
7575 } 7576 }
7576 7577
7577 static inline uint32_t HashForObject(HashTableKey* key, Object* object) { 7578 static inline uint32_t HashForObject(HashTableKey* key, Object* object) {
7578 return key->HashForObject(object); 7579 return key->HashForObject(object);
7579 } 7580 }
7580 7581
7581 MUST_USE_RESULT static MaybeObject* AsObject(Heap* heap, 7582 MUST_USE_RESULT static MaybeObject* AsObject(Heap* heap,
7582 HashTableKey* key) { 7583 HashTableKey* key) {
7583 return key->AsObject(heap); 7584 return key->AsObject(heap);
7584 } 7585 }
7585 7586
7586 static const int kPrefixSize = 0; 7587 static const int kPrefixSize = 0;
7587 static const int kEntrySize = 2; 7588 static const int kEntrySize = 2;
7588 }; 7589 };
7589 7590
7590 7591
7591 class CompilationCacheTable FINAL : public HashTable<CompilationCacheShape, 7592 class CompilationCacheTable V8_FINAL : public HashTable<CompilationCacheShape,
7592 HashTableKey*> { 7593 HashTableKey*> {
7593 public: 7594 public:
7594 // Find cached value for a string key, otherwise return null. 7595 // Find cached value for a string key, otherwise return null.
7595 Object* Lookup(String* src, Context* context); 7596 Object* Lookup(String* src, Context* context);
7596 Object* LookupEval(String* src, 7597 Object* LookupEval(String* src,
7597 Context* context, 7598 Context* context,
7598 LanguageMode language_mode, 7599 LanguageMode language_mode,
7599 int scope_position); 7600 int scope_position);
7600 Object* LookupRegExp(String* source, JSRegExp::Flags flags); 7601 Object* LookupRegExp(String* source, JSRegExp::Flags flags);
7601 MUST_USE_RESULT MaybeObject* Put(String* src, 7602 MUST_USE_RESULT MaybeObject* Put(String* src,
(...skipping 10 matching lines...) Expand all
7612 // Remove given value from cache. 7613 // Remove given value from cache.
7613 void Remove(Object* value); 7614 void Remove(Object* value);
7614 7615
7615 static inline CompilationCacheTable* cast(Object* obj); 7616 static inline CompilationCacheTable* cast(Object* obj);
7616 7617
7617 private: 7618 private:
7618 DISALLOW_IMPLICIT_CONSTRUCTORS(CompilationCacheTable); 7619 DISALLOW_IMPLICIT_CONSTRUCTORS(CompilationCacheTable);
7619 }; 7620 };
7620 7621
7621 7622
7622 class CodeCache FINAL : public Struct { 7623 class CodeCache V8_FINAL : public Struct {
7623 public: 7624 public:
7624 DECL_ACCESSORS(default_cache, FixedArray) 7625 DECL_ACCESSORS(default_cache, FixedArray)
7625 DECL_ACCESSORS(normal_type_cache, Object) 7626 DECL_ACCESSORS(normal_type_cache, Object)
7626 7627
7627 // Add the code object to the cache. 7628 // Add the code object to the cache.
7628 MUST_USE_RESULT MaybeObject* Update(Name* name, Code* code); 7629 MUST_USE_RESULT MaybeObject* Update(Name* name, Code* code);
7629 7630
7630 // Lookup code object in the cache. Returns code object if found and undefined 7631 // Lookup code object in the cache. Returns code object if found and undefined
7631 // if not. 7632 // if not.
7632 Object* Lookup(Name* name, Code::Flags flags); 7633 Object* Lookup(Name* name, Code::Flags flags);
(...skipping 27 matching lines...) Expand all
7660 // Code cache layout of the default cache. Elements are alternating name and 7661 // Code cache layout of the default cache. Elements are alternating name and
7661 // code objects for non normal load/store/call IC's. 7662 // code objects for non normal load/store/call IC's.
7662 static const int kCodeCacheEntrySize = 2; 7663 static const int kCodeCacheEntrySize = 2;
7663 static const int kCodeCacheEntryNameOffset = 0; 7664 static const int kCodeCacheEntryNameOffset = 0;
7664 static const int kCodeCacheEntryCodeOffset = 1; 7665 static const int kCodeCacheEntryCodeOffset = 1;
7665 7666
7666 DISALLOW_IMPLICIT_CONSTRUCTORS(CodeCache); 7667 DISALLOW_IMPLICIT_CONSTRUCTORS(CodeCache);
7667 }; 7668 };
7668 7669
7669 7670
7670 class CodeCacheHashTableShape FINAL : public BaseShape<HashTableKey*> { 7671 class CodeCacheHashTableShape V8_FINAL : public BaseShape<HashTableKey*> {
7671 public: 7672 public:
7672 static inline bool IsMatch(HashTableKey* key, Object* value) { 7673 static inline bool IsMatch(HashTableKey* key, Object* value) {
7673 return key->IsMatch(value); 7674 return key->IsMatch(value);
7674 } 7675 }
7675 7676
7676 static inline uint32_t Hash(HashTableKey* key) { 7677 static inline uint32_t Hash(HashTableKey* key) {
7677 return key->Hash(); 7678 return key->Hash();
7678 } 7679 }
7679 7680
7680 static inline uint32_t HashForObject(HashTableKey* key, Object* object) { 7681 static inline uint32_t HashForObject(HashTableKey* key, Object* object) {
7681 return key->HashForObject(object); 7682 return key->HashForObject(object);
7682 } 7683 }
7683 7684
7684 MUST_USE_RESULT static MaybeObject* AsObject(Heap* heap, 7685 MUST_USE_RESULT static MaybeObject* AsObject(Heap* heap,
7685 HashTableKey* key) { 7686 HashTableKey* key) {
7686 return key->AsObject(heap); 7687 return key->AsObject(heap);
7687 } 7688 }
7688 7689
7689 static const int kPrefixSize = 0; 7690 static const int kPrefixSize = 0;
7690 static const int kEntrySize = 2; 7691 static const int kEntrySize = 2;
7691 }; 7692 };
7692 7693
7693 7694
7694 class CodeCacheHashTable FINAL : public HashTable<CodeCacheHashTableShape, 7695 class CodeCacheHashTable V8_FINAL : public HashTable<CodeCacheHashTableShape,
7695 HashTableKey*> { 7696 HashTableKey*> {
7696 public: 7697 public:
7697 Object* Lookup(Name* name, Code::Flags flags); 7698 Object* Lookup(Name* name, Code::Flags flags);
7698 MUST_USE_RESULT MaybeObject* Put(Name* name, Code* code); 7699 MUST_USE_RESULT MaybeObject* Put(Name* name, Code* code);
7699 7700
7700 int GetIndex(Name* name, Code::Flags flags); 7701 int GetIndex(Name* name, Code::Flags flags);
7701 void RemoveByIndex(int index); 7702 void RemoveByIndex(int index);
7702 7703
7703 static inline CodeCacheHashTable* cast(Object* obj); 7704 static inline CodeCacheHashTable* cast(Object* obj);
7704 7705
7705 // Initial size of the fixed array backing the hash table. 7706 // Initial size of the fixed array backing the hash table.
7706 static const int kInitialSize = 64; 7707 static const int kInitialSize = 64;
7707 7708
7708 private: 7709 private:
7709 DISALLOW_IMPLICIT_CONSTRUCTORS(CodeCacheHashTable); 7710 DISALLOW_IMPLICIT_CONSTRUCTORS(CodeCacheHashTable);
7710 }; 7711 };
7711 7712
7712 7713
7713 class PolymorphicCodeCache FINAL : public Struct { 7714 class PolymorphicCodeCache V8_FINAL : public Struct {
7714 public: 7715 public:
7715 DECL_ACCESSORS(cache, Object) 7716 DECL_ACCESSORS(cache, Object)
7716 7717
7717 static void Update(Handle<PolymorphicCodeCache> cache, 7718 static void Update(Handle<PolymorphicCodeCache> cache,
7718 MapHandleList* maps, 7719 MapHandleList* maps,
7719 Code::Flags flags, 7720 Code::Flags flags,
7720 Handle<Code> code); 7721 Handle<Code> code);
7721 7722
7722 MUST_USE_RESULT MaybeObject* Update(MapHandleList* maps, 7723 MUST_USE_RESULT MaybeObject* Update(MapHandleList* maps,
7723 Code::Flags flags, 7724 Code::Flags flags,
7724 Code* code); 7725 Code* code);
7725 7726
7726 // Returns an undefined value if the entry is not found. 7727 // Returns an undefined value if the entry is not found.
7727 Handle<Object> Lookup(MapHandleList* maps, Code::Flags flags); 7728 Handle<Object> Lookup(MapHandleList* maps, Code::Flags flags);
7728 7729
7729 static inline PolymorphicCodeCache* cast(Object* obj); 7730 static inline PolymorphicCodeCache* cast(Object* obj);
7730 7731
7731 // Dispatched behavior. 7732 // Dispatched behavior.
7732 DECLARE_PRINTER(PolymorphicCodeCache) 7733 DECLARE_PRINTER(PolymorphicCodeCache)
7733 DECLARE_VERIFIER(PolymorphicCodeCache) 7734 DECLARE_VERIFIER(PolymorphicCodeCache)
7734 7735
7735 static const int kCacheOffset = HeapObject::kHeaderSize; 7736 static const int kCacheOffset = HeapObject::kHeaderSize;
7736 static const int kSize = kCacheOffset + kPointerSize; 7737 static const int kSize = kCacheOffset + kPointerSize;
7737 7738
7738 private: 7739 private:
7739 DISALLOW_IMPLICIT_CONSTRUCTORS(PolymorphicCodeCache); 7740 DISALLOW_IMPLICIT_CONSTRUCTORS(PolymorphicCodeCache);
7740 }; 7741 };
7741 7742
7742 7743
7743 class PolymorphicCodeCacheHashTable FINAL 7744 class PolymorphicCodeCacheHashTable V8_FINAL
7744 : public HashTable<CodeCacheHashTableShape, HashTableKey*> { 7745 : public HashTable<CodeCacheHashTableShape, HashTableKey*> {
7745 public: 7746 public:
7746 Object* Lookup(MapHandleList* maps, int code_kind); 7747 Object* Lookup(MapHandleList* maps, int code_kind);
7747 7748
7748 MUST_USE_RESULT MaybeObject* Put(MapHandleList* maps, 7749 MUST_USE_RESULT MaybeObject* Put(MapHandleList* maps,
7749 int code_kind, 7750 int code_kind,
7750 Code* code); 7751 Code* code);
7751 7752
7752 static inline PolymorphicCodeCacheHashTable* cast(Object* obj); 7753 static inline PolymorphicCodeCacheHashTable* cast(Object* obj);
7753 7754
7754 static const int kInitialSize = 64; 7755 static const int kInitialSize = 64;
7755 private: 7756 private:
7756 DISALLOW_IMPLICIT_CONSTRUCTORS(PolymorphicCodeCacheHashTable); 7757 DISALLOW_IMPLICIT_CONSTRUCTORS(PolymorphicCodeCacheHashTable);
7757 }; 7758 };
7758 7759
7759 7760
7760 class TypeFeedbackInfo FINAL : public Struct { 7761 class TypeFeedbackInfo V8_FINAL : public Struct {
7761 public: 7762 public:
7762 inline int ic_total_count(); 7763 inline int ic_total_count();
7763 inline void set_ic_total_count(int count); 7764 inline void set_ic_total_count(int count);
7764 7765
7765 inline int ic_with_type_info_count(); 7766 inline int ic_with_type_info_count();
7766 inline void change_ic_with_type_info_count(int count); 7767 inline void change_ic_with_type_info_count(int count);
7767 7768
7768 inline void initialize_storage(); 7769 inline void initialize_storage();
7769 7770
7770 inline void change_own_type_change_checksum(); 7771 inline void change_own_type_change_checksum();
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
7804 }; 7805 };
7805 7806
7806 7807
7807 enum AllocationSiteMode { 7808 enum AllocationSiteMode {
7808 DONT_TRACK_ALLOCATION_SITE, 7809 DONT_TRACK_ALLOCATION_SITE,
7809 TRACK_ALLOCATION_SITE, 7810 TRACK_ALLOCATION_SITE,
7810 LAST_ALLOCATION_SITE_MODE = TRACK_ALLOCATION_SITE 7811 LAST_ALLOCATION_SITE_MODE = TRACK_ALLOCATION_SITE
7811 }; 7812 };
7812 7813
7813 7814
7814 class AllocationSite FINAL : public Struct { 7815 class AllocationSite V8_FINAL : public Struct {
7815 public: 7816 public:
7816 static const uint32_t kMaximumArrayBytesToPretransition = 8 * 1024; 7817 static const uint32_t kMaximumArrayBytesToPretransition = 8 * 1024;
7817 7818
7818 DECL_ACCESSORS(transition_info, Object) 7819 DECL_ACCESSORS(transition_info, Object)
7819 DECL_ACCESSORS(weak_next, Object) 7820 DECL_ACCESSORS(weak_next, Object)
7820 7821
7821 void Initialize() { 7822 void Initialize() {
7822 SetElementsKind(GetInitialFastElementsKind()); 7823 SetElementsKind(GetInitialFastElementsKind());
7823 } 7824 }
7824 7825
(...skipping 27 matching lines...) Expand all
7852 7853
7853 typedef FixedBodyDescriptor<HeapObject::kHeaderSize, 7854 typedef FixedBodyDescriptor<HeapObject::kHeaderSize,
7854 kTransitionInfoOffset + kPointerSize, 7855 kTransitionInfoOffset + kPointerSize,
7855 kSize> BodyDescriptor; 7856 kSize> BodyDescriptor;
7856 7857
7857 private: 7858 private:
7858 DISALLOW_IMPLICIT_CONSTRUCTORS(AllocationSite); 7859 DISALLOW_IMPLICIT_CONSTRUCTORS(AllocationSite);
7859 }; 7860 };
7860 7861
7861 7862
7862 class AllocationMemento FINAL : public Struct { 7863 class AllocationMemento V8_FINAL : public Struct {
7863 public: 7864 public:
7864 static const int kAllocationSiteOffset = HeapObject::kHeaderSize; 7865 static const int kAllocationSiteOffset = HeapObject::kHeaderSize;
7865 static const int kSize = kAllocationSiteOffset + kPointerSize; 7866 static const int kSize = kAllocationSiteOffset + kPointerSize;
7866 7867
7867 DECL_ACCESSORS(allocation_site, Object) 7868 DECL_ACCESSORS(allocation_site, Object)
7868 7869
7869 bool IsValid() { return allocation_site()->IsAllocationSite(); } 7870 bool IsValid() { return allocation_site()->IsAllocationSite(); }
7870 AllocationSite* GetAllocationSite() { 7871 AllocationSite* GetAllocationSite() {
7871 ASSERT(IsValid()); 7872 ASSERT(IsValid());
7872 return AllocationSite::cast(allocation_site()); 7873 return AllocationSite::cast(allocation_site());
(...skipping 12 matching lines...) Expand all
7885 7886
7886 7887
7887 // Representation of a slow alias as part of a non-strict arguments objects. 7888 // Representation of a slow alias as part of a non-strict arguments objects.
7888 // For fast aliases (if HasNonStrictArgumentsElements()): 7889 // For fast aliases (if HasNonStrictArgumentsElements()):
7889 // - the parameter map contains an index into the context 7890 // - the parameter map contains an index into the context
7890 // - all attributes of the element have default values 7891 // - all attributes of the element have default values
7891 // For slow aliases (if HasDictionaryArgumentsElements()): 7892 // For slow aliases (if HasDictionaryArgumentsElements()):
7892 // - the parameter map contains no fast alias mapping (i.e. the hole) 7893 // - the parameter map contains no fast alias mapping (i.e. the hole)
7893 // - this struct (in the slow backing store) contains an index into the context 7894 // - this struct (in the slow backing store) contains an index into the context
7894 // - all attributes are available as part if the property details 7895 // - all attributes are available as part if the property details
7895 class AliasedArgumentsEntry FINAL : public Struct { 7896 class AliasedArgumentsEntry V8_FINAL : public Struct {
7896 public: 7897 public:
7897 inline int aliased_context_slot(); 7898 inline int aliased_context_slot();
7898 inline void set_aliased_context_slot(int count); 7899 inline void set_aliased_context_slot(int count);
7899 7900
7900 static inline AliasedArgumentsEntry* cast(Object* obj); 7901 static inline AliasedArgumentsEntry* cast(Object* obj);
7901 7902
7902 // Dispatched behavior. 7903 // Dispatched behavior.
7903 DECLARE_PRINTER(AliasedArgumentsEntry) 7904 DECLARE_PRINTER(AliasedArgumentsEntry)
7904 DECLARE_VERIFIER(AliasedArgumentsEntry) 7905 DECLARE_VERIFIER(AliasedArgumentsEntry)
7905 7906
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
7973 // few bits of information is moderately expensive, involving two memory 7974 // few bits of information is moderately expensive, involving two memory
7974 // loads where the second is dependent on the first. To improve efficiency 7975 // loads where the second is dependent on the first. To improve efficiency
7975 // the shape of the string is given its own class so that it can be retrieved 7976 // the shape of the string is given its own class so that it can be retrieved
7976 // once and used for several string operations. A StringShape is small enough 7977 // once and used for several string operations. A StringShape is small enough
7977 // to be passed by value and is immutable, but be aware that flattening a 7978 // to be passed by value and is immutable, but be aware that flattening a
7978 // string can potentially alter its shape. Also be aware that a GC caused by 7979 // string can potentially alter its shape. Also be aware that a GC caused by
7979 // something else can alter the shape of a string due to ConsString 7980 // something else can alter the shape of a string due to ConsString
7980 // shortcutting. Keeping these restrictions in mind has proven to be error- 7981 // shortcutting. Keeping these restrictions in mind has proven to be error-
7981 // prone and so we no longer put StringShapes in variables unless there is a 7982 // prone and so we no longer put StringShapes in variables unless there is a
7982 // concrete performance benefit at that particular point in the code. 7983 // concrete performance benefit at that particular point in the code.
7983 class StringShape FINAL BASE_EMBEDDED { 7984 class StringShape V8_FINAL BASE_EMBEDDED {
7984 public: 7985 public:
7985 inline explicit StringShape(String* s); 7986 inline explicit StringShape(String* s);
7986 inline explicit StringShape(Map* s); 7987 inline explicit StringShape(Map* s);
7987 inline explicit StringShape(InstanceType t); 7988 inline explicit StringShape(InstanceType t);
7988 inline bool IsSequential(); 7989 inline bool IsSequential();
7989 inline bool IsExternal(); 7990 inline bool IsExternal();
7990 inline bool IsCons(); 7991 inline bool IsCons();
7991 inline bool IsSliced(); 7992 inline bool IsSliced();
7992 inline bool IsIndirect(); 7993 inline bool IsIndirect();
7993 inline bool IsExternalAscii(); 7994 inline bool IsExternalAscii();
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
8098 8099
8099 protected: 8100 protected:
8100 static inline bool IsHashFieldComputed(uint32_t field); 8101 static inline bool IsHashFieldComputed(uint32_t field);
8101 8102
8102 private: 8103 private:
8103 DISALLOW_IMPLICIT_CONSTRUCTORS(Name); 8104 DISALLOW_IMPLICIT_CONSTRUCTORS(Name);
8104 }; 8105 };
8105 8106
8106 8107
8107 // ES6 symbols. 8108 // ES6 symbols.
8108 class Symbol FINAL : public Name { 8109 class Symbol V8_FINAL : public Name {
8109 public: 8110 public:
8110 // [name]: the print name of a symbol, or undefined if none. 8111 // [name]: the print name of a symbol, or undefined if none.
8111 DECL_ACCESSORS(name, Object) 8112 DECL_ACCESSORS(name, Object)
8112 8113
8113 // Casting. 8114 // Casting.
8114 static inline Symbol* cast(Object* obj); 8115 static inline Symbol* cast(Object* obj);
8115 8116
8116 // Dispatched behavior. 8117 // Dispatched behavior.
8117 DECLARE_PRINTER(Symbol) 8118 DECLARE_PRINTER(Symbol)
8118 DECLARE_VERIFIER(Symbol) 8119 DECLARE_VERIFIER(Symbol)
(...skipping 348 matching lines...) Expand 10 before | Expand all | Expand 10 after
8467 // truncating the original string. 8468 // truncating the original string.
8468 MUST_USE_RESULT static Handle<String> Truncate(Handle<SeqString> string, 8469 MUST_USE_RESULT static Handle<String> Truncate(Handle<SeqString> string,
8469 int new_length); 8470 int new_length);
8470 private: 8471 private:
8471 DISALLOW_IMPLICIT_CONSTRUCTORS(SeqString); 8472 DISALLOW_IMPLICIT_CONSTRUCTORS(SeqString);
8472 }; 8473 };
8473 8474
8474 8475
8475 // The AsciiString class captures sequential ASCII string objects. 8476 // The AsciiString class captures sequential ASCII string objects.
8476 // Each character in the AsciiString is an ASCII character. 8477 // Each character in the AsciiString is an ASCII character.
8477 class SeqOneByteString FINAL : public SeqString { 8478 class SeqOneByteString V8_FINAL : public SeqString {
8478 public: 8479 public:
8479 static const bool kHasAsciiEncoding = true; 8480 static const bool kHasAsciiEncoding = true;
8480 8481
8481 // Dispatched behavior. 8482 // Dispatched behavior.
8482 inline uint16_t SeqOneByteStringGet(int index); 8483 inline uint16_t SeqOneByteStringGet(int index);
8483 inline void SeqOneByteStringSet(int index, uint16_t value); 8484 inline void SeqOneByteStringSet(int index, uint16_t value);
8484 8485
8485 // Get the address of the characters in this string. 8486 // Get the address of the characters in this string.
8486 inline Address GetCharsAddress(); 8487 inline Address GetCharsAddress();
8487 8488
(...skipping 18 matching lines...) Expand all
8506 // Q.v. String::kMaxLength which is the maximal size of concatenated strings. 8507 // Q.v. String::kMaxLength which is the maximal size of concatenated strings.
8507 static const int kMaxLength = (kMaxSize - kHeaderSize); 8508 static const int kMaxLength = (kMaxSize - kHeaderSize);
8508 8509
8509 private: 8510 private:
8510 DISALLOW_IMPLICIT_CONSTRUCTORS(SeqOneByteString); 8511 DISALLOW_IMPLICIT_CONSTRUCTORS(SeqOneByteString);
8511 }; 8512 };
8512 8513
8513 8514
8514 // The TwoByteString class captures sequential unicode string objects. 8515 // The TwoByteString class captures sequential unicode string objects.
8515 // Each character in the TwoByteString is a two-byte uint16_t. 8516 // Each character in the TwoByteString is a two-byte uint16_t.
8516 class SeqTwoByteString FINAL : public SeqString { 8517 class SeqTwoByteString V8_FINAL : public SeqString {
8517 public: 8518 public:
8518 static const bool kHasAsciiEncoding = false; 8519 static const bool kHasAsciiEncoding = false;
8519 8520
8520 // Dispatched behavior. 8521 // Dispatched behavior.
8521 inline uint16_t SeqTwoByteStringGet(int index); 8522 inline uint16_t SeqTwoByteStringGet(int index);
8522 inline void SeqTwoByteStringSet(int index, uint16_t value); 8523 inline void SeqTwoByteStringSet(int index, uint16_t value);
8523 8524
8524 // Get the address of the characters in this string. 8525 // Get the address of the characters in this string.
8525 inline Address GetCharsAddress(); 8526 inline Address GetCharsAddress();
8526 8527
(...skipping 27 matching lines...) Expand all
8554 8555
8555 8556
8556 // The ConsString class describes string values built by using the 8557 // The ConsString class describes string values built by using the
8557 // addition operator on strings. A ConsString is a pair where the 8558 // addition operator on strings. A ConsString is a pair where the
8558 // first and second components are pointers to other string values. 8559 // first and second components are pointers to other string values.
8559 // One or both components of a ConsString can be pointers to other 8560 // One or both components of a ConsString can be pointers to other
8560 // ConsStrings, creating a binary tree of ConsStrings where the leaves 8561 // ConsStrings, creating a binary tree of ConsStrings where the leaves
8561 // are non-ConsString string values. The string value represented by 8562 // are non-ConsString string values. The string value represented by
8562 // a ConsString can be obtained by concatenating the leaf string 8563 // a ConsString can be obtained by concatenating the leaf string
8563 // values in a left-to-right depth-first traversal of the tree. 8564 // values in a left-to-right depth-first traversal of the tree.
8564 class ConsString FINAL : public String { 8565 class ConsString V8_FINAL : public String {
8565 public: 8566 public:
8566 // First string of the cons cell. 8567 // First string of the cons cell.
8567 inline String* first(); 8568 inline String* first();
8568 // Doesn't check that the result is a string, even in debug mode. This is 8569 // Doesn't check that the result is a string, even in debug mode. This is
8569 // useful during GC where the mark bits confuse the checks. 8570 // useful during GC where the mark bits confuse the checks.
8570 inline Object* unchecked_first(); 8571 inline Object* unchecked_first();
8571 inline void set_first(String* first, 8572 inline void set_first(String* first,
8572 WriteBarrierMode mode = UPDATE_WRITE_BARRIER); 8573 WriteBarrierMode mode = UPDATE_WRITE_BARRIER);
8573 8574
8574 // Second string of the cons cell. 8575 // Second string of the cons cell.
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
8608 // a substring. A Sliced String is described as a pointer to the parent, 8609 // a substring. A Sliced String is described as a pointer to the parent,
8609 // the offset from the start of the parent string and the length. Using 8610 // the offset from the start of the parent string and the length. Using
8610 // a Sliced String therefore requires unpacking of the parent string and 8611 // a Sliced String therefore requires unpacking of the parent string and
8611 // adding the offset to the start address. A substring of a Sliced String 8612 // adding the offset to the start address. A substring of a Sliced String
8612 // are not nested since the double indirection is simplified when creating 8613 // are not nested since the double indirection is simplified when creating
8613 // such a substring. 8614 // such a substring.
8614 // Currently missing features are: 8615 // Currently missing features are:
8615 // - handling externalized parent strings 8616 // - handling externalized parent strings
8616 // - external strings as parent 8617 // - external strings as parent
8617 // - truncating sliced string to enable otherwise unneeded parent to be GC'ed. 8618 // - truncating sliced string to enable otherwise unneeded parent to be GC'ed.
8618 class SlicedString FINAL : public String { 8619 class SlicedString V8_FINAL : public String {
8619 public: 8620 public:
8620 inline String* parent(); 8621 inline String* parent();
8621 inline void set_parent(String* parent, 8622 inline void set_parent(String* parent,
8622 WriteBarrierMode mode = UPDATE_WRITE_BARRIER); 8623 WriteBarrierMode mode = UPDATE_WRITE_BARRIER);
8623 inline int offset(); 8624 inline int offset();
8624 inline void set_offset(int offset); 8625 inline void set_offset(int offset);
8625 8626
8626 // Dispatched behavior. 8627 // Dispatched behavior.
8627 uint16_t SlicedStringGet(int index); 8628 uint16_t SlicedStringGet(int index);
8628 8629
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
8676 8677
8677 STATIC_CHECK(kResourceOffset == Internals::kStringResourceOffset); 8678 STATIC_CHECK(kResourceOffset == Internals::kStringResourceOffset);
8678 8679
8679 private: 8680 private:
8680 DISALLOW_IMPLICIT_CONSTRUCTORS(ExternalString); 8681 DISALLOW_IMPLICIT_CONSTRUCTORS(ExternalString);
8681 }; 8682 };
8682 8683
8683 8684
8684 // The ExternalAsciiString class is an external string backed by an 8685 // The ExternalAsciiString class is an external string backed by an
8685 // ASCII string. 8686 // ASCII string.
8686 class ExternalAsciiString FINAL : public ExternalString { 8687 class ExternalAsciiString V8_FINAL : public ExternalString {
8687 public: 8688 public:
8688 static const bool kHasAsciiEncoding = true; 8689 static const bool kHasAsciiEncoding = true;
8689 8690
8690 typedef v8::String::ExternalAsciiStringResource Resource; 8691 typedef v8::String::ExternalAsciiStringResource Resource;
8691 8692
8692 // The underlying resource. 8693 // The underlying resource.
8693 inline const Resource* resource(); 8694 inline const Resource* resource();
8694 inline void set_resource(const Resource* buffer); 8695 inline void set_resource(const Resource* buffer);
8695 8696
8696 // Update the pointer cache to the external character array. 8697 // Update the pointer cache to the external character array.
(...skipping 16 matching lines...) Expand all
8713 template<typename StaticVisitor> 8714 template<typename StaticVisitor>
8714 inline void ExternalAsciiStringIterateBody(); 8715 inline void ExternalAsciiStringIterateBody();
8715 8716
8716 private: 8717 private:
8717 DISALLOW_IMPLICIT_CONSTRUCTORS(ExternalAsciiString); 8718 DISALLOW_IMPLICIT_CONSTRUCTORS(ExternalAsciiString);
8718 }; 8719 };
8719 8720
8720 8721
8721 // The ExternalTwoByteString class is an external string backed by a UTF-16 8722 // The ExternalTwoByteString class is an external string backed by a UTF-16
8722 // encoded string. 8723 // encoded string.
8723 class ExternalTwoByteString FINAL : public ExternalString { 8724 class ExternalTwoByteString V8_FINAL : public ExternalString {
8724 public: 8725 public:
8725 static const bool kHasAsciiEncoding = false; 8726 static const bool kHasAsciiEncoding = false;
8726 8727
8727 typedef v8::String::ExternalStringResource Resource; 8728 typedef v8::String::ExternalStringResource Resource;
8728 8729
8729 // The underlying string resource. 8730 // The underlying string resource.
8730 inline const Resource* resource(); 8731 inline const Resource* resource();
8731 inline void set_resource(const Resource* buffer); 8732 inline void set_resource(const Resource* buffer);
8732 8733
8733 // Update the pointer cache to the external character array. 8734 // Update the pointer cache to the external character array.
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
8777 static char* Iterate(ObjectVisitor* v, char* t); 8778 static char* Iterate(ObjectVisitor* v, char* t);
8778 private: 8779 private:
8779 Isolate* isolate_; 8780 Isolate* isolate_;
8780 Relocatable* prev_; 8781 Relocatable* prev_;
8781 }; 8782 };
8782 8783
8783 8784
8784 // A flat string reader provides random access to the contents of a 8785 // A flat string reader provides random access to the contents of a
8785 // string independent of the character width of the string. The handle 8786 // string independent of the character width of the string. The handle
8786 // must be valid as long as the reader is being used. 8787 // must be valid as long as the reader is being used.
8787 class FlatStringReader FINAL : public Relocatable { 8788 class FlatStringReader V8_FINAL : public Relocatable {
8788 public: 8789 public:
8789 FlatStringReader(Isolate* isolate, Handle<String> str); 8790 FlatStringReader(Isolate* isolate, Handle<String> str);
8790 FlatStringReader(Isolate* isolate, Vector<const char> input); 8791 FlatStringReader(Isolate* isolate, Vector<const char> input);
8791 void PostGarbageCollection(); 8792 void PostGarbageCollection();
8792 inline uc32 Get(int index); 8793 inline uc32 Get(int index);
8793 int length() { return length_; } 8794 int length() { return length_; }
8794 private: 8795 private:
8795 String** str_; 8796 String** str_;
8796 bool is_ascii_; 8797 bool is_ascii_;
8797 int length_; 8798 int length_;
8798 const void* start_; 8799 const void* start_;
8799 }; 8800 };
8800 8801
8801 8802
8802 // A ConsStringOp that returns null. 8803 // A ConsStringOp that returns null.
8803 // Useful when the operation to apply on a ConsString 8804 // Useful when the operation to apply on a ConsString
8804 // requires an expensive data structure. 8805 // requires an expensive data structure.
8805 class ConsStringNullOp FINAL { 8806 class ConsStringNullOp V8_FINAL {
8806 public: 8807 public:
8807 inline ConsStringNullOp() {} 8808 inline ConsStringNullOp() {}
8808 static inline String* Operate(String*, unsigned*, int32_t*, unsigned*); 8809 static inline String* Operate(String*, unsigned*, int32_t*, unsigned*);
8809 private: 8810 private:
8810 DISALLOW_COPY_AND_ASSIGN(ConsStringNullOp); 8811 DISALLOW_COPY_AND_ASSIGN(ConsStringNullOp);
8811 }; 8812 };
8812 8813
8813 8814
8814 // This maintains an off-stack representation of the stack frames required 8815 // This maintains an off-stack representation of the stack frames required
8815 // to traverse a ConsString, allowing an entirely iterative and restartable 8816 // to traverse a ConsString, allowing an entirely iterative and restartable
8816 // traversal of the entire string 8817 // traversal of the entire string
8817 // Note: this class is not GC-safe. 8818 // Note: this class is not GC-safe.
8818 class ConsStringIteratorOp FINAL { 8819 class ConsStringIteratorOp V8_FINAL {
8819 public: 8820 public:
8820 inline ConsStringIteratorOp() {} 8821 inline ConsStringIteratorOp() {}
8821 String* Operate(String* string, 8822 String* Operate(String* string,
8822 unsigned* offset_out, 8823 unsigned* offset_out,
8823 int32_t* type_out, 8824 int32_t* type_out,
8824 unsigned* length_out); 8825 unsigned* length_out);
8825 inline String* ContinueOperation(int32_t* type_out, unsigned* length_out); 8826 inline String* ContinueOperation(int32_t* type_out, unsigned* length_out);
8826 inline void Reset(); 8827 inline void Reset();
8827 inline bool HasMore(); 8828 inline bool HasMore();
8828 8829
(...skipping 19 matching lines...) Expand all
8848 // Stack must always contain only frames for which right traversal 8849 // Stack must always contain only frames for which right traversal
8849 // has not yet been performed. 8850 // has not yet been performed.
8850 ConsString* frames_[kStackSize]; 8851 ConsString* frames_[kStackSize];
8851 unsigned consumed_; 8852 unsigned consumed_;
8852 ConsString* root_; 8853 ConsString* root_;
8853 DISALLOW_COPY_AND_ASSIGN(ConsStringIteratorOp); 8854 DISALLOW_COPY_AND_ASSIGN(ConsStringIteratorOp);
8854 }; 8855 };
8855 8856
8856 8857
8857 // Note: this class is not GC-safe. 8858 // Note: this class is not GC-safe.
8858 class StringCharacterStream FINAL { 8859 class StringCharacterStream V8_FINAL {
8859 public: 8860 public:
8860 inline StringCharacterStream(String* string, 8861 inline StringCharacterStream(String* string,
8861 ConsStringIteratorOp* op, 8862 ConsStringIteratorOp* op,
8862 unsigned offset = 0); 8863 unsigned offset = 0);
8863 inline uint16_t GetNext(); 8864 inline uint16_t GetNext();
8864 inline bool HasMore(); 8865 inline bool HasMore();
8865 inline void Reset(String* string, unsigned offset = 0); 8866 inline void Reset(String* string, unsigned offset = 0);
8866 inline void VisitOneByteString(const uint8_t* chars, unsigned length); 8867 inline void VisitOneByteString(const uint8_t* chars, unsigned length);
8867 inline void VisitTwoByteString(const uint16_t* chars, unsigned length); 8868 inline void VisitTwoByteString(const uint16_t* chars, unsigned length);
8868 8869
8869 private: 8870 private:
8870 bool is_one_byte_; 8871 bool is_one_byte_;
8871 union { 8872 union {
8872 const uint8_t* buffer8_; 8873 const uint8_t* buffer8_;
8873 const uint16_t* buffer16_; 8874 const uint16_t* buffer16_;
8874 }; 8875 };
8875 const uint8_t* end_; 8876 const uint8_t* end_;
8876 ConsStringIteratorOp* op_; 8877 ConsStringIteratorOp* op_;
8877 DISALLOW_COPY_AND_ASSIGN(StringCharacterStream); 8878 DISALLOW_COPY_AND_ASSIGN(StringCharacterStream);
8878 }; 8879 };
8879 8880
8880 8881
8881 template <typename T> 8882 template <typename T>
8882 class VectorIterator FINAL { 8883 class VectorIterator V8_FINAL {
8883 public: 8884 public:
8884 VectorIterator(T* d, int l) : data_(Vector<const T>(d, l)), index_(0) { } 8885 VectorIterator(T* d, int l) : data_(Vector<const T>(d, l)), index_(0) { }
8885 explicit VectorIterator(Vector<const T> data) : data_(data), index_(0) { } 8886 explicit VectorIterator(Vector<const T> data) : data_(data), index_(0) { }
8886 T GetNext() { return data_[index_++]; } 8887 T GetNext() { return data_[index_++]; }
8887 bool has_more() { return index_ < data_.length(); } 8888 bool has_more() { return index_ < data_.length(); }
8888 private: 8889 private:
8889 Vector<const T> data_; 8890 Vector<const T> data_;
8890 int index_; 8891 int index_;
8891 }; 8892 };
8892 8893
8893 8894
8894 // The Oddball describes objects null, undefined, true, and false. 8895 // The Oddball describes objects null, undefined, true, and false.
8895 class Oddball FINAL : public HeapObject { 8896 class Oddball V8_FINAL : public HeapObject {
8896 public: 8897 public:
8897 // [to_string]: Cached to_string computed at startup. 8898 // [to_string]: Cached to_string computed at startup.
8898 DECL_ACCESSORS(to_string, String) 8899 DECL_ACCESSORS(to_string, String)
8899 8900
8900 // [to_number]: Cached to_number computed at startup. 8901 // [to_number]: Cached to_number computed at startup.
8901 DECL_ACCESSORS(to_number, Object) 8902 DECL_ACCESSORS(to_number, Object)
8902 8903
8903 inline byte kind(); 8904 inline byte kind();
8904 inline void set_kind(byte kind); 8905 inline void set_kind(byte kind);
8905 8906
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
8971 8972
8972 typedef FixedBodyDescriptor<kValueOffset, 8973 typedef FixedBodyDescriptor<kValueOffset,
8973 kValueOffset + kPointerSize, 8974 kValueOffset + kPointerSize,
8974 kSize> BodyDescriptor; 8975 kSize> BodyDescriptor;
8975 8976
8976 private: 8977 private:
8977 DISALLOW_IMPLICIT_CONSTRUCTORS(Cell); 8978 DISALLOW_IMPLICIT_CONSTRUCTORS(Cell);
8978 }; 8979 };
8979 8980
8980 8981
8981 class PropertyCell FINAL : public Cell { 8982 class PropertyCell V8_FINAL : public Cell {
8982 public: 8983 public:
8983 // [type]: type of the global property. 8984 // [type]: type of the global property.
8984 Type* type(); 8985 Type* type();
8985 void set_type(Type* value, WriteBarrierMode mode = UPDATE_WRITE_BARRIER); 8986 void set_type(Type* value, WriteBarrierMode mode = UPDATE_WRITE_BARRIER);
8986 8987
8987 // [dependent_code]: dependent code that depends on the type of the global 8988 // [dependent_code]: dependent code that depends on the type of the global
8988 // property. 8989 // property.
8989 DECL_ACCESSORS(dependent_code, DependentCode) 8990 DECL_ACCESSORS(dependent_code, DependentCode)
8990 8991
8991 // Sets the value of the cell and updates the type field to be the union 8992 // Sets the value of the cell and updates the type field to be the union
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after
9127 Handle<Name> name, 9128 Handle<Name> name,
9128 DeleteMode mode); 9129 DeleteMode mode);
9129 static Handle<Object> DeleteElementWithHandler(Handle<JSProxy> object, 9130 static Handle<Object> DeleteElementWithHandler(Handle<JSProxy> object,
9130 uint32_t index, 9131 uint32_t index,
9131 DeleteMode mode); 9132 DeleteMode mode);
9132 9133
9133 DISALLOW_IMPLICIT_CONSTRUCTORS(JSProxy); 9134 DISALLOW_IMPLICIT_CONSTRUCTORS(JSProxy);
9134 }; 9135 };
9135 9136
9136 9137
9137 class JSFunctionProxy FINAL : public JSProxy { 9138 class JSFunctionProxy V8_FINAL : public JSProxy {
9138 public: 9139 public:
9139 // [call_trap]: The call trap. 9140 // [call_trap]: The call trap.
9140 DECL_ACCESSORS(call_trap, Object) 9141 DECL_ACCESSORS(call_trap, Object)
9141 9142
9142 // [construct_trap]: The construct trap. 9143 // [construct_trap]: The construct trap.
9143 DECL_ACCESSORS(construct_trap, Object) 9144 DECL_ACCESSORS(construct_trap, Object)
9144 9145
9145 // Casting. 9146 // Casting.
9146 static inline JSFunctionProxy* cast(Object* obj); 9147 static inline JSFunctionProxy* cast(Object* obj);
9147 9148
(...skipping 13 matching lines...) Expand all
9161 typedef FixedBodyDescriptor<kHandlerOffset, 9162 typedef FixedBodyDescriptor<kHandlerOffset,
9162 kConstructTrapOffset + kPointerSize, 9163 kConstructTrapOffset + kPointerSize,
9163 kSize> BodyDescriptor; 9164 kSize> BodyDescriptor;
9164 9165
9165 private: 9166 private:
9166 DISALLOW_IMPLICIT_CONSTRUCTORS(JSFunctionProxy); 9167 DISALLOW_IMPLICIT_CONSTRUCTORS(JSFunctionProxy);
9167 }; 9168 };
9168 9169
9169 9170
9170 // The JSSet describes EcmaScript Harmony sets 9171 // The JSSet describes EcmaScript Harmony sets
9171 class JSSet FINAL : public JSObject { 9172 class JSSet V8_FINAL : public JSObject {
9172 public: 9173 public:
9173 // [set]: the backing hash set containing keys. 9174 // [set]: the backing hash set containing keys.
9174 DECL_ACCESSORS(table, Object) 9175 DECL_ACCESSORS(table, Object)
9175 9176
9176 // Casting. 9177 // Casting.
9177 static inline JSSet* cast(Object* obj); 9178 static inline JSSet* cast(Object* obj);
9178 9179
9179 // Dispatched behavior. 9180 // Dispatched behavior.
9180 DECLARE_PRINTER(JSSet) 9181 DECLARE_PRINTER(JSSet)
9181 DECLARE_VERIFIER(JSSet) 9182 DECLARE_VERIFIER(JSSet)
9182 9183
9183 static const int kTableOffset = JSObject::kHeaderSize; 9184 static const int kTableOffset = JSObject::kHeaderSize;
9184 static const int kSize = kTableOffset + kPointerSize; 9185 static const int kSize = kTableOffset + kPointerSize;
9185 9186
9186 private: 9187 private:
9187 DISALLOW_IMPLICIT_CONSTRUCTORS(JSSet); 9188 DISALLOW_IMPLICIT_CONSTRUCTORS(JSSet);
9188 }; 9189 };
9189 9190
9190 9191
9191 // The JSMap describes EcmaScript Harmony maps 9192 // The JSMap describes EcmaScript Harmony maps
9192 class JSMap FINAL : public JSObject { 9193 class JSMap V8_FINAL : public JSObject {
9193 public: 9194 public:
9194 // [table]: the backing hash table mapping keys to values. 9195 // [table]: the backing hash table mapping keys to values.
9195 DECL_ACCESSORS(table, Object) 9196 DECL_ACCESSORS(table, Object)
9196 9197
9197 // Casting. 9198 // Casting.
9198 static inline JSMap* cast(Object* obj); 9199 static inline JSMap* cast(Object* obj);
9199 9200
9200 // Dispatched behavior. 9201 // Dispatched behavior.
9201 DECLARE_PRINTER(JSMap) 9202 DECLARE_PRINTER(JSMap)
9202 DECLARE_VERIFIER(JSMap) 9203 DECLARE_VERIFIER(JSMap)
(...skipping 18 matching lines...) Expand all
9221 static const int kTableOffset = JSObject::kHeaderSize; 9222 static const int kTableOffset = JSObject::kHeaderSize;
9222 static const int kNextOffset = kTableOffset + kPointerSize; 9223 static const int kNextOffset = kTableOffset + kPointerSize;
9223 static const int kSize = kNextOffset + kPointerSize; 9224 static const int kSize = kNextOffset + kPointerSize;
9224 9225
9225 private: 9226 private:
9226 DISALLOW_IMPLICIT_CONSTRUCTORS(JSWeakCollection); 9227 DISALLOW_IMPLICIT_CONSTRUCTORS(JSWeakCollection);
9227 }; 9228 };
9228 9229
9229 9230
9230 // The JSWeakMap describes EcmaScript Harmony weak maps 9231 // The JSWeakMap describes EcmaScript Harmony weak maps
9231 class JSWeakMap FINAL : public JSWeakCollection { 9232 class JSWeakMap V8_FINAL : public JSWeakCollection {
9232 public: 9233 public:
9233 // Casting. 9234 // Casting.
9234 static inline JSWeakMap* cast(Object* obj); 9235 static inline JSWeakMap* cast(Object* obj);
9235 9236
9236 // Dispatched behavior. 9237 // Dispatched behavior.
9237 DECLARE_PRINTER(JSWeakMap) 9238 DECLARE_PRINTER(JSWeakMap)
9238 DECLARE_VERIFIER(JSWeakMap) 9239 DECLARE_VERIFIER(JSWeakMap)
9239 9240
9240 private: 9241 private:
9241 DISALLOW_IMPLICIT_CONSTRUCTORS(JSWeakMap); 9242 DISALLOW_IMPLICIT_CONSTRUCTORS(JSWeakMap);
9242 }; 9243 };
9243 9244
9244 9245
9245 // The JSWeakSet describes EcmaScript Harmony weak sets 9246 // The JSWeakSet describes EcmaScript Harmony weak sets
9246 class JSWeakSet FINAL : public JSWeakCollection { 9247 class JSWeakSet V8_FINAL : public JSWeakCollection {
9247 public: 9248 public:
9248 // Casting. 9249 // Casting.
9249 static inline JSWeakSet* cast(Object* obj); 9250 static inline JSWeakSet* cast(Object* obj);
9250 9251
9251 // Dispatched behavior. 9252 // Dispatched behavior.
9252 DECLARE_PRINTER(JSWeakSet) 9253 DECLARE_PRINTER(JSWeakSet)
9253 DECLARE_VERIFIER(JSWeakSet) 9254 DECLARE_VERIFIER(JSWeakSet)
9254 9255
9255 private: 9256 private:
9256 DISALLOW_IMPLICIT_CONSTRUCTORS(JSWeakSet); 9257 DISALLOW_IMPLICIT_CONSTRUCTORS(JSWeakSet);
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
9331 static const int kViewSize = kWeakNextOffset + kPointerSize; 9332 static const int kViewSize = kWeakNextOffset + kPointerSize;
9332 9333
9333 protected: 9334 protected:
9334 void NeuterView(); 9335 void NeuterView();
9335 9336
9336 private: 9337 private:
9337 DISALLOW_IMPLICIT_CONSTRUCTORS(JSArrayBufferView); 9338 DISALLOW_IMPLICIT_CONSTRUCTORS(JSArrayBufferView);
9338 }; 9339 };
9339 9340
9340 9341
9341 class JSTypedArray FINAL : public JSArrayBufferView { 9342 class JSTypedArray V8_FINAL : public JSArrayBufferView {
9342 public: 9343 public:
9343 // [length]: length of typed array in elements. 9344 // [length]: length of typed array in elements.
9344 DECL_ACCESSORS(length, Object) 9345 DECL_ACCESSORS(length, Object)
9345 9346
9346 // Neutering. Only neuters this typed array. 9347 // Neutering. Only neuters this typed array.
9347 void Neuter(); 9348 void Neuter();
9348 9349
9349 // Casting. 9350 // Casting.
9350 static inline JSTypedArray* cast(Object* obj); 9351 static inline JSTypedArray* cast(Object* obj);
9351 9352
9352 ExternalArrayType type(); 9353 ExternalArrayType type();
9353 size_t element_size(); 9354 size_t element_size();
9354 9355
9355 // Dispatched behavior. 9356 // Dispatched behavior.
9356 DECLARE_PRINTER(JSTypedArray) 9357 DECLARE_PRINTER(JSTypedArray)
9357 DECLARE_VERIFIER(JSTypedArray) 9358 DECLARE_VERIFIER(JSTypedArray)
9358 9359
9359 static const int kLengthOffset = kViewSize + kPointerSize; 9360 static const int kLengthOffset = kViewSize + kPointerSize;
9360 static const int kSize = kLengthOffset + kPointerSize; 9361 static const int kSize = kLengthOffset + kPointerSize;
9361 9362
9362 static const int kSizeWithInternalFields = 9363 static const int kSizeWithInternalFields =
9363 kSize + v8::ArrayBufferView::kInternalFieldCount * kPointerSize; 9364 kSize + v8::ArrayBufferView::kInternalFieldCount * kPointerSize;
9364 9365
9365 private: 9366 private:
9366 DISALLOW_IMPLICIT_CONSTRUCTORS(JSTypedArray); 9367 DISALLOW_IMPLICIT_CONSTRUCTORS(JSTypedArray);
9367 }; 9368 };
9368 9369
9369 9370
9370 class JSDataView FINAL : public JSArrayBufferView { 9371 class JSDataView V8_FINAL : public JSArrayBufferView {
9371 public: 9372 public:
9372 // Only neuters this DataView 9373 // Only neuters this DataView
9373 void Neuter(); 9374 void Neuter();
9374 9375
9375 // Casting. 9376 // Casting.
9376 static inline JSDataView* cast(Object* obj); 9377 static inline JSDataView* cast(Object* obj);
9377 9378
9378 // Dispatched behavior. 9379 // Dispatched behavior.
9379 DECLARE_PRINTER(JSDataView) 9380 DECLARE_PRINTER(JSDataView)
9380 DECLARE_VERIFIER(JSDataView) 9381 DECLARE_VERIFIER(JSDataView)
9381 9382
9382 static const int kSize = kViewSize; 9383 static const int kSize = kViewSize;
9383 9384
9384 static const int kSizeWithInternalFields = 9385 static const int kSizeWithInternalFields =
9385 kSize + v8::ArrayBufferView::kInternalFieldCount * kPointerSize; 9386 kSize + v8::ArrayBufferView::kInternalFieldCount * kPointerSize;
9386 9387
9387 private: 9388 private:
9388 DISALLOW_IMPLICIT_CONSTRUCTORS(JSDataView); 9389 DISALLOW_IMPLICIT_CONSTRUCTORS(JSDataView);
9389 }; 9390 };
9390 9391
9391 9392
9392 // Foreign describes objects pointing from JavaScript to C structures. 9393 // Foreign describes objects pointing from JavaScript to C structures.
9393 // Since they cannot contain references to JS HeapObjects they can be 9394 // Since they cannot contain references to JS HeapObjects they can be
9394 // placed in old_data_space. 9395 // placed in old_data_space.
9395 class Foreign FINAL : public HeapObject { 9396 class Foreign V8_FINAL : public HeapObject {
9396 public: 9397 public:
9397 // [address]: field containing the address. 9398 // [address]: field containing the address.
9398 inline Address foreign_address(); 9399 inline Address foreign_address();
9399 inline void set_foreign_address(Address value); 9400 inline void set_foreign_address(Address value);
9400 9401
9401 // Casting. 9402 // Casting.
9402 static inline Foreign* cast(Object* obj); 9403 static inline Foreign* cast(Object* obj);
9403 9404
9404 // Dispatched behavior. 9405 // Dispatched behavior.
9405 inline void ForeignIterateBody(ObjectVisitor* v); 9406 inline void ForeignIterateBody(ObjectVisitor* v);
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
9483 Handle<Object> CacheInitialJSArrayMaps(Handle<Context> native_context, 9484 Handle<Object> CacheInitialJSArrayMaps(Handle<Context> native_context,
9484 Handle<Map> initial_map); 9485 Handle<Map> initial_map);
9485 9486
9486 9487
9487 // JSRegExpResult is just a JSArray with a specific initial map. 9488 // JSRegExpResult is just a JSArray with a specific initial map.
9488 // This initial map adds in-object properties for "index" and "input" 9489 // This initial map adds in-object properties for "index" and "input"
9489 // properties, as assigned by RegExp.prototype.exec, which allows 9490 // properties, as assigned by RegExp.prototype.exec, which allows
9490 // faster creation of RegExp exec results. 9491 // faster creation of RegExp exec results.
9491 // This class just holds constants used when creating the result. 9492 // This class just holds constants used when creating the result.
9492 // After creation the result must be treated as a JSArray in all regards. 9493 // After creation the result must be treated as a JSArray in all regards.
9493 class JSRegExpResult FINAL : public JSArray { 9494 class JSRegExpResult V8_FINAL : public JSArray {
9494 public: 9495 public:
9495 // Offsets of object fields. 9496 // Offsets of object fields.
9496 static const int kIndexOffset = JSArray::kSize; 9497 static const int kIndexOffset = JSArray::kSize;
9497 static const int kInputOffset = kIndexOffset + kPointerSize; 9498 static const int kInputOffset = kIndexOffset + kPointerSize;
9498 static const int kSize = kInputOffset + kPointerSize; 9499 static const int kSize = kInputOffset + kPointerSize;
9499 // Indices of in-object properties. 9500 // Indices of in-object properties.
9500 static const int kIndexIndex = 0; 9501 static const int kIndexIndex = 0;
9501 static const int kInputIndex = 1; 9502 static const int kInputIndex = 1;
9502 private: 9503 private:
9503 DISALLOW_IMPLICIT_CONSTRUCTORS(JSRegExpResult); 9504 DISALLOW_IMPLICIT_CONSTRUCTORS(JSRegExpResult);
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
9594 struct PrimitiveValueDescriptor primitive_value_descriptor; 9595 struct PrimitiveValueDescriptor primitive_value_descriptor;
9595 struct ObjectDerefenceDescriptor object_dereference_descriptor; 9596 struct ObjectDerefenceDescriptor object_dereference_descriptor;
9596 struct PointerShiftDescriptor pointer_shift_descriptor; 9597 struct PointerShiftDescriptor pointer_shift_descriptor;
9597 }; 9598 };
9598 }; 9599 };
9599 9600
9600 9601
9601 class DeclaredAccessorDescriptor; 9602 class DeclaredAccessorDescriptor;
9602 9603
9603 9604
9604 class DeclaredAccessorDescriptorIterator FINAL { 9605 class DeclaredAccessorDescriptorIterator V8_FINAL {
9605 public: 9606 public:
9606 explicit DeclaredAccessorDescriptorIterator( 9607 explicit DeclaredAccessorDescriptorIterator(
9607 DeclaredAccessorDescriptor* descriptor); 9608 DeclaredAccessorDescriptor* descriptor);
9608 const DeclaredAccessorDescriptorData* Next(); 9609 const DeclaredAccessorDescriptorData* Next();
9609 bool Complete() const { return length_ == offset_; } 9610 bool Complete() const { return length_ == offset_; }
9610 private: 9611 private:
9611 uint8_t* array_; 9612 uint8_t* array_;
9612 const int length_; 9613 const int length_;
9613 int offset_; 9614 int offset_;
9614 DISALLOW_IMPLICIT_CONSTRUCTORS(DeclaredAccessorDescriptorIterator); 9615 DISALLOW_IMPLICIT_CONSTRUCTORS(DeclaredAccessorDescriptorIterator);
9615 }; 9616 };
9616 9617
9617 9618
9618 class DeclaredAccessorDescriptor FINAL : public Struct { 9619 class DeclaredAccessorDescriptor V8_FINAL : public Struct {
9619 public: 9620 public:
9620 DECL_ACCESSORS(serialized_data, ByteArray) 9621 DECL_ACCESSORS(serialized_data, ByteArray)
9621 9622
9622 static inline DeclaredAccessorDescriptor* cast(Object* obj); 9623 static inline DeclaredAccessorDescriptor* cast(Object* obj);
9623 9624
9624 static Handle<DeclaredAccessorDescriptor> Create( 9625 static Handle<DeclaredAccessorDescriptor> Create(
9625 Isolate* isolate, 9626 Isolate* isolate,
9626 const DeclaredAccessorDescriptorData& data, 9627 const DeclaredAccessorDescriptorData& data,
9627 Handle<DeclaredAccessorDescriptor> previous); 9628 Handle<DeclaredAccessorDescriptor> previous);
9628 9629
9629 // Dispatched behavior. 9630 // Dispatched behavior.
9630 DECLARE_PRINTER(DeclaredAccessorDescriptor) 9631 DECLARE_PRINTER(DeclaredAccessorDescriptor)
9631 DECLARE_VERIFIER(DeclaredAccessorDescriptor) 9632 DECLARE_VERIFIER(DeclaredAccessorDescriptor)
9632 9633
9633 static const int kSerializedDataOffset = HeapObject::kHeaderSize; 9634 static const int kSerializedDataOffset = HeapObject::kHeaderSize;
9634 static const int kSize = kSerializedDataOffset + kPointerSize; 9635 static const int kSize = kSerializedDataOffset + kPointerSize;
9635 9636
9636 private: 9637 private:
9637 DISALLOW_IMPLICIT_CONSTRUCTORS(DeclaredAccessorDescriptor); 9638 DISALLOW_IMPLICIT_CONSTRUCTORS(DeclaredAccessorDescriptor);
9638 }; 9639 };
9639 9640
9640 9641
9641 class DeclaredAccessorInfo FINAL : public AccessorInfo { 9642 class DeclaredAccessorInfo V8_FINAL : public AccessorInfo {
9642 public: 9643 public:
9643 DECL_ACCESSORS(descriptor, DeclaredAccessorDescriptor) 9644 DECL_ACCESSORS(descriptor, DeclaredAccessorDescriptor)
9644 9645
9645 static inline DeclaredAccessorInfo* cast(Object* obj); 9646 static inline DeclaredAccessorInfo* cast(Object* obj);
9646 9647
9647 // Dispatched behavior. 9648 // Dispatched behavior.
9648 DECLARE_PRINTER(DeclaredAccessorInfo) 9649 DECLARE_PRINTER(DeclaredAccessorInfo)
9649 DECLARE_VERIFIER(DeclaredAccessorInfo) 9650 DECLARE_VERIFIER(DeclaredAccessorInfo)
9650 9651
9651 static const int kDescriptorOffset = AccessorInfo::kSize; 9652 static const int kDescriptorOffset = AccessorInfo::kSize;
9652 static const int kSize = kDescriptorOffset + kPointerSize; 9653 static const int kSize = kDescriptorOffset + kPointerSize;
9653 9654
9654 private: 9655 private:
9655 DISALLOW_IMPLICIT_CONSTRUCTORS(DeclaredAccessorInfo); 9656 DISALLOW_IMPLICIT_CONSTRUCTORS(DeclaredAccessorInfo);
9656 }; 9657 };
9657 9658
9658 9659
9659 // An accessor must have a getter, but can have no setter. 9660 // An accessor must have a getter, but can have no setter.
9660 // 9661 //
9661 // When setting a property, V8 searches accessors in prototypes. 9662 // When setting a property, V8 searches accessors in prototypes.
9662 // If an accessor was found and it does not have a setter, 9663 // If an accessor was found and it does not have a setter,
9663 // the request is ignored. 9664 // the request is ignored.
9664 // 9665 //
9665 // If the accessor in the prototype has the READ_ONLY property attribute, then 9666 // If the accessor in the prototype has the READ_ONLY property attribute, then
9666 // a new value is added to the local object when the property is set. 9667 // a new value is added to the local object when the property is set.
9667 // This shadows the accessor in the prototype. 9668 // This shadows the accessor in the prototype.
9668 class ExecutableAccessorInfo FINAL : public AccessorInfo { 9669 class ExecutableAccessorInfo V8_FINAL : public AccessorInfo {
9669 public: 9670 public:
9670 DECL_ACCESSORS(getter, Object) 9671 DECL_ACCESSORS(getter, Object)
9671 DECL_ACCESSORS(setter, Object) 9672 DECL_ACCESSORS(setter, Object)
9672 DECL_ACCESSORS(data, Object) 9673 DECL_ACCESSORS(data, Object)
9673 9674
9674 static inline ExecutableAccessorInfo* cast(Object* obj); 9675 static inline ExecutableAccessorInfo* cast(Object* obj);
9675 9676
9676 // Dispatched behavior. 9677 // Dispatched behavior.
9677 DECLARE_PRINTER(ExecutableAccessorInfo) 9678 DECLARE_PRINTER(ExecutableAccessorInfo)
9678 DECLARE_VERIFIER(ExecutableAccessorInfo) 9679 DECLARE_VERIFIER(ExecutableAccessorInfo)
9679 9680
9680 static const int kGetterOffset = AccessorInfo::kSize; 9681 static const int kGetterOffset = AccessorInfo::kSize;
9681 static const int kSetterOffset = kGetterOffset + kPointerSize; 9682 static const int kSetterOffset = kGetterOffset + kPointerSize;
9682 static const int kDataOffset = kSetterOffset + kPointerSize; 9683 static const int kDataOffset = kSetterOffset + kPointerSize;
9683 static const int kSize = kDataOffset + kPointerSize; 9684 static const int kSize = kDataOffset + kPointerSize;
9684 9685
9685 private: 9686 private:
9686 DISALLOW_IMPLICIT_CONSTRUCTORS(ExecutableAccessorInfo); 9687 DISALLOW_IMPLICIT_CONSTRUCTORS(ExecutableAccessorInfo);
9687 }; 9688 };
9688 9689
9689 9690
9690 // Support for JavaScript accessors: A pair of a getter and a setter. Each 9691 // Support for JavaScript accessors: A pair of a getter and a setter. Each
9691 // accessor can either be 9692 // accessor can either be
9692 // * a pointer to a JavaScript function or proxy: a real accessor 9693 // * a pointer to a JavaScript function or proxy: a real accessor
9693 // * undefined: considered an accessor by the spec, too, strangely enough 9694 // * undefined: considered an accessor by the spec, too, strangely enough
9694 // * the hole: an accessor which has not been set 9695 // * the hole: an accessor which has not been set
9695 // * a pointer to a map: a transition used to ensure map sharing 9696 // * a pointer to a map: a transition used to ensure map sharing
9696 class AccessorPair FINAL : public Struct { 9697 class AccessorPair V8_FINAL : public Struct {
9697 public: 9698 public:
9698 DECL_ACCESSORS(getter, Object) 9699 DECL_ACCESSORS(getter, Object)
9699 DECL_ACCESSORS(setter, Object) 9700 DECL_ACCESSORS(setter, Object)
9700 9701
9701 static inline AccessorPair* cast(Object* obj); 9702 static inline AccessorPair* cast(Object* obj);
9702 9703
9703 static Handle<AccessorPair> Copy(Handle<AccessorPair> pair); 9704 static Handle<AccessorPair> Copy(Handle<AccessorPair> pair);
9704 9705
9705 Object* get(AccessorComponent component) { 9706 Object* get(AccessorComponent component) {
9706 return component == ACCESSOR_GETTER ? getter() : setter(); 9707 return component == ACCESSOR_GETTER ? getter() : setter();
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
9742 // Object.defineProperty(obj, "foo", {get: undefined}); 9743 // Object.defineProperty(obj, "foo", {get: undefined});
9743 // assertTrue("foo" in obj); 9744 // assertTrue("foo" in obj);
9744 bool IsJSAccessor(Object* obj) { 9745 bool IsJSAccessor(Object* obj) {
9745 return obj->IsSpecFunction() || obj->IsUndefined(); 9746 return obj->IsSpecFunction() || obj->IsUndefined();
9746 } 9747 }
9747 9748
9748 DISALLOW_IMPLICIT_CONSTRUCTORS(AccessorPair); 9749 DISALLOW_IMPLICIT_CONSTRUCTORS(AccessorPair);
9749 }; 9750 };
9750 9751
9751 9752
9752 class AccessCheckInfo FINAL : public Struct { 9753 class AccessCheckInfo V8_FINAL : public Struct {
9753 public: 9754 public:
9754 DECL_ACCESSORS(named_callback, Object) 9755 DECL_ACCESSORS(named_callback, Object)
9755 DECL_ACCESSORS(indexed_callback, Object) 9756 DECL_ACCESSORS(indexed_callback, Object)
9756 DECL_ACCESSORS(data, Object) 9757 DECL_ACCESSORS(data, Object)
9757 9758
9758 static inline AccessCheckInfo* cast(Object* obj); 9759 static inline AccessCheckInfo* cast(Object* obj);
9759 9760
9760 // Dispatched behavior. 9761 // Dispatched behavior.
9761 DECLARE_PRINTER(AccessCheckInfo) 9762 DECLARE_PRINTER(AccessCheckInfo)
9762 DECLARE_VERIFIER(AccessCheckInfo) 9763 DECLARE_VERIFIER(AccessCheckInfo)
9763 9764
9764 static const int kNamedCallbackOffset = HeapObject::kHeaderSize; 9765 static const int kNamedCallbackOffset = HeapObject::kHeaderSize;
9765 static const int kIndexedCallbackOffset = kNamedCallbackOffset + kPointerSize; 9766 static const int kIndexedCallbackOffset = kNamedCallbackOffset + kPointerSize;
9766 static const int kDataOffset = kIndexedCallbackOffset + kPointerSize; 9767 static const int kDataOffset = kIndexedCallbackOffset + kPointerSize;
9767 static const int kSize = kDataOffset + kPointerSize; 9768 static const int kSize = kDataOffset + kPointerSize;
9768 9769
9769 private: 9770 private:
9770 DISALLOW_IMPLICIT_CONSTRUCTORS(AccessCheckInfo); 9771 DISALLOW_IMPLICIT_CONSTRUCTORS(AccessCheckInfo);
9771 }; 9772 };
9772 9773
9773 9774
9774 class InterceptorInfo FINAL : public Struct { 9775 class InterceptorInfo V8_FINAL : public Struct {
9775 public: 9776 public:
9776 DECL_ACCESSORS(getter, Object) 9777 DECL_ACCESSORS(getter, Object)
9777 DECL_ACCESSORS(setter, Object) 9778 DECL_ACCESSORS(setter, Object)
9778 DECL_ACCESSORS(query, Object) 9779 DECL_ACCESSORS(query, Object)
9779 DECL_ACCESSORS(deleter, Object) 9780 DECL_ACCESSORS(deleter, Object)
9780 DECL_ACCESSORS(enumerator, Object) 9781 DECL_ACCESSORS(enumerator, Object)
9781 DECL_ACCESSORS(data, Object) 9782 DECL_ACCESSORS(data, Object)
9782 9783
9783 static inline InterceptorInfo* cast(Object* obj); 9784 static inline InterceptorInfo* cast(Object* obj);
9784 9785
9785 // Dispatched behavior. 9786 // Dispatched behavior.
9786 DECLARE_PRINTER(InterceptorInfo) 9787 DECLARE_PRINTER(InterceptorInfo)
9787 DECLARE_VERIFIER(InterceptorInfo) 9788 DECLARE_VERIFIER(InterceptorInfo)
9788 9789
9789 static const int kGetterOffset = HeapObject::kHeaderSize; 9790 static const int kGetterOffset = HeapObject::kHeaderSize;
9790 static const int kSetterOffset = kGetterOffset + kPointerSize; 9791 static const int kSetterOffset = kGetterOffset + kPointerSize;
9791 static const int kQueryOffset = kSetterOffset + kPointerSize; 9792 static const int kQueryOffset = kSetterOffset + kPointerSize;
9792 static const int kDeleterOffset = kQueryOffset + kPointerSize; 9793 static const int kDeleterOffset = kQueryOffset + kPointerSize;
9793 static const int kEnumeratorOffset = kDeleterOffset + kPointerSize; 9794 static const int kEnumeratorOffset = kDeleterOffset + kPointerSize;
9794 static const int kDataOffset = kEnumeratorOffset + kPointerSize; 9795 static const int kDataOffset = kEnumeratorOffset + kPointerSize;
9795 static const int kSize = kDataOffset + kPointerSize; 9796 static const int kSize = kDataOffset + kPointerSize;
9796 9797
9797 private: 9798 private:
9798 DISALLOW_IMPLICIT_CONSTRUCTORS(InterceptorInfo); 9799 DISALLOW_IMPLICIT_CONSTRUCTORS(InterceptorInfo);
9799 }; 9800 };
9800 9801
9801 9802
9802 class CallHandlerInfo FINAL : public Struct { 9803 class CallHandlerInfo V8_FINAL : public Struct {
9803 public: 9804 public:
9804 DECL_ACCESSORS(callback, Object) 9805 DECL_ACCESSORS(callback, Object)
9805 DECL_ACCESSORS(data, Object) 9806 DECL_ACCESSORS(data, Object)
9806 9807
9807 static inline CallHandlerInfo* cast(Object* obj); 9808 static inline CallHandlerInfo* cast(Object* obj);
9808 9809
9809 // Dispatched behavior. 9810 // Dispatched behavior.
9810 DECLARE_PRINTER(CallHandlerInfo) 9811 DECLARE_PRINTER(CallHandlerInfo)
9811 DECLARE_VERIFIER(CallHandlerInfo) 9812 DECLARE_VERIFIER(CallHandlerInfo)
9812 9813
(...skipping 15 matching lines...) Expand all
9828 9829
9829 static const int kTagOffset = HeapObject::kHeaderSize; 9830 static const int kTagOffset = HeapObject::kHeaderSize;
9830 static const int kPropertyListOffset = kTagOffset + kPointerSize; 9831 static const int kPropertyListOffset = kTagOffset + kPointerSize;
9831 static const int kHeaderSize = kPropertyListOffset + kPointerSize; 9832 static const int kHeaderSize = kPropertyListOffset + kPointerSize;
9832 9833
9833 private: 9834 private:
9834 DISALLOW_IMPLICIT_CONSTRUCTORS(TemplateInfo); 9835 DISALLOW_IMPLICIT_CONSTRUCTORS(TemplateInfo);
9835 }; 9836 };
9836 9837
9837 9838
9838 class FunctionTemplateInfo FINAL : public TemplateInfo { 9839 class FunctionTemplateInfo V8_FINAL : public TemplateInfo {
9839 public: 9840 public:
9840 DECL_ACCESSORS(serial_number, Object) 9841 DECL_ACCESSORS(serial_number, Object)
9841 DECL_ACCESSORS(call_code, Object) 9842 DECL_ACCESSORS(call_code, Object)
9842 DECL_ACCESSORS(property_accessors, Object) 9843 DECL_ACCESSORS(property_accessors, Object)
9843 DECL_ACCESSORS(prototype_template, Object) 9844 DECL_ACCESSORS(prototype_template, Object)
9844 DECL_ACCESSORS(parent_template, Object) 9845 DECL_ACCESSORS(parent_template, Object)
9845 DECL_ACCESSORS(named_property_handler, Object) 9846 DECL_ACCESSORS(named_property_handler, Object)
9846 DECL_ACCESSORS(indexed_property_handler, Object) 9847 DECL_ACCESSORS(indexed_property_handler, Object)
9847 DECL_ACCESSORS(instance_template, Object) 9848 DECL_ACCESSORS(instance_template, Object)
9848 DECL_ACCESSORS(class_name, Object) 9849 DECL_ACCESSORS(class_name, Object)
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
9894 // Bit position in the flag, from least significant bit position. 9895 // Bit position in the flag, from least significant bit position.
9895 static const int kHiddenPrototypeBit = 0; 9896 static const int kHiddenPrototypeBit = 0;
9896 static const int kUndetectableBit = 1; 9897 static const int kUndetectableBit = 1;
9897 static const int kNeedsAccessCheckBit = 2; 9898 static const int kNeedsAccessCheckBit = 2;
9898 static const int kReadOnlyPrototypeBit = 3; 9899 static const int kReadOnlyPrototypeBit = 3;
9899 9900
9900 DISALLOW_IMPLICIT_CONSTRUCTORS(FunctionTemplateInfo); 9901 DISALLOW_IMPLICIT_CONSTRUCTORS(FunctionTemplateInfo);
9901 }; 9902 };
9902 9903
9903 9904
9904 class ObjectTemplateInfo FINAL : public TemplateInfo { 9905 class ObjectTemplateInfo V8_FINAL : public TemplateInfo {
9905 public: 9906 public:
9906 DECL_ACCESSORS(constructor, Object) 9907 DECL_ACCESSORS(constructor, Object)
9907 DECL_ACCESSORS(internal_field_count, Object) 9908 DECL_ACCESSORS(internal_field_count, Object)
9908 9909
9909 static inline ObjectTemplateInfo* cast(Object* obj); 9910 static inline ObjectTemplateInfo* cast(Object* obj);
9910 9911
9911 // Dispatched behavior. 9912 // Dispatched behavior.
9912 DECLARE_PRINTER(ObjectTemplateInfo) 9913 DECLARE_PRINTER(ObjectTemplateInfo)
9913 DECLARE_VERIFIER(ObjectTemplateInfo) 9914 DECLARE_VERIFIER(ObjectTemplateInfo)
9914 9915
9915 static const int kConstructorOffset = TemplateInfo::kHeaderSize; 9916 static const int kConstructorOffset = TemplateInfo::kHeaderSize;
9916 static const int kInternalFieldCountOffset = 9917 static const int kInternalFieldCountOffset =
9917 kConstructorOffset + kPointerSize; 9918 kConstructorOffset + kPointerSize;
9918 static const int kSize = kInternalFieldCountOffset + kPointerSize; 9919 static const int kSize = kInternalFieldCountOffset + kPointerSize;
9919 }; 9920 };
9920 9921
9921 9922
9922 class SignatureInfo FINAL : public Struct { 9923 class SignatureInfo V8_FINAL : public Struct {
9923 public: 9924 public:
9924 DECL_ACCESSORS(receiver, Object) 9925 DECL_ACCESSORS(receiver, Object)
9925 DECL_ACCESSORS(args, Object) 9926 DECL_ACCESSORS(args, Object)
9926 9927
9927 static inline SignatureInfo* cast(Object* obj); 9928 static inline SignatureInfo* cast(Object* obj);
9928 9929
9929 // Dispatched behavior. 9930 // Dispatched behavior.
9930 DECLARE_PRINTER(SignatureInfo) 9931 DECLARE_PRINTER(SignatureInfo)
9931 DECLARE_VERIFIER(SignatureInfo) 9932 DECLARE_VERIFIER(SignatureInfo)
9932 9933
9933 static const int kReceiverOffset = Struct::kHeaderSize; 9934 static const int kReceiverOffset = Struct::kHeaderSize;
9934 static const int kArgsOffset = kReceiverOffset + kPointerSize; 9935 static const int kArgsOffset = kReceiverOffset + kPointerSize;
9935 static const int kSize = kArgsOffset + kPointerSize; 9936 static const int kSize = kArgsOffset + kPointerSize;
9936 9937
9937 private: 9938 private:
9938 DISALLOW_IMPLICIT_CONSTRUCTORS(SignatureInfo); 9939 DISALLOW_IMPLICIT_CONSTRUCTORS(SignatureInfo);
9939 }; 9940 };
9940 9941
9941 9942
9942 class TypeSwitchInfo FINAL : public Struct { 9943 class TypeSwitchInfo V8_FINAL : public Struct {
9943 public: 9944 public:
9944 DECL_ACCESSORS(types, Object) 9945 DECL_ACCESSORS(types, Object)
9945 9946
9946 static inline TypeSwitchInfo* cast(Object* obj); 9947 static inline TypeSwitchInfo* cast(Object* obj);
9947 9948
9948 // Dispatched behavior. 9949 // Dispatched behavior.
9949 DECLARE_PRINTER(TypeSwitchInfo) 9950 DECLARE_PRINTER(TypeSwitchInfo)
9950 DECLARE_VERIFIER(TypeSwitchInfo) 9951 DECLARE_VERIFIER(TypeSwitchInfo)
9951 9952
9952 static const int kTypesOffset = Struct::kHeaderSize; 9953 static const int kTypesOffset = Struct::kHeaderSize;
9953 static const int kSize = kTypesOffset + kPointerSize; 9954 static const int kSize = kTypesOffset + kPointerSize;
9954 }; 9955 };
9955 9956
9956 9957
9957 #ifdef ENABLE_DEBUGGER_SUPPORT 9958 #ifdef ENABLE_DEBUGGER_SUPPORT
9958 // The DebugInfo class holds additional information for a function being 9959 // The DebugInfo class holds additional information for a function being
9959 // debugged. 9960 // debugged.
9960 class DebugInfo FINAL : public Struct { 9961 class DebugInfo V8_FINAL : public Struct {
9961 public: 9962 public:
9962 // The shared function info for the source being debugged. 9963 // The shared function info for the source being debugged.
9963 DECL_ACCESSORS(shared, SharedFunctionInfo) 9964 DECL_ACCESSORS(shared, SharedFunctionInfo)
9964 // Code object for the original code. 9965 // Code object for the original code.
9965 DECL_ACCESSORS(original_code, Code) 9966 DECL_ACCESSORS(original_code, Code)
9966 // Code object for the patched code. This code object is the code object 9967 // Code object for the patched code. This code object is the code object
9967 // currently active for the function. 9968 // currently active for the function.
9968 DECL_ACCESSORS(code, Code) 9969 DECL_ACCESSORS(code, Code)
9969 // Fixed array holding status information for each active break point. 9970 // Fixed array holding status information for each active break point.
9970 DECL_ACCESSORS(break_points, FixedArray) 9971 DECL_ACCESSORS(break_points, FixedArray)
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
10010 // Lookup the index in the break_points array for a code position. 10011 // Lookup the index in the break_points array for a code position.
10011 int GetBreakPointInfoIndex(int code_position); 10012 int GetBreakPointInfoIndex(int code_position);
10012 10013
10013 DISALLOW_IMPLICIT_CONSTRUCTORS(DebugInfo); 10014 DISALLOW_IMPLICIT_CONSTRUCTORS(DebugInfo);
10014 }; 10015 };
10015 10016
10016 10017
10017 // The BreakPointInfo class holds information for break points set in a 10018 // The BreakPointInfo class holds information for break points set in a
10018 // function. The DebugInfo object holds a BreakPointInfo object for each code 10019 // function. The DebugInfo object holds a BreakPointInfo object for each code
10019 // position with one or more break points. 10020 // position with one or more break points.
10020 class BreakPointInfo FINAL : public Struct { 10021 class BreakPointInfo V8_FINAL : public Struct {
10021 public: 10022 public:
10022 // The position in the code for the break point. 10023 // The position in the code for the break point.
10023 DECL_ACCESSORS(code_position, Smi) 10024 DECL_ACCESSORS(code_position, Smi)
10024 // The position in the source for the break position. 10025 // The position in the source for the break position.
10025 DECL_ACCESSORS(source_position, Smi) 10026 DECL_ACCESSORS(source_position, Smi)
10026 // The position in the source for the last statement before this break 10027 // The position in the source for the last statement before this break
10027 // position. 10028 // position.
10028 DECL_ACCESSORS(statement_position, Smi) 10029 DECL_ACCESSORS(statement_position, Smi)
10029 // List of related JavaScript break points. 10030 // List of related JavaScript break points.
10030 DECL_ACCESSORS(break_point_objects, Object) 10031 DECL_ACCESSORS(break_point_objects, Object)
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
10075 V(kRelocatable, "relocatable", "(Relocatable)") \ 10076 V(kRelocatable, "relocatable", "(Relocatable)") \
10076 V(kDebug, "debug", "(Debugger)") \ 10077 V(kDebug, "debug", "(Debugger)") \
10077 V(kCompilationCache, "compilationcache", "(Compilation cache)") \ 10078 V(kCompilationCache, "compilationcache", "(Compilation cache)") \
10078 V(kHandleScope, "handlescope", "(Handle scope)") \ 10079 V(kHandleScope, "handlescope", "(Handle scope)") \
10079 V(kBuiltins, "builtins", "(Builtins)") \ 10080 V(kBuiltins, "builtins", "(Builtins)") \
10080 V(kGlobalHandles, "globalhandles", "(Global handles)") \ 10081 V(kGlobalHandles, "globalhandles", "(Global handles)") \
10081 V(kEternalHandles, "eternalhandles", "(Eternal handles)") \ 10082 V(kEternalHandles, "eternalhandles", "(Eternal handles)") \
10082 V(kThreadManager, "threadmanager", "(Thread manager)") \ 10083 V(kThreadManager, "threadmanager", "(Thread manager)") \
10083 V(kExtensions, "Extensions", "(Extensions)") 10084 V(kExtensions, "Extensions", "(Extensions)")
10084 10085
10085 class VisitorSynchronization FINAL : public AllStatic { 10086 class VisitorSynchronization V8_FINAL : public AllStatic {
10086 public: 10087 public:
10087 #define DECLARE_ENUM(enum_item, ignore1, ignore2) enum_item, 10088 #define DECLARE_ENUM(enum_item, ignore1, ignore2) enum_item,
10088 enum SyncTag { 10089 enum SyncTag {
10089 VISITOR_SYNCHRONIZATION_TAGS_LIST(DECLARE_ENUM) 10090 VISITOR_SYNCHRONIZATION_TAGS_LIST(DECLARE_ENUM)
10090 kNumberOfSyncTags 10091 kNumberOfSyncTags
10091 }; 10092 };
10092 #undef DECLARE_ENUM 10093 #undef DECLARE_ENUM
10093 10094
10094 static const char* const kTags[kNumberOfSyncTags]; 10095 static const char* const kTags[kNumberOfSyncTags];
10095 static const char* const kTagNames[kNumberOfSyncTags]; 10096 static const char* const kTagNames[kNumberOfSyncTags];
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
10153 // Visits a handle that has an embedder-assigned class ID. 10154 // Visits a handle that has an embedder-assigned class ID.
10154 virtual void VisitEmbedderReference(Object** p, uint16_t class_id) {} 10155 virtual void VisitEmbedderReference(Object** p, uint16_t class_id) {}
10155 10156
10156 // Intended for serialization/deserialization checking: insert, or 10157 // Intended for serialization/deserialization checking: insert, or
10157 // check for the presence of, a tag at this position in the stream. 10158 // check for the presence of, a tag at this position in the stream.
10158 // Also used for marking up GC roots in heap snapshots. 10159 // Also used for marking up GC roots in heap snapshots.
10159 virtual void Synchronize(VisitorSynchronization::SyncTag tag) {} 10160 virtual void Synchronize(VisitorSynchronization::SyncTag tag) {}
10160 }; 10161 };
10161 10162
10162 10163
10163 class StructBodyDescriptor FINAL : public 10164 class StructBodyDescriptor V8_FINAL : public
10164 FlexibleBodyDescriptor<HeapObject::kHeaderSize> { 10165 FlexibleBodyDescriptor<HeapObject::kHeaderSize> {
10165 public: 10166 public:
10166 static inline int SizeOf(Map* map, HeapObject* object) { 10167 static inline int SizeOf(Map* map, HeapObject* object) {
10167 return map->instance_size(); 10168 return map->instance_size();
10168 } 10169 }
10169 }; 10170 };
10170 10171
10171 10172
10172 // BooleanBit is a helper class for setting and getting a bit in an 10173 // BooleanBit is a helper class for setting and getting a bit in an
10173 // integer or Smi. 10174 // integer or Smi.
10174 class BooleanBit FINAL : public AllStatic { 10175 class BooleanBit V8_FINAL : public AllStatic {
10175 public: 10176 public:
10176 static inline bool get(Smi* smi, int bit_position) { 10177 static inline bool get(Smi* smi, int bit_position) {
10177 return get(smi->value(), bit_position); 10178 return get(smi->value(), bit_position);
10178 } 10179 }
10179 10180
10180 static inline bool get(int value, int bit_position) { 10181 static inline bool get(int value, int bit_position) {
10181 return (value & (1 << bit_position)) != 0; 10182 return (value & (1 << bit_position)) != 0;
10182 } 10183 }
10183 10184
10184 static inline Smi* set(Smi* smi, int bit_position, bool v) { 10185 static inline Smi* set(Smi* smi, int bit_position, bool v) {
10185 return Smi::FromInt(set(smi->value(), bit_position, v)); 10186 return Smi::FromInt(set(smi->value(), bit_position, v));
10186 } 10187 }
10187 10188
10188 static inline int set(int value, int bit_position, bool v) { 10189 static inline int set(int value, int bit_position, bool v) {
10189 if (v) { 10190 if (v) {
10190 value |= (1 << bit_position); 10191 value |= (1 << bit_position);
10191 } else { 10192 } else {
10192 value &= ~(1 << bit_position); 10193 value &= ~(1 << bit_position);
10193 } 10194 }
10194 return value; 10195 return value;
10195 } 10196 }
10196 }; 10197 };
10197 10198
10198 } } // namespace v8::internal 10199 } } // namespace v8::internal
10199 10200
10200 #endif // V8_OBJECTS_H_ 10201 #endif // V8_OBJECTS_H_
OLDNEW
« no previous file with comments | « src/mips/lithium-mips.h ('k') | src/objects.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698