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

Unified Diff: src/code-stubs-hydrogen.cc

Issue 1347473003: Revert of [crankshaft] Re-add fast-case for string add left/right. (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/code-stubs.cc ('k') | src/hydrogen.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/code-stubs-hydrogen.cc
diff --git a/src/code-stubs-hydrogen.cc b/src/code-stubs-hydrogen.cc
index 43cf265e97f94af41800587d3ac5831674df74f1..9f9b14e309d975f15c77020d72a6e38b8e3e0a28 100644
--- a/src/code-stubs-hydrogen.cc
+++ b/src/code-stubs-hydrogen.cc
@@ -112,8 +112,6 @@
void BuildInstallFromOptimizedCodeMap(HValue* js_function,
HValue* shared_info,
HValue* native_context);
-
- HValue* CheckString(HValue* input, bool convert);
private:
HValue* BuildArraySingleArgumentConstructor(JSArrayBuilder* builder);
@@ -1458,66 +1456,6 @@
}
-HValue* CodeStubGraphBuilderBase::CheckString(HValue* input, bool convert) {
- if (!convert) return BuildCheckString(input);
- IfBuilder if_inputissmi(this);
- HValue* inputissmi = if_inputissmi.If<HIsSmiAndBranch>(input);
- if_inputissmi.Then();
- {
- // Convert the input smi to a string.
- Push(BuildNumberToString(input, Type::SignedSmall()));
- }
- if_inputissmi.Else();
- {
- HValue* input_map =
- Add<HLoadNamedField>(input, inputissmi, HObjectAccess::ForMap());
- HValue* input_instance_type = Add<HLoadNamedField>(
- input_map, inputissmi, HObjectAccess::ForMapInstanceType());
- IfBuilder if_inputisstring(this);
- if_inputisstring.If<HCompareNumericAndBranch>(
- input_instance_type, Add<HConstant>(FIRST_NONSTRING_TYPE), Token::LT);
- if_inputisstring.Then();
- {
- // The input is already a string.
- Push(input);
- }
- if_inputisstring.Else();
- {
- // Convert to primitive first (if necessary), see
- // ES6 section 12.7.3 The Addition operator.
- IfBuilder if_inputisprimitive(this);
- STATIC_ASSERT(FIRST_PRIMITIVE_TYPE == FIRST_TYPE);
- if_inputisprimitive.If<HCompareNumericAndBranch>(
- input_instance_type, Add<HConstant>(LAST_PRIMITIVE_TYPE), Token::LTE);
- if_inputisprimitive.Then();
- {
- // The input is already a primitive.
- Push(input);
- }
- if_inputisprimitive.Else();
- {
- // TODO(bmeurer): Add support for fast ToPrimitive conversion using
- // a dedicated ToPrimitiveStub.
- Add<HPushArguments>(input);
- Push(Add<HCallRuntime>(Runtime::FunctionForId(Runtime::kToPrimitive),
- 1));
- }
- if_inputisprimitive.End();
- // Convert the primitive to a string value.
- ToStringDescriptor descriptor(isolate());
- ToStringStub stub(isolate());
- HValue* values[] = {context(), Pop()};
- Push(AddUncasted<HCallWithDescriptor>(
- Add<HConstant>(stub.GetCode()), 0, descriptor,
- Vector<HValue*>(values, arraysize(values))));
- }
- if_inputisstring.End();
- }
- if_inputissmi.End();
- return Pop();
-}
-
-
template <>
HValue* CodeStubGraphBuilder<StringAddStub>::BuildCodeInitializedStub() {
StringAddStub* stub = casted_stub();
@@ -1529,12 +1467,10 @@
// Make sure that both arguments are strings if not known in advance.
if ((flags & STRING_ADD_CHECK_LEFT) == STRING_ADD_CHECK_LEFT) {
- left =
- CheckString(left, (flags & STRING_ADD_CONVERT) == STRING_ADD_CONVERT);
+ left = BuildCheckString(left);
}
if ((flags & STRING_ADD_CHECK_RIGHT) == STRING_ADD_CHECK_RIGHT) {
- right =
- CheckString(right, (flags & STRING_ADD_CONVERT) == STRING_ADD_CONVERT);
+ right = BuildCheckString(right);
}
return BuildStringAdd(left, right, HAllocationMode(pretenure_flag));
« no previous file with comments | « src/code-stubs.cc ('k') | src/hydrogen.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698