OLD | NEW |
1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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 9892 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
9903 Handle<FixedArrayBase> elements(boilerplate_object->elements()); | 9903 Handle<FixedArrayBase> elements(boilerplate_object->elements()); |
9904 int elements_size = (elements->length() > 0 && | 9904 int elements_size = (elements->length() > 0 && |
9905 elements->map() != isolate()->heap()->fixed_cow_array_map()) ? | 9905 elements->map() != isolate()->heap()->fixed_cow_array_map()) ? |
9906 elements->Size() : 0; | 9906 elements->Size() : 0; |
9907 | 9907 |
9908 HInstruction* object_elements = NULL; | 9908 HInstruction* object_elements = NULL; |
9909 if (elements_size > 0) { | 9909 if (elements_size > 0) { |
9910 HValue* object_elements_size = Add<HConstant>(elements_size); | 9910 HValue* object_elements_size = Add<HConstant>(elements_size); |
9911 if (boilerplate_object->HasFastDoubleElements()) { | 9911 if (boilerplate_object->HasFastDoubleElements()) { |
9912 // Allocation folding will not be able to fold |object| and | 9912 // Allocation folding will not be able to fold |object| and |
9913 // |object_elements| together in some cases, so initialize | 9913 // |object_elements| together if they are pre-tenured. |
9914 // elements with the undefined to make GC happy. | 9914 if (pretenure_flag == TENURED) { |
9915 HConstant* empty_fixed_array = Add<HConstant>( | 9915 HConstant* empty_fixed_array = Add<HConstant>( |
9916 isolate()->factory()->empty_fixed_array()); | 9916 isolate()->factory()->empty_fixed_array()); |
9917 Add<HStoreNamedField>(object, HObjectAccess::ForElementsPointer(), | 9917 Add<HStoreNamedField>(object, HObjectAccess::ForElementsPointer(), |
9918 empty_fixed_array, INITIALIZING_STORE); | 9918 empty_fixed_array, INITIALIZING_STORE); |
| 9919 } |
9919 object_elements = Add<HAllocate>(object_elements_size, HType::JSObject(), | 9920 object_elements = Add<HAllocate>(object_elements_size, HType::JSObject(), |
9920 pretenure_flag, FIXED_DOUBLE_ARRAY_TYPE, site_context->current()); | 9921 pretenure_flag, FIXED_DOUBLE_ARRAY_TYPE, site_context->current()); |
9921 } else { | 9922 } else { |
9922 object_elements = Add<HAllocate>(object_elements_size, HType::JSObject(), | 9923 object_elements = Add<HAllocate>(object_elements_size, HType::JSObject(), |
9923 pretenure_flag, FIXED_ARRAY_TYPE, site_context->current()); | 9924 pretenure_flag, FIXED_ARRAY_TYPE, site_context->current()); |
9924 } | 9925 } |
9925 } | 9926 } |
9926 BuildInitElementsInObjectHeader(boilerplate_object, object, object_elements); | 9927 BuildInitElementsInObjectHeader(boilerplate_object, object, object_elements); |
9927 | 9928 |
9928 // Copy object elements if non-COW. | 9929 // Copy object elements if non-COW. |
(...skipping 1446 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
11375 if (ShouldProduceTraceOutput()) { | 11376 if (ShouldProduceTraceOutput()) { |
11376 isolate()->GetHTracer()->TraceHydrogen(name(), graph_); | 11377 isolate()->GetHTracer()->TraceHydrogen(name(), graph_); |
11377 } | 11378 } |
11378 | 11379 |
11379 #ifdef DEBUG | 11380 #ifdef DEBUG |
11380 graph_->Verify(false); // No full verify. | 11381 graph_->Verify(false); // No full verify. |
11381 #endif | 11382 #endif |
11382 } | 11383 } |
11383 | 11384 |
11384 } } // namespace v8::internal | 11385 } } // namespace v8::internal |
OLD | NEW |