| OLD | NEW |
| 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/code-stubs.h" | 6 #include "src/code-stubs.h" |
| 7 #include "src/compiler/common-operator.h" | 7 #include "src/compiler/common-operator.h" |
| 8 #include "src/compiler/js-generic-lowering.h" | 8 #include "src/compiler/js-generic-lowering.h" |
| 9 #include "src/compiler/machine-operator.h" | 9 #include "src/compiler/machine-operator.h" |
| 10 #include "src/compiler/node-aux-data-inl.h" | 10 #include "src/compiler/node-aux-data-inl.h" |
| (...skipping 27 matching lines...) Expand all Loading... |
| 38 case IrOpcode::k##x: \ | 38 case IrOpcode::k##x: \ |
| 39 Lower##x(node); \ | 39 Lower##x(node); \ |
| 40 break; | 40 break; |
| 41 JS_OP_LIST(DECLARE_CASE) | 41 JS_OP_LIST(DECLARE_CASE) |
| 42 #undef DECLARE_CASE | 42 #undef DECLARE_CASE |
| 43 case IrOpcode::kBranch: | 43 case IrOpcode::kBranch: |
| 44 // TODO(mstarzinger): If typing is enabled then simplified lowering will | 44 // TODO(mstarzinger): If typing is enabled then simplified lowering will |
| 45 // have inserted the correct ChangeBoolToBit, otherwise we need to perform | 45 // have inserted the correct ChangeBoolToBit, otherwise we need to perform |
| 46 // poor-man's representation inference here and insert manual change. | 46 // poor-man's representation inference here and insert manual change. |
| 47 if (!info()->is_typing_enabled()) { | 47 if (!info()->is_typing_enabled()) { |
| 48 Node* test = graph()->NewNode(machine()->WordEqual(), node->InputAt(0), | 48 Node* condition = node->InputAt(0); |
| 49 jsgraph()->TrueConstant()); | 49 if (condition->opcode() != IrOpcode::kAlways) { |
| 50 node->ReplaceInput(0, test); | 50 Node* test = graph()->NewNode(machine()->WordEqual(), condition, |
| 51 jsgraph()->TrueConstant()); |
| 52 node->ReplaceInput(0, test); |
| 53 } |
| 51 break; | 54 break; |
| 52 } | 55 } |
| 53 // Fall-through. | 56 // Fall-through. |
| 54 default: | 57 default: |
| 55 // Nothing to see. | 58 // Nothing to see. |
| 56 return NoChange(); | 59 return NoChange(); |
| 57 } | 60 } |
| 58 return Changed(node); | 61 return Changed(node); |
| 59 } | 62 } |
| 60 | 63 |
| (...skipping 370 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 431 | 434 |
| 432 | 435 |
| 433 void JSGenericLowering::LowerJSCallRuntime(Node* node) { | 436 void JSGenericLowering::LowerJSCallRuntime(Node* node) { |
| 434 const CallRuntimeParameters& p = CallRuntimeParametersOf(node->op()); | 437 const CallRuntimeParameters& p = CallRuntimeParametersOf(node->op()); |
| 435 ReplaceWithRuntimeCall(node, p.id(), static_cast<int>(p.arity())); | 438 ReplaceWithRuntimeCall(node, p.id(), static_cast<int>(p.arity())); |
| 436 } | 439 } |
| 437 | 440 |
| 438 } // namespace compiler | 441 } // namespace compiler |
| 439 } // namespace internal | 442 } // namespace internal |
| 440 } // namespace v8 | 443 } // namespace v8 |
| OLD | NEW |