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

Unified Diff: src/hydrogen.cc

Issue 1092353002: [strong] Disallow implicit conversions for binary arithmetic operations (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: cl feedback 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/hydrogen.h ('k') | src/ia32/full-codegen-ia32.cc » ('j') | src/ic/ic.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/hydrogen.cc
diff --git a/src/hydrogen.cc b/src/hydrogen.cc
index 1e28ceace21330186672a1287689d1ca416caaf2..eb7a73ee6334110231cc0e3b7c2be069588ecbf0 100644
--- a/src/hydrogen.cc
+++ b/src/hydrogen.cc
@@ -10428,7 +10428,7 @@ HValue* HOptimizedGraphBuilder::BuildBinaryOperation(
HValue* result = HGraphBuilder::BuildBinaryOperation(
expr->op(), left, right, left_type, right_type, result_type,
- fixed_right_arg, allocation_mode);
+ fixed_right_arg, allocation_mode, function_language_mode());
// Add a simulate after instructions with observable side effects, and
// after phis, which are the result of BuildBinaryOperation when we
// inlined some complex subgraph.
@@ -10453,7 +10453,8 @@ HValue* HGraphBuilder::BuildBinaryOperation(
Type* right_type,
Type* result_type,
Maybe<int> fixed_right_arg,
- HAllocationMode allocation_mode) {
+ HAllocationMode allocation_mode,
+ LanguageMode language_mode) {
Representation left_rep = RepresentationFor(left_type);
Representation right_rep = RepresentationFor(right_type);
@@ -10466,7 +10467,7 @@ HValue* HGraphBuilder::BuildBinaryOperation(
if (!left_type->IsInhabited()) {
Add<HDeoptimize>(
Deoptimizer::kInsufficientTypeFeedbackForLHSOfBinaryOperation,
- Deoptimizer::SOFT);
+ is_strong(language_mode) ? Deoptimizer::EAGER : Deoptimizer::SOFT);
left_type = Type::Any(zone());
left_rep = RepresentationFor(left_type);
maybe_string_add = op == Token::ADD;
@@ -10475,7 +10476,7 @@ HValue* HGraphBuilder::BuildBinaryOperation(
if (!right_type->IsInhabited()) {
Add<HDeoptimize>(
Deoptimizer::kInsufficientTypeFeedbackForRHSOfBinaryOperation,
- Deoptimizer::SOFT);
+ is_strong(language_mode) ? Deoptimizer::EAGER : Deoptimizer::SOFT);
right_type = Type::Any(zone());
right_rep = RepresentationFor(right_type);
maybe_string_add = op == Token::ADD;
@@ -10582,7 +10583,8 @@ HValue* HGraphBuilder::BuildBinaryOperation(
// inline several instructions (including the two pushes) for every tagged
// operation in optimized code, which is more expensive, than a stub call.
if (graph()->info()->IsStub() && is_non_primitive) {
- HValue* function = AddLoadJSBuiltin(BinaryOpIC::TokenToJSBuiltin(op));
+ HValue* function = AddLoadJSBuiltin(
+ BinaryOpIC::TokenToJSBuiltin(op, language_mode));
Add<HPushArguments>(left, right);
instr = AddUncasted<HInvokeFunction>(function, 2);
} else {
« no previous file with comments | « src/hydrogen.h ('k') | src/ia32/full-codegen-ia32.cc » ('j') | src/ic/ic.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698