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

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

Issue 1196213004: [turbofan] Add CodeFactory::Instanceof helper. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 6 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-factory.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 9132a3987b506dfb231b812eba862f060f1fc056..2f3d50b49d4f881803a14a3d2484fe6fa50b8dd1 100644
--- a/src/compiler/js-generic-lowering.cc
+++ b/src/compiler/js-generic-lowering.cc
@@ -265,33 +265,33 @@ void JSGenericLowering::ReplaceWithRuntimeCall(Node* node,
void JSGenericLowering::LowerJSUnaryNot(Node* node) {
+ CallDescriptor::Flags flags = AdjustFrameStatesForCall(node);
Callable callable = CodeFactory::ToBoolean(
isolate(), ToBooleanStub::RESULT_AS_INVERSE_ODDBALL);
- CallDescriptor::Flags flags = AdjustFrameStatesForCall(node);
ReplaceWithStubCall(node, callable,
CallDescriptor::kPatchableCallSite | flags);
}
void JSGenericLowering::LowerJSTypeOf(Node* node) {
- Callable callable = CodeFactory::Typeof(isolate());
CallDescriptor::Flags flags = AdjustFrameStatesForCall(node);
+ Callable callable = CodeFactory::Typeof(isolate());
ReplaceWithStubCall(node, callable, flags);
}
void JSGenericLowering::LowerJSToBoolean(Node* node) {
+ CallDescriptor::Flags flags = AdjustFrameStatesForCall(node);
Callable callable =
CodeFactory::ToBoolean(isolate(), ToBooleanStub::RESULT_AS_ODDBALL);
- CallDescriptor::Flags flags = AdjustFrameStatesForCall(node);
ReplaceWithStubCall(node, callable,
CallDescriptor::kPatchableCallSite | flags);
}
void JSGenericLowering::LowerJSToNumber(Node* node) {
- Callable callable = CodeFactory::ToNumber(isolate());
CallDescriptor::Flags flags = AdjustFrameStatesForCall(node);
+ Callable callable = CodeFactory::ToNumber(isolate());
ReplaceWithStubCall(node, callable, flags);
}
@@ -365,17 +365,12 @@ void JSGenericLowering::LowerJSHasProperty(Node* node) {
void JSGenericLowering::LowerJSInstanceOf(Node* node) {
- InstanceofStub::Flags flags = static_cast<InstanceofStub::Flags>(
+ CallDescriptor::Flags flags = AdjustFrameStatesForCall(node);
+ InstanceofStub::Flags stub_flags = static_cast<InstanceofStub::Flags>(
InstanceofStub::kReturnTrueFalseObject |
InstanceofStub::kArgsInRegisters);
- InstanceofStub stub(isolate(), flags);
- CallInterfaceDescriptor d = stub.GetCallInterfaceDescriptor();
- CallDescriptor::Flags desc_flags = AdjustFrameStatesForCall(node);
- CallDescriptor* desc =
- Linkage::GetStubCallDescriptor(isolate(), zone(), d, 0, desc_flags);
- Node* stub_code = jsgraph()->HeapConstant(stub.GetCode());
- node->InsertInput(zone(), 0, stub_code);
- node->set_op(common()->Call(desc));
+ Callable callable = CodeFactory::Instanceof(isolate(), stub_flags);
+ ReplaceWithStubCall(node, callable, flags);
}
« no previous file with comments | « src/code-factory.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698