Chromium Code Reviews| 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 2104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2115 HValue* capacity, | 2115 HValue* capacity, |
| 2116 HValue* length_field, | 2116 HValue* length_field, |
| 2117 bool fill_with_hole) { | 2117 bool fill_with_hole) { |
| 2118 // These HForceRepresentations are because we store these as fields in the | 2118 // These HForceRepresentations are because we store these as fields in the |
| 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 InstanceType instance_type = IsFastDoubleElementsKind(kind_) | |
| 2126 ? FIXED_DOUBLE_ARRAY_TYPE : JS_ARRAY_TYPE; | |
| 2125 // Allocate (dealing with failure appropriately) | 2127 // Allocate (dealing with failure appropriately) |
| 2126 HAllocate* new_object = builder()->Add<HAllocate>(size_in_bytes, | 2128 HAllocate* new_object = builder()->Add<HAllocate>(size_in_bytes, |
| 2127 HType::JSArray(), NOT_TENURED, JS_ARRAY_TYPE); | 2129 HType::JSArray(), NOT_TENURED, instance_type); |
|
Hannes Payer (out of office)
2013/10/23 09:49:34
This is not correct. JS_ARRAY refers to the array
dusmil
2013/10/23 13:27:35
Yes, the problem there is that allocation of array
dusmil
2013/10/23 13:55:20
Done.
| |
| 2128 | 2130 |
| 2129 // Fill in the fields: map, properties, length | 2131 // Fill in the fields: map, properties, length |
| 2130 HValue* map; | 2132 HValue* map; |
| 2131 if (allocation_site_payload_ == NULL) { | 2133 if (allocation_site_payload_ == NULL) { |
| 2132 map = EmitInternalMapCode(); | 2134 map = EmitInternalMapCode(); |
| 2133 } else { | 2135 } else { |
| 2134 map = EmitMapCode(); | 2136 map = EmitMapCode(); |
| 2135 } | 2137 } |
| 2136 elements_location_ = builder()->BuildJSArrayHeader(new_object, | 2138 elements_location_ = builder()->BuildJSArrayHeader(new_object, |
| 2137 map, | 2139 map, |
| (...skipping 7676 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 9814 if (ShouldProduceTraceOutput()) { | 9816 if (ShouldProduceTraceOutput()) { |
| 9815 isolate()->GetHTracer()->TraceHydrogen(name(), graph_); | 9817 isolate()->GetHTracer()->TraceHydrogen(name(), graph_); |
| 9816 } | 9818 } |
| 9817 | 9819 |
| 9818 #ifdef DEBUG | 9820 #ifdef DEBUG |
| 9819 graph_->Verify(false); // No full verify. | 9821 graph_->Verify(false); // No full verify. |
| 9820 #endif | 9822 #endif |
| 9821 } | 9823 } |
| 9822 | 9824 |
| 9823 } } // namespace v8::internal | 9825 } } // namespace v8::internal |
| OLD | NEW |