| 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 311 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 322 } | 322 } |
| 323 | 323 |
| 324 | 324 |
| 325 // Shared routine for multiple shift operations. | 325 // Shared routine for multiple shift operations. |
| 326 static inline void VisitShift(InstructionSelector* selector, Node* node, | 326 static inline void VisitShift(InstructionSelector* selector, Node* node, |
| 327 ArchOpcode opcode) { | 327 ArchOpcode opcode) { |
| 328 IA32OperandGenerator g(selector); | 328 IA32OperandGenerator g(selector); |
| 329 Node* left = node->InputAt(0); | 329 Node* left = node->InputAt(0); |
| 330 Node* right = node->InputAt(1); | 330 Node* right = node->InputAt(1); |
| 331 | 331 |
| 332 // TODO(turbofan): assembler only supports some addressing modes for shifts. | |
| 333 if (g.CanBeImmediate(right)) { | 332 if (g.CanBeImmediate(right)) { |
| 334 selector->Emit(opcode, g.DefineSameAsFirst(node), g.UseRegister(left), | 333 selector->Emit(opcode, g.DefineSameAsFirst(node), g.Use(left), |
| 335 g.UseImmediate(right)); | 334 g.UseImmediate(right)); |
| 336 } else { | 335 } else { |
| 337 Int32BinopMatcher m(node); | 336 Int32BinopMatcher m(node); |
| 338 if (m.right().IsWord32And()) { | 337 if (m.right().IsWord32And()) { |
| 339 Int32BinopMatcher mright(right); | 338 Int32BinopMatcher mright(right); |
| 340 if (mright.right().Is(0x1F)) { | 339 if (mright.right().Is(0x1F)) { |
| 341 right = mright.left().node(); | 340 right = mright.left().node(); |
| 342 } | 341 } |
| 343 } | 342 } |
| 344 selector->Emit(opcode, g.DefineSameAsFirst(node), g.UseRegister(left), | 343 selector->Emit(opcode, g.DefineSameAsFirst(node), g.Use(left), |
| 345 g.UseFixed(right, ecx)); | 344 g.UseFixed(right, ecx)); |
| 346 } | 345 } |
| 347 } | 346 } |
| 348 | 347 |
| 349 | 348 |
| 350 void InstructionSelector::VisitWord32Shl(Node* node) { | 349 void InstructionSelector::VisitWord32Shl(Node* node) { |
| 351 VisitShift(this, node, kIA32Shl); | 350 VisitShift(this, node, kIA32Shl); |
| 352 } | 351 } |
| 353 | 352 |
| 354 | 353 |
| (...skipping 321 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 676 call_instr->MarkAsCall(); | 675 call_instr->MarkAsCall(); |
| 677 if (deoptimization != NULL) { | 676 if (deoptimization != NULL) { |
| 678 DCHECK(continuation != NULL); | 677 DCHECK(continuation != NULL); |
| 679 call_instr->MarkAsControl(); | 678 call_instr->MarkAsControl(); |
| 680 } | 679 } |
| 681 } | 680 } |
| 682 | 681 |
| 683 } // namespace compiler | 682 } // namespace compiler |
| 684 } // namespace internal | 683 } // namespace internal |
| 685 } // namespace v8 | 684 } // namespace v8 |
| OLD | NEW |