OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 // | 4 // |
5 // Review notes: | 5 // Review notes: |
6 // | 6 // |
7 // - The use of macros in these inline functions may seem superfluous | 7 // - The use of macros in these inline functions may seem superfluous |
8 // but it is absolutely needed to make sure gcc generates optimal | 8 // but it is absolutely needed to make sure gcc generates optimal |
9 // code. gcc is not happy when attempting to inline too deep. | 9 // code. gcc is not happy when attempting to inline too deep. |
10 // | 10 // |
(...skipping 2357 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2368 DCHECK(index >= 0 && index < this->length()); | 2368 DCHECK(index >= 0 && index < this->length()); |
2369 DCHECK(reinterpret_cast<Object*>(value)->IsSmi()); | 2369 DCHECK(reinterpret_cast<Object*>(value)->IsSmi()); |
2370 int offset = kHeaderSize + index * kPointerSize; | 2370 int offset = kHeaderSize + index * kPointerSize; |
2371 WRITE_FIELD(this, offset, value); | 2371 WRITE_FIELD(this, offset, value); |
2372 } | 2372 } |
2373 | 2373 |
2374 | 2374 |
2375 void FixedArray::set(int index, Object* value) { | 2375 void FixedArray::set(int index, Object* value) { |
2376 DCHECK_NE(GetHeap()->fixed_cow_array_map(), map()); | 2376 DCHECK_NE(GetHeap()->fixed_cow_array_map(), map()); |
2377 DCHECK(IsFixedArray()); | 2377 DCHECK(IsFixedArray()); |
2378 DCHECK(index >= 0 && index < this->length()); | 2378 DCHECK_GE(index, 0); |
| 2379 DCHECK_LT(index, this->length()); |
2379 int offset = kHeaderSize + index * kPointerSize; | 2380 int offset = kHeaderSize + index * kPointerSize; |
2380 WRITE_FIELD(this, offset, value); | 2381 WRITE_FIELD(this, offset, value); |
2381 WRITE_BARRIER(GetHeap(), this, offset, value); | 2382 WRITE_BARRIER(GetHeap(), this, offset, value); |
2382 } | 2383 } |
2383 | 2384 |
2384 | 2385 |
2385 double FixedDoubleArray::get_scalar(int index) { | 2386 double FixedDoubleArray::get_scalar(int index) { |
2386 DCHECK(map() != GetHeap()->fixed_cow_array_map() && | 2387 DCHECK(map() != GetHeap()->fixed_cow_array_map() && |
2387 map() != GetHeap()->fixed_array_map()); | 2388 map() != GetHeap()->fixed_array_map()); |
2388 DCHECK(index >= 0 && index < this->length()); | 2389 DCHECK(index >= 0 && index < this->length()); |
(...skipping 5486 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7875 #undef WRITE_INT64_FIELD | 7876 #undef WRITE_INT64_FIELD |
7876 #undef READ_BYTE_FIELD | 7877 #undef READ_BYTE_FIELD |
7877 #undef WRITE_BYTE_FIELD | 7878 #undef WRITE_BYTE_FIELD |
7878 #undef NOBARRIER_READ_BYTE_FIELD | 7879 #undef NOBARRIER_READ_BYTE_FIELD |
7879 #undef NOBARRIER_WRITE_BYTE_FIELD | 7880 #undef NOBARRIER_WRITE_BYTE_FIELD |
7880 | 7881 |
7881 } // namespace internal | 7882 } // namespace internal |
7882 } // namespace v8 | 7883 } // namespace v8 |
7883 | 7884 |
7884 #endif // V8_OBJECTS_INL_H_ | 7885 #endif // V8_OBJECTS_INL_H_ |
OLD | NEW |