| OLD | NEW |
| 1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "src/crankshaft/hydrogen.h" | 5 #include "src/crankshaft/hydrogen.h" |
| 6 | 6 |
| 7 #include <memory> | 7 #include <memory> |
| 8 #include <sstream> | 8 #include <sstream> |
| 9 | 9 |
| 10 #include "src/allocation-site-scopes.h" | 10 #include "src/allocation-site-scopes.h" |
| (...skipping 2223 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2234 if (c_right_length->Integer32Value() + 1 >= ConsString::kMinLength) { | 2234 if (c_right_length->Integer32Value() + 1 >= ConsString::kMinLength) { |
| 2235 // The left string contains at least one character. | 2235 // The left string contains at least one character. |
| 2236 return BuildCreateConsString(length, left, right, allocation_mode); | 2236 return BuildCreateConsString(length, left, right, allocation_mode); |
| 2237 } | 2237 } |
| 2238 } | 2238 } |
| 2239 | 2239 |
| 2240 // Check if we should create a cons string. | 2240 // Check if we should create a cons string. |
| 2241 IfBuilder if_createcons(this); | 2241 IfBuilder if_createcons(this); |
| 2242 if_createcons.If<HCompareNumericAndBranch>( | 2242 if_createcons.If<HCompareNumericAndBranch>( |
| 2243 length, Add<HConstant>(ConsString::kMinLength), Token::GTE); | 2243 length, Add<HConstant>(ConsString::kMinLength), Token::GTE); |
| 2244 if_createcons.And(); |
| 2245 if_createcons.If<HCompareNumericAndBranch>( |
| 2246 length, Add<HConstant>(ConsString::kMaxLength), Token::LTE); |
| 2244 if_createcons.Then(); | 2247 if_createcons.Then(); |
| 2245 { | 2248 { |
| 2246 // Create a cons string. | 2249 // Create a cons string. |
| 2247 Push(BuildCreateConsString(length, left, right, allocation_mode)); | 2250 Push(BuildCreateConsString(length, left, right, allocation_mode)); |
| 2248 } | 2251 } |
| 2249 if_createcons.Else(); | 2252 if_createcons.Else(); |
| 2250 { | 2253 { |
| 2251 // Determine the string instance types. | 2254 // Determine the string instance types. |
| 2252 HValue* left_instance_type = AddLoadStringInstanceType(left); | 2255 HValue* left_instance_type = AddLoadStringInstanceType(left); |
| 2253 HValue* right_instance_type = AddLoadStringInstanceType(right); | 2256 HValue* right_instance_type = AddLoadStringInstanceType(right); |
| (...skipping 10758 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 13012 isolate()->GetHTracer()->TraceHydrogen(name(), graph_); | 13015 isolate()->GetHTracer()->TraceHydrogen(name(), graph_); |
| 13013 } | 13016 } |
| 13014 | 13017 |
| 13015 #ifdef DEBUG | 13018 #ifdef DEBUG |
| 13016 graph_->Verify(false); // No full verify. | 13019 graph_->Verify(false); // No full verify. |
| 13017 #endif | 13020 #endif |
| 13018 } | 13021 } |
| 13019 | 13022 |
| 13020 } // namespace internal | 13023 } // namespace internal |
| 13021 } // namespace v8 | 13024 } // namespace v8 |
| OLD | NEW |