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 1325 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1336 | 1336 |
1337 | 1337 |
1338 int HeapNumber::get_sign() { | 1338 int HeapNumber::get_sign() { |
1339 return READ_INT_FIELD(this, kExponentOffset) & kSignMask; | 1339 return READ_INT_FIELD(this, kExponentOffset) & kSignMask; |
1340 } | 1340 } |
1341 | 1341 |
1342 | 1342 |
1343 ACCESSORS(JSObject, properties, FixedArray, kPropertiesOffset) | 1343 ACCESSORS(JSObject, properties, FixedArray, kPropertiesOffset) |
1344 | 1344 |
1345 | 1345 |
1346 HeapObject* JSObject::elements() { | 1346 FixedArrayBase* JSObject::elements() { |
1347 Object* array = READ_FIELD(this, kElementsOffset); | 1347 Object* array = READ_FIELD(this, kElementsOffset); |
1348 ASSERT(array->HasValidElements()); | 1348 ASSERT(array->HasValidElements()); |
1349 return reinterpret_cast<HeapObject*>(array); | 1349 return static_cast<FixedArrayBase*>(array); |
1350 } | 1350 } |
1351 | 1351 |
1352 | 1352 |
1353 void JSObject::set_elements(HeapObject* value, WriteBarrierMode mode) { | 1353 void JSObject::set_elements(FixedArrayBase* value, WriteBarrierMode mode) { |
1354 ASSERT(map()->has_fast_elements() == | 1354 ASSERT(map()->has_fast_elements() == |
1355 (value->map() == GetHeap()->fixed_array_map() || | 1355 (value->map() == GetHeap()->fixed_array_map() || |
1356 value->map() == GetHeap()->fixed_cow_array_map())); | 1356 value->map() == GetHeap()->fixed_cow_array_map())); |
1357 ASSERT(map()->has_fast_double_elements() == | 1357 ASSERT(map()->has_fast_double_elements() == |
1358 value->IsFixedDoubleArray()); | 1358 value->IsFixedDoubleArray()); |
1359 ASSERT(value->HasValidElements()); | 1359 ASSERT(value->HasValidElements()); |
1360 WRITE_FIELD(this, kElementsOffset, value); | 1360 WRITE_FIELD(this, kElementsOffset, value); |
1361 CONDITIONAL_WRITE_BARRIER(GetHeap(), this, kElementsOffset, mode); | 1361 CONDITIONAL_WRITE_BARRIER(GetHeap(), this, kElementsOffset, mode); |
1362 } | 1362 } |
1363 | 1363 |
(...skipping 3244 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4608 #undef WRITE_INT_FIELD | 4608 #undef WRITE_INT_FIELD |
4609 #undef READ_SHORT_FIELD | 4609 #undef READ_SHORT_FIELD |
4610 #undef WRITE_SHORT_FIELD | 4610 #undef WRITE_SHORT_FIELD |
4611 #undef READ_BYTE_FIELD | 4611 #undef READ_BYTE_FIELD |
4612 #undef WRITE_BYTE_FIELD | 4612 #undef WRITE_BYTE_FIELD |
4613 | 4613 |
4614 | 4614 |
4615 } } // namespace v8::internal | 4615 } } // namespace v8::internal |
4616 | 4616 |
4617 #endif // V8_OBJECTS_INL_H_ | 4617 #endif // V8_OBJECTS_INL_H_ |
OLD | NEW |