| 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.h" | 7 #include "src/compiler/node-properties.h" |
| 8 | 8 |
| 9 namespace v8 { | 9 namespace v8 { |
| 10 namespace internal { | 10 namespace internal { |
| (...skipping 444 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 455 } | 455 } |
| 456 | 456 |
| 457 void EmitLea(InstructionSelector* selector, Node* result, Node* index, | 457 void EmitLea(InstructionSelector* selector, Node* result, Node* index, |
| 458 int scale, Node* base, Node* displacement) { | 458 int scale, Node* base, Node* displacement) { |
| 459 IA32OperandGenerator g(selector); | 459 IA32OperandGenerator g(selector); |
| 460 InstructionOperand inputs[4]; | 460 InstructionOperand inputs[4]; |
| 461 size_t input_count = 0; | 461 size_t input_count = 0; |
| 462 AddressingMode mode = g.GenerateMemoryOperandInputs( | 462 AddressingMode mode = g.GenerateMemoryOperandInputs( |
| 463 index, scale, base, displacement, inputs, &input_count); | 463 index, scale, base, displacement, inputs, &input_count); |
| 464 | 464 |
| 465 DCHECK_NE(0, static_cast<int>(input_count)); | 465 DCHECK_NE(0u, input_count); |
| 466 DCHECK_GE(arraysize(inputs), input_count); | 466 DCHECK_GE(arraysize(inputs), input_count); |
| 467 | 467 |
| 468 InstructionOperand outputs[1]; | 468 InstructionOperand outputs[1]; |
| 469 outputs[0] = g.DefineAsRegister(result); | 469 outputs[0] = g.DefineAsRegister(result); |
| 470 | 470 |
| 471 InstructionCode opcode = AddressingModeField::encode(mode) | kIA32Lea; | 471 InstructionCode opcode = AddressingModeField::encode(mode) | kIA32Lea; |
| 472 | 472 |
| 473 selector->Emit(opcode, 1, outputs, input_count, inputs); | 473 selector->Emit(opcode, 1, outputs, input_count, inputs); |
| 474 } | 474 } |
| 475 | 475 |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 508 | 508 |
| 509 // Try to match the Add to a lea pattern | 509 // Try to match the Add to a lea pattern |
| 510 BaseWithIndexAndDisplacement32Matcher m(node); | 510 BaseWithIndexAndDisplacement32Matcher m(node); |
| 511 if (m.matches() && | 511 if (m.matches() && |
| 512 (m.displacement() == NULL || g.CanBeImmediate(m.displacement()))) { | 512 (m.displacement() == NULL || g.CanBeImmediate(m.displacement()))) { |
| 513 InstructionOperand inputs[4]; | 513 InstructionOperand inputs[4]; |
| 514 size_t input_count = 0; | 514 size_t input_count = 0; |
| 515 AddressingMode mode = g.GenerateMemoryOperandInputs( | 515 AddressingMode mode = g.GenerateMemoryOperandInputs( |
| 516 m.index(), m.scale(), m.base(), m.displacement(), inputs, &input_count); | 516 m.index(), m.scale(), m.base(), m.displacement(), inputs, &input_count); |
| 517 | 517 |
| 518 DCHECK_NE(0, static_cast<int>(input_count)); | 518 DCHECK_NE(0u, input_count); |
| 519 DCHECK_GE(arraysize(inputs), input_count); | 519 DCHECK_GE(arraysize(inputs), input_count); |
| 520 | 520 |
| 521 InstructionOperand outputs[1]; | 521 InstructionOperand outputs[1]; |
| 522 outputs[0] = g.DefineAsRegister(node); | 522 outputs[0] = g.DefineAsRegister(node); |
| 523 | 523 |
| 524 InstructionCode opcode = AddressingModeField::encode(mode) | kIA32Lea; | 524 InstructionCode opcode = AddressingModeField::encode(mode) | kIA32Lea; |
| 525 Emit(opcode, 1, outputs, input_count, inputs); | 525 Emit(opcode, 1, outputs, input_count, inputs); |
| 526 return; | 526 return; |
| 527 } | 527 } |
| 528 | 528 |
| (...skipping 547 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1076 MachineOperatorBuilder::kFloat64Ceil | | 1076 MachineOperatorBuilder::kFloat64Ceil | |
| 1077 MachineOperatorBuilder::kFloat64RoundTruncate | | 1077 MachineOperatorBuilder::kFloat64RoundTruncate | |
| 1078 MachineOperatorBuilder::kWord32ShiftIsSafe; | 1078 MachineOperatorBuilder::kWord32ShiftIsSafe; |
| 1079 } | 1079 } |
| 1080 return MachineOperatorBuilder::Flag::kNoFlags; | 1080 return MachineOperatorBuilder::Flag::kNoFlags; |
| 1081 } | 1081 } |
| 1082 | 1082 |
| 1083 } // namespace compiler | 1083 } // namespace compiler |
| 1084 } // namespace internal | 1084 } // namespace internal |
| 1085 } // namespace v8 | 1085 } // namespace v8 |
| OLD | NEW |