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

Side by Side Diff: src/hydrogen.cc

Issue 423083004: Fix handling of potential string additions in hydrogen. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 4 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | test/mjsunit/regress/regress-3476.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/hydrogen.h" 5 #include "src/hydrogen.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "src/v8.h" 9 #include "src/v8.h"
10 10
(...skipping 10222 matching lines...) Expand 10 before | Expand all | Expand 10 after
10233 Type* right_type, 10233 Type* right_type,
10234 Type* result_type, 10234 Type* result_type,
10235 Maybe<int> fixed_right_arg, 10235 Maybe<int> fixed_right_arg,
10236 HAllocationMode allocation_mode) { 10236 HAllocationMode allocation_mode) {
10237 10237
10238 Representation left_rep = Representation::FromType(left_type); 10238 Representation left_rep = Representation::FromType(left_type);
10239 Representation right_rep = Representation::FromType(right_type); 10239 Representation right_rep = Representation::FromType(right_type);
10240 10240
10241 bool maybe_string_add = op == Token::ADD && 10241 bool maybe_string_add = op == Token::ADD &&
10242 (left_type->Maybe(Type::String()) || 10242 (left_type->Maybe(Type::String()) ||
10243 right_type->Maybe(Type::String())); 10243 left_type->Maybe(Type::Receiver()) ||
10244 right_type->Maybe(Type::String()) ||
10245 right_type->Maybe(Type::Receiver()));
10244 10246
10245 if (left_type->Is(Type::None())) { 10247 if (left_type->Is(Type::None())) {
10246 Add<HDeoptimize>("Insufficient type feedback for LHS of binary operation", 10248 Add<HDeoptimize>("Insufficient type feedback for LHS of binary operation",
10247 Deoptimizer::SOFT); 10249 Deoptimizer::SOFT);
10248 // TODO(rossberg): we should be able to get rid of non-continuous 10250 // TODO(rossberg): we should be able to get rid of non-continuous
10249 // defaults. 10251 // defaults.
10250 left_type = Type::Any(zone()); 10252 left_type = Type::Any(zone());
10251 } else { 10253 } else {
10252 if (!maybe_string_add) left = TruncateToNumber(left, &left_type); 10254 if (!maybe_string_add) left = TruncateToNumber(left, &left_type);
10253 left_rep = Representation::FromType(left_type); 10255 left_rep = Representation::FromType(left_type);
(...skipping 2223 matching lines...) Expand 10 before | Expand all | Expand 10 after
12477 if (ShouldProduceTraceOutput()) { 12479 if (ShouldProduceTraceOutput()) {
12478 isolate()->GetHTracer()->TraceHydrogen(name(), graph_); 12480 isolate()->GetHTracer()->TraceHydrogen(name(), graph_);
12479 } 12481 }
12480 12482
12481 #ifdef DEBUG 12483 #ifdef DEBUG
12482 graph_->Verify(false); // No full verify. 12484 graph_->Verify(false); // No full verify.
12483 #endif 12485 #endif
12484 } 12486 }
12485 12487
12486 } } // namespace v8::internal 12488 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | test/mjsunit/regress/regress-3476.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698