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 2124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2135 | 2135 |
2136 double nan_double = FixedDoubleArray::hole_nan_as_double(); | 2136 double nan_double = FixedDoubleArray::hole_nan_as_double(); |
2137 HValue* hole = IsFastSmiOrObjectElementsKind(elements_kind) | 2137 HValue* hole = IsFastSmiOrObjectElementsKind(elements_kind) |
2138 ? Add<HConstant>(factory->the_hole_value()) | 2138 ? Add<HConstant>(factory->the_hole_value()) |
2139 : Add<HConstant>(nan_double); | 2139 : Add<HConstant>(nan_double); |
2140 | 2140 |
2141 // Special loop unfolding case | 2141 // Special loop unfolding case |
2142 static const int kLoopUnfoldLimit = 8; | 2142 static const int kLoopUnfoldLimit = 8; |
2143 STATIC_ASSERT(JSArray::kPreallocatedArrayElements <= kLoopUnfoldLimit); | 2143 STATIC_ASSERT(JSArray::kPreallocatedArrayElements <= kLoopUnfoldLimit); |
2144 int initial_capacity = -1; | 2144 int initial_capacity = -1; |
2145 if (from->ActualValue()->IsConstant() && to->ActualValue()->IsConstant()) { | 2145 if (from->IsInteger32Constant() && to->IsInteger32Constant()) { |
2146 HConstant* constant_from = HConstant::cast(from->ActualValue()); | 2146 int constant_from = from->GetInteger32Constant(); |
2147 HConstant* constant_to = HConstant::cast(to->ActualValue()); | 2147 int constant_to = to->GetInteger32Constant(); |
2148 | 2148 |
2149 if (constant_from->HasInteger32Value() && | 2149 if (constant_from == 0 && constant_to <= kLoopUnfoldLimit) { |
2150 constant_from->Integer32Value() == 0 && | 2150 initial_capacity = constant_to; |
2151 constant_to->HasInteger32Value() && | |
2152 constant_to->Integer32Value() <= kLoopUnfoldLimit) { | |
2153 initial_capacity = constant_to->Integer32Value(); | |
2154 } | 2151 } |
2155 } | 2152 } |
2156 | 2153 |
2157 // Since we're about to store a hole value, the store instruction below must | 2154 // Since we're about to store a hole value, the store instruction below must |
2158 // assume an elements kind that supports heap object values. | 2155 // assume an elements kind that supports heap object values. |
2159 if (IsFastSmiOrObjectElementsKind(elements_kind)) { | 2156 if (IsFastSmiOrObjectElementsKind(elements_kind)) { |
2160 elements_kind = FAST_HOLEY_ELEMENTS; | 2157 elements_kind = FAST_HOLEY_ELEMENTS; |
2161 } | 2158 } |
2162 | 2159 |
2163 if (initial_capacity >= 0) { | 2160 if (initial_capacity >= 0) { |
(...skipping 8168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
10332 if (ShouldProduceTraceOutput()) { | 10329 if (ShouldProduceTraceOutput()) { |
10333 isolate()->GetHTracer()->TraceHydrogen(name(), graph_); | 10330 isolate()->GetHTracer()->TraceHydrogen(name(), graph_); |
10334 } | 10331 } |
10335 | 10332 |
10336 #ifdef DEBUG | 10333 #ifdef DEBUG |
10337 graph_->Verify(false); // No full verify. | 10334 graph_->Verify(false); // No full verify. |
10338 #endif | 10335 #endif |
10339 } | 10336 } |
10340 | 10337 |
10341 } } // namespace v8::internal | 10338 } } // namespace v8::internal |
OLD | NEW |