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 2077 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2088 GetValue(descriptor_number), | 2088 GetValue(descriptor_number), |
2089 GetDetails(descriptor_number)); | 2089 GetDetails(descriptor_number)); |
2090 } | 2090 } |
2091 | 2091 |
2092 | 2092 |
2093 void DescriptorArray::Set(int descriptor_number, | 2093 void DescriptorArray::Set(int descriptor_number, |
2094 Descriptor* desc, | 2094 Descriptor* desc, |
2095 const WhitenessWitness&) { | 2095 const WhitenessWitness&) { |
2096 // Range check. | 2096 // Range check. |
2097 ASSERT(descriptor_number < number_of_descriptors()); | 2097 ASSERT(descriptor_number < number_of_descriptors()); |
| 2098 ASSERT(desc->GetDetails().index() <= number_of_descriptors()); |
2098 ASSERT(desc->GetDetails().index() > 0); | 2099 ASSERT(desc->GetDetails().index() > 0); |
2099 | 2100 |
2100 NoIncrementalWriteBarrierSet(this, | 2101 NoIncrementalWriteBarrierSet(this, |
2101 ToKeyIndex(descriptor_number), | 2102 ToKeyIndex(descriptor_number), |
2102 desc->GetKey()); | 2103 desc->GetKey()); |
2103 NoIncrementalWriteBarrierSet(this, | 2104 NoIncrementalWriteBarrierSet(this, |
2104 ToValueIndex(descriptor_number), | 2105 ToValueIndex(descriptor_number), |
2105 desc->GetValue()); | 2106 desc->GetValue()); |
2106 NoIncrementalWriteBarrierSet(this, | 2107 NoIncrementalWriteBarrierSet(this, |
2107 ToDetailsIndex(descriptor_number), | 2108 ToDetailsIndex(descriptor_number), |
2108 desc->GetDetails().AsSmi()); | 2109 desc->GetDetails().AsSmi()); |
2109 } | 2110 } |
2110 | 2111 |
2111 | 2112 |
| 2113 void DescriptorArray::Append(int descriptor_number, |
| 2114 Descriptor* desc, |
| 2115 const WhitenessWitness& witness) { |
| 2116 desc->SetEnumerationIndex(descriptor_number + 1); |
| 2117 Set(descriptor_number, desc, witness); |
| 2118 } |
| 2119 |
| 2120 |
2112 void DescriptorArray::NoIncrementalWriteBarrierSwapDescriptors( | 2121 void DescriptorArray::NoIncrementalWriteBarrierSwapDescriptors( |
2113 int first, int second) { | 2122 int first, int second) { |
2114 NoIncrementalWriteBarrierSwap(this, ToKeyIndex(first), ToKeyIndex(second)); | 2123 NoIncrementalWriteBarrierSwap(this, ToKeyIndex(first), ToKeyIndex(second)); |
2115 NoIncrementalWriteBarrierSwap(this, | 2124 NoIncrementalWriteBarrierSwap(this, |
2116 ToValueIndex(first), | 2125 ToValueIndex(first), |
2117 ToValueIndex(second)); | 2126 ToValueIndex(second)); |
2118 NoIncrementalWriteBarrierSwap(this, | 2127 NoIncrementalWriteBarrierSwap(this, |
2119 ToDetailsIndex(first), | 2128 ToDetailsIndex(first), |
2120 ToDetailsIndex(second)); | 2129 ToDetailsIndex(second)); |
2121 } | 2130 } |
(...skipping 3184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5306 #undef WRITE_UINT32_FIELD | 5315 #undef WRITE_UINT32_FIELD |
5307 #undef READ_SHORT_FIELD | 5316 #undef READ_SHORT_FIELD |
5308 #undef WRITE_SHORT_FIELD | 5317 #undef WRITE_SHORT_FIELD |
5309 #undef READ_BYTE_FIELD | 5318 #undef READ_BYTE_FIELD |
5310 #undef WRITE_BYTE_FIELD | 5319 #undef WRITE_BYTE_FIELD |
5311 | 5320 |
5312 | 5321 |
5313 } } // namespace v8::internal | 5322 } } // namespace v8::internal |
5314 | 5323 |
5315 #endif // V8_OBJECTS_INL_H_ | 5324 #endif // V8_OBJECTS_INL_H_ |
OLD | NEW |