Commit 08df395f authored by bmeurer@chromium.org's avatar bmeurer@chromium.org

Get rid of the binop_stub parameter to BuildBinaryOperation().

Just ask the graph builder whether we are compiling a stub.

R=svenpanne@chromium.org

Review URL: https://codereview.chromium.org/83073003

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@18004 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent b6b84c02
...@@ -915,14 +915,14 @@ HValue* CodeStubGraphBuilder<BinaryOpStub>::BuildCodeInitializedStub() { ...@@ -915,14 +915,14 @@ HValue* CodeStubGraphBuilder<BinaryOpStub>::BuildCodeInitializedStub() {
Push(BuildBinaryOperation( Push(BuildBinaryOperation(
stub->operation(), left, right, stub->operation(), left, right,
handle(Type::String(), isolate()), right_type, handle(Type::String(), isolate()), right_type,
result_type, stub->fixed_right_arg(), true)); result_type, stub->fixed_right_arg()));
} }
if_leftisstring.Else(); if_leftisstring.Else();
{ {
Push(BuildBinaryOperation( Push(BuildBinaryOperation(
stub->operation(), left, right, stub->operation(), left, right,
left_type, right_type, result_type, left_type, right_type, result_type,
stub->fixed_right_arg(), true)); stub->fixed_right_arg()));
} }
if_leftisstring.End(); if_leftisstring.End();
result = Pop(); result = Pop();
...@@ -934,14 +934,14 @@ HValue* CodeStubGraphBuilder<BinaryOpStub>::BuildCodeInitializedStub() { ...@@ -934,14 +934,14 @@ HValue* CodeStubGraphBuilder<BinaryOpStub>::BuildCodeInitializedStub() {
Push(BuildBinaryOperation( Push(BuildBinaryOperation(
stub->operation(), left, right, stub->operation(), left, right,
left_type, handle(Type::String(), isolate()), left_type, handle(Type::String(), isolate()),
result_type, stub->fixed_right_arg(), true)); result_type, stub->fixed_right_arg()));
} }
if_rightisstring.Else(); if_rightisstring.Else();
{ {
Push(BuildBinaryOperation( Push(BuildBinaryOperation(
stub->operation(), left, right, stub->operation(), left, right,
left_type, right_type, result_type, left_type, right_type, result_type,
stub->fixed_right_arg(), true)); stub->fixed_right_arg()));
} }
if_rightisstring.End(); if_rightisstring.End();
result = Pop(); result = Pop();
...@@ -950,7 +950,7 @@ HValue* CodeStubGraphBuilder<BinaryOpStub>::BuildCodeInitializedStub() { ...@@ -950,7 +950,7 @@ HValue* CodeStubGraphBuilder<BinaryOpStub>::BuildCodeInitializedStub() {
result = BuildBinaryOperation( result = BuildBinaryOperation(
stub->operation(), left, right, stub->operation(), left, right,
left_type, right_type, result_type, left_type, right_type, result_type,
stub->fixed_right_arg(), true); stub->fixed_right_arg());
} }
// If we encounter a generic argument, the number conversion is // If we encounter a generic argument, the number conversion is
......
...@@ -8609,8 +8609,7 @@ HValue* HGraphBuilder::BuildBinaryOperation( ...@@ -8609,8 +8609,7 @@ HValue* HGraphBuilder::BuildBinaryOperation(
Handle<Type> left_type, Handle<Type> left_type,
Handle<Type> right_type, Handle<Type> right_type,
Handle<Type> result_type, Handle<Type> result_type,
Maybe<int> fixed_right_arg, Maybe<int> fixed_right_arg) {
bool binop_stub) {
Representation left_rep = Representation::FromType(left_type); Representation left_rep = Representation::FromType(left_type);
Representation right_rep = Representation::FromType(right_type); Representation right_rep = Representation::FromType(right_type);
...@@ -8679,7 +8678,7 @@ HValue* HGraphBuilder::BuildBinaryOperation( ...@@ -8679,7 +8678,7 @@ HValue* HGraphBuilder::BuildBinaryOperation(
return AddUncasted<HStringAdd>(left, right, STRING_ADD_CHECK_NONE); return AddUncasted<HStringAdd>(left, right, STRING_ADD_CHECK_NONE);
} }
if (binop_stub) { if (graph()->info()->IsStub()) {
left = EnforceNumberType(left, left_type); left = EnforceNumberType(left, left_type);
right = EnforceNumberType(right, right_type); right = EnforceNumberType(right, right_type);
} }
...@@ -8693,7 +8692,7 @@ HValue* HGraphBuilder::BuildBinaryOperation( ...@@ -8693,7 +8692,7 @@ HValue* HGraphBuilder::BuildBinaryOperation(
// Only the stub is allowed to call into the runtime, since otherwise we would // Only the stub is allowed to call into the runtime, since otherwise we would
// inline several instructions (including the two pushes) for every tagged // inline several instructions (including the two pushes) for every tagged
// operation in optimized code, which is more expensive, than a stub call. // operation in optimized code, which is more expensive, than a stub call.
if (binop_stub && is_non_primitive) { if (graph()->info()->IsStub() && is_non_primitive) {
HValue* function = AddLoadJSBuiltin(BinaryOpIC::TokenToJSBuiltin(op)); HValue* function = AddLoadJSBuiltin(BinaryOpIC::TokenToJSBuiltin(op));
Add<HPushArgument>(left); Add<HPushArgument>(left);
Add<HPushArgument>(right); Add<HPushArgument>(right);
...@@ -8768,7 +8767,7 @@ HValue* HGraphBuilder::BuildBinaryOperation( ...@@ -8768,7 +8767,7 @@ HValue* HGraphBuilder::BuildBinaryOperation(
binop->set_observed_input_representation(1, left_rep); binop->set_observed_input_representation(1, left_rep);
binop->set_observed_input_representation(2, right_rep); binop->set_observed_input_representation(2, right_rep);
binop->initialize_output_representation(result_rep); binop->initialize_output_representation(result_rep);
if (binop_stub) { if (graph()->info()->IsStub()) {
// Stub should not call into stub. // Stub should not call into stub.
instr->SetFlag(HValue::kCannotBeTagged); instr->SetFlag(HValue::kCannotBeTagged);
// And should truncate on HForceRepresentation already. // And should truncate on HForceRepresentation already.
......
...@@ -1345,8 +1345,7 @@ class HGraphBuilder { ...@@ -1345,8 +1345,7 @@ class HGraphBuilder {
Handle<Type> left_type, Handle<Type> left_type,
Handle<Type> right_type, Handle<Type> right_type,
Handle<Type> result_type, Handle<Type> result_type,
Maybe<int> fixed_right_arg, Maybe<int> fixed_right_arg);
bool binop_stub = false);
HLoadNamedField* AddLoadFixedArrayLength(HValue *object); HLoadNamedField* AddLoadFixedArrayLength(HValue *object);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment