summaryrefslogtreecommitdiff
path: root/deps/v8/src/compiler/js-builtin-reducer.cc
diff options
context:
space:
mode:
Diffstat (limited to 'deps/v8/src/compiler/js-builtin-reducer.cc')
-rw-r--r--deps/v8/src/compiler/js-builtin-reducer.cc45
1 files changed, 1 insertions, 44 deletions
diff --git a/deps/v8/src/compiler/js-builtin-reducer.cc b/deps/v8/src/compiler/js-builtin-reducer.cc
index 6db5f99e3b..a7a7da57cd 100644
--- a/deps/v8/src/compiler/js-builtin-reducer.cc
+++ b/deps/v8/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);
@@ -143,7 +107,7 @@ Reduction JSBuiltinReducer::ReduceMathMax(Node* node) {
for (int i = 1; i < r.GetJSCallArity(); i++) {
Node* const input = r.GetJSCallInput(i);
value = graph()->NewNode(
- common()->Select(kMachNone),
+ common()->Select(MachineRepresentation::kNone),
graph()->NewNode(simplified()->NumberLessThan(), input, value), value,
input);
}
@@ -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