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

Side by Side Diff: src/compiler/js-typed-lowering.cc

Issue 1169103004: [deoptimizer] Basic support inlining based on SharedFunctionInfo. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix Jaros comment. 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 unified diff | Download patch
« no previous file with comments | « src/compiler/js-inlining.cc ('k') | src/deoptimizer.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 the V8 project authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/code-factory.h" 5 #include "src/code-factory.h"
6 #include "src/compiler/access-builder.h" 6 #include "src/compiler/access-builder.h"
7 #include "src/compiler/js-graph.h" 7 #include "src/compiler/js-graph.h"
8 #include "src/compiler/js-typed-lowering.h" 8 #include "src/compiler/js-typed-lowering.h"
9 #include "src/compiler/linkage.h" 9 #include "src/compiler/linkage.h"
10 #include "src/compiler/node-matchers.h" 10 #include "src/compiler/node-matchers.h"
(...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after
255 if (state_info.state_combine().kind() == OutputFrameStateCombine::kPokeAt && 255 if (state_info.state_combine().kind() == OutputFrameStateCombine::kPokeAt &&
256 state_info.state_combine().GetOffsetToPokeAt() == 1) { 256 state_info.state_combine().GetOffsetToPokeAt() == 1) {
257 return frame_state; 257 return frame_state;
258 } 258 }
259 259
260 // Here, we smash the result of the conversion into the slot just below 260 // Here, we smash the result of the conversion into the slot just below
261 // the stack top. This is the slot that full code uses to store the 261 // the stack top. This is the slot that full code uses to store the
262 // left operand. 262 // left operand.
263 const Operator* op = jsgraph()->common()->FrameState( 263 const Operator* op = jsgraph()->common()->FrameState(
264 state_info.type(), state_info.bailout_id(), 264 state_info.type(), state_info.bailout_id(),
265 OutputFrameStateCombine::PokeAt(1)); 265 OutputFrameStateCombine::PokeAt(1), state_info.shared_info());
266 266
267 return graph()->NewNode(op, 267 return graph()->NewNode(op,
268 frame_state->InputAt(kFrameStateParametersInput), 268 frame_state->InputAt(kFrameStateParametersInput),
269 frame_state->InputAt(kFrameStateLocalsInput), 269 frame_state->InputAt(kFrameStateLocalsInput),
270 frame_state->InputAt(kFrameStateStackInput), 270 frame_state->InputAt(kFrameStateStackInput),
271 frame_state->InputAt(kFrameStateContextInput), 271 frame_state->InputAt(kFrameStateContextInput),
272 frame_state->InputAt(kFrameStateFunctionInput), 272 frame_state->InputAt(kFrameStateFunctionInput),
273 frame_state->InputAt(kFrameStateOuterStateInput)); 273 frame_state->InputAt(kFrameStateOuterStateInput));
274 } 274 }
275 275
276 Node* CreateFrameStateForRightInput(Node* frame_state, Node* converted_left) { 276 Node* CreateFrameStateForRightInput(Node* frame_state, Node* converted_left) {
277 FrameStateCallInfo state_info = 277 FrameStateCallInfo state_info =
278 OpParameter<FrameStateCallInfo>(frame_state); 278 OpParameter<FrameStateCallInfo>(frame_state);
279 279
280 if (state_info.bailout_id() == BailoutId::None()) { 280 if (state_info.bailout_id() == BailoutId::None()) {
281 // Dummy frame state => just leave it as is. 281 // Dummy frame state => just leave it as is.
282 return frame_state; 282 return frame_state;
283 } 283 }
284 284
285 // Create a frame state that stores the result of the operation to the 285 // Create a frame state that stores the result of the operation to the
286 // top of the stack (i.e., the slot used for the right operand). 286 // top of the stack (i.e., the slot used for the right operand).
287 const Operator* op = jsgraph()->common()->FrameState( 287 const Operator* op = jsgraph()->common()->FrameState(
288 state_info.type(), state_info.bailout_id(), 288 state_info.type(), state_info.bailout_id(),
289 OutputFrameStateCombine::PokeAt(0)); 289 OutputFrameStateCombine::PokeAt(0), state_info.shared_info());
290 290
291 // Change the left operand {converted_left} on the expression stack. 291 // Change the left operand {converted_left} on the expression stack.
292 Node* stack = frame_state->InputAt(2); 292 Node* stack = frame_state->InputAt(2);
293 DCHECK_EQ(stack->opcode(), IrOpcode::kStateValues); 293 DCHECK_EQ(stack->opcode(), IrOpcode::kStateValues);
294 DCHECK_GE(stack->InputCount(), 2); 294 DCHECK_GE(stack->InputCount(), 2);
295 295
296 // TODO(jarin) Allocate in a local zone or a reusable buffer. 296 // TODO(jarin) Allocate in a local zone or a reusable buffer.
297 NodeVector new_values(stack->InputCount(), zone()); 297 NodeVector new_values(stack->InputCount(), zone());
298 for (int i = 0; i < stack->InputCount(); i++) { 298 for (int i = 0; i < stack->InputCount(); i++) {
299 if (i == stack->InputCount() - 2) { 299 if (i == stack->InputCount() - 2) {
(...skipping 1312 matching lines...) Expand 10 before | Expand all | Expand 10 after
1612 } 1612 }
1613 1613
1614 1614
1615 MachineOperatorBuilder* JSTypedLowering::machine() const { 1615 MachineOperatorBuilder* JSTypedLowering::machine() const {
1616 return jsgraph()->machine(); 1616 return jsgraph()->machine();
1617 } 1617 }
1618 1618
1619 } // namespace compiler 1619 } // namespace compiler
1620 } // namespace internal 1620 } // namespace internal
1621 } // namespace v8 1621 } // namespace v8
OLDNEW
« no previous file with comments | « src/compiler/js-inlining.cc ('k') | src/deoptimizer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698