Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(262)

Side by Side Diff: src/crankshaft/hydrogen.cc

Issue 2653623002: [crankshaft] Fix string addition to check for max length of cons string. (Closed)
Patch Set: Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | test/mjsunit/regress/regress-678917.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « no previous file | test/mjsunit/regress/regress-678917.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698