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

Side by Side Diff: src/compiler/x64/code-generator-x64.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/mips/code-generator-mips.cc ('k') | no next file » | 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/gap-resolver.h" 8 #include "src/compiler/gap-resolver.h"
9 #include "src/compiler/node-matchers.h" 9 #include "src/compiler/node-matchers.h"
10 #include "src/compiler/node-properties-inl.h" 10 #include "src/compiler/node-properties-inl.h"
(...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after
231 if (FLAG_debug_code) { 231 if (FLAG_debug_code) {
232 // Check the function's context matches the context argument. 232 // Check the function's context matches the context argument.
233 __ cmpp(rsi, FieldOperand(func, JSFunction::kContextOffset)); 233 __ cmpp(rsi, FieldOperand(func, JSFunction::kContextOffset));
234 __ Assert(equal, kWrongFunctionContext); 234 __ Assert(equal, kWrongFunctionContext);
235 } 235 }
236 __ Call(FieldOperand(func, JSFunction::kCodeEntryOffset)); 236 __ Call(FieldOperand(func, JSFunction::kCodeEntryOffset));
237 AddSafepointAndDeopt(instr); 237 AddSafepointAndDeopt(instr);
238 break; 238 break;
239 } 239 }
240 case kArchJmp: 240 case kArchJmp:
241 __ jmp(code_->GetLabel(i.InputRpo(0))); 241 __ jmp(GetLabel(i.InputRpo(0)));
242 break; 242 break;
243 case kArchNop: 243 case kArchNop:
244 // don't emit code for nops. 244 // don't emit code for nops.
245 break; 245 break;
246 case kArchRet: 246 case kArchRet:
247 AssembleReturn(); 247 AssembleReturn();
248 break; 248 break;
249 case kArchStackPointer: 249 case kArchStackPointer:
250 __ movq(i.OutputRegister(), rsp); 250 __ movq(i.OutputRegister(), rsp);
251 break; 251 break;
(...skipping 361 matching lines...) Expand 10 before | Expand all | Expand 10 after
613 X64OperandConverter i(this, instr); 613 X64OperandConverter i(this, instr);
614 Label done; 614 Label done;
615 615
616 // Emit a branch. The true and false targets are always the last two inputs 616 // Emit a branch. The true and false targets are always the last two inputs
617 // to the instruction. 617 // to the instruction.
618 BasicBlock::RpoNumber tblock = 618 BasicBlock::RpoNumber tblock =
619 i.InputRpo(static_cast<int>(instr->InputCount()) - 2); 619 i.InputRpo(static_cast<int>(instr->InputCount()) - 2);
620 BasicBlock::RpoNumber fblock = 620 BasicBlock::RpoNumber fblock =
621 i.InputRpo(static_cast<int>(instr->InputCount()) - 1); 621 i.InputRpo(static_cast<int>(instr->InputCount()) - 1);
622 bool fallthru = IsNextInAssemblyOrder(fblock); 622 bool fallthru = IsNextInAssemblyOrder(fblock);
623 Label* tlabel = code()->GetLabel(tblock); 623 Label* tlabel = GetLabel(tblock);
624 Label* flabel = fallthru ? &done : code()->GetLabel(fblock); 624 Label* flabel = fallthru ? &done : GetLabel(fblock);
625 Label::Distance flabel_distance = fallthru ? Label::kNear : Label::kFar; 625 Label::Distance flabel_distance = fallthru ? Label::kNear : Label::kFar;
626 switch (condition) { 626 switch (condition) {
627 case kUnorderedEqual: 627 case kUnorderedEqual:
628 __ j(parity_even, flabel, flabel_distance); 628 __ j(parity_even, flabel, flabel_distance);
629 // Fall through. 629 // Fall through.
630 case kEqual: 630 case kEqual:
631 __ j(equal, tlabel); 631 __ j(equal, tlabel);
632 break; 632 break;
633 case kUnorderedNotEqual: 633 case kUnorderedNotEqual:
634 __ j(parity_even, tlabel); 634 __ j(parity_even, tlabel);
(...skipping 396 matching lines...) Expand 10 before | Expand all | Expand 10 after
1031 } 1031 }
1032 } 1032 }
1033 MarkLazyDeoptSite(); 1033 MarkLazyDeoptSite();
1034 } 1034 }
1035 1035
1036 #undef __ 1036 #undef __
1037 1037
1038 } // namespace internal 1038 } // namespace internal
1039 } // namespace compiler 1039 } // namespace compiler
1040 } // namespace v8 1040 } // namespace v8
OLDNEW
« no previous file with comments | « src/compiler/mips/code-generator-mips.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698