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

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

Issue 530783002: Convert Linkage to use MachineSignature. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Rebase. Created 6 years, 3 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 | Annotate | Revision Log
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 208 matching lines...) Expand 10 before | Expand all | Expand 10 after
219 case kArchCallAddress: 219 case kArchCallAddress:
220 if (HasImmediateInput(instr, 0)) { 220 if (HasImmediateInput(instr, 0)) {
221 Immediate64 imm = i.InputImmediate64(0); 221 Immediate64 imm = i.InputImmediate64(0);
222 DCHECK_EQ(kImm64Value, imm.type); 222 DCHECK_EQ(kImm64Value, imm.type);
223 __ Call(reinterpret_cast<byte*>(imm.value), RelocInfo::NONE64); 223 __ Call(reinterpret_cast<byte*>(imm.value), RelocInfo::NONE64);
224 } else { 224 } else {
225 __ call(i.InputRegister(0)); 225 __ call(i.InputRegister(0));
226 } 226 }
227 break; 227 break;
228 case kArchCallJSFunction: { 228 case kArchCallJSFunction: {
229 // TODO(jarin) The load of the context should be separated from the call.
230 Register func = i.InputRegister(0); 229 Register func = i.InputRegister(0);
231 __ movp(rsi, FieldOperand(func, JSFunction::kContextOffset)); 230 if (FLAG_debug_code) {
231 // Check the function's context matches the context argument.
232 __ cmpp(rsi, FieldOperand(func, JSFunction::kContextOffset));
233 __ Assert(equal, kWrongFunctionContext);
234 }
232 __ Call(FieldOperand(func, JSFunction::kCodeEntryOffset)); 235 __ Call(FieldOperand(func, JSFunction::kCodeEntryOffset));
233 AddSafepointAndDeopt(instr); 236 AddSafepointAndDeopt(instr);
234 break; 237 break;
235 } 238 }
236 case kArchDrop: { 239 case kArchDrop: {
237 int words = MiscField::decode(instr->opcode()); 240 int words = MiscField::decode(instr->opcode());
238 __ addq(rsp, Immediate(kPointerSize * words)); 241 __ addq(rsp, Immediate(kPointerSize * words));
239 break; 242 break;
240 } 243 }
241 case kArchJmp: 244 case kArchJmp:
(...skipping 609 matching lines...) Expand 10 before | Expand all | Expand 10 after
851 __ ret(0); 854 __ ret(0);
852 } else { 855 } else {
853 // No saved registers. 856 // No saved registers.
854 __ movq(rsp, rbp); // Move stack pointer back to frame pointer. 857 __ movq(rsp, rbp); // Move stack pointer back to frame pointer.
855 __ popq(rbp); // Pop caller's frame pointer. 858 __ popq(rbp); // Pop caller's frame pointer.
856 __ ret(0); 859 __ ret(0);
857 } 860 }
858 } else { 861 } else {
859 __ movq(rsp, rbp); // Move stack pointer back to frame pointer. 862 __ movq(rsp, rbp); // Move stack pointer back to frame pointer.
860 __ popq(rbp); // Pop caller's frame pointer. 863 __ popq(rbp); // Pop caller's frame pointer.
861 int pop_count = 864 int pop_count = descriptor->IsJSFunctionCall()
862 descriptor->IsJSFunctionCall() ? descriptor->ParameterCount() : 0; 865 ? static_cast<int>(descriptor->JSParameterCount())
866 : 0;
863 __ ret(pop_count * kPointerSize); 867 __ ret(pop_count * kPointerSize);
864 } 868 }
865 } 869 }
866 870
867 871
868 void CodeGenerator::AssembleMove(InstructionOperand* source, 872 void CodeGenerator::AssembleMove(InstructionOperand* source,
869 InstructionOperand* destination) { 873 InstructionOperand* destination) {
870 X64OperandConverter g(this, NULL); 874 X64OperandConverter g(this, NULL);
871 // Dispatch on the source and destination operand kinds. Not all 875 // Dispatch on the source and destination operand kinds. Not all
872 // combinations are possible. 876 // combinations are possible.
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after
995 } 999 }
996 1000
997 1001
998 void CodeGenerator::AddNopForSmiCodeInlining() { __ nop(); } 1002 void CodeGenerator::AddNopForSmiCodeInlining() { __ nop(); }
999 1003
1000 #undef __ 1004 #undef __
1001 1005
1002 } // namespace internal 1006 } // namespace internal
1003 } // namespace compiler 1007 } // namespace compiler
1004 } // namespace v8 1008 } // namespace v8
OLDNEW
« no previous file with comments | « src/compiler/structured-machine-assembler.cc ('k') | src/compiler/x64/instruction-selector-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698