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 3731 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3742 int* total_size) { | 3742 int* total_size) { |
3743 ASSERT(max_depth >= 0 && *max_properties >= 0); | 3743 ASSERT(max_depth >= 0 && *max_properties >= 0); |
3744 if (max_depth == 0) return false; | 3744 if (max_depth == 0) return false; |
3745 | 3745 |
3746 Handle<FixedArrayBase> elements(boilerplate->elements()); | 3746 Handle<FixedArrayBase> elements(boilerplate->elements()); |
3747 if (elements->length() > 0 && | 3747 if (elements->length() > 0 && |
3748 elements->map() != boilerplate->GetHeap()->fixed_cow_array_map()) { | 3748 elements->map() != boilerplate->GetHeap()->fixed_cow_array_map()) { |
3749 if (boilerplate->HasFastDoubleElements()) { | 3749 if (boilerplate->HasFastDoubleElements()) { |
3750 *total_size += FixedDoubleArray::SizeFor(elements->length()); | 3750 *total_size += FixedDoubleArray::SizeFor(elements->length()); |
3751 } else if (boilerplate->HasFastElements()) { | 3751 } else if (boilerplate->HasFastElements()) { |
| 3752 Handle<FixedArray> fast_elements = Handle<FixedArray>::cast(elements); |
3752 int length = elements->length(); | 3753 int length = elements->length(); |
3753 for (int i = 0; i < length; i++) { | 3754 for (int i = 0; i < length; i++) { |
3754 if ((*max_properties)-- == 0) return false; | 3755 if ((*max_properties)-- == 0) return false; |
3755 Handle<Object> value = JSObject::GetElement(boilerplate, i); | 3756 Handle<Object> value(fast_elements->get(i)); |
3756 if (value->IsJSObject()) { | 3757 if (value->IsJSObject()) { |
3757 Handle<JSObject> value_object = Handle<JSObject>::cast(value); | 3758 Handle<JSObject> value_object = Handle<JSObject>::cast(value); |
3758 if (!IsFastLiteral(value_object, | 3759 if (!IsFastLiteral(value_object, |
3759 max_depth - 1, | 3760 max_depth - 1, |
3760 max_properties, | 3761 max_properties, |
3761 total_size)) { | 3762 total_size)) { |
3762 return false; | 3763 return false; |
3763 } | 3764 } |
3764 } | 3765 } |
3765 } | 3766 } |
(...skipping 4599 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
8365 } | 8366 } |
8366 } | 8367 } |
8367 | 8368 |
8368 #ifdef DEBUG | 8369 #ifdef DEBUG |
8369 if (graph_ != NULL) graph_->Verify(false); // No full verify. | 8370 if (graph_ != NULL) graph_->Verify(false); // No full verify. |
8370 if (allocator_ != NULL) allocator_->Verify(); | 8371 if (allocator_ != NULL) allocator_->Verify(); |
8371 #endif | 8372 #endif |
8372 } | 8373 } |
8373 | 8374 |
8374 } } // namespace v8::internal | 8375 } } // namespace v8::internal |
OLD | NEW |