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

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

Issue 1182193005: [turbofan] Remove the TryLowerDirectJSCall hack from generic lowering. (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/compiler/js-generic-lowering.h ('k') | src/compiler/js-typed-lowering.h » ('j') | 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 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());
« no previous file with comments | « src/compiler/js-generic-lowering.h ('k') | src/compiler/js-typed-lowering.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698