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

Side by Side Diff: src/crankshaft/x87/lithium-codegen-x87.cc

Issue 1416673009: X87: Remove CallFunctionStub, always call through the Call builtin (also from CallIC). (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 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
« no previous file with comments | « no previous file | src/full-codegen/x87/full-codegen-x87.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 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 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 #if V8_TARGET_ARCH_X87 5 #if V8_TARGET_ARCH_X87
6 6
7 #include "src/crankshaft/x87/lithium-codegen-x87.h" 7 #include "src/crankshaft/x87/lithium-codegen-x87.h"
8 8
9 #include "src/base/bits.h" 9 #include "src/base/bits.h"
10 #include "src/code-factory.h" 10 #include "src/code-factory.h"
(...skipping 4163 matching lines...) Expand 10 before | Expand all | Expand 10 after
4174 } 4174 }
4175 } 4175 }
4176 4176
4177 4177
4178 void LCodeGen::DoCallFunction(LCallFunction* instr) { 4178 void LCodeGen::DoCallFunction(LCallFunction* instr) {
4179 DCHECK(ToRegister(instr->context()).is(esi)); 4179 DCHECK(ToRegister(instr->context()).is(esi));
4180 DCHECK(ToRegister(instr->function()).is(edi)); 4180 DCHECK(ToRegister(instr->function()).is(edi));
4181 DCHECK(ToRegister(instr->result()).is(eax)); 4181 DCHECK(ToRegister(instr->result()).is(eax));
4182 4182
4183 int arity = instr->arity(); 4183 int arity = instr->arity();
4184 CallFunctionFlags flags = instr->hydrogen()->function_flags();
4185 if (instr->hydrogen()->HasVectorAndSlot()) { 4184 if (instr->hydrogen()->HasVectorAndSlot()) {
4186 Register slot_register = ToRegister(instr->temp_slot()); 4185 Register slot_register = ToRegister(instr->temp_slot());
4187 Register vector_register = ToRegister(instr->temp_vector()); 4186 Register vector_register = ToRegister(instr->temp_vector());
4188 DCHECK(slot_register.is(edx)); 4187 DCHECK(slot_register.is(edx));
4189 DCHECK(vector_register.is(ebx)); 4188 DCHECK(vector_register.is(ebx));
4190 4189
4191 AllowDeferredHandleDereference vector_structure_check; 4190 AllowDeferredHandleDereference vector_structure_check;
4192 Handle<TypeFeedbackVector> vector = instr->hydrogen()->feedback_vector(); 4191 Handle<TypeFeedbackVector> vector = instr->hydrogen()->feedback_vector();
4193 int index = vector->GetIndex(instr->hydrogen()->slot()); 4192 int index = vector->GetIndex(instr->hydrogen()->slot());
4194 4193
4195 __ mov(vector_register, vector); 4194 __ mov(vector_register, vector);
4196 __ mov(slot_register, Immediate(Smi::FromInt(index))); 4195 __ mov(slot_register, Immediate(Smi::FromInt(index)));
4197 4196
4198 CallICState::CallType call_type =
4199 (flags & CALL_AS_METHOD) ? CallICState::METHOD : CallICState::FUNCTION;
4200
4201 Handle<Code> ic = 4197 Handle<Code> ic =
4202 CodeFactory::CallICInOptimizedCode(isolate(), arity, call_type).code(); 4198 CodeFactory::CallICInOptimizedCode(isolate(), arity).code();
4203 CallCode(ic, RelocInfo::CODE_TARGET, instr); 4199 CallCode(ic, RelocInfo::CODE_TARGET, instr);
4204 } else { 4200 } else {
4205 CallFunctionStub stub(isolate(), arity, flags); 4201 __ Set(eax, arity);
4206 CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr); 4202 CallCode(isolate()->builtins()->Call(), RelocInfo::CODE_TARGET, instr);
4207 } 4203 }
4208 } 4204 }
4209 4205
4210 4206
4211 void LCodeGen::DoCallNew(LCallNew* instr) { 4207 void LCodeGen::DoCallNew(LCallNew* instr) {
4212 DCHECK(ToRegister(instr->context()).is(esi)); 4208 DCHECK(ToRegister(instr->context()).is(esi));
4213 DCHECK(ToRegister(instr->constructor()).is(edi)); 4209 DCHECK(ToRegister(instr->constructor()).is(edi));
4214 DCHECK(ToRegister(instr->result()).is(eax)); 4210 DCHECK(ToRegister(instr->result()).is(eax));
4215 4211
4216 // No cell in ebx for construct type feedback in optimized code 4212 // No cell in ebx for construct type feedback in optimized code
(...skipping 2071 matching lines...) Expand 10 before | Expand all | Expand 10 after
6288 RecordSafepoint(Safepoint::kNoLazyDeopt); 6284 RecordSafepoint(Safepoint::kNoLazyDeopt);
6289 } 6285 }
6290 6286
6291 6287
6292 #undef __ 6288 #undef __
6293 6289
6294 } // namespace internal 6290 } // namespace internal
6295 } // namespace v8 6291 } // namespace v8
6296 6292
6297 #endif // V8_TARGET_ARCH_X87 6293 #endif // V8_TARGET_ARCH_X87
OLDNEW
« no previous file with comments | « no previous file | src/full-codegen/x87/full-codegen-x87.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698