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 2370 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2381 DCHECK(index >= 0 && index < this->length()); | 2381 DCHECK(index >= 0 && index < this->length()); |
2382 DCHECK(reinterpret_cast<Object*>(value)->IsSmi()); | 2382 DCHECK(reinterpret_cast<Object*>(value)->IsSmi()); |
2383 int offset = kHeaderSize + index * kPointerSize; | 2383 int offset = kHeaderSize + index * kPointerSize; |
2384 WRITE_FIELD(this, offset, value); | 2384 WRITE_FIELD(this, offset, value); |
2385 } | 2385 } |
2386 | 2386 |
2387 | 2387 |
2388 void FixedArray::set(int index, Object* value) { | 2388 void FixedArray::set(int index, Object* value) { |
2389 DCHECK_NE(GetHeap()->fixed_cow_array_map(), map()); | 2389 DCHECK_NE(GetHeap()->fixed_cow_array_map(), map()); |
2390 DCHECK(IsFixedArray()); | 2390 DCHECK(IsFixedArray()); |
2391 DCHECK(index >= 0 && index < this->length()); | 2391 DCHECK_GE(index, 0); |
| 2392 DCHECK_LT(index, this->length()); |
2392 int offset = kHeaderSize + index * kPointerSize; | 2393 int offset = kHeaderSize + index * kPointerSize; |
2393 WRITE_FIELD(this, offset, value); | 2394 WRITE_FIELD(this, offset, value); |
2394 WRITE_BARRIER(GetHeap(), this, offset, value); | 2395 WRITE_BARRIER(GetHeap(), this, offset, value); |
2395 } | 2396 } |
2396 | 2397 |
2397 | 2398 |
2398 double FixedDoubleArray::get_scalar(int index) { | 2399 double FixedDoubleArray::get_scalar(int index) { |
2399 DCHECK(map() != GetHeap()->fixed_cow_array_map() && | 2400 DCHECK(map() != GetHeap()->fixed_cow_array_map() && |
2400 map() != GetHeap()->fixed_array_map()); | 2401 map() != GetHeap()->fixed_array_map()); |
2401 DCHECK(index >= 0 && index < this->length()); | 2402 DCHECK(index >= 0 && index < this->length()); |
(...skipping 5440 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7842 #undef WRITE_INT64_FIELD | 7843 #undef WRITE_INT64_FIELD |
7843 #undef READ_BYTE_FIELD | 7844 #undef READ_BYTE_FIELD |
7844 #undef WRITE_BYTE_FIELD | 7845 #undef WRITE_BYTE_FIELD |
7845 #undef NOBARRIER_READ_BYTE_FIELD | 7846 #undef NOBARRIER_READ_BYTE_FIELD |
7846 #undef NOBARRIER_WRITE_BYTE_FIELD | 7847 #undef NOBARRIER_WRITE_BYTE_FIELD |
7847 | 7848 |
7848 } // namespace internal | 7849 } // namespace internal |
7849 } // namespace v8 | 7850 } // namespace v8 |
7850 | 7851 |
7851 #endif // V8_OBJECTS_INL_H_ | 7852 #endif // V8_OBJECTS_INL_H_ |
OLD | NEW |