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

Side by Side Diff: src/compiler/code-generator.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/arm64/code-generator-arm64.cc ('k') | src/compiler/code-generator-impl.h » ('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 2013 the V8 project authors. All rights reserved. 1 // Copyright 2013 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/code-generator.h" 5 #include "src/compiler/code-generator.h"
6 6
7 #include "src/compiler/code-generator-impl.h" 7 #include "src/compiler/code-generator-impl.h"
8 #include "src/compiler/linkage.h" 8 #include "src/compiler/linkage.h"
9 #include "src/compiler/pipeline.h" 9 #include "src/compiler/pipeline.h"
10 10
(...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after
192 AssembleSourcePosition(SourcePositionInstruction::cast(instr)); 192 AssembleSourcePosition(SourcePositionInstruction::cast(instr));
193 } else { 193 } else {
194 // Assemble architecture-specific code for the instruction. 194 // Assemble architecture-specific code for the instruction.
195 AssembleArchInstruction(instr); 195 AssembleArchInstruction(instr);
196 196
197 FlagsMode mode = FlagsModeField::decode(instr->opcode()); 197 FlagsMode mode = FlagsModeField::decode(instr->opcode());
198 FlagsCondition condition = FlagsConditionField::decode(instr->opcode()); 198 FlagsCondition condition = FlagsConditionField::decode(instr->opcode());
199 if (mode == kFlags_branch) { 199 if (mode == kFlags_branch) {
200 // Assemble a branch after this instruction. 200 // Assemble a branch after this instruction.
201 InstructionOperandConverter i(this, instr); 201 InstructionOperandConverter i(this, instr);
202 BasicBlock::RpoNumber true_rpo = 202 BasicBlock::RpoNumber true_rpo = i.InputRpo(instr->InputCount() - 2);
203 i.InputRpo(static_cast<int>(instr->InputCount()) - 2); 203 BasicBlock::RpoNumber false_rpo = i.InputRpo(instr->InputCount() - 1);
204 BasicBlock::RpoNumber false_rpo =
205 i.InputRpo(static_cast<int>(instr->InputCount()) - 1);
206 204
207 if (true_rpo == false_rpo) { 205 if (true_rpo == false_rpo) {
208 // redundant branch. 206 // redundant branch.
209 if (!IsNextInAssemblyOrder(true_rpo)) { 207 if (!IsNextInAssemblyOrder(true_rpo)) {
210 AssembleArchJump(true_rpo); 208 AssembleArchJump(true_rpo);
211 } 209 }
212 return; 210 return;
213 } 211 }
214 if (IsNextInAssemblyOrder(true_rpo)) { 212 if (IsNextInAssemblyOrder(true_rpo)) {
215 // true block is next, can fall through if condition negated. 213 // true block is next, can fall through if condition negated.
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after
394 if (deoptimization_literals_[i].is_identical_to(literal)) return i; 392 if (deoptimization_literals_[i].is_identical_to(literal)) return i;
395 } 393 }
396 deoptimization_literals_.push_back(literal); 394 deoptimization_literals_.push_back(literal);
397 return result; 395 return result;
398 } 396 }
399 397
400 398
401 FrameStateDescriptor* CodeGenerator::GetFrameStateDescriptor( 399 FrameStateDescriptor* CodeGenerator::GetFrameStateDescriptor(
402 Instruction* instr, size_t frame_state_offset) { 400 Instruction* instr, size_t frame_state_offset) {
403 InstructionOperandConverter i(this, instr); 401 InstructionOperandConverter i(this, instr);
404 InstructionSequence::StateId state_id = InstructionSequence::StateId::FromInt( 402 InstructionSequence::StateId state_id =
405 i.InputInt32(static_cast<int>(frame_state_offset))); 403 InstructionSequence::StateId::FromInt(i.InputInt32(frame_state_offset));
406 return code()->GetFrameStateDescriptor(state_id); 404 return code()->GetFrameStateDescriptor(state_id);
407 } 405 }
408 406
409 struct OperandAndType { 407 struct OperandAndType {
410 OperandAndType(InstructionOperand* operand, MachineType type) 408 OperandAndType(InstructionOperand* operand, MachineType type)
411 : operand_(operand), type_(type) {} 409 : operand_(operand), type_(type) {}
412 410
413 InstructionOperand* operand_; 411 InstructionOperand* operand_;
414 MachineType type_; 412 MachineType type_;
415 }; 413 };
(...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after
636 : masm_(gen->masm()), next_(gen->ools_) { 634 : masm_(gen->masm()), next_(gen->ools_) {
637 gen->ools_ = this; 635 gen->ools_ = this;
638 } 636 }
639 637
640 638
641 OutOfLineCode::~OutOfLineCode() {} 639 OutOfLineCode::~OutOfLineCode() {}
642 640
643 } // namespace compiler 641 } // namespace compiler
644 } // namespace internal 642 } // namespace internal
645 } // namespace v8 643 } // namespace v8
OLDNEW
« no previous file with comments | « src/compiler/arm64/code-generator-arm64.cc ('k') | src/compiler/code-generator-impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698