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

Side by Side Diff: src/arm/code-stubs-arm.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_ARM 7 #if V8_TARGET_ARCH_ARM
8 8
9 #include "src/bootstrapper.h" 9 #include "src/bootstrapper.h"
10 #include "src/code-stubs.h" 10 #include "src/code-stubs.h"
11 #include "src/codegen.h" 11 #include "src/codegen.h"
12 #include "src/ic/handler-compiler.h" 12 #include "src/ic/handler-compiler.h"
13 #include "src/isolate.h" 13 #include "src/isolate.h"
14 #include "src/jsregexp.h" 14 #include "src/jsregexp.h"
15 #include "src/regexp-macro-assembler.h" 15 #include "src/regexp-macro-assembler.h"
16 #include "src/runtime.h" 16 #include "src/runtime.h"
17 17
18 namespace v8 { 18 namespace v8 {
19 namespace internal { 19 namespace internal {
20 20
21 21
22 static void InitializeArrayConstructorDescriptor( 22 static void InitializeArrayConstructorDescriptor(
23 Isolate* isolate, CodeStub::Major major, 23 Isolate* isolate, CodeStub::Major major,
24 CodeStubInterfaceDescriptor* descriptor, 24 CodeStubInterfaceDescriptor* descriptor,
25 int constant_stack_parameter_count) { 25 int constant_stack_parameter_count) {
26 Address deopt_handler = Runtime::FunctionForId( 26 Address deopt_handler = Runtime::FunctionForId(
27 Runtime::kArrayConstructor)->entry; 27 Runtime::kArrayConstructor)->entry;
28 28
29 if (constant_stack_parameter_count == 0) { 29 if (constant_stack_parameter_count == 0) {
30 CallInterfaceDescriptor* call_descriptor = isolate->call_descriptor( 30 ArrayConstructorConstantArgCountDescriptor call_descriptor(isolate);
31 CallDescriptorKey::ArrayConstructorConstantArgCountCall);
32 descriptor->Initialize(major, call_descriptor, deopt_handler, 31 descriptor->Initialize(major, call_descriptor, deopt_handler,
33 constant_stack_parameter_count, 32 constant_stack_parameter_count,
34 JS_FUNCTION_STUB_MODE); 33 JS_FUNCTION_STUB_MODE);
35 } else { 34 } else {
36 CallInterfaceDescriptor* call_descriptor = 35 ArrayConstructorDescriptor call_descriptor(isolate);
37 isolate->call_descriptor(CallDescriptorKey::ArrayConstructorCall);
38 descriptor->Initialize(major, call_descriptor, r0, deopt_handler, 36 descriptor->Initialize(major, call_descriptor, r0, deopt_handler,
39 constant_stack_parameter_count, 37 constant_stack_parameter_count,
40 JS_FUNCTION_STUB_MODE, PASS_ARGUMENTS); 38 JS_FUNCTION_STUB_MODE, PASS_ARGUMENTS);
41 } 39 }
42 } 40 }
43 41
44 42
45 static void InitializeInternalArrayConstructorDescriptor( 43 static void InitializeInternalArrayConstructorDescriptor(
46 Isolate* isolate, CodeStub::Major major, 44 Isolate* isolate, CodeStub::Major major,
47 CodeStubInterfaceDescriptor* descriptor, 45 CodeStubInterfaceDescriptor* descriptor,
48 int constant_stack_parameter_count) { 46 int constant_stack_parameter_count) {
49 Address deopt_handler = Runtime::FunctionForId( 47 Address deopt_handler = Runtime::FunctionForId(
50 Runtime::kInternalArrayConstructor)->entry; 48 Runtime::kInternalArrayConstructor)->entry;
51 49
52 if (constant_stack_parameter_count == 0) { 50 if (constant_stack_parameter_count == 0) {
53 CallInterfaceDescriptor* call_descriptor = isolate->call_descriptor( 51 InternalArrayConstructorConstantArgCountDescriptor call_descriptor(isolate);
54 CallDescriptorKey::InternalArrayConstructorConstantArgCountCall);
55 descriptor->Initialize(major, call_descriptor, deopt_handler, 52 descriptor->Initialize(major, call_descriptor, deopt_handler,
56 constant_stack_parameter_count, 53 constant_stack_parameter_count,
57 JS_FUNCTION_STUB_MODE); 54 JS_FUNCTION_STUB_MODE);
58 } else { 55 } else {
59 CallInterfaceDescriptor* call_descriptor = isolate->call_descriptor( 56 InternalArrayConstructorDescriptor call_descriptor(isolate);
60 CallDescriptorKey::InternalArrayConstructorCall);
61 descriptor->Initialize(major, call_descriptor, r0, deopt_handler, 57 descriptor->Initialize(major, call_descriptor, r0, deopt_handler,
62 constant_stack_parameter_count, 58 constant_stack_parameter_count,
63 JS_FUNCTION_STUB_MODE, PASS_ARGUMENTS); 59 JS_FUNCTION_STUB_MODE, PASS_ARGUMENTS);
64 } 60 }
65 } 61 }
66 62
67 63
68 void ArrayNoArgumentConstructorStub::InitializeInterfaceDescriptor( 64 void ArrayNoArgumentConstructorStub::InitializeInterfaceDescriptor(
69 CodeStubInterfaceDescriptor* descriptor) { 65 CodeStubInterfaceDescriptor* descriptor) {
70 InitializeArrayConstructorDescriptor(isolate(), MajorKey(), descriptor, 0); 66 InitializeArrayConstructorDescriptor(isolate(), MajorKey(), descriptor, 0);
(...skipping 1546 matching lines...) Expand 10 before | Expand all | Expand 10 after
1617 __ cmp(r0, Operand::Zero()); 1613 __ cmp(r0, Operand::Zero());
1618 __ LoadRoot(r0, Heap::kTrueValueRootIndex, eq); 1614 __ LoadRoot(r0, Heap::kTrueValueRootIndex, eq);
1619 __ LoadRoot(r0, Heap::kFalseValueRootIndex, ne); 1615 __ LoadRoot(r0, Heap::kFalseValueRootIndex, ne);
1620 __ Ret(HasArgsInRegisters() ? 0 : 2); 1616 __ Ret(HasArgsInRegisters() ? 0 : 2);
1621 } 1617 }
1622 } 1618 }
1623 1619
1624 1620
1625 void FunctionPrototypeStub::Generate(MacroAssembler* masm) { 1621 void FunctionPrototypeStub::Generate(MacroAssembler* masm) {
1626 Label miss; 1622 Label miss;
1627 Register receiver = LoadConvention::ReceiverRegister(); 1623 Register receiver = LoadDescriptor::ReceiverRegister();
1628 1624
1629 NamedLoadHandlerCompiler::GenerateLoadFunctionPrototype(masm, receiver, r3, 1625 NamedLoadHandlerCompiler::GenerateLoadFunctionPrototype(masm, receiver, r3,
1630 r4, &miss); 1626 r4, &miss);
1631 __ bind(&miss); 1627 __ bind(&miss);
1632 PropertyAccessCompiler::TailCallBuiltin( 1628 PropertyAccessCompiler::TailCallBuiltin(
1633 masm, PropertyAccessCompiler::MissBuiltin(Code::LOAD_IC)); 1629 masm, PropertyAccessCompiler::MissBuiltin(Code::LOAD_IC));
1634 } 1630 }
1635 1631
1636 1632
1637 void ArgumentsAccessStub::GenerateReadElement(MacroAssembler* masm) { 1633 void ArgumentsAccessStub::GenerateReadElement(MacroAssembler* masm) {
(...skipping 2691 matching lines...) Expand 10 before | Expand all | Expand 10 after
4329 __ add(r1, r1, Operand(1)); 4325 __ add(r1, r1, Operand(1));
4330 } 4326 }
4331 masm->LeaveFrame(StackFrame::STUB_FAILURE_TRAMPOLINE); 4327 masm->LeaveFrame(StackFrame::STUB_FAILURE_TRAMPOLINE);
4332 __ mov(r1, Operand(r1, LSL, kPointerSizeLog2)); 4328 __ mov(r1, Operand(r1, LSL, kPointerSizeLog2));
4333 __ add(sp, sp, r1); 4329 __ add(sp, sp, r1);
4334 __ Ret(); 4330 __ Ret();
4335 } 4331 }
4336 4332
4337 4333
4338 void LoadICTrampolineStub::Generate(MacroAssembler* masm) { 4334 void LoadICTrampolineStub::Generate(MacroAssembler* masm) {
4339 EmitLoadTypeFeedbackVector(masm, FullVectorLoadConvention::VectorRegister()); 4335 EmitLoadTypeFeedbackVector(masm, VectorLoadICDescriptor::VectorRegister());
4340 VectorLoadStub stub(isolate(), state()); 4336 VectorLoadStub stub(isolate(), state());
4341 __ Jump(stub.GetCode(), RelocInfo::CODE_TARGET); 4337 __ Jump(stub.GetCode(), RelocInfo::CODE_TARGET);
4342 } 4338 }
4343 4339
4344 4340
4345 void KeyedLoadICTrampolineStub::Generate(MacroAssembler* masm) { 4341 void KeyedLoadICTrampolineStub::Generate(MacroAssembler* masm) {
4346 EmitLoadTypeFeedbackVector(masm, FullVectorLoadConvention::VectorRegister()); 4342 EmitLoadTypeFeedbackVector(masm, VectorLoadICDescriptor::VectorRegister());
4347 VectorKeyedLoadStub stub(isolate()); 4343 VectorKeyedLoadStub stub(isolate());
4348 __ Jump(stub.GetCode(), RelocInfo::CODE_TARGET); 4344 __ Jump(stub.GetCode(), RelocInfo::CODE_TARGET);
4349 } 4345 }
4350 4346
4351 4347
4352 void ProfileEntryHookStub::MaybeCallEntryHook(MacroAssembler* masm) { 4348 void ProfileEntryHookStub::MaybeCallEntryHook(MacroAssembler* masm) {
4353 if (masm->isolate()->function_entry_hook() != NULL) { 4349 if (masm->isolate()->function_entry_hook() != NULL) {
4354 ProfileEntryHookStub stub(masm->isolate()); 4350 ProfileEntryHookStub stub(masm->isolate());
4355 int code_size = masm->CallStubSize(&stub) + 2 * Assembler::kInstrSize; 4351 int code_size = masm->CallStubSize(&stub) + 2 * Assembler::kInstrSize;
4356 PredictableCodeSizeScope predictable(masm, code_size); 4352 PredictableCodeSizeScope predictable(masm, code_size);
(...skipping 496 matching lines...) Expand 10 before | Expand all | Expand 10 after
4853 MemOperand(fp, 6 * kPointerSize), 4849 MemOperand(fp, 6 * kPointerSize),
4854 NULL); 4850 NULL);
4855 } 4851 }
4856 4852
4857 4853
4858 #undef __ 4854 #undef __
4859 4855
4860 } } // namespace v8::internal 4856 } } // namespace v8::internal
4861 4857
4862 #endif // V8_TARGET_ARCH_ARM 4858 #endif // V8_TARGET_ARCH_ARM
OLDNEW
« no previous file with comments | « BUILD.gn ('k') | src/arm/debug-arm.cc » ('j') | src/arm/interface-descriptors-arm.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698