| 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/compiler/instruction-selector-impl.h" | 5 #include "src/compiler/instruction-selector-impl.h" |
| 6 #include "src/compiler/node-matchers.h" | 6 #include "src/compiler/node-matchers.h" |
| 7 #include "src/compiler/node-properties-inl.h" | 7 #include "src/compiler/node-properties-inl.h" |
| 8 | 8 |
| 9 namespace v8 { | 9 namespace v8 { |
| 10 namespace internal { | 10 namespace internal { |
| (...skipping 285 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 296 IA32OperandGenerator g(this); | 296 IA32OperandGenerator g(this); |
| 297 Int32BinopMatcher m(node); | 297 Int32BinopMatcher m(node); |
| 298 if (m.left().Is(0)) { | 298 if (m.left().Is(0)) { |
| 299 Emit(kIA32Neg, g.DefineSameAsFirst(node), g.Use(m.right().node())); | 299 Emit(kIA32Neg, g.DefineSameAsFirst(node), g.Use(m.right().node())); |
| 300 } else { | 300 } else { |
| 301 VisitBinop(this, node, kIA32Sub); | 301 VisitBinop(this, node, kIA32Sub); |
| 302 } | 302 } |
| 303 } | 303 } |
| 304 | 304 |
| 305 | 305 |
| 306 void InstructionSelector::VisitInt32SubWithOverflow(Node* node) { |
| 307 VisitBinopWithOverflow(this, node, kIA32Sub); |
| 308 } |
| 309 |
| 310 |
| 306 void InstructionSelector::VisitInt32Mul(Node* node) { | 311 void InstructionSelector::VisitInt32Mul(Node* node) { |
| 307 IA32OperandGenerator g(this); | 312 IA32OperandGenerator g(this); |
| 308 Node* left = node->InputAt(0); | 313 Node* left = node->InputAt(0); |
| 309 Node* right = node->InputAt(1); | 314 Node* right = node->InputAt(1); |
| 310 if (g.CanBeImmediate(right)) { | 315 if (g.CanBeImmediate(right)) { |
| 311 Emit(kIA32Imul, g.DefineAsRegister(node), g.Use(left), | 316 Emit(kIA32Imul, g.DefineAsRegister(node), g.Use(left), |
| 312 g.UseImmediate(right)); | 317 g.UseImmediate(right)); |
| 313 } else if (g.CanBeImmediate(left)) { | 318 } else if (g.CanBeImmediate(left)) { |
| 314 Emit(kIA32Imul, g.DefineAsRegister(node), g.Use(right), | 319 Emit(kIA32Imul, g.DefineAsRegister(node), g.Use(right), |
| 315 g.UseImmediate(left)); | 320 g.UseImmediate(left)); |
| (...skipping 239 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 555 if (descriptor->kind() == CallDescriptor::kCallAddress && | 560 if (descriptor->kind() == CallDescriptor::kCallAddress && |
| 556 buffer.pushed_count > 0) { | 561 buffer.pushed_count > 0) { |
| 557 ASSERT(deoptimization == NULL && continuation == NULL); | 562 ASSERT(deoptimization == NULL && continuation == NULL); |
| 558 Emit(kPopStack | MiscField::encode(buffer.pushed_count), NULL); | 563 Emit(kPopStack | MiscField::encode(buffer.pushed_count), NULL); |
| 559 } | 564 } |
| 560 } | 565 } |
| 561 | 566 |
| 562 } // namespace compiler | 567 } // namespace compiler |
| 563 } // namespace internal | 568 } // namespace internal |
| 564 } // namespace v8 | 569 } // namespace v8 |
| OLD | NEW |