| OLD | NEW |
| 1 // Copyright 2006-2008 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2008 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 1124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1135 return true; | 1135 return true; |
| 1136 } | 1136 } |
| 1137 | 1137 |
| 1138 | 1138 |
| 1139 Object* FixedArray::get(int index) { | 1139 Object* FixedArray::get(int index) { |
| 1140 ASSERT(index >= 0 && index < this->length()); | 1140 ASSERT(index >= 0 && index < this->length()); |
| 1141 return READ_FIELD(this, kHeaderSize + index * kPointerSize); | 1141 return READ_FIELD(this, kHeaderSize + index * kPointerSize); |
| 1142 } | 1142 } |
| 1143 | 1143 |
| 1144 | 1144 |
| 1145 void FixedArray::set(int index, Smi* value) { |
| 1146 ASSERT(reinterpret_cast<Object*>(value)->IsSmi()); |
| 1147 int offset = kHeaderSize + index * kPointerSize; |
| 1148 WRITE_FIELD(this, offset, value); |
| 1149 } |
| 1150 |
| 1151 |
| 1145 void FixedArray::set(int index, Object* value) { | 1152 void FixedArray::set(int index, Object* value) { |
| 1146 ASSERT(index >= 0 && index < this->length()); | 1153 ASSERT(index >= 0 && index < this->length()); |
| 1147 int offset = kHeaderSize + index * kPointerSize; | 1154 int offset = kHeaderSize + index * kPointerSize; |
| 1148 WRITE_FIELD(this, offset, value); | 1155 WRITE_FIELD(this, offset, value); |
| 1149 WRITE_BARRIER(this, offset); | 1156 WRITE_BARRIER(this, offset); |
| 1150 } | 1157 } |
| 1151 | 1158 |
| 1152 | 1159 |
| 1153 WriteBarrierMode HeapObject::GetWriteBarrierMode() { | 1160 WriteBarrierMode HeapObject::GetWriteBarrierMode() { |
| 1154 if (Heap::InNewSpace(this)) return SKIP_WRITE_BARRIER; | 1161 if (Heap::InNewSpace(this)) return SKIP_WRITE_BARRIER; |
| (...skipping 1295 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2450 #undef WRITE_INT_FIELD | 2457 #undef WRITE_INT_FIELD |
| 2451 #undef READ_SHORT_FIELD | 2458 #undef READ_SHORT_FIELD |
| 2452 #undef WRITE_SHORT_FIELD | 2459 #undef WRITE_SHORT_FIELD |
| 2453 #undef READ_BYTE_FIELD | 2460 #undef READ_BYTE_FIELD |
| 2454 #undef WRITE_BYTE_FIELD | 2461 #undef WRITE_BYTE_FIELD |
| 2455 | 2462 |
| 2456 | 2463 |
| 2457 } } // namespace v8::internal | 2464 } } // namespace v8::internal |
| 2458 | 2465 |
| 2459 #endif // V8_OBJECTS_INL_H_ | 2466 #endif // V8_OBJECTS_INL_H_ |
| OLD | NEW |