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

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

Issue 71163006: Merge bleeding_edge r17376:17693. (Closed) Base URL: https://v8.googlecode.com/svn/branches/experimental/parser
Patch Set: Fix all.gyp Created 7 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 | Annotate | Revision Log
« no previous file with comments | « src/arm/builtins-arm.cc ('k') | src/arm/codegen-arm.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 // 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 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
70 } 70 }
71 71
72 72
73 void FastCloneShallowArrayStub::InitializeInterfaceDescriptor( 73 void FastCloneShallowArrayStub::InitializeInterfaceDescriptor(
74 Isolate* isolate, 74 Isolate* isolate,
75 CodeStubInterfaceDescriptor* descriptor) { 75 CodeStubInterfaceDescriptor* descriptor) {
76 static Register registers[] = { r3, r2, r1 }; 76 static Register registers[] = { r3, r2, r1 };
77 descriptor->register_param_count_ = 3; 77 descriptor->register_param_count_ = 3;
78 descriptor->register_params_ = registers; 78 descriptor->register_params_ = registers;
79 descriptor->deoptimization_handler_ = 79 descriptor->deoptimization_handler_ =
80 Runtime::FunctionForId(Runtime::kCreateArrayLiteralShallow)->entry; 80 Runtime::FunctionForId(Runtime::kCreateArrayLiteral)->entry;
81 } 81 }
82 82
83 83
84 void FastCloneShallowObjectStub::InitializeInterfaceDescriptor( 84 void FastCloneShallowObjectStub::InitializeInterfaceDescriptor(
85 Isolate* isolate, 85 Isolate* isolate,
86 CodeStubInterfaceDescriptor* descriptor) { 86 CodeStubInterfaceDescriptor* descriptor) {
87 static Register registers[] = { r3, r2, r1, r0 }; 87 static Register registers[] = { r3, r2, r1, r0 };
88 descriptor->register_param_count_ = 4; 88 descriptor->register_param_count_ = 4;
89 descriptor->register_params_ = registers; 89 descriptor->register_params_ = registers;
90 descriptor->deoptimization_handler_ = 90 descriptor->deoptimization_handler_ =
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
182 182
183 183
184 static void InitializeArrayConstructorDescriptor( 184 static void InitializeArrayConstructorDescriptor(
185 Isolate* isolate, 185 Isolate* isolate,
186 CodeStubInterfaceDescriptor* descriptor, 186 CodeStubInterfaceDescriptor* descriptor,
187 int constant_stack_parameter_count) { 187 int constant_stack_parameter_count) {
188 // register state 188 // register state
189 // r0 -- number of arguments 189 // r0 -- number of arguments
190 // r1 -- function 190 // r1 -- function
191 // r2 -- type info cell with elements kind 191 // r2 -- type info cell with elements kind
192 static Register registers[] = { r1, r2 }; 192 static Register registers_variable_args[] = { r1, r2, r0 };
193 descriptor->register_param_count_ = 2; 193 static Register registers_no_args[] = { r1, r2 };
194 if (constant_stack_parameter_count != 0) { 194
195 if (constant_stack_parameter_count == 0) {
196 descriptor->register_param_count_ = 2;
197 descriptor->register_params_ = registers_no_args;
198 } else {
195 // stack param count needs (constructor pointer, and single argument) 199 // stack param count needs (constructor pointer, and single argument)
200 descriptor->handler_arguments_mode_ = PASS_ARGUMENTS;
196 descriptor->stack_parameter_count_ = r0; 201 descriptor->stack_parameter_count_ = r0;
202 descriptor->register_param_count_ = 3;
203 descriptor->register_params_ = registers_variable_args;
197 } 204 }
205
198 descriptor->hint_stack_parameter_count_ = constant_stack_parameter_count; 206 descriptor->hint_stack_parameter_count_ = constant_stack_parameter_count;
199 descriptor->register_params_ = registers;
200 descriptor->function_mode_ = JS_FUNCTION_STUB_MODE; 207 descriptor->function_mode_ = JS_FUNCTION_STUB_MODE;
201 descriptor->deoptimization_handler_ = 208 descriptor->deoptimization_handler_ =
202 Runtime::FunctionForId(Runtime::kArrayConstructor)->entry; 209 Runtime::FunctionForId(Runtime::kArrayConstructor)->entry;
203 } 210 }
204 211
205 212
206 static void InitializeInternalArrayConstructorDescriptor( 213 static void InitializeInternalArrayConstructorDescriptor(
207 Isolate* isolate, 214 Isolate* isolate,
208 CodeStubInterfaceDescriptor* descriptor, 215 CodeStubInterfaceDescriptor* descriptor,
209 int constant_stack_parameter_count) { 216 int constant_stack_parameter_count) {
210 // register state 217 // register state
211 // r0 -- number of arguments 218 // r0 -- number of arguments
212 // r1 -- constructor function 219 // r1 -- constructor function
213 static Register registers[] = { r1 }; 220 static Register registers_variable_args[] = { r1, r0 };
214 descriptor->register_param_count_ = 1; 221 static Register registers_no_args[] = { r1 };
215 222
216 if (constant_stack_parameter_count != 0) { 223 if (constant_stack_parameter_count == 0) {
224 descriptor->register_param_count_ = 1;
225 descriptor->register_params_ = registers_no_args;
226 } else {
217 // stack param count needs (constructor pointer, and single argument) 227 // stack param count needs (constructor pointer, and single argument)
228 descriptor->handler_arguments_mode_ = PASS_ARGUMENTS;
218 descriptor->stack_parameter_count_ = r0; 229 descriptor->stack_parameter_count_ = r0;
230 descriptor->register_param_count_ = 2;
231 descriptor->register_params_ = registers_variable_args;
219 } 232 }
233
220 descriptor->hint_stack_parameter_count_ = constant_stack_parameter_count; 234 descriptor->hint_stack_parameter_count_ = constant_stack_parameter_count;
221 descriptor->register_params_ = registers;
222 descriptor->function_mode_ = JS_FUNCTION_STUB_MODE; 235 descriptor->function_mode_ = JS_FUNCTION_STUB_MODE;
223 descriptor->deoptimization_handler_ = 236 descriptor->deoptimization_handler_ =
224 Runtime::FunctionForId(Runtime::kInternalArrayConstructor)->entry; 237 Runtime::FunctionForId(Runtime::kInternalArrayConstructor)->entry;
225 } 238 }
226 239
227 240
228 void ArrayNoArgumentConstructorStub::InitializeInterfaceDescriptor( 241 void ArrayNoArgumentConstructorStub::InitializeInterfaceDescriptor(
229 Isolate* isolate, 242 Isolate* isolate,
230 CodeStubInterfaceDescriptor* descriptor) { 243 CodeStubInterfaceDescriptor* descriptor) {
231 InitializeArrayConstructorDescriptor(isolate, descriptor, 0); 244 InitializeArrayConstructorDescriptor(isolate, descriptor, 0);
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
295 Isolate* isolate, 308 Isolate* isolate,
296 CodeStubInterfaceDescriptor* descriptor) { 309 CodeStubInterfaceDescriptor* descriptor) {
297 static Register registers[] = { r0, r3, r1, r2 }; 310 static Register registers[] = { r0, r3, r1, r2 };
298 descriptor->register_param_count_ = 4; 311 descriptor->register_param_count_ = 4;
299 descriptor->register_params_ = registers; 312 descriptor->register_params_ = registers;
300 descriptor->deoptimization_handler_ = 313 descriptor->deoptimization_handler_ =
301 FUNCTION_ADDR(ElementsTransitionAndStoreIC_Miss); 314 FUNCTION_ADDR(ElementsTransitionAndStoreIC_Miss);
302 } 315 }
303 316
304 317
318 void NewStringAddStub::InitializeInterfaceDescriptor(
319 Isolate* isolate,
320 CodeStubInterfaceDescriptor* descriptor) {
321 static Register registers[] = { r1, r0 };
322 descriptor->register_param_count_ = 2;
323 descriptor->register_params_ = registers;
324 descriptor->deoptimization_handler_ =
325 Runtime::FunctionForId(Runtime::kStringAdd)->entry;
326 }
327
328
305 #define __ ACCESS_MASM(masm) 329 #define __ ACCESS_MASM(masm)
306 330
307 331
308 static void EmitIdenticalObjectComparison(MacroAssembler* masm, 332 static void EmitIdenticalObjectComparison(MacroAssembler* masm,
309 Label* slow, 333 Label* slow,
310 Condition cond); 334 Condition cond);
311 static void EmitSmiNonsmiComparison(MacroAssembler* masm, 335 static void EmitSmiNonsmiComparison(MacroAssembler* masm,
312 Register lhs, 336 Register lhs,
313 Register rhs, 337 Register rhs,
314 Label* lhs_not_nan, 338 Label* lhs_not_nan,
(...skipping 3022 matching lines...) Expand 10 before | Expand all | Expand 10 after
3337 __ cmp(r1, r3); 3361 __ cmp(r1, r3);
3338 __ b(ne, &not_array_function); 3362 __ b(ne, &not_array_function);
3339 3363
3340 // The target function is the Array constructor, 3364 // The target function is the Array constructor,
3341 // Create an AllocationSite if we don't already have it, store it in the cell 3365 // Create an AllocationSite if we don't already have it, store it in the cell
3342 { 3366 {
3343 FrameScope scope(masm, StackFrame::INTERNAL); 3367 FrameScope scope(masm, StackFrame::INTERNAL);
3344 3368
3345 // Arguments register must be smi-tagged to call out. 3369 // Arguments register must be smi-tagged to call out.
3346 __ SmiTag(r0); 3370 __ SmiTag(r0);
3347 __ push(r0); 3371 __ Push(r2, r1, r0);
3348 __ push(r1);
3349 __ push(r2);
3350 3372
3351 CreateAllocationSiteStub create_stub; 3373 CreateAllocationSiteStub create_stub;
3352 __ CallStub(&create_stub); 3374 __ CallStub(&create_stub);
3353 3375
3354 __ pop(r2); 3376 __ Pop(r2, r1, r0);
3355 __ pop(r1);
3356 __ pop(r0);
3357 __ SmiUntag(r0); 3377 __ SmiUntag(r0);
3358 } 3378 }
3359 __ b(&done); 3379 __ b(&done);
3360 3380
3361 __ bind(&not_array_function); 3381 __ bind(&not_array_function);
3362 __ str(r1, FieldMemOperand(r2, Cell::kValueOffset)); 3382 __ str(r1, FieldMemOperand(r2, Cell::kValueOffset));
3363 // No need for a write barrier here - cells are rescanned. 3383 // No need for a write barrier here - cells are rescanned.
3364 3384
3365 __ bind(&done); 3385 __ bind(&done);
3366 } 3386 }
(...skipping 1647 matching lines...) Expand 10 before | Expand all | Expand 10 after
5014 5034
5015 5035
5016 void ICCompareStub::GenerateMiss(MacroAssembler* masm) { 5036 void ICCompareStub::GenerateMiss(MacroAssembler* masm) {
5017 { 5037 {
5018 // Call the runtime system in a fresh internal frame. 5038 // Call the runtime system in a fresh internal frame.
5019 ExternalReference miss = 5039 ExternalReference miss =
5020 ExternalReference(IC_Utility(IC::kCompareIC_Miss), masm->isolate()); 5040 ExternalReference(IC_Utility(IC::kCompareIC_Miss), masm->isolate());
5021 5041
5022 FrameScope scope(masm, StackFrame::INTERNAL); 5042 FrameScope scope(masm, StackFrame::INTERNAL);
5023 __ Push(r1, r0); 5043 __ Push(r1, r0);
5024 __ push(lr); 5044 __ Push(lr, r1, r0);
5025 __ Push(r1, r0);
5026 __ mov(ip, Operand(Smi::FromInt(op_))); 5045 __ mov(ip, Operand(Smi::FromInt(op_)));
5027 __ push(ip); 5046 __ push(ip);
5028 __ CallExternalReference(miss, 3); 5047 __ CallExternalReference(miss, 3);
5029 // Compute the entry point of the rewritten stub. 5048 // Compute the entry point of the rewritten stub.
5030 __ add(r2, r0, Operand(Code::kHeaderSize - kHeapObjectTag)); 5049 __ add(r2, r0, Operand(Code::kHeaderSize - kHeapObjectTag));
5031 // Restore registers. 5050 // Restore registers.
5032 __ pop(lr); 5051 __ pop(lr);
5033 __ pop(r0); 5052 __ Pop(r1, r0);
5034 __ pop(r1);
5035 } 5053 }
5036 5054
5037 __ Jump(r2); 5055 __ Jump(r2);
5038 } 5056 }
5039 5057
5040 5058
5041 void DirectCEntryStub::Generate(MacroAssembler* masm) { 5059 void DirectCEntryStub::Generate(MacroAssembler* masm) {
5042 // Place the return address on the stack, making the call 5060 // Place the return address on the stack, making the call
5043 // GC safe. The RegExp backend also relies on this. 5061 // GC safe. The RegExp backend also relies on this.
5044 __ str(lr, MemOperand(sp, 0)); 5062 __ str(lr, MemOperand(sp, 0));
(...skipping 1023 matching lines...) Expand 10 before | Expand all | Expand 10 after
6068 __ bind(&fast_elements_case); 6086 __ bind(&fast_elements_case);
6069 GenerateCase(masm, FAST_ELEMENTS); 6087 GenerateCase(masm, FAST_ELEMENTS);
6070 } 6088 }
6071 6089
6072 6090
6073 #undef __ 6091 #undef __
6074 6092
6075 } } // namespace v8::internal 6093 } } // namespace v8::internal
6076 6094
6077 #endif // V8_TARGET_ARCH_ARM 6095 #endif // V8_TARGET_ARCH_ARM
OLDNEW
« no previous file with comments | « 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