| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 // | 4 // |
| 5 // Review notes: | 5 // Review notes: |
| 6 // | 6 // |
| 7 // - The use of macros in these inline functions may seem superfluous | 7 // - The use of macros in these inline functions may seem superfluous |
| 8 // but it is absolutely needed to make sure gcc generates optimal | 8 // but it is absolutely needed to make sure gcc generates optimal |
| 9 // code. gcc is not happy when attempting to inline too deep. | 9 // code. gcc is not happy when attempting to inline too deep. |
| 10 // | 10 // |
| (...skipping 6928 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6939 void Map::ClearCodeCache(Heap* heap) { | 6939 void Map::ClearCodeCache(Heap* heap) { |
| 6940 // No write barrier is needed since empty_fixed_array is not in new space. | 6940 // No write barrier is needed since empty_fixed_array is not in new space. |
| 6941 // Please note this function is used during marking: | 6941 // Please note this function is used during marking: |
| 6942 // - MarkCompactCollector::MarkUnmarkedObject | 6942 // - MarkCompactCollector::MarkUnmarkedObject |
| 6943 // - IncrementalMarking::Step | 6943 // - IncrementalMarking::Step |
| 6944 DCHECK(!heap->InNewSpace(heap->empty_fixed_array())); | 6944 DCHECK(!heap->InNewSpace(heap->empty_fixed_array())); |
| 6945 WRITE_FIELD(this, kCodeCacheOffset, heap->empty_fixed_array()); | 6945 WRITE_FIELD(this, kCodeCacheOffset, heap->empty_fixed_array()); |
| 6946 } | 6946 } |
| 6947 | 6947 |
| 6948 | 6948 |
| 6949 int Map::SlackForArraySize(bool is_prototype_map, int old_size, | 6949 int Map::SlackForArraySize(int old_size, int size_limit) { |
| 6950 int size_limit) { | |
| 6951 const int max_slack = size_limit - old_size; | 6950 const int max_slack = size_limit - old_size; |
| 6952 CHECK_LE(0, max_slack); | 6951 CHECK_LE(0, max_slack); |
| 6953 if (old_size < 4) return Min(max_slack, 1); | 6952 if (old_size < 4) { |
| 6954 if (is_prototype_map) return Min(max_slack, 4); | 6953 DCHECK_LE(1, max_slack); |
| 6954 return 1; |
| 6955 } |
| 6955 return Min(max_slack, old_size / 4); | 6956 return Min(max_slack, old_size / 4); |
| 6956 } | 6957 } |
| 6957 | 6958 |
| 6958 | 6959 |
| 6959 void JSArray::set_length(Smi* length) { | 6960 void JSArray::set_length(Smi* length) { |
| 6960 // Don't need a write barrier for a Smi. | 6961 // Don't need a write barrier for a Smi. |
| 6961 set_length(static_cast<Object*>(length), SKIP_WRITE_BARRIER); | 6962 set_length(static_cast<Object*>(length), SKIP_WRITE_BARRIER); |
| 6962 } | 6963 } |
| 6963 | 6964 |
| 6964 | 6965 |
| (...skipping 349 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7314 #undef READ_SHORT_FIELD | 7315 #undef READ_SHORT_FIELD |
| 7315 #undef WRITE_SHORT_FIELD | 7316 #undef WRITE_SHORT_FIELD |
| 7316 #undef READ_BYTE_FIELD | 7317 #undef READ_BYTE_FIELD |
| 7317 #undef WRITE_BYTE_FIELD | 7318 #undef WRITE_BYTE_FIELD |
| 7318 #undef NOBARRIER_READ_BYTE_FIELD | 7319 #undef NOBARRIER_READ_BYTE_FIELD |
| 7319 #undef NOBARRIER_WRITE_BYTE_FIELD | 7320 #undef NOBARRIER_WRITE_BYTE_FIELD |
| 7320 | 7321 |
| 7321 } } // namespace v8::internal | 7322 } } // namespace v8::internal |
| 7322 | 7323 |
| 7323 #endif // V8_OBJECTS_INL_H_ | 7324 #endif // V8_OBJECTS_INL_H_ |
| OLD | NEW |