OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 2030 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2041 inline void set_length(int value); | 2041 inline void set_length(int value); |
2042 | 2042 |
2043 inline static FixedArrayBase* cast(Object* object); | 2043 inline static FixedArrayBase* cast(Object* object); |
2044 | 2044 |
2045 // Layout description. | 2045 // Layout description. |
2046 // Length is smi tagged when it is stored. | 2046 // Length is smi tagged when it is stored. |
2047 static const int kLengthOffset = HeapObject::kHeaderSize; | 2047 static const int kLengthOffset = HeapObject::kHeaderSize; |
2048 static const int kHeaderSize = kLengthOffset + kPointerSize; | 2048 static const int kHeaderSize = kLengthOffset + kPointerSize; |
2049 }; | 2049 }; |
2050 | 2050 |
| 2051 class FixedDoubleArray; |
2051 | 2052 |
2052 // FixedArray describes fixed-sized arrays with element type Object*. | 2053 // FixedArray describes fixed-sized arrays with element type Object*. |
2053 class FixedArray: public FixedArrayBase { | 2054 class FixedArray: public FixedArrayBase { |
2054 public: | 2055 public: |
2055 // Setter and getter for elements. | 2056 // Setter and getter for elements. |
2056 inline Object* get(int index); | 2057 inline Object* get(int index); |
2057 // Setter that uses write barrier. | 2058 // Setter that uses write barrier. |
2058 inline void set(int index, Object* value); | 2059 inline void set(int index, Object* value); |
2059 | 2060 |
2060 // Setter that doesn't need write barrier). | 2061 // Setter that doesn't need write barrier). |
(...skipping 22 matching lines...) Expand all Loading... |
2083 // Copy operations. | 2084 // Copy operations. |
2084 MUST_USE_RESULT inline MaybeObject* Copy(); | 2085 MUST_USE_RESULT inline MaybeObject* Copy(); |
2085 MUST_USE_RESULT MaybeObject* CopySize(int new_length); | 2086 MUST_USE_RESULT MaybeObject* CopySize(int new_length); |
2086 | 2087 |
2087 // Add the elements of a JSArray to this FixedArray. | 2088 // Add the elements of a JSArray to this FixedArray. |
2088 MUST_USE_RESULT MaybeObject* AddKeysFromJSArray(JSArray* array); | 2089 MUST_USE_RESULT MaybeObject* AddKeysFromJSArray(JSArray* array); |
2089 | 2090 |
2090 // Compute the union of this and other. | 2091 // Compute the union of this and other. |
2091 MUST_USE_RESULT MaybeObject* UnionOfKeys(FixedArray* other); | 2092 MUST_USE_RESULT MaybeObject* UnionOfKeys(FixedArray* other); |
2092 | 2093 |
| 2094 // Compute the union of this and other. |
| 2095 MUST_USE_RESULT MaybeObject* UnionOfDoubleKeys( |
| 2096 FixedDoubleArray* other); |
| 2097 |
2093 // Copy a sub array from the receiver to dest. | 2098 // Copy a sub array from the receiver to dest. |
2094 void CopyTo(int pos, FixedArray* dest, int dest_pos, int len); | 2099 void CopyTo(int pos, FixedArray* dest, int dest_pos, int len); |
2095 | 2100 |
2096 // Garbage collection support. | 2101 // Garbage collection support. |
2097 static int SizeFor(int length) { return kHeaderSize + length * kPointerSize; } | 2102 static int SizeFor(int length) { return kHeaderSize + length * kPointerSize; } |
2098 | 2103 |
2099 // Code Generation support. | 2104 // Code Generation support. |
2100 static int OffsetOfElementAt(int index) { return SizeFor(index); } | 2105 static int OffsetOfElementAt(int index) { return SizeFor(index); } |
2101 | 2106 |
2102 // Casting. | 2107 // Casting. |
(...skipping 5071 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7174 } else { | 7179 } else { |
7175 value &= ~(1 << bit_position); | 7180 value &= ~(1 << bit_position); |
7176 } | 7181 } |
7177 return value; | 7182 return value; |
7178 } | 7183 } |
7179 }; | 7184 }; |
7180 | 7185 |
7181 } } // namespace v8::internal | 7186 } } // namespace v8::internal |
7182 | 7187 |
7183 #endif // V8_OBJECTS_H_ | 7188 #endif // V8_OBJECTS_H_ |
OLD | NEW |