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

Side by Side Diff: src/compiler/context-relaxation.cc

Issue 1220823004: [turbofan]: Add a context relaxation Reducer (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 5 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
(Empty)
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
5 #include "src/compiler/context-relaxation.h"
6 #include "src/compiler/js-operator.h"
7 #include "src/compiler/node.h"
8 #include "src/compiler/node-properties.h"
9
10 namespace v8 {
11 namespace internal {
12 namespace compiler {
13
14 Reduction ContextRelaxation::Reduce(Node* node) {
Michael Starzinger 2015/07/02 10:29:26 I think it would make sense to rename this class t
15 switch (node->opcode()) {
16 case IrOpcode::kJSCallRuntime:
17 switch (OpParameter<CallRuntimeParameters>(node->op()).id()) {
18 case Runtime::kInlineMathClz32:
19 case Runtime::kInlineMathFloor:
20 case Runtime::kInlineMathSqrt:
21 break;
22 default:
23 return NoChange();
24 }
25 // Fall through...
26 case IrOpcode::kJSCallFunction:
27 case IrOpcode::kJSToNumber:
28 if (!context_is_wired_) {
danno 2015/07/01 09:11:48 This is a bit weird, any better ideas?
Michael Starzinger 2015/07/02 10:29:26 As discussed offline: We could move the parameter
29 if (relaxed_context_->InputAt(0) == nullptr) {
Michael Starzinger 2015/07/02 10:29:26 Can we please use relaxed_context_->IsDead() inste
30 relaxed_context_->ReplaceInput(0, start_);
31 }
32 context_is_wired_ = true;
33 }
34 NodeProperties::ReplaceContextInput(node, relaxed_context_);
35 return Changed(node);
36 break;
37 default:
38 break;
39 }
40 return NoChange();
41 }
42
43 } // namespace compiler
44 } // namespace internal
45 } // namespace v8
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698