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

Unified Diff: src/compiler/js-builtin-reducer.cc

Issue 1445513002: [turbofan] Introduce JSCallReducer to strength reduce JSCallFunction nodes. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Comment. Created 5 years, 1 month 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-builtin-reducer.h ('k') | src/compiler/js-call-reducer.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/js-builtin-reducer.cc
diff --git a/src/compiler/js-builtin-reducer.cc b/src/compiler/js-builtin-reducer.cc
index 6db5f99e3b12aad0915b2fa3fafa0a89c2791efe..3e06c4f6f557fb8e9ce18de96f2d522a172e57f0 100644
--- a/src/compiler/js-builtin-reducer.cc
+++ b/src/compiler/js-builtin-reducer.cc
@@ -2,7 +2,6 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "src/compiler/diamond.h"
#include "src/compiler/js-builtin-reducer.h"
#include "src/compiler/js-graph.h"
#include "src/compiler/node-matchers.h"
@@ -91,41 +90,6 @@ JSBuiltinReducer::JSBuiltinReducer(Editor* editor, JSGraph* jsgraph)
: AdvancedReducer(editor), jsgraph_(jsgraph) {}
-// ES6 section 19.2.3.3 Function.prototype.call (thisArg, ...args)
-Reduction JSBuiltinReducer::ReduceFunctionCall(Node* node) {
- DCHECK_EQ(IrOpcode::kJSCallFunction, node->opcode());
- CallFunctionParameters const& p = CallFunctionParametersOf(node->op());
- Handle<JSFunction> apply = Handle<JSFunction>::cast(
- HeapObjectMatcher(NodeProperties::GetValueInput(node, 0)).Value());
- // Change context of {node} to the Function.prototype.call context,
- // to ensure any exception is thrown in the correct context.
- NodeProperties::ReplaceContextInput(
- node, jsgraph()->HeapConstant(handle(apply->context(), isolate())));
- // Remove the target from {node} and use the receiver as target instead, and
- // the thisArg becomes the new target. If thisArg was not provided, insert
- // undefined instead.
- size_t arity = p.arity();
- DCHECK_LE(2u, arity);
- ConvertReceiverMode convert_mode;
- if (arity == 2) {
- // The thisArg was not provided, use undefined as receiver.
- convert_mode = ConvertReceiverMode::kNullOrUndefined;
- node->ReplaceInput(0, node->InputAt(1));
- node->ReplaceInput(1, jsgraph()->UndefinedConstant());
- } else {
- // Just remove the target, which is the first value input.
- convert_mode = ConvertReceiverMode::kAny;
- node->RemoveInput(0);
- --arity;
- }
- // TODO(turbofan): Migrate the call count to the new operator?
- NodeProperties::ChangeOp(node, javascript()->CallFunction(
- arity, p.language_mode(), VectorSlotPair(),
- convert_mode, p.tail_call_mode()));
- return Changed(node);
-}
-
-
// ECMA-262, section 15.8.2.11.
Reduction JSBuiltinReducer::ReduceMathMax(Node* node) {
JSCallReduction r(node);
@@ -185,8 +149,6 @@ Reduction JSBuiltinReducer::Reduce(Node* node) {
// Dispatch according to the BuiltinFunctionId if present.
if (!r.HasBuiltinFunctionId()) return NoChange();
switch (r.GetBuiltinFunctionId()) {
- case kFunctionCall:
- return ReduceFunctionCall(node);
case kMathMax:
reduction = ReduceMathMax(node);
break;
@@ -228,11 +190,6 @@ SimplifiedOperatorBuilder* JSBuiltinReducer::simplified() const {
return jsgraph()->simplified();
}
-
-JSOperatorBuilder* JSBuiltinReducer::javascript() const {
- return jsgraph()->javascript();
-}
-
} // namespace compiler
} // namespace internal
} // namespace v8
« no previous file with comments | « src/compiler/js-builtin-reducer.h ('k') | src/compiler/js-call-reducer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698