Chromium Code Reviews| OLD | NEW |
|---|---|
| (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 | |
| OLD | NEW |