| 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 2108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2119 // objects we construct, and an int32-to-smi HChange could deopt. Accept | 2119 // objects we construct, and an int32-to-smi HChange could deopt. Accept |
| 2120 // the deopt possibility now, before allocation occurs. | 2120 // the deopt possibility now, before allocation occurs. |
| 2121 capacity = builder()->Add<HForceRepresentation>(capacity, | 2121 capacity = builder()->Add<HForceRepresentation>(capacity, |
| 2122 Representation::Smi()); | 2122 Representation::Smi()); |
| 2123 length_field = builder()->Add<HForceRepresentation>(length_field, | 2123 length_field = builder()->Add<HForceRepresentation>(length_field, |
| 2124 Representation::Smi()); | 2124 Representation::Smi()); |
| 2125 // Allocate (dealing with failure appropriately) | 2125 // Allocate (dealing with failure appropriately) |
| 2126 HAllocate* new_object = builder()->Add<HAllocate>(size_in_bytes, | 2126 HAllocate* new_object = builder()->Add<HAllocate>(size_in_bytes, |
| 2127 HType::JSArray(), NOT_TENURED, JS_ARRAY_TYPE); | 2127 HType::JSArray(), NOT_TENURED, JS_ARRAY_TYPE); |
| 2128 | 2128 |
| 2129 // Folded array allocation should be aligned if it has fast double elements. |
| 2130 if (IsFastDoubleElementsKind(kind_)) { |
| 2131 new_object->MakeDoubleAligned(); |
| 2132 } |
| 2133 |
| 2129 // Fill in the fields: map, properties, length | 2134 // Fill in the fields: map, properties, length |
| 2130 HValue* map; | 2135 HValue* map; |
| 2131 if (allocation_site_payload_ == NULL) { | 2136 if (allocation_site_payload_ == NULL) { |
| 2132 map = EmitInternalMapCode(); | 2137 map = EmitInternalMapCode(); |
| 2133 } else { | 2138 } else { |
| 2134 map = EmitMapCode(); | 2139 map = EmitMapCode(); |
| 2135 } | 2140 } |
| 2136 elements_location_ = builder()->BuildJSArrayHeader(new_object, | 2141 elements_location_ = builder()->BuildJSArrayHeader(new_object, |
| 2137 map, | 2142 map, |
| 2138 mode_, | 2143 mode_, |
| (...skipping 7675 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 9814 if (ShouldProduceTraceOutput()) { | 9819 if (ShouldProduceTraceOutput()) { |
| 9815 isolate()->GetHTracer()->TraceHydrogen(name(), graph_); | 9820 isolate()->GetHTracer()->TraceHydrogen(name(), graph_); |
| 9816 } | 9821 } |
| 9817 | 9822 |
| 9818 #ifdef DEBUG | 9823 #ifdef DEBUG |
| 9819 graph_->Verify(false); // No full verify. | 9824 graph_->Verify(false); // No full verify. |
| 9820 #endif | 9825 #endif |
| 9821 } | 9826 } |
| 9822 | 9827 |
| 9823 } } // namespace v8::internal | 9828 } } // namespace v8::internal |
| OLD | NEW |