| 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 2074 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2085 int index, | 2085 int index, |
| 2086 Object* value) { | 2086 Object* value) { |
| 2087 ASSERT(array->map() != HEAP->fixed_cow_array_map()); | 2087 ASSERT(array->map() != HEAP->fixed_cow_array_map()); |
| 2088 ASSERT(index >= 0 && index < array->length()); | 2088 ASSERT(index >= 0 && index < array->length()); |
| 2089 ASSERT(!HEAP->InNewSpace(value)); | 2089 ASSERT(!HEAP->InNewSpace(value)); |
| 2090 WRITE_FIELD(array, kHeaderSize + index * kPointerSize, value); | 2090 WRITE_FIELD(array, kHeaderSize + index * kPointerSize, value); |
| 2091 } | 2091 } |
| 2092 | 2092 |
| 2093 | 2093 |
| 2094 void FixedArray::set_undefined(int index) { | 2094 void FixedArray::set_undefined(int index) { |
| 2095 ASSERT(map() != HEAP->fixed_cow_array_map()); | 2095 ASSERT(map() != GetHeap()->fixed_cow_array_map()); |
| 2096 set_undefined(GetHeap(), index); | |
| 2097 } | |
| 2098 | |
| 2099 | |
| 2100 void FixedArray::set_undefined(Heap* heap, int index) { | |
| 2101 ASSERT(index >= 0 && index < this->length()); | 2096 ASSERT(index >= 0 && index < this->length()); |
| 2102 ASSERT(!heap->InNewSpace(heap->undefined_value())); | 2097 ASSERT(!GetHeap()->InNewSpace(GetHeap()->undefined_value())); |
| 2103 WRITE_FIELD(this, kHeaderSize + index * kPointerSize, | 2098 WRITE_FIELD(this, |
| 2104 heap->undefined_value()); | 2099 kHeaderSize + index * kPointerSize, |
| 2100 GetHeap()->undefined_value()); |
| 2105 } | 2101 } |
| 2106 | 2102 |
| 2107 | 2103 |
| 2108 void FixedArray::set_null(int index) { | 2104 void FixedArray::set_null(int index) { |
| 2109 set_null(GetHeap(), index); | 2105 ASSERT(index >= 0 && index < this->length()); |
| 2106 ASSERT(!GetHeap()->InNewSpace(GetHeap()->null_value())); |
| 2107 WRITE_FIELD(this, |
| 2108 kHeaderSize + index * kPointerSize, |
| 2109 GetHeap()->null_value()); |
| 2110 } | 2110 } |
| 2111 | 2111 |
| 2112 | 2112 |
| 2113 void FixedArray::set_null(Heap* heap, int index) { | |
| 2114 ASSERT(index >= 0 && index < this->length()); | |
| 2115 ASSERT(!heap->InNewSpace(heap->null_value())); | |
| 2116 WRITE_FIELD(this, kHeaderSize + index * kPointerSize, heap->null_value()); | |
| 2117 } | |
| 2118 | |
| 2119 | |
| 2120 void FixedArray::set_the_hole(int index) { | 2113 void FixedArray::set_the_hole(int index) { |
| 2121 ASSERT(map() != HEAP->fixed_cow_array_map()); | 2114 ASSERT(map() != HEAP->fixed_cow_array_map()); |
| 2122 ASSERT(index >= 0 && index < this->length()); | 2115 ASSERT(index >= 0 && index < this->length()); |
| 2123 ASSERT(!HEAP->InNewSpace(HEAP->the_hole_value())); | 2116 ASSERT(!HEAP->InNewSpace(HEAP->the_hole_value())); |
| 2124 WRITE_FIELD(this, | 2117 WRITE_FIELD(this, |
| 2125 kHeaderSize + index * kPointerSize, | 2118 kHeaderSize + index * kPointerSize, |
| 2126 GetHeap()->the_hole_value()); | 2119 GetHeap()->the_hole_value()); |
| 2127 } | 2120 } |
| 2128 | 2121 |
| 2129 | 2122 |
| (...skipping 4162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6292 #undef WRITE_UINT32_FIELD | 6285 #undef WRITE_UINT32_FIELD |
| 6293 #undef READ_SHORT_FIELD | 6286 #undef READ_SHORT_FIELD |
| 6294 #undef WRITE_SHORT_FIELD | 6287 #undef WRITE_SHORT_FIELD |
| 6295 #undef READ_BYTE_FIELD | 6288 #undef READ_BYTE_FIELD |
| 6296 #undef WRITE_BYTE_FIELD | 6289 #undef WRITE_BYTE_FIELD |
| 6297 | 6290 |
| 6298 | 6291 |
| 6299 } } // namespace v8::internal | 6292 } } // namespace v8::internal |
| 6300 | 6293 |
| 6301 #endif // V8_OBJECTS_INL_H_ | 6294 #endif // V8_OBJECTS_INL_H_ |
| OLD | NEW |