OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 1321 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1332 #endif | 1332 #endif |
1333 if (new_map != NULL) { | 1333 if (new_map != NULL) { |
1334 if (mode == UPDATE_WRITE_BARRIER) { | 1334 if (mode == UPDATE_WRITE_BARRIER) { |
1335 set_map(new_map); | 1335 set_map(new_map); |
1336 } else { | 1336 } else { |
1337 ASSERT(mode == SKIP_WRITE_BARRIER); | 1337 ASSERT(mode == SKIP_WRITE_BARRIER); |
1338 set_map_no_write_barrier(new_map); | 1338 set_map_no_write_barrier(new_map); |
1339 } | 1339 } |
1340 } | 1340 } |
1341 ASSERT((map()->has_fast_elements() || | 1341 ASSERT((map()->has_fast_elements() || |
1342 map()->has_fast_smi_only_elements()) == | 1342 map()->has_fast_smi_only_elements() || |
| 1343 (value == GetHeap()->empty_fixed_array())) == |
1343 (value->map() == GetHeap()->fixed_array_map() || | 1344 (value->map() == GetHeap()->fixed_array_map() || |
1344 value->map() == GetHeap()->fixed_cow_array_map())); | 1345 value->map() == GetHeap()->fixed_cow_array_map())); |
1345 ASSERT(map()->has_fast_double_elements() == | 1346 ASSERT((value == GetHeap()->empty_fixed_array()) || |
1346 value->IsFixedDoubleArray()); | 1347 (map()->has_fast_double_elements() == value->IsFixedDoubleArray())); |
1347 WRITE_FIELD(this, kElementsOffset, value); | 1348 WRITE_FIELD(this, kElementsOffset, value); |
1348 CONDITIONAL_WRITE_BARRIER(GetHeap(), this, kElementsOffset, value, mode); | 1349 CONDITIONAL_WRITE_BARRIER(GetHeap(), this, kElementsOffset, value, mode); |
1349 } | 1350 } |
1350 | 1351 |
1351 | 1352 |
1352 void JSObject::set_elements(FixedArrayBase* value, WriteBarrierMode mode) { | 1353 void JSObject::set_elements(FixedArrayBase* value, WriteBarrierMode mode) { |
1353 set_map_and_elements(NULL, value, mode); | 1354 set_map_and_elements(NULL, value, mode); |
1354 } | 1355 } |
1355 | 1356 |
1356 | 1357 |
(...skipping 3545 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4902 #undef WRITE_INT_FIELD | 4903 #undef WRITE_INT_FIELD |
4903 #undef READ_SHORT_FIELD | 4904 #undef READ_SHORT_FIELD |
4904 #undef WRITE_SHORT_FIELD | 4905 #undef WRITE_SHORT_FIELD |
4905 #undef READ_BYTE_FIELD | 4906 #undef READ_BYTE_FIELD |
4906 #undef WRITE_BYTE_FIELD | 4907 #undef WRITE_BYTE_FIELD |
4907 | 4908 |
4908 | 4909 |
4909 } } // namespace v8::internal | 4910 } } // namespace v8::internal |
4910 | 4911 |
4911 #endif // V8_OBJECTS_INL_H_ | 4912 #endif // V8_OBJECTS_INL_H_ |
OLD | NEW |