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

Side by Side Diff: src/ia32/code-stubs-ia32.cc

Issue 527093002: Make concrete classes for individual call descriptors. (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 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 #include "src/v8.h" 5 #include "src/v8.h"
6 6
7 #if V8_TARGET_ARCH_IA32 7 #if V8_TARGET_ARCH_IA32
8 8
9 #include "src/bootstrapper.h" 9 #include "src/bootstrapper.h"
10 #include "src/code-stubs.h" 10 #include "src/code-stubs.h"
(...skipping 13 matching lines...) Expand all
24 CodeStubInterfaceDescriptor* descriptor, 24 CodeStubInterfaceDescriptor* descriptor,
25 int constant_stack_parameter_count) { 25 int constant_stack_parameter_count) {
26 // register state 26 // register state
27 // eax -- number of arguments 27 // eax -- number of arguments
28 // edi -- function 28 // edi -- function
29 // ebx -- allocation site with elements kind 29 // ebx -- allocation site with elements kind
30 Address deopt_handler = Runtime::FunctionForId( 30 Address deopt_handler = Runtime::FunctionForId(
31 Runtime::kArrayConstructor)->entry; 31 Runtime::kArrayConstructor)->entry;
32 32
33 if (constant_stack_parameter_count == 0) { 33 if (constant_stack_parameter_count == 0) {
34 CallInterfaceDescriptor* call_descriptor = isolate->call_descriptor( 34 ArrayConstructorConstantArgCountDescriptor call_descriptor(isolate);
35 CallDescriptorKey::ArrayConstructorConstantArgCountCall);
36 descriptor->Initialize(major, call_descriptor, deopt_handler, 35 descriptor->Initialize(major, call_descriptor, deopt_handler,
37 constant_stack_parameter_count, 36 constant_stack_parameter_count,
38 JS_FUNCTION_STUB_MODE); 37 JS_FUNCTION_STUB_MODE);
39 } else { 38 } else {
40 CallInterfaceDescriptor* call_descriptor = 39 ArrayConstructorDescriptor call_descriptor(isolate);
41 isolate->call_descriptor(CallDescriptorKey::ArrayConstructorCall);
42 descriptor->Initialize(major, call_descriptor, eax, deopt_handler, 40 descriptor->Initialize(major, call_descriptor, eax, deopt_handler,
43 constant_stack_parameter_count, 41 constant_stack_parameter_count,
44 JS_FUNCTION_STUB_MODE, PASS_ARGUMENTS); 42 JS_FUNCTION_STUB_MODE, PASS_ARGUMENTS);
45 } 43 }
46 } 44 }
47 45
48 46
49 static void InitializeInternalArrayConstructorDescriptor( 47 static void InitializeInternalArrayConstructorDescriptor(
50 Isolate* isolate, CodeStub::Major major, 48 Isolate* isolate, CodeStub::Major major,
51 CodeStubInterfaceDescriptor* descriptor, 49 CodeStubInterfaceDescriptor* descriptor,
52 int constant_stack_parameter_count) { 50 int constant_stack_parameter_count) {
53 // register state 51 // register state
54 // eax -- number of arguments 52 // eax -- number of arguments
55 // edi -- constructor function 53 // edi -- constructor function
56 Address deopt_handler = Runtime::FunctionForId( 54 Address deopt_handler = Runtime::FunctionForId(
57 Runtime::kInternalArrayConstructor)->entry; 55 Runtime::kInternalArrayConstructor)->entry;
58 56
59 if (constant_stack_parameter_count == 0) { 57 if (constant_stack_parameter_count == 0) {
60 CallInterfaceDescriptor* call_descriptor = isolate->call_descriptor( 58 InternalArrayConstructorConstantArgCountDescriptor call_descriptor(isolate);
61 CallDescriptorKey::InternalArrayConstructorConstantArgCountCall);
62 descriptor->Initialize(major, call_descriptor, deopt_handler, 59 descriptor->Initialize(major, call_descriptor, deopt_handler,
63 constant_stack_parameter_count, 60 constant_stack_parameter_count,
64 JS_FUNCTION_STUB_MODE); 61 JS_FUNCTION_STUB_MODE);
65 } else { 62 } else {
66 CallInterfaceDescriptor* call_descriptor = isolate->call_descriptor( 63 InternalArrayConstructorDescriptor call_descriptor(isolate);
67 CallDescriptorKey::InternalArrayConstructorCall);
68 descriptor->Initialize(major, call_descriptor, eax, deopt_handler, 64 descriptor->Initialize(major, call_descriptor, eax, deopt_handler,
69 constant_stack_parameter_count, 65 constant_stack_parameter_count,
70 JS_FUNCTION_STUB_MODE, PASS_ARGUMENTS); 66 JS_FUNCTION_STUB_MODE, PASS_ARGUMENTS);
71 } 67 }
72 } 68 }
73 69
74 70
75 void ArrayNoArgumentConstructorStub::InitializeInterfaceDescriptor( 71 void ArrayNoArgumentConstructorStub::InitializeInterfaceDescriptor(
76 CodeStubInterfaceDescriptor* descriptor) { 72 CodeStubInterfaceDescriptor* descriptor) {
77 InitializeArrayConstructorDescriptor(isolate(), MajorKey(), descriptor, 0); 73 InitializeArrayConstructorDescriptor(isolate(), MajorKey(), descriptor, 0);
(...skipping 579 matching lines...) Expand 10 before | Expand all | Expand 10 after
657 653
658 __ bind(&done); 654 __ bind(&done);
659 __ IncrementCounter(counters->math_pow(), 1); 655 __ IncrementCounter(counters->math_pow(), 1);
660 __ ret(0); 656 __ ret(0);
661 } 657 }
662 } 658 }
663 659
664 660
665 void FunctionPrototypeStub::Generate(MacroAssembler* masm) { 661 void FunctionPrototypeStub::Generate(MacroAssembler* masm) {
666 Label miss; 662 Label miss;
667 Register receiver = LoadConvention::ReceiverRegister(); 663 Register receiver = LoadDescriptor::ReceiverRegister();
668 664
669 NamedLoadHandlerCompiler::GenerateLoadFunctionPrototype(masm, receiver, eax, 665 NamedLoadHandlerCompiler::GenerateLoadFunctionPrototype(masm, receiver, eax,
670 ebx, &miss); 666 ebx, &miss);
671 __ bind(&miss); 667 __ bind(&miss);
672 PropertyAccessCompiler::TailCallBuiltin( 668 PropertyAccessCompiler::TailCallBuiltin(
673 masm, PropertyAccessCompiler::MissBuiltin(Code::LOAD_IC)); 669 masm, PropertyAccessCompiler::MissBuiltin(Code::LOAD_IC));
674 } 670 }
675 671
676 672
677 void ArgumentsAccessStub::GenerateReadElement(MacroAssembler* masm) { 673 void ArgumentsAccessStub::GenerateReadElement(MacroAssembler* masm) {
(...skipping 3579 matching lines...) Expand 10 before | Expand all | Expand 10 after
4257 masm->LeaveFrame(StackFrame::STUB_FAILURE_TRAMPOLINE); 4253 masm->LeaveFrame(StackFrame::STUB_FAILURE_TRAMPOLINE);
4258 __ pop(ecx); 4254 __ pop(ecx);
4259 int additional_offset = 4255 int additional_offset =
4260 function_mode() == JS_FUNCTION_STUB_MODE ? kPointerSize : 0; 4256 function_mode() == JS_FUNCTION_STUB_MODE ? kPointerSize : 0;
4261 __ lea(esp, MemOperand(esp, ebx, times_pointer_size, additional_offset)); 4257 __ lea(esp, MemOperand(esp, ebx, times_pointer_size, additional_offset));
4262 __ jmp(ecx); // Return to IC Miss stub, continuation still on stack. 4258 __ jmp(ecx); // Return to IC Miss stub, continuation still on stack.
4263 } 4259 }
4264 4260
4265 4261
4266 void LoadICTrampolineStub::Generate(MacroAssembler* masm) { 4262 void LoadICTrampolineStub::Generate(MacroAssembler* masm) {
4267 EmitLoadTypeFeedbackVector(masm, FullVectorLoadConvention::VectorRegister()); 4263 EmitLoadTypeFeedbackVector(masm, VectorLoadICDescriptor::VectorRegister());
4268 VectorLoadStub stub(isolate(), state()); 4264 VectorLoadStub stub(isolate(), state());
4269 __ jmp(stub.GetCode(), RelocInfo::CODE_TARGET); 4265 __ jmp(stub.GetCode(), RelocInfo::CODE_TARGET);
4270 } 4266 }
4271 4267
4272 4268
4273 void KeyedLoadICTrampolineStub::Generate(MacroAssembler* masm) { 4269 void KeyedLoadICTrampolineStub::Generate(MacroAssembler* masm) {
4274 EmitLoadTypeFeedbackVector(masm, FullVectorLoadConvention::VectorRegister()); 4270 EmitLoadTypeFeedbackVector(masm, VectorLoadICDescriptor::VectorRegister());
4275 VectorKeyedLoadStub stub(isolate()); 4271 VectorKeyedLoadStub stub(isolate());
4276 __ jmp(stub.GetCode(), RelocInfo::CODE_TARGET); 4272 __ jmp(stub.GetCode(), RelocInfo::CODE_TARGET);
4277 } 4273 }
4278 4274
4279 4275
4280 void ProfileEntryHookStub::MaybeCallEntryHook(MacroAssembler* masm) { 4276 void ProfileEntryHookStub::MaybeCallEntryHook(MacroAssembler* masm) {
4281 if (masm->isolate()->function_entry_hook() != NULL) { 4277 if (masm->isolate()->function_entry_hook() != NULL) {
4282 ProfileEntryHookStub stub(masm->isolate()); 4278 ProfileEntryHookStub stub(masm->isolate());
4283 masm->CallStub(&stub); 4279 masm->CallStub(&stub);
4284 } 4280 }
(...skipping 496 matching lines...) Expand 10 before | Expand all | Expand 10 after
4781 Operand(ebp, 7 * kPointerSize), 4777 Operand(ebp, 7 * kPointerSize),
4782 NULL); 4778 NULL);
4783 } 4779 }
4784 4780
4785 4781
4786 #undef __ 4782 #undef __
4787 4783
4788 } } // namespace v8::internal 4784 } } // namespace v8::internal
4789 4785
4790 #endif // V8_TARGET_ARCH_IA32 4786 #endif // V8_TARGET_ARCH_IA32
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698