Reviewers: Sven Panne,
Message:
Hey Sven,
This is trivial cleanup. PTAL
-- Benedikt
Description:
Get rid of the binop_stub parameter to BuildBinaryOperation().
Just ask the graph builder whether we are compiling a stub.
Please review this at https://codereview.chromium.org/83073003/
SVN Base: https://v8.googlecode.com/svn/branches/bleeding_edge
Affected files (+10, -12 lines):
M src/code-stubs-hydrogen.cc
M src/hydrogen.h
M src/hydrogen.cc
Index: src/code-stubs-hydrogen.cc
diff --git a/src/code-stubs-hydrogen.cc b/src/code-stubs-hydrogen.cc
index
3d42483d93bcf9a9ccfc74f16f824d9265ca757f..3c90b5effa7ac16f8723b8732a4cf45c84d9f709
100644
--- a/src/code-stubs-hydrogen.cc
+++ b/src/code-stubs-hydrogen.cc
@@ -915,14 +915,14 @@ HValue*
CodeStubGraphBuilder<BinaryOpStub>::BuildCodeInitializedStub() {
Push(BuildBinaryOperation(
stub->operation(), left, right,
handle(Type::String(), isolate()), right_type,
- result_type, stub->fixed_right_arg(), true));
+ result_type, stub->fixed_right_arg()));
}
if_leftisstring.Else();
{
Push(BuildBinaryOperation(
stub->operation(), left, right,
left_type, right_type, result_type,
- stub->fixed_right_arg(), true));
+ stub->fixed_right_arg()));
}
if_leftisstring.End();
result = Pop();
@@ -934,14 +934,14 @@ HValue*
CodeStubGraphBuilder<BinaryOpStub>::BuildCodeInitializedStub() {
Push(BuildBinaryOperation(
stub->operation(), left, right,
left_type, handle(Type::String(), isolate()),
- result_type, stub->fixed_right_arg(), true));
+ result_type, stub->fixed_right_arg()));
}
if_rightisstring.Else();
{
Push(BuildBinaryOperation(
stub->operation(), left, right,
left_type, right_type, result_type,
- stub->fixed_right_arg(), true));
+ stub->fixed_right_arg()));
}
if_rightisstring.End();
result = Pop();
@@ -950,7 +950,7 @@ HValue*
CodeStubGraphBuilder<BinaryOpStub>::BuildCodeInitializedStub() {
result = BuildBinaryOperation(
stub->operation(), left, right,
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
Index: src/hydrogen.cc
diff --git a/src/hydrogen.cc b/src/hydrogen.cc
index
fd93ce3296dd5e75cbf1e733a41b3bdf9903720b..8581b14036c99aee9263bebcbba479d6ae6710ef
100644
--- a/src/hydrogen.cc
+++ b/src/hydrogen.cc
@@ -8619,8 +8619,7 @@ HValue* HGraphBuilder::BuildBinaryOperation(
Handle<Type> left_type,
Handle<Type> right_type,
Handle<Type> result_type,
- Maybe<int> fixed_right_arg,
- bool binop_stub) {
+ Maybe<int> fixed_right_arg) {
Representation left_rep = Representation::FromType(left_type);
Representation right_rep = Representation::FromType(right_type);
@@ -8689,7 +8688,7 @@ HValue* HGraphBuilder::BuildBinaryOperation(
return AddUncasted<HStringAdd>(left, right, STRING_ADD_CHECK_NONE);
}
- if (binop_stub) {
+ if (graph()->info()->IsStub()) {
left = EnforceNumberType(left, left_type);
right = EnforceNumberType(right, right_type);
}
@@ -8703,7 +8702,7 @@ HValue* HGraphBuilder::BuildBinaryOperation(
// Only the stub is allowed to call into the runtime, since otherwise we
would
// inline several instructions (including the two pushes) for every
tagged
// 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));
Add<HPushArgument>(left);
Add<HPushArgument>(right);
@@ -8778,7 +8777,7 @@ HValue* HGraphBuilder::BuildBinaryOperation(
binop->set_observed_input_representation(1, left_rep);
binop->set_observed_input_representation(2, right_rep);
binop->initialize_output_representation(result_rep);
- if (binop_stub) {
+ if (graph()->info()->IsStub()) {
// Stub should not call into stub.
instr->SetFlag(HValue::kCannotBeTagged);
// And should truncate on HForceRepresentation already.
Index: src/hydrogen.h
diff --git a/src/hydrogen.h b/src/hydrogen.h
index
d11fbc0a0de21e66814f15526e8caafd9dfbecaa..441c4136800944ae9fde78f40ecc2d2686c6d579
100644
--- a/src/hydrogen.h
+++ b/src/hydrogen.h
@@ -1345,8 +1345,7 @@ class HGraphBuilder {
Handle<Type> left_type,
Handle<Type> right_type,
Handle<Type> result_type,
- Maybe<int> fixed_right_arg,
- bool binop_stub = false);
+ Maybe<int> fixed_right_arg);
HLoadNamedField* AddLoadFixedArrayLength(HValue *object);
--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
---
You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.