Index: src/compiler/js-generic-lowering.cc |
diff --git a/src/compiler/js-generic-lowering.cc b/src/compiler/js-generic-lowering.cc |
index 322654cad57371f7f5f49dc39af36d8a768b1f1a..51b4f10073f673f079d891b313be8e13a435f9bf 100644 |
--- a/src/compiler/js-generic-lowering.cc |
+++ b/src/compiler/js-generic-lowering.cc |
@@ -514,44 +514,7 @@ void JSGenericLowering::LowerJSCallConstruct(Node* node) { |
} |
-bool JSGenericLowering::TryLowerDirectJSCall(Node* node) { |
- // Lower to a direct call to a constant JSFunction if legal. |
- const CallFunctionParameters& p = CallFunctionParametersOf(node->op()); |
- int arg_count = static_cast<int>(p.arity() - 2); |
- |
- // Check the function is a constant and is really a JSFunction. |
- HeapObjectMatcher<Object> function_const(node->InputAt(0)); |
- if (!function_const.HasValue()) return false; // not a constant. |
- Handle<Object> func = function_const.Value().handle(); |
- if (!func->IsJSFunction()) return false; // not a function. |
- Handle<JSFunction> function = Handle<JSFunction>::cast(func); |
- if (arg_count != function->shared()->internal_formal_parameter_count()) { |
- return false; |
- } |
- |
- // Check the receiver doesn't need to be wrapped. |
- Node* receiver = node->InputAt(1); |
- if (!NodeProperties::IsTyped(receiver)) return false; |
- Type* ok_receiver = Type::Union(Type::Undefined(), Type::Receiver(), zone()); |
- if (!NodeProperties::GetBounds(receiver).upper->Is(ok_receiver)) return false; |
- |
- // Update to the function context. |
- NodeProperties::ReplaceContextInput( |
- node, jsgraph()->HeapConstant(Handle<Context>(function->context()))); |
- CallDescriptor::Flags flags = FlagsForNode(node); |
- if (is_strict(p.language_mode())) flags |= CallDescriptor::kSupportsTailCalls; |
- CallDescriptor* desc = |
- Linkage::GetJSCallDescriptor(zone(), false, 1 + arg_count, flags); |
- node->set_op(common()->Call(desc)); |
- return true; |
-} |
- |
- |
void JSGenericLowering::LowerJSCallFunction(Node* node) { |
- // Fast case: call function directly. |
- if (TryLowerDirectJSCall(node)) return; |
- |
- // General case: CallFunctionStub. |
const CallFunctionParameters& p = CallFunctionParametersOf(node->op()); |
int arg_count = static_cast<int>(p.arity() - 2); |
CallFunctionStub stub(isolate(), arg_count, p.flags()); |