Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1)

Side by Side Diff: src/compiler/ia32/instruction-selector-ia32.cc

Issue 946553002: [turbofan] Fix several int vs size_t issues. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: REBASE. Fix Win64. Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/compiler/ia32/code-generator-ia32.cc ('k') | src/compiler/instruction-selector.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
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
OLDNEW
« no previous file with comments | « src/compiler/ia32/code-generator-ia32.cc ('k') | src/compiler/instruction-selector.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698