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 1317 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1328 | 1328 |
1329 | 1329 |
1330 int HeapNumber::get_sign() { | 1330 int HeapNumber::get_sign() { |
1331 return READ_INT_FIELD(this, kExponentOffset) & kSignMask; | 1331 return READ_INT_FIELD(this, kExponentOffset) & kSignMask; |
1332 } | 1332 } |
1333 | 1333 |
1334 | 1334 |
1335 ACCESSORS(JSObject, properties, FixedArray, kPropertiesOffset) | 1335 ACCESSORS(JSObject, properties, FixedArray, kPropertiesOffset) |
1336 | 1336 |
1337 | 1337 |
1338 HeapObject* JSObject::elements() { | 1338 FixedArrayBase* JSObject::elements() { |
1339 Object* array = READ_FIELD(this, kElementsOffset); | 1339 Object* array = READ_FIELD(this, kElementsOffset); |
1340 ASSERT(array->HasValidElements()); | 1340 ASSERT(array->HasValidElements()); |
1341 return reinterpret_cast<HeapObject*>(array); | 1341 return reinterpret_cast<FixedArrayBase*>(array); |
Sven Panne
2011/08/12 11:11:22
static_cast might be nicer here.
| |
1342 } | 1342 } |
1343 | 1343 |
1344 | 1344 |
1345 void JSObject::set_elements(HeapObject* value, WriteBarrierMode mode) { | 1345 void JSObject::set_elements(FixedArrayBase* value, WriteBarrierMode mode) { |
1346 ASSERT(map()->has_fast_elements() == | 1346 ASSERT(map()->has_fast_elements() == |
1347 (value->map() == GetHeap()->fixed_array_map() || | 1347 (value->map() == GetHeap()->fixed_array_map() || |
1348 value->map() == GetHeap()->fixed_cow_array_map())); | 1348 value->map() == GetHeap()->fixed_cow_array_map())); |
1349 ASSERT(map()->has_fast_double_elements() == | 1349 ASSERT(map()->has_fast_double_elements() == |
1350 value->IsFixedDoubleArray()); | 1350 value->IsFixedDoubleArray()); |
1351 ASSERT(value->HasValidElements()); | 1351 ASSERT(value->HasValidElements()); |
1352 WRITE_FIELD(this, kElementsOffset, value); | 1352 WRITE_FIELD(this, kElementsOffset, value); |
1353 CONDITIONAL_WRITE_BARRIER(GetHeap(), this, kElementsOffset, mode); | 1353 CONDITIONAL_WRITE_BARRIER(GetHeap(), this, kElementsOffset, mode); |
1354 } | 1354 } |
1355 | 1355 |
(...skipping 3244 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
4600 #undef WRITE_INT_FIELD | 4600 #undef WRITE_INT_FIELD |
4601 #undef READ_SHORT_FIELD | 4601 #undef READ_SHORT_FIELD |
4602 #undef WRITE_SHORT_FIELD | 4602 #undef WRITE_SHORT_FIELD |
4603 #undef READ_BYTE_FIELD | 4603 #undef READ_BYTE_FIELD |
4604 #undef WRITE_BYTE_FIELD | 4604 #undef WRITE_BYTE_FIELD |
4605 | 4605 |
4606 | 4606 |
4607 } } // namespace v8::internal | 4607 } } // namespace v8::internal |
4608 | 4608 |
4609 #endif // V8_OBJECTS_INL_H_ | 4609 #endif // V8_OBJECTS_INL_H_ |
OLD | NEW |