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

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

Issue 110573004: Merge bleeding_edge 17696:18016. (Closed) Base URL: https://v8.googlecode.com/svn/branches/experimental/parser
Patch Set: Created 7 years 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 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
106 Isolate* isolate, 106 Isolate* isolate,
107 CodeStubInterfaceDescriptor* descriptor) { 107 CodeStubInterfaceDescriptor* descriptor) {
108 static Register registers[] = { r1, r0 }; 108 static Register registers[] = { r1, r0 };
109 descriptor->register_param_count_ = 2; 109 descriptor->register_param_count_ = 2;
110 descriptor->register_params_ = registers; 110 descriptor->register_params_ = registers;
111 descriptor->deoptimization_handler_ = 111 descriptor->deoptimization_handler_ =
112 FUNCTION_ADDR(KeyedLoadIC_MissFromStubFailure); 112 FUNCTION_ADDR(KeyedLoadIC_MissFromStubFailure);
113 } 113 }
114 114
115 115
116 void KeyedLoadDictionaryElementStub::InitializeInterfaceDescriptor(
117 Isolate* isolate,
118 CodeStubInterfaceDescriptor* descriptor) {
119 static Register registers[] = { r1, r0 };
120 descriptor->register_param_count_ = 2;
121 descriptor->register_params_ = registers;
122 descriptor->deoptimization_handler_ =
123 FUNCTION_ADDR(KeyedLoadIC_MissFromStubFailure);
124 }
125
126
116 void LoadFieldStub::InitializeInterfaceDescriptor( 127 void LoadFieldStub::InitializeInterfaceDescriptor(
117 Isolate* isolate, 128 Isolate* isolate,
118 CodeStubInterfaceDescriptor* descriptor) { 129 CodeStubInterfaceDescriptor* descriptor) {
119 static Register registers[] = { r0 }; 130 static Register registers[] = { r0 };
120 descriptor->register_param_count_ = 1; 131 descriptor->register_param_count_ = 1;
121 descriptor->register_params_ = registers; 132 descriptor->register_params_ = registers;
122 descriptor->deoptimization_handler_ = NULL; 133 descriptor->deoptimization_handler_ = NULL;
123 } 134 }
124 135
125 136
126 void KeyedLoadFieldStub::InitializeInterfaceDescriptor( 137 void KeyedLoadFieldStub::InitializeInterfaceDescriptor(
127 Isolate* isolate, 138 Isolate* isolate,
128 CodeStubInterfaceDescriptor* descriptor) { 139 CodeStubInterfaceDescriptor* descriptor) {
129 static Register registers[] = { r1 }; 140 static Register registers[] = { r1 };
130 descriptor->register_param_count_ = 1; 141 descriptor->register_param_count_ = 1;
131 descriptor->register_params_ = registers; 142 descriptor->register_params_ = registers;
132 descriptor->deoptimization_handler_ = NULL; 143 descriptor->deoptimization_handler_ = NULL;
133 } 144 }
134 145
135 146
147 void KeyedArrayCallStub::InitializeInterfaceDescriptor(
148 Isolate* isolate,
149 CodeStubInterfaceDescriptor* descriptor) {
150 static Register registers[] = { r2 };
151 descriptor->register_param_count_ = 1;
152 descriptor->register_params_ = registers;
153 descriptor->continuation_type_ = TAIL_CALL_CONTINUATION;
154 descriptor->handler_arguments_mode_ = PASS_ARGUMENTS;
155 descriptor->deoptimization_handler_ =
156 FUNCTION_ADDR(KeyedCallIC_MissFromStubFailure);
157 }
158
159
136 void KeyedStoreFastElementStub::InitializeInterfaceDescriptor( 160 void KeyedStoreFastElementStub::InitializeInterfaceDescriptor(
137 Isolate* isolate, 161 Isolate* isolate,
138 CodeStubInterfaceDescriptor* descriptor) { 162 CodeStubInterfaceDescriptor* descriptor) {
139 static Register registers[] = { r2, r1, r0 }; 163 static Register registers[] = { r2, r1, r0 };
140 descriptor->register_param_count_ = 3; 164 descriptor->register_param_count_ = 3;
141 descriptor->register_params_ = registers; 165 descriptor->register_params_ = registers;
142 descriptor->deoptimization_handler_ = 166 descriptor->deoptimization_handler_ =
143 FUNCTION_ADDR(KeyedStoreIC_MissFromStubFailure); 167 FUNCTION_ADDR(KeyedStoreIC_MissFromStubFailure);
144 } 168 }
145 169
(...skipping 5540 matching lines...) Expand 10 before | Expand all | Expand 10 after
5686 if (function_mode_ == JS_FUNCTION_STUB_MODE) { 5710 if (function_mode_ == JS_FUNCTION_STUB_MODE) {
5687 __ add(r1, r1, Operand(1)); 5711 __ add(r1, r1, Operand(1));
5688 } 5712 }
5689 masm->LeaveFrame(StackFrame::STUB_FAILURE_TRAMPOLINE); 5713 masm->LeaveFrame(StackFrame::STUB_FAILURE_TRAMPOLINE);
5690 __ mov(r1, Operand(r1, LSL, kPointerSizeLog2)); 5714 __ mov(r1, Operand(r1, LSL, kPointerSizeLog2));
5691 __ add(sp, sp, r1); 5715 __ add(sp, sp, r1);
5692 __ Ret(); 5716 __ Ret();
5693 } 5717 }
5694 5718
5695 5719
5720 void StubFailureTailCallTrampolineStub::Generate(MacroAssembler* masm) {
5721 CEntryStub ces(1, fp_registers_ ? kSaveFPRegs : kDontSaveFPRegs);
5722 __ Call(ces.GetCode(masm->isolate()), RelocInfo::CODE_TARGET);
5723 __ mov(r1, r0);
5724 int parameter_count_offset =
5725 StubFailureTrampolineFrame::kCallerStackParameterCountFrameOffset;
5726 __ ldr(r0, MemOperand(fp, parameter_count_offset));
5727 // The parameter count above includes the receiver for the arguments passed to
5728 // the deoptimization handler. Subtract the receiver for the parameter count
5729 // for the call.
5730 __ sub(r0, r0, Operand(1));
5731 masm->LeaveFrame(StackFrame::STUB_FAILURE_TRAMPOLINE);
5732 ParameterCount argument_count(r0);
5733 __ InvokeFunction(
5734 r1, argument_count, JUMP_FUNCTION, NullCallWrapper(), CALL_AS_METHOD);
5735 }
5736
5737
5696 void ProfileEntryHookStub::MaybeCallEntryHook(MacroAssembler* masm) { 5738 void ProfileEntryHookStub::MaybeCallEntryHook(MacroAssembler* masm) {
5697 if (masm->isolate()->function_entry_hook() != NULL) { 5739 if (masm->isolate()->function_entry_hook() != NULL) {
5698 PredictableCodeSizeScope predictable(masm, 4 * Assembler::kInstrSize); 5740 PredictableCodeSizeScope predictable(masm, 4 * Assembler::kInstrSize);
5699 AllowStubCallsScope allow_stub_calls(masm, true); 5741 AllowStubCallsScope allow_stub_calls(masm, true);
5700 ProfileEntryHookStub stub; 5742 ProfileEntryHookStub stub;
5701 __ push(lr); 5743 __ push(lr);
5702 __ CallStub(&stub); 5744 __ CallStub(&stub);
5703 __ pop(lr); 5745 __ pop(lr);
5704 } 5746 }
5705 } 5747 }
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after
5843 __ add(r3, r3, Operand(1)); 5885 __ add(r3, r3, Operand(1));
5844 __ ldr(r5, FieldMemOperand(r2, Cell::kValueOffset)); 5886 __ ldr(r5, FieldMemOperand(r2, Cell::kValueOffset));
5845 5887
5846 if (FLAG_debug_code) { 5888 if (FLAG_debug_code) {
5847 __ ldr(r5, FieldMemOperand(r5, 0)); 5889 __ ldr(r5, FieldMemOperand(r5, 0));
5848 __ CompareRoot(r5, Heap::kAllocationSiteMapRootIndex); 5890 __ CompareRoot(r5, Heap::kAllocationSiteMapRootIndex);
5849 __ Assert(eq, kExpectedAllocationSiteInCell); 5891 __ Assert(eq, kExpectedAllocationSiteInCell);
5850 __ ldr(r5, FieldMemOperand(r2, Cell::kValueOffset)); 5892 __ ldr(r5, FieldMemOperand(r2, Cell::kValueOffset));
5851 } 5893 }
5852 5894
5853 // Save the resulting elements kind in type info 5895 // Save the resulting elements kind in type info. We can't just store r3
5854 __ SmiTag(r3); 5896 // in the AllocationSite::transition_info field because elements kind is
5855 __ ldr(r5, FieldMemOperand(r2, Cell::kValueOffset)); 5897 // restricted to a portion of the field...upper bits need to be left alone.
5856 __ str(r3, FieldMemOperand(r5, AllocationSite::kTransitionInfoOffset)); 5898 STATIC_ASSERT(AllocationSite::ElementsKindBits::kShift == 0);
5857 __ SmiUntag(r3); 5899 __ ldr(r4, FieldMemOperand(r5, AllocationSite::kTransitionInfoOffset));
5900 __ add(r4, r4, Operand(Smi::FromInt(kFastElementsKindPackedToHoley)));
5901 __ str(r4, FieldMemOperand(r5, AllocationSite::kTransitionInfoOffset));
5858 5902
5859 __ bind(&normal_sequence); 5903 __ bind(&normal_sequence);
5860 int last_index = GetSequenceIndexFromFastElementsKind( 5904 int last_index = GetSequenceIndexFromFastElementsKind(
5861 TERMINAL_FAST_ELEMENTS_KIND); 5905 TERMINAL_FAST_ELEMENTS_KIND);
5862 for (int i = 0; i <= last_index; ++i) { 5906 for (int i = 0; i <= last_index; ++i) {
5863 Label next; 5907 Label next;
5864 ElementsKind kind = GetFastElementsKindFromSequenceIndex(i); 5908 ElementsKind kind = GetFastElementsKindFromSequenceIndex(i);
5865 __ cmp(r3, Operand(kind)); 5909 __ cmp(r3, Operand(kind));
5866 __ b(ne, &next); 5910 __ b(ne, &next);
5867 ArraySingleArgumentConstructorStub stub(kind); 5911 ArraySingleArgumentConstructorStub stub(kind);
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after
5989 __ ldr(r3, FieldMemOperand(r2, Cell::kValueOffset)); 6033 __ ldr(r3, FieldMemOperand(r2, Cell::kValueOffset));
5990 6034
5991 // If the type cell is undefined, or contains anything other than an 6035 // If the type cell is undefined, or contains anything other than an
5992 // AllocationSite, call an array constructor that doesn't use AllocationSites. 6036 // AllocationSite, call an array constructor that doesn't use AllocationSites.
5993 __ ldr(r4, FieldMemOperand(r3, 0)); 6037 __ ldr(r4, FieldMemOperand(r3, 0));
5994 __ CompareRoot(r4, Heap::kAllocationSiteMapRootIndex); 6038 __ CompareRoot(r4, Heap::kAllocationSiteMapRootIndex);
5995 __ b(ne, &no_info); 6039 __ b(ne, &no_info);
5996 6040
5997 __ ldr(r3, FieldMemOperand(r3, AllocationSite::kTransitionInfoOffset)); 6041 __ ldr(r3, FieldMemOperand(r3, AllocationSite::kTransitionInfoOffset));
5998 __ SmiUntag(r3); 6042 __ SmiUntag(r3);
6043 STATIC_ASSERT(AllocationSite::ElementsKindBits::kShift == 0);
6044 __ and_(r3, r3, Operand(AllocationSite::ElementsKindBits::kMask));
5999 GenerateDispatchToArrayStub(masm, DONT_OVERRIDE); 6045 GenerateDispatchToArrayStub(masm, DONT_OVERRIDE);
6000 6046
6001 __ bind(&no_info); 6047 __ bind(&no_info);
6002 GenerateDispatchToArrayStub(masm, DISABLE_ALLOCATION_SITES); 6048 GenerateDispatchToArrayStub(masm, DISABLE_ALLOCATION_SITES);
6003 } 6049 }
6004 6050
6005 6051
6006 void InternalArrayConstructorStub::GenerateCase( 6052 void InternalArrayConstructorStub::GenerateCase(
6007 MacroAssembler* masm, ElementsKind kind) { 6053 MacroAssembler* masm, ElementsKind kind) {
6008 Label not_zero_case, not_one_case; 6054 Label not_zero_case, not_one_case;
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
6086 __ bind(&fast_elements_case); 6132 __ bind(&fast_elements_case);
6087 GenerateCase(masm, FAST_ELEMENTS); 6133 GenerateCase(masm, FAST_ELEMENTS);
6088 } 6134 }
6089 6135
6090 6136
6091 #undef __ 6137 #undef __
6092 6138
6093 } } // namespace v8::internal 6139 } } // namespace v8::internal
6094 6140
6095 #endif // V8_TARGET_ARCH_ARM 6141 #endif // V8_TARGET_ARCH_ARM
OLDNEW
« include/v8-platform.h ('K') | « src/arm/builtins-arm.cc ('k') | src/arm/codegen-arm.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698