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

Side by Side Diff: src/compiler/mips/code-generator-mips.cc

Issue 707803002: [turbofan] move label generation to code generator (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 1 month 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 | Annotate | Revision Log
« no previous file with comments | « src/compiler/instruction.cc ('k') | src/compiler/x64/code-generator-x64.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/code-generator.h" 5 #include "src/compiler/code-generator.h"
6 #include "src/compiler/code-generator-impl.h" 6 #include "src/compiler/code-generator-impl.h"
7 #include "src/compiler/gap-resolver.h" 7 #include "src/compiler/gap-resolver.h"
8 #include "src/compiler/node-matchers.h" 8 #include "src/compiler/node-matchers.h"
9 #include "src/compiler/node-properties-inl.h" 9 #include "src/compiler/node-properties-inl.h"
10 #include "src/mips/macro-assembler-mips.h" 10 #include "src/mips/macro-assembler-mips.h"
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after
147 __ lw(kScratchReg, FieldMemOperand(func, JSFunction::kContextOffset)); 147 __ lw(kScratchReg, FieldMemOperand(func, JSFunction::kContextOffset));
148 __ Assert(eq, kWrongFunctionContext, cp, Operand(kScratchReg)); 148 __ Assert(eq, kWrongFunctionContext, cp, Operand(kScratchReg));
149 } 149 }
150 150
151 __ lw(at, FieldMemOperand(func, JSFunction::kCodeEntryOffset)); 151 __ lw(at, FieldMemOperand(func, JSFunction::kCodeEntryOffset));
152 __ Call(at); 152 __ Call(at);
153 AddSafepointAndDeopt(instr); 153 AddSafepointAndDeopt(instr);
154 break; 154 break;
155 } 155 }
156 case kArchJmp: 156 case kArchJmp:
157 __ Branch(code_->GetLabel(i.InputRpo(0))); 157 __ Branch(GetLabel(i.InputRpo(0)));
158 break; 158 break;
159 case kArchNop: 159 case kArchNop:
160 // don't emit code for nops. 160 // don't emit code for nops.
161 break; 161 break;
162 case kArchRet: 162 case kArchRet:
163 AssembleReturn(); 163 AssembleReturn();
164 break; 164 break;
165 case kArchStackPointer: 165 case kArchStackPointer:
166 __ mov(i.OutputRegister(), sp); 166 __ mov(i.OutputRegister(), sp);
167 break; 167 break;
(...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after
396 MipsOperandConverter i(this, instr); 396 MipsOperandConverter i(this, instr);
397 Label done; 397 Label done;
398 398
399 // Emit a branch. The true and false targets are always the last two inputs 399 // Emit a branch. The true and false targets are always the last two inputs
400 // to the instruction. 400 // to the instruction.
401 BasicBlock::RpoNumber tblock = 401 BasicBlock::RpoNumber tblock =
402 i.InputRpo(static_cast<int>(instr->InputCount()) - 2); 402 i.InputRpo(static_cast<int>(instr->InputCount()) - 2);
403 BasicBlock::RpoNumber fblock = 403 BasicBlock::RpoNumber fblock =
404 i.InputRpo(static_cast<int>(instr->InputCount()) - 1); 404 i.InputRpo(static_cast<int>(instr->InputCount()) - 1);
405 bool fallthru = IsNextInAssemblyOrder(fblock); 405 bool fallthru = IsNextInAssemblyOrder(fblock);
406 Label* tlabel = code()->GetLabel(tblock); 406 Label* tlabel = GetLabel(tblock);
407 Label* flabel = fallthru ? &done : code()->GetLabel(fblock); 407 Label* flabel = fallthru ? &done : GetLabel(fblock);
408 Condition cc = kNoCondition; 408 Condition cc = kNoCondition;
409 409
410 // MIPS does not have condition code flags, so compare and branch are 410 // MIPS does not have condition code flags, so compare and branch are
411 // implemented differently than on the other arch's. The compare operations 411 // implemented differently than on the other arch's. The compare operations
412 // emit mips psuedo-instructions, which are handled here by branch 412 // emit mips psuedo-instructions, which are handled here by branch
413 // instructions that do the actual comparison. Essential that the input 413 // instructions that do the actual comparison. Essential that the input
414 // registers to compare psuedo-op are not modified before this branch op, as 414 // registers to compare psuedo-op are not modified before this branch op, as
415 // they are tested here. 415 // they are tested here.
416 // TODO(plind): Add CHECK() to ensure that test/cmp and this branch were 416 // TODO(plind): Add CHECK() to ensure that test/cmp and this branch were
417 // not separated by other instructions. 417 // not separated by other instructions.
(...skipping 543 matching lines...) Expand 10 before | Expand all | Expand 10 after
961 } 961 }
962 } 962 }
963 MarkLazyDeoptSite(); 963 MarkLazyDeoptSite();
964 } 964 }
965 965
966 #undef __ 966 #undef __
967 967
968 } // namespace compiler 968 } // namespace compiler
969 } // namespace internal 969 } // namespace internal
970 } // namespace v8 970 } // namespace v8
OLDNEW
« no previous file with comments | « src/compiler/instruction.cc ('k') | src/compiler/x64/code-generator-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698