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

Unified Diff: src/compiler/js-generic-lowering.cc

Issue 450273002: Extend ToBooleanStub to be able to return oddballs. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 4 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-hydrogen.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/js-generic-lowering.cc
diff --git a/src/compiler/js-generic-lowering.cc b/src/compiler/js-generic-lowering.cc
index fe4fe652760b071f6bcc1d949abfa35ae0ed1e2b..699f7dd60569f8f6abe14767b1ca9325849ace9b 100644
--- a/src/compiler/js-generic-lowering.cc
+++ b/src/compiler/js-generic-lowering.cc
@@ -382,35 +382,15 @@ Node* JSGenericLowering::LowerBranch(Node* node) {
Node* JSGenericLowering::LowerJSUnaryNot(Node* node) {
- ToBooleanStub stub(isolate());
- CodeStubInterfaceDescriptor* d = stub.GetInterfaceDescriptor();
- CallDescriptor* desc = linkage()->GetStubCallDescriptor(d);
- Node* to_bool =
- graph()->NewNode(common()->Call(desc), CodeConstant(stub.GetCode()),
- NodeProperties::GetValueInput(node, 0),
- NodeProperties::GetContextInput(node),
- NodeProperties::GetEffectInput(node),
- NodeProperties::GetControlInput(node));
- node->ReplaceInput(0, to_bool);
- PatchInsertInput(node, 1, SmiConstant(Token::EQ));
- ReplaceWithRuntimeCall(node, Runtime::kBooleanize);
+ ToBooleanStub stub(isolate(), ToBooleanStub::RESULT_AS_INVERSE_ODDBALL);
+ ReplaceWithICStubCall(node, &stub);
return node;
}
Node* JSGenericLowering::LowerJSToBoolean(Node* node) {
- ToBooleanStub stub(isolate());
- CodeStubInterfaceDescriptor* d = stub.GetInterfaceDescriptor();
- CallDescriptor* desc = linkage()->GetStubCallDescriptor(d);
- Node* to_bool =
- graph()->NewNode(common()->Call(desc), CodeConstant(stub.GetCode()),
- NodeProperties::GetValueInput(node, 0),
- NodeProperties::GetContextInput(node),
- NodeProperties::GetEffectInput(node),
- NodeProperties::GetControlInput(node));
- node->ReplaceInput(0, to_bool);
- PatchInsertInput(node, 1, SmiConstant(Token::NE));
- ReplaceWithRuntimeCall(node, Runtime::kBooleanize);
+ ToBooleanStub stub(isolate(), ToBooleanStub::RESULT_AS_ODDBALL);
+ ReplaceWithICStubCall(node, &stub);
return node;
}
« no previous file with comments | « src/code-stubs-hydrogen.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698