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 1594 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1605 | 1605 |
1606 | 1606 |
1607 Object* FixedArray::get(int index) { | 1607 Object* FixedArray::get(int index) { |
1608 ASSERT(index >= 0 && index < this->length()); | 1608 ASSERT(index >= 0 && index < this->length()); |
1609 return READ_FIELD(this, kHeaderSize + index * kPointerSize); | 1609 return READ_FIELD(this, kHeaderSize + index * kPointerSize); |
1610 } | 1610 } |
1611 | 1611 |
1612 | 1612 |
1613 void FixedArray::set(int index, Smi* value) { | 1613 void FixedArray::set(int index, Smi* value) { |
1614 ASSERT(map() != HEAP->fixed_cow_array_map()); | 1614 ASSERT(map() != HEAP->fixed_cow_array_map()); |
| 1615 ASSERT(index >= 0 && index < this->length()); |
1615 ASSERT(reinterpret_cast<Object*>(value)->IsSmi()); | 1616 ASSERT(reinterpret_cast<Object*>(value)->IsSmi()); |
1616 int offset = kHeaderSize + index * kPointerSize; | 1617 int offset = kHeaderSize + index * kPointerSize; |
1617 WRITE_FIELD(this, offset, value); | 1618 WRITE_FIELD(this, offset, value); |
1618 } | 1619 } |
1619 | 1620 |
1620 | 1621 |
1621 void FixedArray::set(int index, Object* value) { | 1622 void FixedArray::set(int index, Object* value) { |
1622 ASSERT(map() != HEAP->fixed_cow_array_map()); | 1623 ASSERT(map() != HEAP->fixed_cow_array_map()); |
1623 ASSERT(index >= 0 && index < this->length()); | 1624 ASSERT(index >= 0 && index < this->length()); |
1624 int offset = kHeaderSize + index * kPointerSize; | 1625 int offset = kHeaderSize + index * kPointerSize; |
(...skipping 2990 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4615 #undef WRITE_INT_FIELD | 4616 #undef WRITE_INT_FIELD |
4616 #undef READ_SHORT_FIELD | 4617 #undef READ_SHORT_FIELD |
4617 #undef WRITE_SHORT_FIELD | 4618 #undef WRITE_SHORT_FIELD |
4618 #undef READ_BYTE_FIELD | 4619 #undef READ_BYTE_FIELD |
4619 #undef WRITE_BYTE_FIELD | 4620 #undef WRITE_BYTE_FIELD |
4620 | 4621 |
4621 | 4622 |
4622 } } // namespace v8::internal | 4623 } } // namespace v8::internal |
4623 | 4624 |
4624 #endif // V8_OBJECTS_INL_H_ | 4625 #endif // V8_OBJECTS_INL_H_ |
OLD | NEW |