| 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/js-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 JSContextRelaxation::Reduce(Node* node) { |
| 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_) { |
| 29 if (relaxed_context_->IsDead()) { |
| 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 |