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

Unified Diff: src/hydrogen.cc

Issue 1336273002: [builtins] Remove STRING_ADD_LEFT and STRING_ADD_RIGHT builtins. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 3 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/full-codegen/x87/full-codegen-x87.cc ('k') | src/objects.h » ('j') | no next file with comments »
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 79a9d5e35b3c6742fb7ef622ad77c2730ba41c5e..f41748518a988ad9a364e7a9552fa45dac7b4474 100644
--- a/src/hydrogen.cc
+++ b/src/hydrogen.cc
@@ -10995,10 +10995,11 @@ HValue* HGraphBuilder::BuildBinaryOperation(
left = BuildNumberToString(left, left_type);
} else if (!left_type->Is(Type::String())) {
DCHECK(right_type->Is(Type::String()));
- HValue* function =
- AddLoadJSBuiltin(Context::STRING_ADD_RIGHT_BUILTIN_INDEX);
+ // TODO(bmeurer): We might want to optimize this, because we already
+ // know that the right hand side is a string.
Add<HPushArguments>(left, right);
- return AddUncasted<HInvokeFunction>(function, 2);
+ return AddUncasted<HCallRuntime>(Runtime::FunctionForId(Runtime::kAdd),
+ 2);
}
// Convert right argument as necessary.
@@ -11007,10 +11008,11 @@ HValue* HGraphBuilder::BuildBinaryOperation(
right = BuildNumberToString(right, right_type);
} else if (!right_type->Is(Type::String())) {
DCHECK(left_type->Is(Type::String()));
- HValue* function =
- AddLoadJSBuiltin(Context::STRING_ADD_LEFT_BUILTIN_INDEX);
+ // TODO(bmeurer): We might want to optimize this, because we already
+ // know that the left hand side is a string.
Add<HPushArguments>(left, right);
- return AddUncasted<HInvokeFunction>(function, 2);
+ return AddUncasted<HCallRuntime>(Runtime::FunctionForId(Runtime::kAdd),
+ 2);
}
}
« no previous file with comments | « src/full-codegen/x87/full-codegen-x87.cc ('k') | src/objects.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698