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

Side by Side Diff: src/compiler/ia32/code-generator-ia32.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
« no previous file with comments | « src/compiler/graph.cc ('k') | src/compiler/ia32/linkage-ia32.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 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 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
125 Handle<Code> code = Handle<Code>::cast(i.InputHeapObject(0)); 125 Handle<Code> code = Handle<Code>::cast(i.InputHeapObject(0));
126 __ call(code, RelocInfo::CODE_TARGET); 126 __ call(code, RelocInfo::CODE_TARGET);
127 } else { 127 } else {
128 Register reg = i.InputRegister(0); 128 Register reg = i.InputRegister(0);
129 __ call(Operand(reg, Code::kHeaderSize - kHeapObjectTag)); 129 __ call(Operand(reg, Code::kHeaderSize - kHeapObjectTag));
130 } 130 }
131 AddSafepointAndDeopt(instr); 131 AddSafepointAndDeopt(instr);
132 break; 132 break;
133 } 133 }
134 case kArchCallJSFunction: { 134 case kArchCallJSFunction: {
135 // TODO(jarin) The load of the context should be separated from the call.
136 Register func = i.InputRegister(0); 135 Register func = i.InputRegister(0);
137 __ mov(esi, FieldOperand(func, JSFunction::kContextOffset)); 136 if (FLAG_debug_code) {
137 // Check the function's context matches the context argument.
138 __ cmp(esi, FieldOperand(func, JSFunction::kContextOffset));
139 __ Assert(equal, kWrongFunctionContext);
140 }
138 __ call(FieldOperand(func, JSFunction::kCodeEntryOffset)); 141 __ call(FieldOperand(func, JSFunction::kCodeEntryOffset));
139 AddSafepointAndDeopt(instr); 142 AddSafepointAndDeopt(instr);
140 break; 143 break;
141 } 144 }
142 case kArchDrop: { 145 case kArchDrop: {
143 int words = MiscField::decode(instr->opcode()); 146 int words = MiscField::decode(instr->opcode());
144 __ add(esp, Immediate(kPointerSize * words)); 147 __ add(esp, Immediate(kPointerSize * words));
145 break; 148 break;
146 } 149 }
147 case kArchJmp: 150 case kArchJmp:
(...skipping 634 matching lines...) Expand 10 before | Expand all | Expand 10 after
782 __ ret(0); 785 __ ret(0);
783 } else { 786 } else {
784 // No saved registers. 787 // No saved registers.
785 __ mov(esp, ebp); // Move stack pointer back to frame pointer. 788 __ mov(esp, ebp); // Move stack pointer back to frame pointer.
786 __ pop(ebp); // Pop caller's frame pointer. 789 __ pop(ebp); // Pop caller's frame pointer.
787 __ ret(0); 790 __ ret(0);
788 } 791 }
789 } else { 792 } else {
790 __ mov(esp, ebp); // Move stack pointer back to frame pointer. 793 __ mov(esp, ebp); // Move stack pointer back to frame pointer.
791 __ pop(ebp); // Pop caller's frame pointer. 794 __ pop(ebp); // Pop caller's frame pointer.
792 int pop_count = 795 int pop_count = descriptor->IsJSFunctionCall()
793 descriptor->IsJSFunctionCall() ? descriptor->ParameterCount() : 0; 796 ? static_cast<int>(descriptor->JSParameterCount())
797 : 0;
794 __ ret(pop_count * kPointerSize); 798 __ ret(pop_count * kPointerSize);
795 } 799 }
796 } 800 }
797 801
798 802
799 void CodeGenerator::AssembleMove(InstructionOperand* source, 803 void CodeGenerator::AssembleMove(InstructionOperand* source,
800 InstructionOperand* destination) { 804 InstructionOperand* destination) {
801 IA32OperandConverter g(this, NULL); 805 IA32OperandConverter g(this, NULL);
802 // Dispatch on the source and destination operand kinds. Not all 806 // Dispatch on the source and destination operand kinds. Not all
803 // combinations are possible. 807 // combinations are possible.
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after
941 } 945 }
942 946
943 947
944 void CodeGenerator::AddNopForSmiCodeInlining() { __ nop(); } 948 void CodeGenerator::AddNopForSmiCodeInlining() { __ nop(); }
945 949
946 #undef __ 950 #undef __
947 951
948 } // namespace compiler 952 } // namespace compiler
949 } // namespace internal 953 } // namespace internal
950 } // namespace v8 954 } // namespace v8
OLDNEW
« no previous file with comments | « src/compiler/graph.cc ('k') | src/compiler/ia32/linkage-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698