| 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 5074 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5085 SMI_ACCESSORS(InterceptorInfo, flags, kFlagsOffset) | 5085 SMI_ACCESSORS(InterceptorInfo, flags, kFlagsOffset) |
| 5086 BOOL_ACCESSORS(InterceptorInfo, flags, can_intercept_symbols, | 5086 BOOL_ACCESSORS(InterceptorInfo, flags, can_intercept_symbols, |
| 5087 kCanInterceptSymbolsBit) | 5087 kCanInterceptSymbolsBit) |
| 5088 BOOL_ACCESSORS(InterceptorInfo, flags, all_can_read, kAllCanReadBit) | 5088 BOOL_ACCESSORS(InterceptorInfo, flags, all_can_read, kAllCanReadBit) |
| 5089 BOOL_ACCESSORS(InterceptorInfo, flags, non_masking, kNonMasking) | 5089 BOOL_ACCESSORS(InterceptorInfo, flags, non_masking, kNonMasking) |
| 5090 | 5090 |
| 5091 ACCESSORS(CallHandlerInfo, callback, Object, kCallbackOffset) | 5091 ACCESSORS(CallHandlerInfo, callback, Object, kCallbackOffset) |
| 5092 ACCESSORS(CallHandlerInfo, data, Object, kDataOffset) | 5092 ACCESSORS(CallHandlerInfo, data, Object, kDataOffset) |
| 5093 | 5093 |
| 5094 ACCESSORS(TemplateInfo, tag, Object, kTagOffset) | 5094 ACCESSORS(TemplateInfo, tag, Object, kTagOffset) |
| 5095 SMI_ACCESSORS(TemplateInfo, number_of_properties, kNumberOfProperties) |
| 5095 ACCESSORS(TemplateInfo, property_list, Object, kPropertyListOffset) | 5096 ACCESSORS(TemplateInfo, property_list, Object, kPropertyListOffset) |
| 5096 ACCESSORS(TemplateInfo, property_accessors, Object, kPropertyAccessorsOffset) | 5097 ACCESSORS(TemplateInfo, property_accessors, Object, kPropertyAccessorsOffset) |
| 5097 | 5098 |
| 5098 ACCESSORS(FunctionTemplateInfo, serial_number, Object, kSerialNumberOffset) | 5099 ACCESSORS(FunctionTemplateInfo, serial_number, Object, kSerialNumberOffset) |
| 5099 ACCESSORS(FunctionTemplateInfo, call_code, Object, kCallCodeOffset) | 5100 ACCESSORS(FunctionTemplateInfo, call_code, Object, kCallCodeOffset) |
| 5100 ACCESSORS(FunctionTemplateInfo, prototype_template, Object, | 5101 ACCESSORS(FunctionTemplateInfo, prototype_template, Object, |
| 5101 kPrototypeTemplateOffset) | 5102 kPrototypeTemplateOffset) |
| 5102 ACCESSORS(FunctionTemplateInfo, parent_template, Object, kParentTemplateOffset) | 5103 ACCESSORS(FunctionTemplateInfo, parent_template, Object, kParentTemplateOffset) |
| 5103 ACCESSORS(FunctionTemplateInfo, named_property_handler, Object, | 5104 ACCESSORS(FunctionTemplateInfo, named_property_handler, Object, |
| 5104 kNamedPropertyHandlerOffset) | 5105 kNamedPropertyHandlerOffset) |
| (...skipping 1833 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6938 void Map::ClearCodeCache(Heap* heap) { | 6939 void Map::ClearCodeCache(Heap* heap) { |
| 6939 // 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. |
| 6940 // Please note this function is used during marking: | 6941 // Please note this function is used during marking: |
| 6941 // - MarkCompactCollector::MarkUnmarkedObject | 6942 // - MarkCompactCollector::MarkUnmarkedObject |
| 6942 // - IncrementalMarking::Step | 6943 // - IncrementalMarking::Step |
| 6943 DCHECK(!heap->InNewSpace(heap->empty_fixed_array())); | 6944 DCHECK(!heap->InNewSpace(heap->empty_fixed_array())); |
| 6944 WRITE_FIELD(this, kCodeCacheOffset, heap->empty_fixed_array()); | 6945 WRITE_FIELD(this, kCodeCacheOffset, heap->empty_fixed_array()); |
| 6945 } | 6946 } |
| 6946 | 6947 |
| 6947 | 6948 |
| 6948 int Map::SlackForArraySize(int old_size, int size_limit) { | 6949 int Map::SlackForArraySize(bool is_prototype_map, int old_size, |
| 6950 int size_limit) { |
| 6949 const int max_slack = size_limit - old_size; | 6951 const int max_slack = size_limit - old_size; |
| 6950 CHECK(max_slack >= 0); | 6952 CHECK_LE(0, max_slack); |
| 6951 if (old_size < 4) return Min(max_slack, 1); | 6953 if (old_size < 4) return Min(max_slack, 1); |
| 6952 return Min(max_slack, old_size / 2); | 6954 if (is_prototype_map) return Min(max_slack, 4); |
| 6955 return Min(max_slack, old_size / 4); |
| 6953 } | 6956 } |
| 6954 | 6957 |
| 6955 | 6958 |
| 6956 void JSArray::set_length(Smi* length) { | 6959 void JSArray::set_length(Smi* length) { |
| 6957 // Don't need a write barrier for a Smi. | 6960 // Don't need a write barrier for a Smi. |
| 6958 set_length(static_cast<Object*>(length), SKIP_WRITE_BARRIER); | 6961 set_length(static_cast<Object*>(length), SKIP_WRITE_BARRIER); |
| 6959 } | 6962 } |
| 6960 | 6963 |
| 6961 | 6964 |
| 6962 bool JSArray::SetLengthWouldNormalize(Heap* heap, uint32_t new_length) { | 6965 bool JSArray::SetLengthWouldNormalize(Heap* heap, uint32_t new_length) { |
| (...skipping 348 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7311 #undef READ_SHORT_FIELD | 7314 #undef READ_SHORT_FIELD |
| 7312 #undef WRITE_SHORT_FIELD | 7315 #undef WRITE_SHORT_FIELD |
| 7313 #undef READ_BYTE_FIELD | 7316 #undef READ_BYTE_FIELD |
| 7314 #undef WRITE_BYTE_FIELD | 7317 #undef WRITE_BYTE_FIELD |
| 7315 #undef NOBARRIER_READ_BYTE_FIELD | 7318 #undef NOBARRIER_READ_BYTE_FIELD |
| 7316 #undef NOBARRIER_WRITE_BYTE_FIELD | 7319 #undef NOBARRIER_WRITE_BYTE_FIELD |
| 7317 | 7320 |
| 7318 } } // namespace v8::internal | 7321 } } // namespace v8::internal |
| 7319 | 7322 |
| 7320 #endif // V8_OBJECTS_INL_H_ | 7323 #endif // V8_OBJECTS_INL_H_ |
| OLD | NEW |