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

Side by Side Diff: src/compiler/tail-call-optimization.cc

Issue 1366753003: [turbofan] Make Node::set_op safer via wrapper. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Addressed comments. Created 5 years, 3 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
OLDNEW
1 // Copyright 2015 the V8 project authors. All rights reserved. 1 // Copyright 2015 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/compiler/tail-call-optimization.h" 5 #include "src/compiler/tail-call-optimization.h"
6 6
7 #include "src/compiler/common-operator.h" 7 #include "src/compiler/common-operator.h"
8 #include "src/compiler/graph.h" 8 #include "src/compiler/graph.h"
9 #include "src/compiler/linkage.h" 9 #include "src/compiler/linkage.h"
10 #include "src/compiler/node-properties.h" 10 #include "src/compiler/node-properties.h"
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
56 // | | | | 56 // | | | |
57 // | +--+ +-+ | 57 // | +--+ +-+ |
58 // +----------+ | | +------+ 58 // +----------+ | | +------+
59 // \ | | / 59 // \ | | /
60 // TailCall[Descriptor] 60 // TailCall[Descriptor]
61 // ^ 61 // ^
62 // | 62 // |
63 63
64 DCHECK_EQ(call, NodeProperties::GetControlInput(control, 0)); 64 DCHECK_EQ(call, NodeProperties::GetControlInput(control, 0));
65 DCHECK_EQ(3, node->InputCount()); 65 DCHECK_EQ(3, node->InputCount());
66 node->set_op(
67 common()->TailCall(OpParameter<CallDescriptor const*>(call)));
68 node->ReplaceInput(0, NodeProperties::GetEffectInput(call)); 66 node->ReplaceInput(0, NodeProperties::GetEffectInput(call));
69 node->ReplaceInput(1, NodeProperties::GetControlInput(call)); 67 node->ReplaceInput(1, NodeProperties::GetControlInput(call));
70 node->RemoveInput(2); 68 node->RemoveInput(2);
71 for (int index = 0; index < call->op()->ValueInputCount(); ++index) { 69 for (int index = 0; index < call->op()->ValueInputCount(); ++index) {
72 node->InsertInput(graph()->zone(), index, 70 node->InsertInput(graph()->zone(), index,
73 NodeProperties::GetValueInput(call, index)); 71 NodeProperties::GetValueInput(call, index));
74 } 72 }
73 NodeProperties::ChangeOp(
74 node, common()->TailCall(OpParameter<CallDescriptor const*>(call)));
75 return Changed(node); 75 return Changed(node);
76 } 76 }
77 } 77 }
78 return NoChange(); 78 return NoChange();
79 } 79 }
80 80
81 } // namespace compiler 81 } // namespace compiler
82 } // namespace internal 82 } // namespace internal
83 } // namespace v8 83 } // namespace v8
OLDNEW
« no previous file with comments | « src/compiler/simplified-operator-reducer.cc ('k') | test/unittests/compiler/graph-reducer-unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698