| Ben Murdoch | b8a8cc1 | 2014-11-26 15:28:44 +0000 | [diff] [blame] | 1 | // Copyright 2014 the V8 project authors. All rights reserved. |
| 2 | // Use of this source code is governed by a BSD-style license that can be |
| 3 | // found in the LICENSE file. |
| 4 | |
| Ben Murdoch | 014dc51 | 2016-03-22 12:00:34 +0000 | [diff] [blame] | 5 | #include "src/compiler/js-inlining.h" |
| 6 | |
| Ben Murdoch | 014dc51 | 2016-03-22 12:00:34 +0000 | [diff] [blame] | 7 | #include "src/ast/ast-numbering.h" |
| Ben Murdoch | 13e2dad | 2016-09-16 13:49:30 +0100 | [diff] [blame] | 8 | #include "src/ast/ast.h" |
| Ben Murdoch | 014dc51 | 2016-03-22 12:00:34 +0000 | [diff] [blame] | 9 | #include "src/ast/scopes.h" |
| 10 | #include "src/compiler.h" |
| Ben Murdoch | b8a8cc1 | 2014-11-26 15:28:44 +0000 | [diff] [blame] | 11 | #include "src/compiler/ast-graph-builder.h" |
| Ben Murdoch | 13e2dad | 2016-09-16 13:49:30 +0100 | [diff] [blame] | 12 | #include "src/compiler/ast-loop-assignment-analyzer.h" |
| Ben Murdoch | b8a8cc1 | 2014-11-26 15:28:44 +0000 | [diff] [blame] | 13 | #include "src/compiler/common-operator.h" |
| Ben Murdoch | 014dc51 | 2016-03-22 12:00:34 +0000 | [diff] [blame] | 14 | #include "src/compiler/graph-reducer.h" |
| Ben Murdoch | b8a8cc1 | 2014-11-26 15:28:44 +0000 | [diff] [blame] | 15 | #include "src/compiler/js-operator.h" |
| Ben Murdoch | b8a8cc1 | 2014-11-26 15:28:44 +0000 | [diff] [blame] | 16 | #include "src/compiler/node-matchers.h" |
| Ben Murdoch | 014dc51 | 2016-03-22 12:00:34 +0000 | [diff] [blame] | 17 | #include "src/compiler/node-properties.h" |
| 18 | #include "src/compiler/operator-properties.h" |
| Ben Murdoch | f91f061 | 2016-11-29 16:50:11 +0000 | [diff] [blame^] | 19 | #include "src/compiler/simplified-operator.h" |
| Ben Murdoch | 13e2dad | 2016-09-16 13:49:30 +0100 | [diff] [blame] | 20 | #include "src/compiler/type-hint-analyzer.h" |
| Ben Murdoch | 014dc51 | 2016-03-22 12:00:34 +0000 | [diff] [blame] | 21 | #include "src/isolate-inl.h" |
| Ben Murdoch | f91f061 | 2016-11-29 16:50:11 +0000 | [diff] [blame^] | 22 | #include "src/parsing/parse-info.h" |
| Ben Murdoch | 014dc51 | 2016-03-22 12:00:34 +0000 | [diff] [blame] | 23 | #include "src/parsing/rewriter.h" |
| Ben Murdoch | b8a8cc1 | 2014-11-26 15:28:44 +0000 | [diff] [blame] | 24 | |
| 25 | namespace v8 { |
| 26 | namespace internal { |
| 27 | namespace compiler { |
| 28 | |
| Ben Murdoch | 014dc51 | 2016-03-22 12:00:34 +0000 | [diff] [blame] | 29 | #define TRACE(...) \ |
| 30 | do { \ |
| 31 | if (FLAG_trace_turbo_inlining) PrintF(__VA_ARGS__); \ |
| 32 | } while (false) |
| Ben Murdoch | b8a8cc1 | 2014-11-26 15:28:44 +0000 | [diff] [blame] | 33 | |
| Ben Murdoch | 014dc51 | 2016-03-22 12:00:34 +0000 | [diff] [blame] | 34 | |
| 35 | // Provides convenience accessors for the common layout of nodes having either |
| 36 | // the {JSCallFunction} or the {JSCallConstruct} operator. |
| 37 | class JSCallAccessor { |
| 38 | public: |
| 39 | explicit JSCallAccessor(Node* call) : call_(call) { |
| 40 | DCHECK(call->opcode() == IrOpcode::kJSCallFunction || |
| 41 | call->opcode() == IrOpcode::kJSCallConstruct); |
| 42 | } |
| 43 | |
| 44 | Node* target() { |
| 45 | // Both, {JSCallFunction} and {JSCallConstruct}, have same layout here. |
| 46 | return call_->InputAt(0); |
| 47 | } |
| 48 | |
| 49 | Node* receiver() { |
| 50 | DCHECK_EQ(IrOpcode::kJSCallFunction, call_->opcode()); |
| 51 | return call_->InputAt(1); |
| 52 | } |
| 53 | |
| 54 | Node* new_target() { |
| 55 | DCHECK_EQ(IrOpcode::kJSCallConstruct, call_->opcode()); |
| 56 | return call_->InputAt(formal_arguments() + 1); |
| 57 | } |
| 58 | |
| Ben Murdoch | 13e2dad | 2016-09-16 13:49:30 +0100 | [diff] [blame] | 59 | Node* frame_state() { |
| 60 | // Both, {JSCallFunction} and {JSCallConstruct}, have frame state. |
| Ben Murdoch | f91f061 | 2016-11-29 16:50:11 +0000 | [diff] [blame^] | 61 | return NodeProperties::GetFrameStateInput(call_); |
| Ben Murdoch | 014dc51 | 2016-03-22 12:00:34 +0000 | [diff] [blame] | 62 | } |
| 63 | |
| 64 | int formal_arguments() { |
| 65 | // Both, {JSCallFunction} and {JSCallConstruct}, have two extra inputs: |
| 66 | // - JSCallConstruct: Includes target function and new target. |
| 67 | // - JSCallFunction: Includes target function and receiver. |
| 68 | return call_->op()->ValueInputCount() - 2; |
| Ben Murdoch | b8a8cc1 | 2014-11-26 15:28:44 +0000 | [diff] [blame] | 69 | } |
| 70 | |
| 71 | private: |
| Ben Murdoch | 014dc51 | 2016-03-22 12:00:34 +0000 | [diff] [blame] | 72 | Node* call_; |
| Ben Murdoch | b8a8cc1 | 2014-11-26 15:28:44 +0000 | [diff] [blame] | 73 | }; |
| 74 | |
| 75 | |
| Ben Murdoch | 014dc51 | 2016-03-22 12:00:34 +0000 | [diff] [blame] | 76 | Reduction JSInliner::InlineCall(Node* call, Node* new_target, Node* context, |
| 77 | Node* frame_state, Node* start, Node* end) { |
| Ben Murdoch | b8a8cc1 | 2014-11-26 15:28:44 +0000 | [diff] [blame] | 78 | // The scheduler is smart enough to place our code; we just ensure {control} |
| Ben Murdoch | 014dc51 | 2016-03-22 12:00:34 +0000 | [diff] [blame] | 79 | // becomes the control input of the start of the inlinee, and {effect} becomes |
| 80 | // the effect input of the start of the inlinee. |
| Ben Murdoch | b8a8cc1 | 2014-11-26 15:28:44 +0000 | [diff] [blame] | 81 | Node* control = NodeProperties::GetControlInput(call); |
| Ben Murdoch | 014dc51 | 2016-03-22 12:00:34 +0000 | [diff] [blame] | 82 | Node* effect = NodeProperties::GetEffectInput(call); |
| Ben Murdoch | b8a8cc1 | 2014-11-26 15:28:44 +0000 | [diff] [blame] | 83 | |
| Ben Murdoch | 014dc51 | 2016-03-22 12:00:34 +0000 | [diff] [blame] | 84 | int const inlinee_new_target_index = |
| 85 | static_cast<int>(start->op()->ValueOutputCount()) - 3; |
| 86 | int const inlinee_arity_index = |
| 87 | static_cast<int>(start->op()->ValueOutputCount()) - 2; |
| 88 | int const inlinee_context_index = |
| 89 | static_cast<int>(start->op()->ValueOutputCount()) - 1; |
| Ben Murdoch | b8a8cc1 | 2014-11-26 15:28:44 +0000 | [diff] [blame] | 90 | |
| Ben Murdoch | 014dc51 | 2016-03-22 12:00:34 +0000 | [diff] [blame] | 91 | // {inliner_inputs} counts JSFunction, receiver, arguments, but not |
| 92 | // new target value, argument count, context, effect or control. |
| Emily Bernier | 958fae7 | 2015-03-24 16:35:39 -0400 | [diff] [blame] | 93 | int inliner_inputs = call->op()->ValueInputCount(); |
| Ben Murdoch | b8a8cc1 | 2014-11-26 15:28:44 +0000 | [diff] [blame] | 94 | // Iterate over all uses of the start node. |
| Ben Murdoch | 014dc51 | 2016-03-22 12:00:34 +0000 | [diff] [blame] | 95 | for (Edge edge : start->use_edges()) { |
| Emily Bernier | 958fae7 | 2015-03-24 16:35:39 -0400 | [diff] [blame] | 96 | Node* use = edge.from(); |
| Ben Murdoch | b8a8cc1 | 2014-11-26 15:28:44 +0000 | [diff] [blame] | 97 | switch (use->opcode()) { |
| 98 | case IrOpcode::kParameter: { |
| Ben Murdoch | 014dc51 | 2016-03-22 12:00:34 +0000 | [diff] [blame] | 99 | int index = 1 + ParameterIndexOf(use->op()); |
| 100 | DCHECK_LE(index, inlinee_context_index); |
| 101 | if (index < inliner_inputs && index < inlinee_new_target_index) { |
| Ben Murdoch | b8a8cc1 | 2014-11-26 15:28:44 +0000 | [diff] [blame] | 102 | // There is an input from the call, and the index is a value |
| 103 | // projection but not the context, so rewire the input. |
| Ben Murdoch | 014dc51 | 2016-03-22 12:00:34 +0000 | [diff] [blame] | 104 | Replace(use, call->InputAt(index)); |
| 105 | } else if (index == inlinee_new_target_index) { |
| 106 | // The projection is requesting the new target value. |
| 107 | Replace(use, new_target); |
| 108 | } else if (index == inlinee_arity_index) { |
| 109 | // The projection is requesting the number of arguments. |
| Ben Murdoch | f91f061 | 2016-11-29 16:50:11 +0000 | [diff] [blame^] | 110 | Replace(use, jsgraph()->Int32Constant(inliner_inputs - 2)); |
| Ben Murdoch | b8a8cc1 | 2014-11-26 15:28:44 +0000 | [diff] [blame] | 111 | } else if (index == inlinee_context_index) { |
| Ben Murdoch | 014dc51 | 2016-03-22 12:00:34 +0000 | [diff] [blame] | 112 | // The projection is requesting the inlinee function context. |
| 113 | Replace(use, context); |
| Ben Murdoch | b8a8cc1 | 2014-11-26 15:28:44 +0000 | [diff] [blame] | 114 | } else { |
| Ben Murdoch | 014dc51 | 2016-03-22 12:00:34 +0000 | [diff] [blame] | 115 | // Call has fewer arguments than required, fill with undefined. |
| Ben Murdoch | f91f061 | 2016-11-29 16:50:11 +0000 | [diff] [blame^] | 116 | Replace(use, jsgraph()->UndefinedConstant()); |
| Ben Murdoch | b8a8cc1 | 2014-11-26 15:28:44 +0000 | [diff] [blame] | 117 | } |
| Ben Murdoch | b8a8cc1 | 2014-11-26 15:28:44 +0000 | [diff] [blame] | 118 | break; |
| 119 | } |
| 120 | default: |
| Emily Bernier | 958fae7 | 2015-03-24 16:35:39 -0400 | [diff] [blame] | 121 | if (NodeProperties::IsEffectEdge(edge)) { |
| Ben Murdoch | 014dc51 | 2016-03-22 12:00:34 +0000 | [diff] [blame] | 122 | edge.UpdateTo(effect); |
| Emily Bernier | 958fae7 | 2015-03-24 16:35:39 -0400 | [diff] [blame] | 123 | } else if (NodeProperties::IsControlEdge(edge)) { |
| 124 | edge.UpdateTo(control); |
| Ben Murdoch | 014dc51 | 2016-03-22 12:00:34 +0000 | [diff] [blame] | 125 | } else if (NodeProperties::IsFrameStateEdge(edge)) { |
| 126 | edge.UpdateTo(frame_state); |
| Ben Murdoch | b8a8cc1 | 2014-11-26 15:28:44 +0000 | [diff] [blame] | 127 | } else { |
| 128 | UNREACHABLE(); |
| 129 | } |
| 130 | break; |
| 131 | } |
| 132 | } |
| 133 | |
| Ben Murdoch | 014dc51 | 2016-03-22 12:00:34 +0000 | [diff] [blame] | 134 | NodeVector values(local_zone_); |
| 135 | NodeVector effects(local_zone_); |
| 136 | NodeVector controls(local_zone_); |
| 137 | for (Node* const input : end->inputs()) { |
| 138 | switch (input->opcode()) { |
| 139 | case IrOpcode::kReturn: |
| 140 | values.push_back(NodeProperties::GetValueInput(input, 0)); |
| 141 | effects.push_back(NodeProperties::GetEffectInput(input)); |
| 142 | controls.push_back(NodeProperties::GetControlInput(input)); |
| 143 | break; |
| 144 | case IrOpcode::kDeoptimize: |
| 145 | case IrOpcode::kTerminate: |
| 146 | case IrOpcode::kThrow: |
| Ben Murdoch | f91f061 | 2016-11-29 16:50:11 +0000 | [diff] [blame^] | 147 | NodeProperties::MergeControlToEnd(graph(), common(), input); |
| 148 | Revisit(graph()->end()); |
| Ben Murdoch | 014dc51 | 2016-03-22 12:00:34 +0000 | [diff] [blame] | 149 | break; |
| 150 | default: |
| 151 | UNREACHABLE(); |
| 152 | break; |
| 153 | } |
| 154 | } |
| 155 | DCHECK_EQ(values.size(), effects.size()); |
| 156 | DCHECK_EQ(values.size(), controls.size()); |
| 157 | |
| 158 | // Depending on whether the inlinee produces a value, we either replace value |
| 159 | // uses with said value or kill value uses if no value can be returned. |
| 160 | if (values.size() > 0) { |
| 161 | int const input_count = static_cast<int>(controls.size()); |
| Ben Murdoch | f91f061 | 2016-11-29 16:50:11 +0000 | [diff] [blame^] | 162 | Node* control_output = graph()->NewNode(common()->Merge(input_count), |
| 163 | input_count, &controls.front()); |
| Ben Murdoch | 014dc51 | 2016-03-22 12:00:34 +0000 | [diff] [blame] | 164 | values.push_back(control_output); |
| 165 | effects.push_back(control_output); |
| Ben Murdoch | f91f061 | 2016-11-29 16:50:11 +0000 | [diff] [blame^] | 166 | Node* value_output = graph()->NewNode( |
| 167 | common()->Phi(MachineRepresentation::kTagged, input_count), |
| Ben Murdoch | 014dc51 | 2016-03-22 12:00:34 +0000 | [diff] [blame] | 168 | static_cast<int>(values.size()), &values.front()); |
| Ben Murdoch | f91f061 | 2016-11-29 16:50:11 +0000 | [diff] [blame^] | 169 | Node* effect_output = |
| 170 | graph()->NewNode(common()->EffectPhi(input_count), |
| 171 | static_cast<int>(effects.size()), &effects.front()); |
| Ben Murdoch | 014dc51 | 2016-03-22 12:00:34 +0000 | [diff] [blame] | 172 | ReplaceWithValue(call, value_output, effect_output, control_output); |
| 173 | return Changed(value_output); |
| 174 | } else { |
| Ben Murdoch | f91f061 | 2016-11-29 16:50:11 +0000 | [diff] [blame^] | 175 | ReplaceWithValue(call, call, call, jsgraph()->Dead()); |
| Ben Murdoch | 014dc51 | 2016-03-22 12:00:34 +0000 | [diff] [blame] | 176 | return Changed(call); |
| 177 | } |
| Ben Murdoch | b8a8cc1 | 2014-11-26 15:28:44 +0000 | [diff] [blame] | 178 | } |
| 179 | |
| 180 | |
| Ben Murdoch | 014dc51 | 2016-03-22 12:00:34 +0000 | [diff] [blame] | 181 | Node* JSInliner::CreateArtificialFrameState(Node* node, Node* outer_frame_state, |
| 182 | int parameter_count, |
| 183 | FrameStateType frame_state_type, |
| 184 | Handle<SharedFunctionInfo> shared) { |
| 185 | const FrameStateFunctionInfo* state_info = |
| Ben Murdoch | f91f061 | 2016-11-29 16:50:11 +0000 | [diff] [blame^] | 186 | common()->CreateFrameStateFunctionInfo(frame_state_type, |
| 187 | parameter_count + 1, 0, shared); |
| Ben Murdoch | b8a8cc1 | 2014-11-26 15:28:44 +0000 | [diff] [blame] | 188 | |
| Ben Murdoch | f91f061 | 2016-11-29 16:50:11 +0000 | [diff] [blame^] | 189 | const Operator* op = common()->FrameState( |
| Ben Murdoch | 014dc51 | 2016-03-22 12:00:34 +0000 | [diff] [blame] | 190 | BailoutId(-1), OutputFrameStateCombine::Ignore(), state_info); |
| Ben Murdoch | f91f061 | 2016-11-29 16:50:11 +0000 | [diff] [blame^] | 191 | const Operator* op0 = common()->StateValues(0); |
| 192 | Node* node0 = graph()->NewNode(op0); |
| Ben Murdoch | 014dc51 | 2016-03-22 12:00:34 +0000 | [diff] [blame] | 193 | NodeVector params(local_zone_); |
| 194 | for (int parameter = 0; parameter < parameter_count + 1; ++parameter) { |
| 195 | params.push_back(node->InputAt(1 + parameter)); |
| Ben Murdoch | b8a8cc1 | 2014-11-26 15:28:44 +0000 | [diff] [blame] | 196 | } |
| 197 | const Operator* op_param = |
| Ben Murdoch | f91f061 | 2016-11-29 16:50:11 +0000 | [diff] [blame^] | 198 | common()->StateValues(static_cast<int>(params.size())); |
| 199 | Node* params_node = graph()->NewNode( |
| Ben Murdoch | b8a8cc1 | 2014-11-26 15:28:44 +0000 | [diff] [blame] | 200 | op_param, static_cast<int>(params.size()), ¶ms.front()); |
| Ben Murdoch | f91f061 | 2016-11-29 16:50:11 +0000 | [diff] [blame^] | 201 | return graph()->NewNode(op, params_node, node0, node0, |
| 202 | jsgraph()->UndefinedConstant(), node->InputAt(0), |
| 203 | outer_frame_state); |
| Ben Murdoch | b8a8cc1 | 2014-11-26 15:28:44 +0000 | [diff] [blame] | 204 | } |
| 205 | |
| Ben Murdoch | 3b9bc31 | 2016-06-02 14:46:10 +0100 | [diff] [blame] | 206 | Node* JSInliner::CreateTailCallerFrameState(Node* node, Node* frame_state) { |
| 207 | FrameStateInfo const& frame_info = OpParameter<FrameStateInfo>(frame_state); |
| 208 | Handle<SharedFunctionInfo> shared; |
| 209 | frame_info.shared_info().ToHandle(&shared); |
| 210 | |
| 211 | Node* function = frame_state->InputAt(kFrameStateFunctionInput); |
| 212 | |
| 213 | // If we are inlining a tail call drop caller's frame state and an |
| 214 | // arguments adaptor if it exists. |
| Ben Murdoch | f91f061 | 2016-11-29 16:50:11 +0000 | [diff] [blame^] | 215 | frame_state = NodeProperties::GetFrameStateInput(frame_state); |
| Ben Murdoch | 3b9bc31 | 2016-06-02 14:46:10 +0100 | [diff] [blame] | 216 | if (frame_state->opcode() == IrOpcode::kFrameState) { |
| 217 | FrameStateInfo const& frame_info = OpParameter<FrameStateInfo>(frame_state); |
| 218 | if (frame_info.type() == FrameStateType::kArgumentsAdaptor) { |
| Ben Murdoch | f91f061 | 2016-11-29 16:50:11 +0000 | [diff] [blame^] | 219 | frame_state = NodeProperties::GetFrameStateInput(frame_state); |
| Ben Murdoch | 3b9bc31 | 2016-06-02 14:46:10 +0100 | [diff] [blame] | 220 | } |
| 221 | } |
| 222 | |
| 223 | const FrameStateFunctionInfo* state_info = |
| Ben Murdoch | f91f061 | 2016-11-29 16:50:11 +0000 | [diff] [blame^] | 224 | common()->CreateFrameStateFunctionInfo( |
| Ben Murdoch | 3b9bc31 | 2016-06-02 14:46:10 +0100 | [diff] [blame] | 225 | FrameStateType::kTailCallerFunction, 0, 0, shared); |
| 226 | |
| Ben Murdoch | f91f061 | 2016-11-29 16:50:11 +0000 | [diff] [blame^] | 227 | const Operator* op = common()->FrameState( |
| Ben Murdoch | 3b9bc31 | 2016-06-02 14:46:10 +0100 | [diff] [blame] | 228 | BailoutId(-1), OutputFrameStateCombine::Ignore(), state_info); |
| Ben Murdoch | f91f061 | 2016-11-29 16:50:11 +0000 | [diff] [blame^] | 229 | const Operator* op0 = common()->StateValues(0); |
| 230 | Node* node0 = graph()->NewNode(op0); |
| 231 | return graph()->NewNode(op, node0, node0, node0, |
| 232 | jsgraph()->UndefinedConstant(), function, |
| 233 | frame_state); |
| Ben Murdoch | 3b9bc31 | 2016-06-02 14:46:10 +0100 | [diff] [blame] | 234 | } |
| Ben Murdoch | b8a8cc1 | 2014-11-26 15:28:44 +0000 | [diff] [blame] | 235 | |
| Ben Murdoch | 014dc51 | 2016-03-22 12:00:34 +0000 | [diff] [blame] | 236 | namespace { |
| Ben Murdoch | b8a8cc1 | 2014-11-26 15:28:44 +0000 | [diff] [blame] | 237 | |
| Ben Murdoch | 014dc51 | 2016-03-22 12:00:34 +0000 | [diff] [blame] | 238 | // TODO(mstarzinger,verwaest): Move this predicate onto SharedFunctionInfo? |
| Ben Murdoch | 109988c | 2016-05-18 11:27:45 +0100 | [diff] [blame] | 239 | bool NeedsImplicitReceiver(Handle<SharedFunctionInfo> shared_info) { |
| 240 | DisallowHeapAllocation no_gc; |
| 241 | Isolate* const isolate = shared_info->GetIsolate(); |
| 242 | Code* const construct_stub = shared_info->construct_stub(); |
| Ben Murdoch | 3b9bc31 | 2016-06-02 14:46:10 +0100 | [diff] [blame] | 243 | return construct_stub != *isolate->builtins()->JSBuiltinsConstructStub() && |
| 244 | construct_stub != |
| 245 | *isolate->builtins()->JSBuiltinsConstructStubForDerived() && |
| 246 | construct_stub != *isolate->builtins()->JSConstructStubApi(); |
| Ben Murdoch | 109988c | 2016-05-18 11:27:45 +0100 | [diff] [blame] | 247 | } |
| 248 | |
| 249 | bool IsNonConstructible(Handle<SharedFunctionInfo> shared_info) { |
| 250 | DisallowHeapAllocation no_gc; |
| 251 | Isolate* const isolate = shared_info->GetIsolate(); |
| 252 | Code* const construct_stub = shared_info->construct_stub(); |
| 253 | return construct_stub == *isolate->builtins()->ConstructedNonConstructable(); |
| Ben Murdoch | 014dc51 | 2016-03-22 12:00:34 +0000 | [diff] [blame] | 254 | } |
| 255 | |
| 256 | } // namespace |
| 257 | |
| 258 | |
| 259 | Reduction JSInliner::Reduce(Node* node) { |
| 260 | if (!IrOpcode::IsInlineeOpcode(node->opcode())) return NoChange(); |
| 261 | |
| 262 | // This reducer can handle both normal function calls as well a constructor |
| 263 | // calls whenever the target is a constant function object, as follows: |
| 264 | // - JSCallFunction(target:constant, receiver, args...) |
| 265 | // - JSCallConstruct(target:constant, args..., new.target) |
| 266 | HeapObjectMatcher match(node->InputAt(0)); |
| 267 | if (!match.HasValue() || !match.Value()->IsJSFunction()) return NoChange(); |
| 268 | Handle<JSFunction> function = Handle<JSFunction>::cast(match.Value()); |
| 269 | |
| 270 | return ReduceJSCall(node, function); |
| 271 | } |
| 272 | |
| 273 | |
| 274 | Reduction JSInliner::ReduceJSCall(Node* node, Handle<JSFunction> function) { |
| 275 | DCHECK(IrOpcode::IsInlineeOpcode(node->opcode())); |
| 276 | JSCallAccessor call(node); |
| Ben Murdoch | 109988c | 2016-05-18 11:27:45 +0100 | [diff] [blame] | 277 | Handle<SharedFunctionInfo> shared_info(function->shared()); |
| Ben Murdoch | 014dc51 | 2016-03-22 12:00:34 +0000 | [diff] [blame] | 278 | |
| 279 | // Function must be inlineable. |
| Ben Murdoch | 109988c | 2016-05-18 11:27:45 +0100 | [diff] [blame] | 280 | if (!shared_info->IsInlineable()) { |
| Ben Murdoch | 014dc51 | 2016-03-22 12:00:34 +0000 | [diff] [blame] | 281 | TRACE("Not inlining %s into %s because callee is not inlineable\n", |
| Ben Murdoch | 109988c | 2016-05-18 11:27:45 +0100 | [diff] [blame] | 282 | shared_info->DebugName()->ToCString().get(), |
| Ben Murdoch | 014dc51 | 2016-03-22 12:00:34 +0000 | [diff] [blame] | 283 | info_->shared_info()->DebugName()->ToCString().get()); |
| 284 | return NoChange(); |
| Ben Murdoch | b8a8cc1 | 2014-11-26 15:28:44 +0000 | [diff] [blame] | 285 | } |
| 286 | |
| Ben Murdoch | 014dc51 | 2016-03-22 12:00:34 +0000 | [diff] [blame] | 287 | // Constructor must be constructable. |
| 288 | if (node->opcode() == IrOpcode::kJSCallConstruct && |
| Ben Murdoch | 109988c | 2016-05-18 11:27:45 +0100 | [diff] [blame] | 289 | IsNonConstructible(shared_info)) { |
| Ben Murdoch | 014dc51 | 2016-03-22 12:00:34 +0000 | [diff] [blame] | 290 | TRACE("Not inlining %s into %s because constructor is not constructable.\n", |
| Ben Murdoch | 109988c | 2016-05-18 11:27:45 +0100 | [diff] [blame] | 291 | shared_info->DebugName()->ToCString().get(), |
| Ben Murdoch | 014dc51 | 2016-03-22 12:00:34 +0000 | [diff] [blame] | 292 | info_->shared_info()->DebugName()->ToCString().get()); |
| 293 | return NoChange(); |
| 294 | } |
| Ben Murdoch | b8a8cc1 | 2014-11-26 15:28:44 +0000 | [diff] [blame] | 295 | |
| Ben Murdoch | 014dc51 | 2016-03-22 12:00:34 +0000 | [diff] [blame] | 296 | // Class constructors are callable, but [[Call]] will raise an exception. |
| 297 | // See ES6 section 9.2.1 [[Call]] ( thisArgument, argumentsList ). |
| 298 | if (node->opcode() == IrOpcode::kJSCallFunction && |
| Ben Murdoch | 109988c | 2016-05-18 11:27:45 +0100 | [diff] [blame] | 299 | IsClassConstructor(shared_info->kind())) { |
| Ben Murdoch | 014dc51 | 2016-03-22 12:00:34 +0000 | [diff] [blame] | 300 | TRACE("Not inlining %s into %s because callee is a class constructor.\n", |
| Ben Murdoch | 109988c | 2016-05-18 11:27:45 +0100 | [diff] [blame] | 301 | shared_info->DebugName()->ToCString().get(), |
| Ben Murdoch | 014dc51 | 2016-03-22 12:00:34 +0000 | [diff] [blame] | 302 | info_->shared_info()->DebugName()->ToCString().get()); |
| 303 | return NoChange(); |
| 304 | } |
| 305 | |
| 306 | // Function contains break points. |
| Ben Murdoch | 109988c | 2016-05-18 11:27:45 +0100 | [diff] [blame] | 307 | if (shared_info->HasDebugInfo()) { |
| Ben Murdoch | 014dc51 | 2016-03-22 12:00:34 +0000 | [diff] [blame] | 308 | TRACE("Not inlining %s into %s because callee may contain break points\n", |
| Ben Murdoch | 109988c | 2016-05-18 11:27:45 +0100 | [diff] [blame] | 309 | shared_info->DebugName()->ToCString().get(), |
| Ben Murdoch | 014dc51 | 2016-03-22 12:00:34 +0000 | [diff] [blame] | 310 | info_->shared_info()->DebugName()->ToCString().get()); |
| 311 | return NoChange(); |
| 312 | } |
| 313 | |
| 314 | // Disallow cross native-context inlining for now. This means that all parts |
| 315 | // of the resulting code will operate on the same global object. |
| 316 | // This also prevents cross context leaks for asm.js code, where we could |
| 317 | // inline functions from a different context and hold on to that context (and |
| 318 | // closure) from the code object. |
| 319 | // TODO(turbofan): We might want to revisit this restriction later when we |
| 320 | // have a need for this, and we know how to model different native contexts |
| 321 | // in the same graph in a compositional way. |
| 322 | if (function->context()->native_context() != |
| 323 | info_->context()->native_context()) { |
| 324 | TRACE("Not inlining %s into %s because of different native contexts\n", |
| Ben Murdoch | 109988c | 2016-05-18 11:27:45 +0100 | [diff] [blame] | 325 | shared_info->DebugName()->ToCString().get(), |
| Ben Murdoch | 014dc51 | 2016-03-22 12:00:34 +0000 | [diff] [blame] | 326 | info_->shared_info()->DebugName()->ToCString().get()); |
| 327 | return NoChange(); |
| 328 | } |
| 329 | |
| 330 | // TODO(turbofan): TranslatedState::GetAdaptedArguments() currently relies on |
| 331 | // not inlining recursive functions. We might want to relax that at some |
| 332 | // point. |
| Ben Murdoch | 13e2dad | 2016-09-16 13:49:30 +0100 | [diff] [blame] | 333 | for (Node* frame_state = call.frame_state(); |
| Ben Murdoch | 014dc51 | 2016-03-22 12:00:34 +0000 | [diff] [blame] | 334 | frame_state->opcode() == IrOpcode::kFrameState; |
| 335 | frame_state = frame_state->InputAt(kFrameStateOuterStateInput)) { |
| Ben Murdoch | 109988c | 2016-05-18 11:27:45 +0100 | [diff] [blame] | 336 | FrameStateInfo const& frame_info = OpParameter<FrameStateInfo>(frame_state); |
| 337 | Handle<SharedFunctionInfo> frame_shared_info; |
| 338 | if (frame_info.shared_info().ToHandle(&frame_shared_info) && |
| 339 | *frame_shared_info == *shared_info) { |
| Ben Murdoch | 014dc51 | 2016-03-22 12:00:34 +0000 | [diff] [blame] | 340 | TRACE("Not inlining %s into %s because call is recursive\n", |
| Ben Murdoch | 109988c | 2016-05-18 11:27:45 +0100 | [diff] [blame] | 341 | shared_info->DebugName()->ToCString().get(), |
| Ben Murdoch | 014dc51 | 2016-03-22 12:00:34 +0000 | [diff] [blame] | 342 | info_->shared_info()->DebugName()->ToCString().get()); |
| 343 | return NoChange(); |
| Ben Murdoch | b8a8cc1 | 2014-11-26 15:28:44 +0000 | [diff] [blame] | 344 | } |
| Ben Murdoch | b8a8cc1 | 2014-11-26 15:28:44 +0000 | [diff] [blame] | 345 | } |
| 346 | |
| Ben Murdoch | 014dc51 | 2016-03-22 12:00:34 +0000 | [diff] [blame] | 347 | // TODO(turbofan): Inlining into a try-block is not yet supported. |
| 348 | if (NodeProperties::IsExceptionalCall(node)) { |
| 349 | TRACE("Not inlining %s into %s because of surrounding try-block\n", |
| Ben Murdoch | 109988c | 2016-05-18 11:27:45 +0100 | [diff] [blame] | 350 | shared_info->DebugName()->ToCString().get(), |
| Ben Murdoch | 014dc51 | 2016-03-22 12:00:34 +0000 | [diff] [blame] | 351 | info_->shared_info()->DebugName()->ToCString().get()); |
| 352 | return NoChange(); |
| 353 | } |
| Ben Murdoch | b8a8cc1 | 2014-11-26 15:28:44 +0000 | [diff] [blame] | 354 | |
| Ben Murdoch | 3b9bc31 | 2016-06-02 14:46:10 +0100 | [diff] [blame] | 355 | Zone zone(info_->isolate()->allocator()); |
| Ben Murdoch | 014dc51 | 2016-03-22 12:00:34 +0000 | [diff] [blame] | 356 | ParseInfo parse_info(&zone, function); |
| Ben Murdoch | bcf72ee | 2016-08-08 18:44:38 +0100 | [diff] [blame] | 357 | CompilationInfo info(&parse_info, function); |
| Ben Murdoch | 109988c | 2016-05-18 11:27:45 +0100 | [diff] [blame] | 358 | if (info_->is_deoptimization_enabled()) info.MarkAsDeoptimizationEnabled(); |
| Ben Murdoch | 13e2dad | 2016-09-16 13:49:30 +0100 | [diff] [blame] | 359 | if (info_->is_type_feedback_enabled()) info.MarkAsTypeFeedbackEnabled(); |
| Ben Murdoch | 014dc51 | 2016-03-22 12:00:34 +0000 | [diff] [blame] | 360 | |
| 361 | if (!Compiler::ParseAndAnalyze(info.parse_info())) { |
| 362 | TRACE("Not inlining %s into %s because parsing failed\n", |
| Ben Murdoch | 109988c | 2016-05-18 11:27:45 +0100 | [diff] [blame] | 363 | shared_info->DebugName()->ToCString().get(), |
| Ben Murdoch | 014dc51 | 2016-03-22 12:00:34 +0000 | [diff] [blame] | 364 | info_->shared_info()->DebugName()->ToCString().get()); |
| 365 | if (info_->isolate()->has_pending_exception()) { |
| 366 | info_->isolate()->clear_pending_exception(); |
| Ben Murdoch | b8a8cc1 | 2014-11-26 15:28:44 +0000 | [diff] [blame] | 367 | } |
| Ben Murdoch | 014dc51 | 2016-03-22 12:00:34 +0000 | [diff] [blame] | 368 | return NoChange(); |
| Ben Murdoch | b8a8cc1 | 2014-11-26 15:28:44 +0000 | [diff] [blame] | 369 | } |
| 370 | |
| Ben Murdoch | 014dc51 | 2016-03-22 12:00:34 +0000 | [diff] [blame] | 371 | if (!Compiler::EnsureDeoptimizationSupport(&info)) { |
| 372 | TRACE("Not inlining %s into %s because deoptimization support failed\n", |
| Ben Murdoch | 109988c | 2016-05-18 11:27:45 +0100 | [diff] [blame] | 373 | shared_info->DebugName()->ToCString().get(), |
| Ben Murdoch | 014dc51 | 2016-03-22 12:00:34 +0000 | [diff] [blame] | 374 | info_->shared_info()->DebugName()->ToCString().get()); |
| 375 | return NoChange(); |
| 376 | } |
| Ben Murdoch | 13e2dad | 2016-09-16 13:49:30 +0100 | [diff] [blame] | 377 | |
| Ben Murdoch | 014dc51 | 2016-03-22 12:00:34 +0000 | [diff] [blame] | 378 | // Remember that we inlined this function. This needs to be called right |
| 379 | // after we ensure deoptimization support so that the code flusher |
| 380 | // does not remove the code with the deoptimization support. |
| Ben Murdoch | 109988c | 2016-05-18 11:27:45 +0100 | [diff] [blame] | 381 | info_->AddInlinedFunction(shared_info); |
| Ben Murdoch | 014dc51 | 2016-03-22 12:00:34 +0000 | [diff] [blame] | 382 | |
| 383 | // ---------------------------------------------------------------- |
| 384 | // After this point, we've made a decision to inline this function. |
| 385 | // We shall not bailout from inlining if we got here. |
| 386 | |
| 387 | TRACE("Inlining %s into %s\n", |
| Ben Murdoch | 109988c | 2016-05-18 11:27:45 +0100 | [diff] [blame] | 388 | shared_info->DebugName()->ToCString().get(), |
| Ben Murdoch | 014dc51 | 2016-03-22 12:00:34 +0000 | [diff] [blame] | 389 | info_->shared_info()->DebugName()->ToCString().get()); |
| 390 | |
| Ben Murdoch | 13e2dad | 2016-09-16 13:49:30 +0100 | [diff] [blame] | 391 | // If function was lazily compiled, it's literals array may not yet be set up. |
| 392 | JSFunction::EnsureLiterals(function); |
| Ben Murdoch | b8a8cc1 | 2014-11-26 15:28:44 +0000 | [diff] [blame] | 393 | |
| Ben Murdoch | 13e2dad | 2016-09-16 13:49:30 +0100 | [diff] [blame] | 394 | // Create the subgraph for the inlinee. |
| 395 | Node* start; |
| 396 | Node* end; |
| 397 | { |
| 398 | // Run the loop assignment analyzer on the inlinee. |
| 399 | AstLoopAssignmentAnalyzer loop_assignment_analyzer(&zone, &info); |
| 400 | LoopAssignmentAnalysis* loop_assignment = |
| 401 | loop_assignment_analyzer.Analyze(); |
| Ben Murdoch | b8a8cc1 | 2014-11-26 15:28:44 +0000 | [diff] [blame] | 402 | |
| Ben Murdoch | 13e2dad | 2016-09-16 13:49:30 +0100 | [diff] [blame] | 403 | // Run the type hint analyzer on the inlinee. |
| 404 | TypeHintAnalyzer type_hint_analyzer(&zone); |
| 405 | TypeHintAnalysis* type_hint_analysis = |
| 406 | type_hint_analyzer.Analyze(handle(shared_info->code(), info.isolate())); |
| Ben Murdoch | b8a8cc1 | 2014-11-26 15:28:44 +0000 | [diff] [blame] | 407 | |
| Ben Murdoch | 13e2dad | 2016-09-16 13:49:30 +0100 | [diff] [blame] | 408 | // Run the AstGraphBuilder to create the subgraph. |
| 409 | Graph::SubgraphScope scope(graph()); |
| 410 | AstGraphBuilder graph_builder(&zone, &info, jsgraph(), loop_assignment, |
| 411 | type_hint_analysis); |
| 412 | graph_builder.CreateGraph(false); |
| 413 | |
| 414 | // Extract the inlinee start/end nodes. |
| 415 | start = graph()->start(); |
| 416 | end = graph()->end(); |
| Ben Murdoch | b8a8cc1 | 2014-11-26 15:28:44 +0000 | [diff] [blame] | 417 | } |
| 418 | |
| Ben Murdoch | 13e2dad | 2016-09-16 13:49:30 +0100 | [diff] [blame] | 419 | Node* frame_state = call.frame_state(); |
| Ben Murdoch | f91f061 | 2016-11-29 16:50:11 +0000 | [diff] [blame^] | 420 | Node* new_target = jsgraph()->UndefinedConstant(); |
| Ben Murdoch | 13e2dad | 2016-09-16 13:49:30 +0100 | [diff] [blame] | 421 | |
| 422 | // Inline {JSCallConstruct} requires some additional magic. |
| Ben Murdoch | 014dc51 | 2016-03-22 12:00:34 +0000 | [diff] [blame] | 423 | if (node->opcode() == IrOpcode::kJSCallConstruct) { |
| Ben Murdoch | 13e2dad | 2016-09-16 13:49:30 +0100 | [diff] [blame] | 424 | // Insert nodes around the call that model the behavior required for a |
| 425 | // constructor dispatch (allocate implicit receiver and check return value). |
| 426 | // This models the behavior usually accomplished by our {JSConstructStub}. |
| 427 | // Note that the context has to be the callers context (input to call node). |
| Ben Murdoch | f91f061 | 2016-11-29 16:50:11 +0000 | [diff] [blame^] | 428 | Node* receiver = jsgraph()->UndefinedConstant(); // Implicit receiver. |
| Ben Murdoch | 13e2dad | 2016-09-16 13:49:30 +0100 | [diff] [blame] | 429 | if (NeedsImplicitReceiver(shared_info)) { |
| 430 | Node* frame_state_before = NodeProperties::FindFrameStateBefore(node); |
| 431 | Node* effect = NodeProperties::GetEffectInput(node); |
| 432 | Node* context = NodeProperties::GetContextInput(node); |
| Ben Murdoch | f91f061 | 2016-11-29 16:50:11 +0000 | [diff] [blame^] | 433 | Node* create = graph()->NewNode(javascript()->Create(), call.target(), |
| 434 | call.new_target(), context, |
| 435 | frame_state_before, effect); |
| Ben Murdoch | 13e2dad | 2016-09-16 13:49:30 +0100 | [diff] [blame] | 436 | NodeProperties::ReplaceEffectInput(node, create); |
| 437 | // Insert a check of the return value to determine whether the return |
| Ben Murdoch | f91f061 | 2016-11-29 16:50:11 +0000 | [diff] [blame^] | 438 | // value or the implicit receiver should be selected as a result of the |
| 439 | // call. |
| 440 | Node* check = graph()->NewNode(simplified()->ObjectIsReceiver(), node); |
| 441 | Node* select = |
| 442 | graph()->NewNode(common()->Select(MachineRepresentation::kTagged), |
| 443 | check, node, create); |
| 444 | NodeProperties::ReplaceUses(node, select, node, node, node); |
| 445 | // Fix-up inputs that have been mangled by the {ReplaceUses} call above. |
| 446 | NodeProperties::ReplaceValueInput(select, node, 1); // Fix-up input. |
| 447 | NodeProperties::ReplaceValueInput(check, node, 0); // Fix-up input. |
| Ben Murdoch | 13e2dad | 2016-09-16 13:49:30 +0100 | [diff] [blame] | 448 | receiver = create; // The implicit receiver. |
| 449 | } |
| 450 | |
| 451 | // Swizzle the inputs of the {JSCallConstruct} node to look like inputs to a |
| 452 | // normal {JSCallFunction} node so that the rest of the inlining machinery |
| 453 | // behaves as if we were dealing with a regular function invocation. |
| Ben Murdoch | 014dc51 | 2016-03-22 12:00:34 +0000 | [diff] [blame] | 454 | new_target = call.new_target(); // Retrieve new target value input. |
| 455 | node->RemoveInput(call.formal_arguments() + 1); // Drop new target. |
| Ben Murdoch | f91f061 | 2016-11-29 16:50:11 +0000 | [diff] [blame^] | 456 | node->InsertInput(graph()->zone(), 1, receiver); |
| Ben Murdoch | 13e2dad | 2016-09-16 13:49:30 +0100 | [diff] [blame] | 457 | |
| Ben Murdoch | 014dc51 | 2016-03-22 12:00:34 +0000 | [diff] [blame] | 458 | // Insert a construct stub frame into the chain of frame states. This will |
| 459 | // reconstruct the proper frame when deoptimizing within the constructor. |
| 460 | frame_state = CreateArtificialFrameState( |
| 461 | node, frame_state, call.formal_arguments(), |
| 462 | FrameStateType::kConstructStub, info.shared_info()); |
| 463 | } |
| 464 | |
| 465 | // The inlinee specializes to the context from the JSFunction object. |
| 466 | // TODO(turbofan): We might want to load the context from the JSFunction at |
| 467 | // runtime in case we only know the SharedFunctionInfo once we have dynamic |
| 468 | // type feedback in the compiler. |
| Ben Murdoch | f91f061 | 2016-11-29 16:50:11 +0000 | [diff] [blame^] | 469 | Node* context = jsgraph()->Constant(handle(function->context())); |
| Ben Murdoch | 014dc51 | 2016-03-22 12:00:34 +0000 | [diff] [blame] | 470 | |
| 471 | // Insert a JSConvertReceiver node for sloppy callees. Note that the context |
| 472 | // passed into this node has to be the callees context (loaded above). Note |
| 473 | // that the frame state passed to the JSConvertReceiver must be the frame |
| 474 | // state _before_ the call; it is not necessary to fiddle with the receiver |
| 475 | // in that frame state tho, as the conversion of the receiver can be repeated |
| 476 | // any number of times, it's not observable. |
| 477 | if (node->opcode() == IrOpcode::kJSCallFunction && |
| Ben Murdoch | bcf72ee | 2016-08-08 18:44:38 +0100 | [diff] [blame] | 478 | is_sloppy(parse_info.language_mode()) && !shared_info->native()) { |
| Ben Murdoch | 014dc51 | 2016-03-22 12:00:34 +0000 | [diff] [blame] | 479 | const CallFunctionParameters& p = CallFunctionParametersOf(node->op()); |
| Ben Murdoch | 13e2dad | 2016-09-16 13:49:30 +0100 | [diff] [blame] | 480 | Node* frame_state_before = NodeProperties::FindFrameStateBefore(node); |
| Ben Murdoch | 014dc51 | 2016-03-22 12:00:34 +0000 | [diff] [blame] | 481 | Node* effect = NodeProperties::GetEffectInput(node); |
| Ben Murdoch | f91f061 | 2016-11-29 16:50:11 +0000 | [diff] [blame^] | 482 | Node* convert = graph()->NewNode( |
| 483 | javascript()->ConvertReceiver(p.convert_mode()), call.receiver(), |
| 484 | context, frame_state_before, effect, start); |
| Ben Murdoch | 014dc51 | 2016-03-22 12:00:34 +0000 | [diff] [blame] | 485 | NodeProperties::ReplaceValueInput(node, convert, 1); |
| 486 | NodeProperties::ReplaceEffectInput(node, convert); |
| 487 | } |
| 488 | |
| Ben Murdoch | 3b9bc31 | 2016-06-02 14:46:10 +0100 | [diff] [blame] | 489 | // If we are inlining a JS call at tail position then we have to pop current |
| 490 | // frame state and its potential arguments adaptor frame state in order to |
| 491 | // make the call stack be consistent with non-inlining case. |
| 492 | // After that we add a tail caller frame state which lets deoptimizer handle |
| 493 | // the case when the outermost function inlines a tail call (it should remove |
| 494 | // potential arguments adaptor frame that belongs to outermost function when |
| 495 | // deopt happens). |
| 496 | if (node->opcode() == IrOpcode::kJSCallFunction) { |
| 497 | const CallFunctionParameters& p = CallFunctionParametersOf(node->op()); |
| 498 | if (p.tail_call_mode() == TailCallMode::kAllow) { |
| 499 | frame_state = CreateTailCallerFrameState(node, frame_state); |
| 500 | } |
| 501 | } |
| 502 | |
| Ben Murdoch | 014dc51 | 2016-03-22 12:00:34 +0000 | [diff] [blame] | 503 | // Insert argument adaptor frame if required. The callees formal parameter |
| 504 | // count (i.e. value outputs of start node minus target, receiver, new target, |
| 505 | // arguments count and context) have to match the number of arguments passed |
| 506 | // to the call. |
| Ben Murdoch | 3b9bc31 | 2016-06-02 14:46:10 +0100 | [diff] [blame] | 507 | int parameter_count = info.literal()->parameter_count(); |
| Ben Murdoch | 014dc51 | 2016-03-22 12:00:34 +0000 | [diff] [blame] | 508 | DCHECK_EQ(parameter_count, start->op()->ValueOutputCount() - 5); |
| 509 | if (call.formal_arguments() != parameter_count) { |
| 510 | frame_state = CreateArtificialFrameState( |
| 511 | node, frame_state, call.formal_arguments(), |
| Ben Murdoch | 109988c | 2016-05-18 11:27:45 +0100 | [diff] [blame] | 512 | FrameStateType::kArgumentsAdaptor, shared_info); |
| Ben Murdoch | 014dc51 | 2016-03-22 12:00:34 +0000 | [diff] [blame] | 513 | } |
| 514 | |
| 515 | return InlineCall(node, new_target, context, frame_state, start, end); |
| Ben Murdoch | b8a8cc1 | 2014-11-26 15:28:44 +0000 | [diff] [blame] | 516 | } |
| Emily Bernier | 958fae7 | 2015-03-24 16:35:39 -0400 | [diff] [blame] | 517 | |
| Ben Murdoch | 13e2dad | 2016-09-16 13:49:30 +0100 | [diff] [blame] | 518 | Graph* JSInliner::graph() const { return jsgraph()->graph(); } |
| 519 | |
| Ben Murdoch | f91f061 | 2016-11-29 16:50:11 +0000 | [diff] [blame^] | 520 | JSOperatorBuilder* JSInliner::javascript() const { |
| 521 | return jsgraph()->javascript(); |
| 522 | } |
| 523 | |
| 524 | CommonOperatorBuilder* JSInliner::common() const { return jsgraph()->common(); } |
| 525 | |
| 526 | SimplifiedOperatorBuilder* JSInliner::simplified() const { |
| 527 | return jsgraph()->simplified(); |
| 528 | } |
| 529 | |
| Ben Murdoch | 014dc51 | 2016-03-22 12:00:34 +0000 | [diff] [blame] | 530 | } // namespace compiler |
| 531 | } // namespace internal |
| 532 | } // namespace v8 |