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 2082 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2093 | 2093 |
2094 double nan_double = FixedDoubleArray::hole_nan_as_double(); | 2094 double nan_double = FixedDoubleArray::hole_nan_as_double(); |
2095 HValue* hole = IsFastSmiOrObjectElementsKind(elements_kind) | 2095 HValue* hole = IsFastSmiOrObjectElementsKind(elements_kind) |
2096 ? Add<HConstant>(factory->the_hole_value()) | 2096 ? Add<HConstant>(factory->the_hole_value()) |
2097 : Add<HConstant>(nan_double); | 2097 : Add<HConstant>(nan_double); |
2098 | 2098 |
2099 // Special loop unfolding case | 2099 // Special loop unfolding case |
2100 static const int kLoopUnfoldLimit = 4; | 2100 static const int kLoopUnfoldLimit = 4; |
2101 bool unfold_loop = false; | 2101 bool unfold_loop = false; |
2102 int initial_capacity = JSArray::kPreallocatedArrayElements; | 2102 int initial_capacity = JSArray::kPreallocatedArrayElements; |
2103 if (from->IsConstant() && to->IsConstant() && | 2103 if (from->ActualValue()->IsConstant() && to->ActualValue()->IsConstant() && |
2104 initial_capacity <= kLoopUnfoldLimit) { | 2104 initial_capacity <= kLoopUnfoldLimit) { |
2105 HConstant* constant_from = HConstant::cast(from); | 2105 HConstant* constant_from = HConstant::cast(from->ActualValue()); |
2106 HConstant* constant_to = HConstant::cast(to); | 2106 HConstant* constant_to = HConstant::cast(to->ActualValue()); |
2107 | 2107 |
2108 if (constant_from->HasInteger32Value() && | 2108 if (constant_from->HasInteger32Value() && |
2109 constant_from->Integer32Value() == 0 && | 2109 constant_from->Integer32Value() == 0 && |
2110 constant_to->HasInteger32Value() && | 2110 constant_to->HasInteger32Value() && |
2111 constant_to->Integer32Value() == initial_capacity) { | 2111 constant_to->Integer32Value() == initial_capacity) { |
2112 unfold_loop = true; | 2112 unfold_loop = true; |
2113 } | 2113 } |
2114 } | 2114 } |
2115 | 2115 |
2116 // Since we're about to store a hole value, the store instruction below must | 2116 // Since we're about to store a hole value, the store instruction below must |
(...skipping 8051 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
10168 if (ShouldProduceTraceOutput()) { | 10168 if (ShouldProduceTraceOutput()) { |
10169 isolate()->GetHTracer()->TraceHydrogen(name(), graph_); | 10169 isolate()->GetHTracer()->TraceHydrogen(name(), graph_); |
10170 } | 10170 } |
10171 | 10171 |
10172 #ifdef DEBUG | 10172 #ifdef DEBUG |
10173 graph_->Verify(false); // No full verify. | 10173 graph_->Verify(false); // No full verify. |
10174 #endif | 10174 #endif |
10175 } | 10175 } |
10176 | 10176 |
10177 } } // namespace v8::internal | 10177 } } // namespace v8::internal |
OLD | NEW |