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

Side by Side Diff: src/hydrogen.cc

Issue 1071473003: Fix maybe_string_add for adds that have no type feedback where --always-opt is on. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Merge status file. Created 5 years, 8 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/compiler/generic-add.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 <sstream> 7 #include <sstream>
8 8
9 #include "src/v8.h" 9 #include "src/v8.h"
10 10
(...skipping 10380 matching lines...) Expand 10 before | Expand all | Expand 10 after
10391 bool maybe_string_add = op == Token::ADD && 10391 bool maybe_string_add = op == Token::ADD &&
10392 (left_type->Maybe(Type::String()) || 10392 (left_type->Maybe(Type::String()) ||
10393 left_type->Maybe(Type::Receiver()) || 10393 left_type->Maybe(Type::Receiver()) ||
10394 right_type->Maybe(Type::String()) || 10394 right_type->Maybe(Type::String()) ||
10395 right_type->Maybe(Type::Receiver())); 10395 right_type->Maybe(Type::Receiver()));
10396 10396
10397 if (!left_type->IsInhabited()) { 10397 if (!left_type->IsInhabited()) {
10398 Add<HDeoptimize>( 10398 Add<HDeoptimize>(
10399 Deoptimizer::kInsufficientTypeFeedbackForLHSOfBinaryOperation, 10399 Deoptimizer::kInsufficientTypeFeedbackForLHSOfBinaryOperation,
10400 Deoptimizer::SOFT); 10400 Deoptimizer::SOFT);
10401 // TODO(rossberg): we should be able to get rid of non-continuous
10402 // defaults.
10403 left_type = Type::Any(zone()); 10401 left_type = Type::Any(zone());
10404 } else {
10405 if (!maybe_string_add) left = TruncateToNumber(left, &left_type);
10406 left_rep = Representation::FromType(left_type); 10402 left_rep = Representation::FromType(left_type);
10403 maybe_string_add = op == Token::ADD;
10407 } 10404 }
10408 10405
10409 if (!right_type->IsInhabited()) { 10406 if (!right_type->IsInhabited()) {
10410 Add<HDeoptimize>( 10407 Add<HDeoptimize>(
10411 Deoptimizer::kInsufficientTypeFeedbackForRHSOfBinaryOperation, 10408 Deoptimizer::kInsufficientTypeFeedbackForRHSOfBinaryOperation,
10412 Deoptimizer::SOFT); 10409 Deoptimizer::SOFT);
10413 right_type = Type::Any(zone()); 10410 right_type = Type::Any(zone());
10414 } else {
10415 if (!maybe_string_add) right = TruncateToNumber(right, &right_type);
10416 right_rep = Representation::FromType(right_type); 10411 right_rep = Representation::FromType(right_type);
10412 maybe_string_add = op == Token::ADD;
10413 }
10414
10415 if (!maybe_string_add) {
10416 left = TruncateToNumber(left, &left_type);
10417 right = TruncateToNumber(right, &right_type);
10417 } 10418 }
10418 10419
10419 // Special case for string addition here. 10420 // Special case for string addition here.
10420 if (op == Token::ADD && 10421 if (op == Token::ADD &&
10421 (left_type->Is(Type::String()) || right_type->Is(Type::String()))) { 10422 (left_type->Is(Type::String()) || right_type->Is(Type::String()))) {
10422 // Validate type feedback for left argument. 10423 // Validate type feedback for left argument.
10423 if (left_type->Is(Type::String())) { 10424 if (left_type->Is(Type::String())) {
10424 left = BuildCheckString(left); 10425 left = BuildCheckString(left);
10425 } 10426 }
10426 10427
(...skipping 2494 matching lines...) Expand 10 before | Expand all | Expand 10 after
12921 if (ShouldProduceTraceOutput()) { 12922 if (ShouldProduceTraceOutput()) {
12922 isolate()->GetHTracer()->TraceHydrogen(name(), graph_); 12923 isolate()->GetHTracer()->TraceHydrogen(name(), graph_);
12923 } 12924 }
12924 12925
12925 #ifdef DEBUG 12926 #ifdef DEBUG
12926 graph_->Verify(false); // No full verify. 12927 graph_->Verify(false); // No full verify.
12927 #endif 12928 #endif
12928 } 12929 }
12929 12930
12930 } } // namespace v8::internal 12931 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | test/mjsunit/compiler/generic-add.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698